TB-13 — Write Guard + Reconciliation Scanner
Summary
Build the write guard safety layer that prevents status regressions and protects critical financial fields, plus an automated reconciliation scanner that proactively detects drift between Stripe, Supabase, and remittance records. Daily scan surfaces discrepancies in Pipeline Shepherd WhatsApp summary.
What it produced
- Enhanced write_guard.py protecting against status regressions (Closed to Scheduled, Paid to Unpaid) and financial field overwrites
- Reconciliation scanner: daily cross-check of Supabase vs Stripe vs remittance records
- Discrepancy report with severity levels (info, warning, critical)
Connections
- depends on: supabase-service — write guards hook into supabase_write_service
- depends on: Stripe — cross-checks Stripe invoice and payment status
- depends on: pipeline-shepherd — critical discrepancies surface in daily WhatsApp summary
- produced: write guard layer and automated reconciliation scanner