Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f6f66a9
test(live-drift): prove the drift-failure routing script
claude Aug 14, 2026
7ce2872
docs(medications): refresh the generated lexicon review to unstick it…
claude Aug 14, 2026
f928be1
docs(issues): record Phase 0 closure and retarget the lexicon findings
claude Aug 14, 2026
e77bae7
docs(audit): record the Phase 0 forced-dispatch proof and the correct…
claude Aug 14, 2026
20228fa
docs(issues): resolve the two competing #316 updates into one accurat…
claude Aug 14, 2026
08a49b3
Merge branch 'main' into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
1bc5f39
Merge branch 'main' into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
4c55ec0
test(drift): enforce routing API contracts
BigSimmo Aug 14, 2026
e4d3e4d
docs(review): record PR-1951 contract fix
BigSimmo Aug 14, 2026
7eaac4a
Merge branch main into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
e976855
Merge branch 'main' into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
5060d7e
Merge branch 'main' into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
7d70c74
Merge branch main into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
c39d8fb
docs(review): record PR-1951 current-base review
BigSimmo Aug 14, 2026
809c50b
test(live-drift): format workflow coverage
BigSimmo Aug 14, 2026
85f9c24
docs(review): record PR-1951 format repair
BigSimmo Aug 14, 2026
f9d7f90
Merge branch 'main' into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
6ed1fb8
Merge branch 'main' into claude/db-remediation-phase-0-wfaiyl
BigSimmo Aug 14, 2026
4ceb2e5
docs(ledger): record PR #1951 final base sync
BigSimmo Aug 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions docs/audit/live-drift-forensics-2026-08.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,36 @@ runs on pushes to `main` touching `supabase/migrations/**` or `supabase/schema.s
`workflow_dispatch`, the secret preflight, and `concurrency.cancel-in-progress: false` were kept
unchanged. No hosted Supabase call was made.

Outstanding for the operator: dispatch `live-drift` once to confirm a real failure produces the
pinned issue (provider-backed — not run from the authoring session), and add
`SUPABASE_ACCESS_TOKEN` to environment secrets per plan step 0.3 and ledger `#183`.
_2026-08-14, forced-dispatch proof (owner-authorized)._ `live-drift` dispatched on `main`
(Actions run `31813064485`). The definition-of-done behaviour was observed end-to-end:

- `live-drift` job **failed** at `Compare live schema drift`, as intended for this proof.
- `Capture drift and migration-history findings` still ran (`if: always()`), and
`Align migration history for Supabase Preview` correctly **skipped** after the failing step.
- The separate `drift-routing` job then ran (`if: ${{ !cancelled() }}`) and **succeeded**,
creating issue **#1963 "Live drift check failing"** with label `live-drift-failure`, the run
URL, `Job result: failure`, `Trigger: workflow_dispatch`, and the full findings block.

That run also supersedes the stale 2026-08-09 figures this file was opened with. Measured
2026-08-14, `UNEXPECTED DRIFT (32)`:

| Category | 2026-08-09 | 2026-08-14 |
| ---------------------------------------- | ---------- | ------------------ |
| `match_*` function `def_hash` mismatches | 10 | **10 — unchanged** |
| `missing_live` indexes | 21 | **20** |
| `unexpected_live` indexes | 2 | **2 — unchanged** |

`documents_title_trgm_idx` and `document_chunks_content_trgm_idx` are absent from the missing
list, independently corroborating the Phase 4 restoration below (verified separately by
read-only query against `sjrfecxgysukkwxsowpy`: both `indisvalid`/`indisready`, 648 kB and
68 MB). The 10 RPC mismatches are untouched, so **Phase 3 remains entirely outstanding** and is
the next step per the plan's ordering.

Routing is also covered offline by `tests/live-drift-workflow.test.ts` (mutation-verified), so a
future regression fails a test rather than waiting for a live failure to be mishandled.

Outstanding for the operator: add `SUPABASE_ACCESS_TOKEN` to environment secrets per plan step
0.3 and ledger `#183` (dashboard work; names only, never values).

## Phase 1 — Read-only forensics

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-14 | PR-1951 | 7d70c74cc5449d577df3895aa766ad31f3204045 | tests/live-drift-workflow.test.ts; docs/outstanding-issues-inbox; docs/branch-review-records | preserved prior test fixes; merged latest main; cancelled superseded #331/#333 ledger mutations to restore deterministic queue application | manual adversarial review; current thread verification; docs links passed; ledger inbox passed; ledger guards passed; git merge-tree; git diff --check; focused Vitest unavailable (node_modules absent) |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-14 | claude/db-remediation-phase-0-wfaiyl | 20228faa6002da009e290bc398345a47d2cd7a02 | PR #1951 review-and-fix | reviewed live-drift routing workflow contract and Phase 0 records; fixed no PR-introduced defect; merged latest main | offline: routing-script stub exercise; check-outstanding-issues; ledger-inbox check; Prettier changed files; check:github-actions; check:gate-manifest; check:verification-plan; maintainability budgets; targeted Vitest unavailable (isolated worktree has no node_modules); manual adversarial pass |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-14 | PR-1951 | 4c55ec05875dcf063555e71021adb9d1f1a42f5c | PR #1951 full review and unblock | fixed | workflow permission-map parser; GitHub Issue API owner/repo assertions; node scripts/check-docs-links.mjs; node scripts/ledger-inbox.mjs check; node scripts/check-ledger-write-discipline.mjs --self-test; Vitest unavailable: node_modules absent |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-14 | PR-1951 | 809c50bf4ca8ede8c2c0ec49df9371cd4d56c517 | PR #1951 CI format repair | fixed the exact-head Changed-file format check failure in live-drift workflow coverage | Prettier 3.9.6; All matched files use Prettier code style!; Tests 15 passed (15); git diff --check passed; docs link check passed: 1775 repo path references resolve.; Ledger inbox check passed: 22 pending request(s), 138 applied.; ledger write discipline self-test passed.; Branch review ledger guard passed: 880 live table records + 1206 archived + 91 immutable |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-14 | PR-1951 | 6ed1fb871c7e16e89ed111a9576d502d90a765b1 | PR #1951 final base sync after formatting fix | Merged the current main including the #1959 ledger reconciliation after the targeted Prettier repair; merge tree is clean and the run-scoped workflow regression suite remains green. | All matched files use Prettier code style; Test Files 1 passed; Tests 15 passed; docs link check passed: 1775 repo path references resolve; Ledger inbox check passed: 22 pending request(s), 138 applied; branch-review-ledger self-test passed; Branch review ledger guard passed: 880 live table records + 1206 archived + 98 immutable; verify:pr-local unavailable: tsx/cli absent from isolated worktree (Node v24.14.0). |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-14 | claude/db-remediation-phase-0-wfaiyl | 08a49b316b505a5ef39d0e7fd514a7ece7993f8f | PR #1951 review-and-fix | fixed stale pending cancellation after base reconciliation; preserved only valid remaining queue mutations | offline: reproduced docs:check-links failure; docs:check-links pass after fix; check-outstanding-issues; ledger-inbox check; Prettier affected requests; git diff --check |
4 changes: 2 additions & 2 deletions docs/medication-interaction-lexicon-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ the class cannot be enumerated, and holds the medication at grey rather than gre

**35 of the catalogue's 328 medications sit outside both ends of every resolved
interaction row.** Entering one of them produces no alert — not because the combination was checked and
found clear, but because no machine-resolved edge in the corpus includes that drug. On screen those
outcomes look the same, so this list is the honest boundary of the feature.
found clear, but because no machine-resolved edge in the corpus includes that drug. On screen those outcomes look the
same, so this list is the honest boundary of the feature.

This is a **corpus coverage** limit, not necessarily a lexicon fault. Widening it means adding an
interaction row or making an existing row machine-resolvable, with clinical review of the source content.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "21b6525a-dd2d-4dcc-95d5-c3c777420adf",
"createdOn": "2026-08-14",
"action": "update",
"payload": {
"id": "#333",
"detail": "PARTIAL 2026-08-14 (PR #1951): the regeneration half of this row's Next step is done. Ran npm run medications:lexicon-report, confirmed by whitespace-normalised byte comparison that it is a pure re-wrap and not a content change needing clinical review (all 28 catalogue terms identical), and committed it. The diagnosis in #331 is now closed out: it was not a staleness-comparison bug, it was a genuinely stale committed file that prettier could not flag because proseWrap: preserve accepts both wrappings. STILL OPEN, and the more important half: the check is in the local verify:pr-local chain but in no CI job, so it fails every local preflight while every required check stays green. Decide one way or the other — wire it into CI so it cannot silently rot again, or drop it from verify:pr-local so it stops failing preflights it does not gate. Caveat on this PR: #1951 carries the regeneration alongside a workflow test rather than strictly on its own as this row asked, because the session was constrained to a single designated branch; the regeneration is its own revertible commit."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "3d0adf39-ec7a-4fa3-9309-057a193410de",
"createdOn": "2026-08-14",
"action": "update",
"payload": {
"id": "#316",
"detail": "Combined 2026-08-14 update, superseding the two partial requests cancelled in this same batch. PHASE 0 CLOSED including the forced-dispatch proof its definition of done required: live-drift dispatched on main (Actions run 31813064485) failed at the drift step, the always() capture step still ran, the migration-history step correctly skipped, and the separate drift-routing job then created issue #1963 \"Live drift check failing\" carrying the label, run URL, job result, trigger and the full findings block. Routing is now also covered offline by tests/live-drift-workflow.test.ts, mutation-verified. INCIDENT REPAIR, owner-approved in-session: the two retrieval-critical indexes documents_title_trgm_idx and document_chunks_content_trgm_idx were restored with CREATE INDEX CONCURRENTLY plus ANALYZE, both indisvalid and indisready at 648 kB and 68 MB, re-verified afterwards by an independent read-only query. Before and after supabase_rpc_latency_ms 31610 to 1535 on the text fast path and 8519 hybrid, with match_document_chunks_text_v2 at 14 ms. No repo schema change was needed because the definitions were already codified. CORRECTED FIGURES measured 2026-08-14, superseding the 2026-08-09 numbers this row was opened with: 10 match_* def_hash mismatches (unchanged), 20 missing_live indexes rather than 21, and the same 2 unexpected_live. ATTRIBUTION STILL OPEN: migration 20260705180000 recorded 14 executed statements so it was not mark-applied, and the 20260804110240 guard validates four other indexes and never checks this pair, so it gives no existence bound for 2026-08-04. The drop window is therefore 2026-07-05 to 2026-08-02 and the dashboard audit-history pairing remains owner action; #248 stays open. NEXT: Phase 3 RPC reconciliation before Phase 4, per the plan's ordering that the change which can alter clinical answers precedes the ones that only speed them up. Evidence: docs/audit/live-drift-forensics-2026-08.md."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "3dda04ff-1ae9-4153-80ed-ad081931e396",
"createdOn": "2026-08-14",
"action": "cancel",
"payload": {
"requestId": "9792c896-78d8-46ab-b194-6a52b7fd7cab",
"reason": "Superseded by the single combined #316 update queued in the same batch, which merges this request's dispatch proof and corrected drift figures with the incident-session findings from request bbf21714 so the row carries one coherent account instead of two partial ones."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "3f8797e0-dffa-4d26-8019-15147b9af397",
"createdOn": "2026-08-14",
"action": "update",
"payload": {
"id": "#292",
"detail": "Recurred 2026-08-14 on the database remediation plan, this time with two assistants building Phase 0: PR #1938 and PR #1939 both implemented live-drift failure routing and the post-migration trigger, merged four hours apart. Both landed and no harm resulted — #1939 built on #1938's commit and improved it, moving the findings capture after the migration-history step so a migration-history failure is visible instead of a clean drift result being published as its explanation. The cost was still two full authoring sessions and two CI cycles for one deliverable. This matters more for the phases still ahead than it did here: Phase 1 consumes an approved read-only production window, and Phases 3 and 4 consume approved mutation windows and live eval-canary budget, so a duplicate there wastes an operator-gated resource rather than just tokens. Concrete ask for the remediation work specifically: check the open-PR list for the surface before starting any of Phases 1-5, per docs/database-remediation-playbook.md."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "5db479fa-07fc-4e9e-a377-93b4e27797ee",
"createdOn": "2026-08-14",
"action": "cancel",
"payload": {
"requestId": "21b6525a-dd2d-4dcc-95d5-c3c777420adf",
"reason": "Superseded by f3b63187-c295-4f6a-8ecd-602f348835c4, which closes duplicate #333 and preserves its evidence on #331."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "6b09c1df-5f7c-4103-af3c-aead33eafb00",
"createdOn": "2026-08-14",
"action": "update",
"payload": {
"id": "#316",
"detail": "MISSING"
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "9792c896-78d8-46ab-b194-6a52b7fd7cab",
"createdOn": "2026-08-14",
"action": "update",
"payload": {
"id": "#316",
"detail": "Phase 0 CLOSED 2026-08-14, including the forced-dispatch proof its definition of done required. Dispatched live-drift on main (run 31813064485): the drift job failed as expected, the always() capture step still ran, and the separate drift-routing job then created issue #1963 'Live drift check failing' automatically, carrying the run URL, job result, trigger and the full findings block. Failure routing is therefore proven end-to-end against the real repository, not just offline; PR #1951 adds a mutation-verified contract test so it stays proven. That run also supersedes the stale 2026-08-09 drift numbers this row was opened with. Measured now: 10 match_* function def_hash mismatches (UNCHANGED - Phase 3 is entirely outstanding and remains the highest-stakes unknown), 20 missing_live indexes (not 21), and the same 2 unexpected_live indexes (document_table_facts_document_id_idx, storage_cleanup_jobs_owner_id_idx). documents_title_trgm_idx and document_chunks_content_trgm_idx are no longer in the missing list, independently confirmed by direct read-only query against sjrfecxgysukkwxsowpy (both indisvalid/indisready, 648 kB and 68 MB), which corroborates the restoration recorded in PR #1960. Next: Phase 3 (RPC reconciliation) before Phase 4, per the plan's ordering — the change that can alter clinical answers goes before the ones that only speed them up."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "c3d91fce-52e5-41ed-8648-b2bf5e95b32c",
"createdOn": "2026-08-14",
"action": "done",
"payload": {
"id": "#331",
"outcome": "Not a comparison bug. Investigated 2026-08-14 in PR #1951: the staleness was real and wrapping-only. Normalising whitespace on the committed and regenerated docs/medication-interaction-lexicon-review.md leaves them byte-identical across all 28 catalogue terms, so no content changed, but the committed line wrapping genuinely differed from the generator's. The reason three branches saw it with 'zero diff on their branch' is that it was already stale on main, so every branch inherited the failure regardless of what it touched — git diff origin/main was the wrong instrument, since main itself carried the stale copy. It also escaped npm run format because prettier runs proseWrap: preserve, which accepts both wrappings. Fixed by regenerating with npm run medications:lexicon-report followed by prettier (the order the check expects). The remaining open question — that no CI job runs this check — is tracked in #333 rather than here."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "c63161f6-21b8-40ec-927c-684e22791066",
"createdOn": "2026-08-14",
"action": "cancel",
"payload": {
"requestId": "c3d91fce-52e5-41ed-8648-b2bf5e95b32c",
"reason": "Superseded by fbfe982f-cd2f-49c9-a94e-908a99efa6b8, the current #331 update consolidating the authoritative remaining work."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"id": "fd548180-f031-44d8-bd70-24c3b03c5f21",
"createdOn": "2026-08-14",
"action": "cancel",
"payload": {
"requestId": "6b09c1df-5f7c-4103-af3c-aead33eafb00",
"reason": "Queued in error: a shell substitution resolved to the placeholder text MISSING instead of the intended detail. Replaced by the correct combined update in the same batch."
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test:coverage": "node scripts/run-vitest.mjs run --coverage",
"test:coverage:node": "node scripts/run-vitest.mjs run --project=node --coverage",
"test:coverage:ui": "node scripts/run-vitest.mjs run --project=jsdom --coverage",
"test:ci-workflows": "node scripts/run-vitest.mjs run tests/ci-cache-safety.test.ts tests/authenticated-live-workflow.test.ts tests/codex-autofix-workflow.test.ts tests/codex-run-pr-operator-workflow.test.ts tests/eval-canary-workflow.test.ts tests/container-ci-contract.test.ts tests/test-runner-safety.test.ts tests/installed-lock-parity.test.ts tests/railway-config.test.ts tests/ingestion-autopilot.test.ts tests/ingestion-autopilot-workflow.test.ts tests/check-lighthouse-budget.test.ts tests/live-web-vitals-inputs.test.ts tests/offline-release-profile.test.ts",
"test:ci-workflows": "node scripts/run-vitest.mjs run tests/ci-cache-safety.test.ts tests/authenticated-live-workflow.test.ts tests/codex-autofix-workflow.test.ts tests/codex-run-pr-operator-workflow.test.ts tests/eval-canary-workflow.test.ts tests/live-drift-workflow.test.ts tests/container-ci-contract.test.ts tests/test-runner-safety.test.ts tests/installed-lock-parity.test.ts tests/railway-config.test.ts tests/ingestion-autopilot.test.ts tests/ingestion-autopilot-workflow.test.ts tests/check-lighthouse-budget.test.ts tests/live-web-vitals-inputs.test.ts tests/offline-release-profile.test.ts",
"test:e2e": "node scripts/run-playwright.mjs",
"test:e2e:all": "node scripts/run-playwright.mjs",
"test:e2e:accessibility": "node scripts/run-playwright.mjs tests/ui-accessibility.spec.ts --project=chromium",
Expand Down
Loading
Loading