docs(issues): close the migration-history rows and re-scope the zero-scan measurement - #2276
Conversation
…scan measurement Queue five immutable inbox requests. Reconcile follows in its own serialized branch once this lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:20 minutes Limit details: You’ve used the included review currently available. Your 90 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Comment |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Summary
Post-drift ledger tidying. Five immutable inbox requests, no canonical-ledger edit. The reconcile follows in its own serialized branch once this lands.
#M54C4N(live-drift's Align migration history step fails on PGRST106). Fixed by PR fix(db): read migration history through a service-role RPC so live-drift can pass (#316) #2198 (a341832af), which landed20260820120000_migration_history_versions_rpcwith theschema.sqlmirror, a regenerated drift manifest and a rewrittenscripts/check-migration-history-alignment.ts. Verified against live-drift run32514326022itself (headmain11550416206e8c90900ddeea0993337824873a55, conclusionsuccess): the step now reportsRemote migration versions: 211 (read via rpc),Remote-only (Preview blockers): 0andMigration history alignment OK: every remote version exists locally, and the preceding step reportsNo unexpected schema drift between live and supabase/schema.sql.#056(reconcile the existing staging migration history). Stagingikoiolksxqxfxgiyqpnuverified at full parity by a read-only query from a dedicated linked worktree: 211 history rows, latest20260820120000, zerostatements IS NULL,migration_history_versions()present, that row carrying 3 statements — equal to the 211 migration files onmainand the 211 remote versions live-drift read from production. The 19check:driftfindings recorded inside that row were aschema.sql-versus-chain disagreement, separately resolved by PR feat(db): codify live SET work_mem on the ten match_* RPCs, the eight schema-only objects, and three chain-stale columns (#316) #2106 and PR feat(db): Phase 4 — restore 20 missing indexes, drop 2 orphans, land guard migrations (#316) #2151, so closing on parity grounds loses nothing.#057remains the open follow-on.#3514B7(live production carries a migration that exists nowhere in the repository). Premise falsified: the migration landed onmainin PR fix(db): read migration history through a service-role RPC so live-drift can pass (#316) #2198 together with the mirror and manifest, and local 211 == remote 211 with zero remote-only versions, so production is no longer ahead of the repository.#47M1XD(restored trigram indexes have never been scanned) with a second read-only production window. The attribution retraction is now stronger and the experiment the row proposed is now known not to discriminate — detail below.#M6JNR8P2 to P1 (recommended-execution-queue rows cannot be re-graded by any ledger writer operation), with the re-confirmation recorded in its Source cell. Detail preserved unchanged.The one job this PR could not do
The stale
#231queue row is unchanged, and that is deliberate. It could not be corrected by any sanctioned path:updateIssueedits only the Open-itemspri/summary/detail/sourcecells; the sole queue-touching function ispruneResolvedIdFromQueue, which runs ondoneand only deletes.A1toA2, reverted immediately:docs/outstanding-issues.md does not exactly match the audited application of 0 moved inbox request(s) from the base.docs/outstanding-issues-inbox/applied/<uuid>.json was introduced without moving the identical pending request from the base.#M6JNR8already documents this exact instance and carries an explicit STOP against hand-editing it. It is now P1 because the row is the first thing the session-start hook surfaces and has mis-directed two sessions into a retrieval investigation the measurements closed. The fix is the owner's call between the two options that row names; this PR does not pick one and does not weaken the check.#47M1XD— what the second window founddocument_chunks_search_idx37,717 to 37,911;documents_title_search_idx37,299 to 37,512; HNSW 4,906 to 4,921; the sibling-table trigram index 2,372 to 2,389) whiledocument_chunks_content_trgm_idx(OID 1491258) anddocuments_title_trgm_idx(OID 1491257) stayed atidx_scan0 andidx_tup_read0, OIDs unchanged. A counter reset before the first read would have been re-populated by that traffic. Still not proof:pg_stat_reset_single_table_countersis invisible, and production is PostgreSQL 17.6, which predatespg_stat_all_indexes.stats_reset.documents,document_chunks,document_table_factsanddocument_index_unitswere all ANALYZEd on 2026-08-18 18:08 UTC and every one reportsn_mod_since_analyze = 0. Re-ANALYZing an unmodified table re-samples the same rows, so a flat result would be uninterpretable. The owner was asked and chose to skip it; no production mutation was made.document_embedding_fieldsis the one stale table (last analyzed 2026-06-25, 3,148 modifications against 271,097 live tuples, about 1.2% — below the autoanalyze threshold). Hygiene, not a cause of a 31-second regression.public.explain_retrieval_rpcare all a singleFunction Scanwith no inner index names, re-confirming#8VAY97. Real execution times: 1.000 / 4.306 / 0.904 / 15.760 ms.Verification
Ledger/docs-only diff (5 new JSON inbox requests).
npm run verify:pr-localnot run: it routinely exceeds 10 minutes on cross-worktree lock contention, and its covering gates were run directly instead.npm run check:ledger-write-discipline—Ledger write discipline passed for dea32b8d26b3..HEAD.npm run check:outstanding-issues—Ledger inbox check passed: 5 pending request(s), 525 applied.andOutstanding-issues guard passed: 437 rows (78 open, 359 archived), unique display and durable ids, collision-free allocation enabled, deprecated next-id marker ignored, no merge driver, no ids deleted from base dea32b8d26b3.npm run check:branch-review-ledger—Branch review ledger guard passed: 880 live table records + 1206 archived + 447 immutable (880 under the 2026-07-29 machine-readable contract), immutable review writes, six cells each, no conflict markers, mojibake, heading records, or duplicates.npx prettier --check docs/outstanding-issues-inbox/*.json—All matched files use Prettier code style!#056from the queue, renumbers 1 to 10, and sets#M6JNR8to P1.UI verification not run: no UI, routing, styling, or browser behaviour changed.
Risk and rollout
npm run issues:reconcileapplies them.git revertthe single commit; the requests are additive files and nothing reads them until reconcile.ikoiolksxqxfxgiyqpnufor the#056parity check and productionsjrfecxgysukkwxsowpyfor the#47M1XDcharacterisation — from a dedicated worktree with the project ref re-read before each call andsupabase unlinkafterwards. No write, no ANALYZE, no migration, no mark-apply. Read-only GitHub Actions reads verified live-drift run32514326022.Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
origin/mainafter this lands — the write-discipline gate structurally refuses a queue-and-reconcile in one transaction, proven above. Never mergemaininto that branch and never use GitHub's "Update branch" button on it.#9X40BT(lower the Supabase automatic-branching limit from 3 to 1 — Branching Compute sits outside the org Spend Cap) and#CCZ4HB(CodeRabbit spending cap exhausted; PR docs(issues): reconcile 19 queued ledger requests and close #316 #2261 landed with no automated review).