WOPC auto-match broken since the T-089 P5 shape migration; no amount guard; sync-time lane absent (tx xTrsN4SGiPPuWLwA7oZg)
Symptom¶
A WOPC payment carrying the matching reference in its description synced and stayed
unmatched; the WOPC (payee JC, ERL-WOPC|2026-009, HK$2,500, pending_transaction)
sat unlinked.
Root cause (verified live)¶
Three compounding defects in the WOPC auto-match lane:
1. Shape β WOPC docs migrated to the bucketed shape on 2026-06-24 (T-089 Phase 5:
WOPC.refNumber, payee.abbreviation, bank.*β¦). Every other reader goes through the
wopcDocShape accessor; the auto-match endpoint still read the pre-migration FLAT
fields β all empty on migrated docs β so the assembled payment confirmation was hollow
and the link could never complete.
2. Stale guard β its already-linked check tested statuses (matched/completed) that
no longer exist in the domain (active/pending_transaction).
3. No amount check β contrary to the design expectation, the lane never compared the
transaction amount to the WOPC total; and it only ran on accounting-page load, never at
sync time.
- β Read AGENTS.md. Fixed under T-168: shape-correct shared core + amount guard (owner-approved: equal or no link, mismatch β match suggestion) + sync-time wiring. Status β fixed at merge; the live tx links on the next deploy + rescan/sync (amounts agree).
- Source: Accounting (Diagnostics) Β· https://claude.ai/code/session_01G58Y71noihrYCDEDMexmea