Skip to content

Live (part 3) — notify on BANK-TX-UPDATE → auto-match

Goal

Part 3 of T-037. When bank txs sync (pages/api/airwallex/sync, ocbc/velocity/sync-accounting, and onTransactionsCreated) and matching runs, fire notifyBankSync (+ a match summary: N created, M auto-matched). The producer EXISTS but is never called by the sync paths. Ties to the T-023 auto-sync-on-app-usage (so a usage-triggered sync also surfaces results).

Log

  • 2026-06-14 created (T-037 split, owner).

Decision log

2026-07-09 — re-scoped (statement-sync half shipped) + routed to Accounting (Diagnostics)

  • ✅ Read AGENTS.md. Backlog-review probe (2026-07-09): notifyBankSync IS now fired on statement filing (lib/bankStatements/store.ts:294) and the Airwallex statement sync — that half shipped along the way. Remaining scope = the tx-sync → auto-match summary notification (new transactions landed → matcher ran → what linked). Owner routing (2026-07-09): → Accounting (Diagnostics), same family as T-038; queue behind their active cluster.
  • Source: EOP Local Assistance (fork) · session edb0abc7-6373-449b-8e31-379fd38d391b

2026-07-10 — BUILT + SHIPPED (owner: "proceed") — status → done

  • ✅ Read AGENTS.md · checked the board by scope (no dup — statement-sync half was already live; this is the remnant tx-sync digest) · tracking T-040.
  • Source: Accounting (Diagnostics) · https://claude.ai/code/session_01G58Y71noihrYCDEDMexmea
  • What landed: ONE wire point instead of three — every sync route (Airwallex, OCBC Velocity, and any future importer) funnels through createTransactionsBatchonTransactionsCreated (hooks.server.ts), which already computed the match summary; the digest now fires there via the existing notifyBankSync producer: title "Bank sync: N new, M auto-matched", message with the account ids, vendor links, receipt attaches, and suggestions-left counts (self-contained per the hide-and-seek rule; capped notes ride in metadata).
  • Design decisions:
  • Severity stays info (in-app only, no email) — a routine per-sync digest emailed every run would be noise; the meaningful money events already email individually via T-038's warning-severity per-link notifications. Owner can revisit at the preference matrix.
  • Digest fires whenever transactions were created — even with zero matches ("money moved" awareness); zero-created syncs stay silent.
  • Failure contract matches the engines: a digest error never fails the sync hook.
  • Verification: 4 new tests (syncDigestNotify.test.ts): counts + accounts + metadata in the digest; zero-match still notifies; zero-created silent; digest failure tolerated. Suite 657/657; unfiltered tsc clean.
  • Commit SHAs (append-only): this ship commit (T-040 in subject; merged via PR).
  • Deploy: pending (main 🟡🟡 manual).
  • Blast radius: notification volume only — accounting roles get one info-severity in-app digest per sync batch that created transactions. No matcher logic or data shapes changed.