Skip to content

docs(audit): fill Phase 1.2 and extend 1.3 with whole-schema drift evidence - #1970

Merged
BigSimmo merged 8 commits into
mainfrom
claude/capture-drift-phase1-evidence
Aug 15, 2026
Merged

docs(audit): fill Phase 1.2 and extend 1.3 with whole-schema drift evidence#1970
BigSimmo merged 8 commits into
mainfrom
claude/capture-drift-phase1-evidence

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

Read-only Supabase connector session, additive to the same day's owner-authorized incident window — this does not restate or revise the incident work, and both indexes repaired there are confirmed still present on live.

  • docs/audit — §1.2 RPC divergence dossier was _Pending._ and is now enumerated. All 93 public functions compared by the manifest's own hash rule (pg_get_functiondef, comments and whitespace stripped, md5) against supabase/drift-manifest.json: 0 missing on live, 0 extra, 16 hash mismatches, every one a match_document_* retrieval RPC.
    • Six are proven normalization noise and are closed. A live session renders body types unqualified (vector); the manifest was generated where they render extensions.vector. Re-qualifying before hashing reproduces the manifest hash exactly — e.g. match_document_chunkscdf9d685c98bc8ff731a0422c29a47a4. Those bodies are byte-identical to the repo.
    • Ten are real and recorded UNCLASSIFIED, per that section's own rule — they match under no variant, so the difference is in the body, but deciding live-ahead vs repo-ahead needs the decisive hunk and this is a protected RAG surface. This independently confirms #316's figure of 10.
  • docs/audit — §1.3 extended with a whole-schema inventory. 210 repo-defined indexes vs 192 live: 20 still absent, 2 orphaned on live. 210 − 20 + 2 = 192, so neither side is a partial read.
    • Zero invalid-or-not-ready indexes across public, so the failed-CREATE INDEX CONCURRENTLY class documented in docs/database-drift-detection.md explains none of the 20. The objects are absent, not broken.
    • All five creating migrations recorded executed DDLstmt_count 32 / 36 / 14 / 27 / 11, none carrying the mark-applied signal, including 20260712165211_reconcile_missing_operational_indexes. This generalises §1.1's conclusion beyond one migration and beyond the two repaired indexes.
  • Ledger — #316 and #248 queued as inbox requests carrying the same evidence, appended to their existing detail rather than replacing it. Apply with npm run issues:reconcile.

Root cause is explicitly left unestablished. §1.1's manual/dashboard-drop inference remains the leading hypothesis and the dashboard audit-history pairing is still the owner action that would confirm or refute it. This inventory widens what that pairing has to explain; it attributes nothing on its own.

One arithmetic discrepancy recorded rather than smoothed over:#316 says 21 missing and 2 were restored, which would leave 19 — I measure 20. The row now carries 20 as the measured current figure and flags 21 as approximate.

A method trap is recorded in §1.2 so the next run doesn't repeat it. Joining manifest signatures directly to live p.oid::regprocedure::text reports all 93 functions as simultaneously missing and extra, because the manifest stores public.fn(extensions.vector,…) while a live session renders fn(vector,…). That is a join failure, not a finding. I hit it on the first pass; normalize both sides, then test each surviving mismatch against the qualification variants before calling it divergence.

Verification

  • npm run verify:pr-local
PR-local verification summary:
- completed: check:runtime, check:installed-lock-parity, format:changed, sitemap:check,
docs:check-index, docs:check-inventory, docs:check-scripts, docs:check-links,
check:branch-review-ledger, check:outstanding-issues, check:ledger-write-discipline
- failed: (none)
- not reached: (none)

Every figure was measured read-only against sjrfecxgysukkwxsowpy via pg_indexes, pg_index, pg_proc and supabase_migrations.schema_migrations, compared against the committed supabase/drift-manifest.json. No writes were performed and no migration was applied.

UI verification not run: no UI, routing, styling, or browser-behaviour change in this diff.

Risk and rollout

  • Risk: Low. Two documentation edits and two queued ledger requests. No application source, no schema, no migration, no workflow. The canonical ledger is untouched until a separate reconcile applies the requests.
  • Rollback: git revert the single commit.
  • Provider or production effects: None on the database. The session that produced this evidence was read-only; the only writes are to files in this repository.
  • Follow-on, deliberately not in this PR: per-function diff hunks for the ten UNCLASSIFIED RPCs (read-only), then a single approved window covering indexes and RPCs together. Do not redeploy repo RPC definitions over live before the hunks classify them — that is a protected-surface behaviour change requiring a canary pair.

Clinical Governance Preflight

Not applicable as a checklist: classifyPullRequestFiles returns clinicalRisk: false, operationalRisk: false, ragRanking: false, ui: false for docs/audit/** and docs/outstanding-issues-inbox/**. The diff changes no ingestion, answer-generation, ranking, source-rendering, document-access or privacy code — it records read-only measurements about the live database. The RAG-surface implications it documents are precisely what the follow-on window must gate, and this PR deliberately performs none of that work.


Generated by Claude Code

…idence
Read-only connector session, additive to the same day's incident window.
1.2 (was Pending) — all 93 public functions compared by the manifest's own
hash rule: 0 missing, 0 extra, 16 mismatches, all match_document_*. Six are
proven normalization noise: re-qualifying vector -> extensions.vector
reproduces the manifest hash exactly, so those bodies are byte-identical.
The other ten are real and recorded UNCLASSIFIED per the section's own rule,
pending decisive hunks. This independently confirms #316's figure of 10.
Also records the join trap: comparing manifest signatures to live
regprocedure directly reports all 93 as simultaneously missing and extra,
because the manifest stores public.fn(extensions.vector,...) and a live
session renders fn(vector,...). That is a join failure, not a finding.
1.3 — whole-schema inventory after the incident repair, explicitly additive
rather than a restatement: 210 repo-defined vs 192 live, 20 still absent,
2 orphaned (210-20+2=192). Both repaired indexes confirmed present. Zero
invalid-or-not-ready indexes, so the failed-CREATE-INDEX-CONCURRENTLY class
explains none of them. All five creating migrations recorded executed DDL
(stmt_count 32/36/14/27/11, none mark-applied), generalising 1.1's
conclusion beyond one migration.
Root cause is explicitly left unestablished; the dashboard audit-history
pairing remains the owner action that would settle attribution.
Ledger: #316 and #248 queued as inbox requests carrying the same evidence.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017paT42ZVMf8jaLtkjFxdy5
@supabase

supabaseBot commented Aug 14, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitaiBot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:28 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 93e832d5-5416-441a-848f-7f0f92a6ff91

📥 Commits

Reviewing files that changed from the base of the PR and between bf486de and 868d299.

📒 Files selected for processing (7)
  • docs/audit/live-drift-forensics-2026-08.md
  • docs/branch-review-records/11809456723dae8154679a80157654f47f67b4c39e333654499b933d49b6b0f4.record.md
  • docs/branch-review-records/a5309edd41a122ccf51a2dacea385abdd2b404d07061df6833f1ef1289d053f3.record.md
  • docs/outstanding-issues-inbox/0948fcd2-2e51-47bc-8990-7ec002934e43.json
  • docs/outstanding-issues-inbox/24408f86-38ff-4715-affa-55d6c7bc1bb7.json
  • docs/outstanding-issues-inbox/397a3588-b8cf-404b-a3d4-6060b84f7d60.json
  • docs/outstanding-issues-inbox/c3622ee1-872f-4476-8b12-20e97057c5d5.json

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:00f5612ccf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threaddocs/audit/live-drift-forensics-2026-08.md Outdated
Comment threaddocs/audit/live-drift-forensics-2026-08.md Outdated
@BigSimmo
BigSimmo enabled auto-merge (squash) August 14, 2026 16:21
@github-actions

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #10953 (success).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo merged commit a91420b into mainAug 15, 2026
56 checks passed
@BigSimmo
BigSimmo deleted the claude/capture-drift-phase1-evidence branch August 15, 2026 05:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@BigSimmo@claude