Skip to content

docs(db): Phase 1.2 RPC divergence dossier — all ten match_* mismatches classified (#316) - #2087

Merged
BigSimmo merged 5 commits into
mainfrom
claude/db-remediation-phase-1-2-19e4de
Aug 18, 2026
Merged

docs(db): Phase 1.2 RPC divergence dossier — all ten match_* mismatches classified (#316)#2087
BigSimmo merged 5 commits into
mainfrom
claude/db-remediation-phase-1-2-19e4de

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Phase 1.2 of the database remediation programme (plan of record docs/database-remediation-plan.md, ledger #316): the RPC divergence dossier is complete. In an owner-authorized read-only Supabase connector window against Clinical KB Database (sjrfecxgysukkwxsowpy, ref verified before the first query; four SELECT statements; zero writes), the ten outstanding match_*def_hash mismatches were fetched with pg_get_functiondef, re-hashed with the exact 20260706200000 normalization rule, and diffed against the repo's canonical bodies.
  • Result: all ten are classified, and every one is attribute-only. The live definition carries a SET work_mem TO '…' clause that supabase/schema.sql (the manifest source) omits; stripping exactly that one line reproduces the manifest hash byte-for-byte for 10/10. Zero body divergences, zero repo-ahead, zero UNCLASSIFIED. Four are mirror-stale (live equals migration 20260724000000; only schema.sql lacks the clause), six are live-ahead attribute-only (128MB on four functions, live-only work_mem on both _v2s and on match_document_table_facts_text after its 20260724120000 recreate). Owner decisions — keep 128MB or standardise to 64MB, and whether a planner-memory attribute is exempt from the repo-ahead eval-canary rule — are flagged in the dossier, not asserted.
  • Evidence (per-function table, decisive hunks, exact query texts, migration-history rows, connector session note) is written into docs/audit/live-drift-forensics-2026-08.md §1.2, and one #316 inbox update request is queued (docs/outstanding-issues-inbox/1591ee4a-….json). No other ledger row is touched.
  • RPC definitions were read and classified only. No RPC, migration, schema.sql, drift-manifest.json, or src/lib/rag/** file was changed, so this is a docs-only PR and no RAG impact: line is required. Nothing was fixed in this phase, per the plan's stop rules.

Verification

  • npm run verify:pr-local -- --files docs/audit/live-drift-forensics-2026-08.md,docs/outstanding-issues-inbox/1591ee4a-ce24-4091-93ba-ac4e7819fb60.json — recognised low-risk docs scope; decisive lines: docs link check passed: 1826 repo path references resolve., Outstanding-issues guard passed: 348 rows (97 open, 251 archived) …, Ledger inbox check passed: 2 pending request(s), 217 applied., Ledger write discipline passed for ed43a64f206e..HEAD., - failed: (none), - not reached: (none).
  • npm run docs:check-links and npm run check:outstanding-issues run standalone before commit (same passing lines).
  • npm run format run and committed before push.
  • UI verification not run: docs-only change, no UI/routing/styling touched.

Risk and rollout

  • Risk: none to runtime — documentation and one immutable inbox request only. Live database was read, never mutated.
  • Rollback: revert the commit.
  • Provider or production effects: read-only Supabase connector session against sjrfecxgysukkwxsowpy (explicitly authorized for Phase 1.2 in the task message); no other provider touched.

Notes

  • Playbook trap-list correction recorded in the dossier but not applied: 20260724120000_table_facts_plpgsql_execute.sql does contain a create or replace function (line 9), contrary to the playbook's trap list — a one-line docs follow-up for the coordinator.
  • Coordination board update (docs/database-remediation-coordination.md, PR docs(db): land and re-baseline the remediation coordination board (#316) #2044) is the coordinator chat's to make.
  • Concurrent worker chats (Phase 2 #056, Phase 6 design) were not touched.

🤖 Generated with Claude Code

…es classified (#316)
Read-only Supabase connector session against sjrfecxgysukkwxsowpy (ref verified first;
four SELECT statements, zero writes). Every one of the ten def_hash mismatches is an
attribute-only difference: live pg_get_functiondef carries a SET work_mem clause that
supabase/schema.sql (the manifest source) omits, and stripping that single line reproduces
the manifest hash byte-for-byte for 10/10 under the exact 20260706200000 normalization.
Zero body divergences, zero repo-ahead, zero UNCLASSIFIED. Four are mirror-stale (live =
migration 20260724000000, schema.sql lacks the clause); six are live-ahead attribute-only
(128MB on four, live-only work_mem on the two _v2s and on table_facts_text after its
20260724120000 recreate). Owner decisions (128MB vs 64MB, canary exemption) are flagged,
not asserted. Queues one #316 inbox update. No RPC, migration or RAG code changed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@supabase

supabaseBot commented Aug 18, 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 18, 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:6 minutes

Limit details: You’ve used all 1 included review currently available under your plan. You completed 100 included PR reviews in the past 7 days; at that activity level, included reviews refill 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?

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: 0b8a1281-29ef-4e1c-856c-6f3047f303e5

📥 Commits

Reviewing files that changed from the base of the PR and between d605eee and bdbb77a.

📒 Files selected for processing (4)
  • docs/audit/live-drift-forensics-2026-08.md
  • docs/branch-review-records/0363fe6d8b7a12cc846d0bb62401f25b543e33bee5210cfc9708ac8c0ba8b348.record.md
  • docs/database-remediation-playbook.md
  • docs/outstanding-issues-inbox/1591ee4a-ce24-4091-93ba-ac4e7819fb60.json

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

BigSimmoand others added 2 commits August 18, 2026 12:14
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…SET-attribute hash trap
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Docs-only PR completing Phase 1.2 of the database remediation programme by recording and classifying the remaining ten match_* RPC def_hash mismatches as attribute-only (SET work_mem present in live pg_get_functiondef, absent from supabase/schema.sql), plus queuing a single #316 outstanding-issues inbox update.

Changes:

  • Adds a detailed Phase 1.2 completion dossier section to docs/audit/live-drift-forensics-2026-08.md with method, queries, and per-function classification.
  • Updates docs/database-remediation-playbook.md to correct a prior trap-list statement and to note that function SET attributes affect drift hashing.
  • Queues a #316 outstanding-issues inbox update request and appends the corresponding immutable branch review record.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/audit/live-drift-forensics-2026-08.mdAdds the Phase 1.2 completion block with evidence, normalization rule, and per-function classification summary.
docs/database-remediation-playbook.mdCorrects the migration trap-list note and documents that SET attributes are included in the drift hash.
docs/outstanding-issues-inbox/1591ee4a-ce24-4091-93ba-ac4e7819fb60.jsonQueues an #316 “update” request capturing Phase 1.2 completion details and next steps.
docs/branch-review-records/0363fe6d8b7a12cc846d0bb62401f25b543e33bee5210cfc9708ac8c0ba8b348.record.mdAdds the immutable review record for this docs-only PR’s scope and verification summary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threaddocs/audit/live-drift-forensics-2026-08.md
@BigSimmo
BigSimmo enabled auto-merge (squash) August 18, 2026 05:36
@BigSimmo
BigSimmo merged commit 173ea9f into mainAug 18, 2026
24 checks passed
@BigSimmo
BigSimmo deleted the claude/db-remediation-phase-1-2-19e4de branch August 18, 2026 05:37
BigSimmo pushed a commit that referenced this pull request Aug 18, 2026
…nchor
Two stale pointers in the playbook's context briefing, both of which misdirect a
fresh session before it reads anything else.
The phase status block still said Phase 1.2 was outstanding and gating Phase 3,
and named "complete 1.2, then Phase 2" as the next step. Both have since landed:
1.2 in PR #2087 (all ten mismatches attribute-only SET work_mem, zero body
divergence, zero repo-ahead, zero UNCLASSIFIED) and Phase 2 in PR #2093 (staging
at full parity, check:drift against staging red with 19 items — the finding the
phase existed to produce, with a re-measure owed once staging carries
20260818090000). Phase 6 is repo-side complete with its migration deploy still
owed. The block now records that and defers to
docs/database-remediation-coordination.md as the live board rather than becoming
a second source of truth beside it.
It also flags that Phase 3 has been reframed: zero repo-ahead bodies means no
eval canary, which the Phase 3 prompt further down this file still assumes. That
prompt and the traps list are deliberately left untouched here — the reframing
and its owner decisions belong to the coordination board, and duplicating them
would recreate the drift this change is repairing.
The tracking anchor quoted the row title "Live DB is missing 21 repo-defined
indexes and 10 retrieval RPC bodies diverge". The row has since been retitled to
"Live DB has 20 currently missing repo-defined indexes and 10 retrieval RPC
bodies diverge; weekly live-drift has been red since 2026-07-26 with no routing",
so the exact-title lookup the playbook instructs could no longer match. The "21"
was preserved deliberately in #1979 because it was the lookup key; correcting the
row is what broke it. Anchor updated to the current title, verified character for
character against the row on main.
No issues:update queued: #316 and #56 are owned by other running chats, and a
second pending mutation on either row would make the inbox refuse the batch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BKNFogaYfCQBvFVqFQnfRt
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