From 927c09bbb27891b34604a077ed27915adac544af Mon Sep 17 00:00:00 2001 From: DEls Date: Sat, 19 Sep 2026 07:49:51 +0200 Subject: [PATCH] docs(dn): append task 6 fix evidence --- .../task-6-report.md | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/.superpowers/sdd/2026-09-18-hybrid-delivery-note-ingestion/task-6-report.md b/.superpowers/sdd/2026-09-18-hybrid-delivery-note-ingestion/task-6-report.md index a006ccd..3871629 100644 --- a/.superpowers/sdd/2026-09-18-hybrid-delivery-note-ingestion/task-6-report.md +++ b/.superpowers/sdd/2026-09-18-hybrid-delivery-note-ingestion/task-6-report.md @@ -96,4 +96,60 @@ Result: passed. Implementation commit: `75a1d85c875c43f66232aaec448ff6fa1f904523`. -Report commit: recorded by the commit that adds this report. +Fix-round implementation commit: `33be75b82153cc602aa7838942ea670588cf920c`. + +## Fix Round 1 + +Review findings addressed: + +- `NoteSegment` now carries optional supplier name and registration evidence; + `segmentPages` copies it from the first page and fills missing values from + continuations. The legacy runner loads entity data whenever any note has a + PO, supplier name, or registration evidence. +- Site-scoped PO loading now projects only real fields, including + `processing_status` and excluding the nonexistent `status`; the runner test + asserts the bound site filter and projection. +- The staged schema migration additively/idempotently adds optional supplier + `registration_number` and `vat_number` fields. `SupplierRecord`, the pure + resolver type, and the loader use those exact fields. No migration was + applied. +- Fuzzy candidates are capped at 20 but retain score, threshold, rank, and + margin even below threshold; they remain suggestions and never auto-resolve. + The resolver now uses the exported `rankPoMatches` primitive. + +Fix-round RED command: + +```text +npx vitest run src/lib/dn-pipeline/resolve-entities.test.ts src/lib/dn-pipeline/segment.test.ts src/lib/dn-pipeline/run.test.ts +``` + +Result before fixes: 5 failed, 52 passed. Failures covered dropped segment +fields, the invalid `status` projection, skipped supplier-only loading, and +discarded below-threshold fuzzy evidence. + +Fix-round GREEN and regression commands: + +```text +npx vitest run src/lib/dn-pipeline/resolve-entities.test.ts src/lib/po-matching.test.ts src/lib/dn-pipeline +``` + +Result: `Test Files 14 passed (14)`, `Tests 210 passed (210)`. + +```text +python3 scripts/pb-add-dn-staged-ingestion.py --self-test +``` + +Result: `self-test: index replacement and idempotence passed`. + +```text +python3 scripts/pb-add-dn-staged-ingestion.py --dry-run +``` + +Result: offline preview completed with `DRY RUN. No schema changes written.` + +```text +npm run typecheck +git diff --check +``` + +Both passed. No production PocketBase writes were made.