feat(parser): re-architect ReceiptParser into a rule/engine pipeline #77
Labels
No labels
area:backend
area:frontend
area:infra
area:ocr
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
phase:M1
phase:M2
phase:M3
phase:M4
phase:M5
phase:M6
phase:M7
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
TJC/bill-splitter#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Re-architect
ReceiptParserfrom one ~320-line static class into therule/engine pipeline sketched in the receipt-parser design notes, scoped to
restaurant/bar/cafe receipts.
Design
docs/adr/0006-receipt-parser-pipeline.mddocs/15-receipt-parsing.mdEvery sub-issue inherits these plus the invariants below; they are the durable
home for the detail (regex catalogue, layouts, scoring, OCR-misread maps), so
the issues stay terse and point at the docs.
Goal
Target shape
OcrResult-> normalize -> classify lines -> item rules + engine -> billdetectors + engine -> validators ->
ParsedReceipt. New code underBillSplitter.Domain/Parsing/**, pure, no new dependencies.Invariants (every sub-issue)
expected.jsonchanges onlywhen a capability deliberately improves that receipt, with justification.
ReceiptParser.Parse(OcrResult)stays static ->OcrWorker.cs:70never changes.
longminor units; the server owns all math.Warnings.wire-contract change is expected, so docs/03-05 stay untouched.
Phase A - structural extraction (behaviour-preserving, one PR per layer)
Phase B - capabilities (each ships with new fixtures)
Sequencing: A1->A5 in order, A6 after A5; then B7/B8/B9, then B10, then B11,
then B12.
Out of scope
Bill.DiscountMinorplus Redis, DTO, docs/02-06).