No checker asserts the live PG schema matches the tracked schema.sql - drift is silent in both directions
Nothing in the fleet asserts that a live PostgreSQL view/function definition matches the tracked one-db/agent-telemetry/schema.sql. Measured 2026-09-13 during OPS-268: production v_usage_resolved held the [claimed_at, withdrawn_at) claim-window join for an unknown period while the tracked schema.sql had neither withdrawn_at nor the predicates, so ANY reapply of the tracked file would have silently regressed production to a naive join crediting withdrawn claims. The same night the drift ran the other way - nw-venus-cc applied a hand-guarded view to production and the repo was ~10 minutes behind it. BOTH DIRECTIONS ARE SILENT AND NEITHER EMITS AN ERROR: a stale tracked file looks like a normal file, and a production object ahead of the repo looks like a working system. The only reason either was caught is that someone compared by hand. PROPOSED INSTRUMENT: a read-only checker that, per view and per function in the tracked schema, extracts the tracked definition and set-compares it against the live object, and reports a per-object verdict. THE COMPARISON MUST NOT BE TEXTUAL - pg_get_viewdef reformats, requalifies and reorders, so a diff of the text is noise. The technique that worked here is semantic: run the tracked body as a CTE and EXCEPT it against the live relation in both directions over the real rows, which returned tracked_not_live 0 / live_not_tracked 0 across 123386 rows and proved equivalence rather than similarity. Constraints: strictly read-only, no DDL, no apply - it reports drift, it never reconciles, because which side is right is a judgement (OPS-268 needed live-wins, and the same night needed repo-catches-up). Must name the DIRECTION of any drift it finds, since the remedy is opposite in each case. Must state the denominator - objects compared vs objects in the file - so an object it could not evaluate is never rendered as agreement. Blocked under the fleet-wide stop; file-not-start.
Activity
-
Delivered d369440. Strict read-only semantic checker compared all 4 tracked views to live PG with bidirectional EXCEPT: agrees 0/0 (4504, 64, 123496, 5 rows). ingest_usage_events is explicitly NOT_EVALUATED because execution could DML; denominator reported as 5 objects, 4 compared, 1 unevaluated.