Org Model v2.3 — Reconciliation Reports
This directory is the committed audit trail for the 7-day zero-delta gate the founder uses to decide whether Org Model v2.3 Phase 2 (read cutover) is safe to flip in dev.
Parent tracker: #570 · HLD: #556 · LLD: #560 §10.1 · §10.2 · Task issue: #692
What lives here
A single markdown file per UTC day, named YYYY-MM-DD.md. Each file
contains:
- A summary table with the number of tenants scanned, tenants with
drift, total missing
org_unitsrows, total missingorg_unit_membershipsrows, and the day's gate status (PASS / FAIL). - A per-tenant breakdown (skipped when no tenants exist yet).
- A rolling-window table showing the last 7 days' gate status and drift counts.
- A "consecutive clean days" streak counter and a visible banner when the 7-day zero-delta gate is met.
How files land here
- CI baseline run —
.github/workflows/org-v23-reconcile-report.ymlruns daily at 08:00 UTC viacron. It invokesgo run ./cmd/reconcile-report --baselinewhich emits an empty-cluster zero-drift stamp. This guarantees the 7-day gate has a continuous audit trail of file commits even before any real tenant exists. When the workflow detects a new file it opens a PR. - In-cluster CronJob —
deploy/cron/org-v23-reconcile-report.yamlruns the same binary against a live Postgres. The rendered markdown is pushed to a PVC; an ops runbook step (documented in the cutover runbook) periodically reconciles that artefact back into this directory. - Manual run — any reviewer can reproduce the live report with:
Re-running on the same UTC date overwrites the day's file (idempotent).DATABASE_URL=postgres://... \go run ./cmd/reconcile-report \--output-dir docs/runbooks/org-v23-reconciliation-reports
How live alerting relates
The markdown reports are the audit trail, not the primary
monitoring surface. Live drift alerting is the Prometheus rules in
deploy/alerts/dualwrite.yaml
against metrics emitted by
internal/orgunit/dualwrite.
A failing CI baseline run will show up as a GitHub status check;
a failing in-cluster report will show up in both the PVC artefact
and the matching Prometheus alert.
Gate criteria
Phase 2 cutover is unblocked when the last 7 consecutive daily
reports show gate PASS (zero drift). See
docs/runbooks/org-v23-phase2-cutover.md
for the founder-operated flag-flip procedure.