feat: public corpus promotion and retrieval-owner verification tooling - #288
feat: public corpus promotion and retrieval-owner verification tooling#288BigSimmo wants to merge 11 commits into
Conversation
fix: restore anonymous production setup-status for psychiatry.tools
- Re-apply indexing_v3_agent_jobs table and claim/update RPCs on live - Codify match_document_embedding_fields_text with service_role-only execute - Enable RLS on rag_visual_eval_* tables - Fix edge function JSONB status RPC parsing - Harden owner-scope and health deep-probe gating - Restore .env.example; remove unused postgres npm dep - Make gold-label governance advisory-only
Remove nested worktree references from the plugin branch and ignore .worktrees/ so checkout and required status checks can pass. Co-authored-by: Cursor <cursoragent@cursor.com>
…gSimmo/Database into cursor/governance-ux-and-hardening-d304
…ripts Add check:retrieval-owner to validate the live sentinel migration and promote:public-documents with dry-run/--apply for locally reviewed docs.
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
BigSimmo
commented
Jul 5, 2026
Organizing open PRs (Jul 6): Main already has public corpus promotion via merged #274. This branch appears to include mixed commits from several other stacks — recommend rebasing the unique verification-script work onto main as a fresh PR, or closing if fully superseded. |
BigSimmo
commented
Jul 5, 2026
Closing as superseded by merged work on \main:
Production is live with these fixes. Any remaining unique commits should be cherry-picked onto a fresh branch from current \main. |
…1761) * issues: capture the in-page nav series (#286 PR 2, #287 PR 3, #288 DocumentViewer decision) and correct #256#256's forms half is disproven against origin/main e71b23b: all six formSections targetIds now render as element ids. Its differential-presentations half is still live, and two DSM routes have the same defect and were never recorded. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GyM49edHSNfm42u1SFDfG3 * issues: correct #256–#288 after review (presentations + DocumentViewer) Presentations shell ownership is already local; DocumentViewer non-adoption is already in search-chrome-behaviour.md. Add #286–#288 to the recommended execution queue and narrow the remaining owner decisions. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Resolves the duplicate #286 that made the PR un-mergeable. Main's in-page-nav series claims #286-#288; this branch independently created its own #286 for the authorizationHeader casing trap. Kept both sides and renumbered the branch's row to #289, bumping issues:next-id to 290. The auto-merge silently dropped the branch's #286 detail row rather than conflicting on it -- only the recommended-queue hunk raised a marker. That row is restored as #289. This is the silent row-loss mode archive row #112 describes: the guard catches duplicate ids but not a vanished one. Also addresses review findings on the handover brief: - Require the Clinical Governance Preflight for Phase 3 regardless of what scripts/pr-policy.mjs classifies. AGENTS.md:257 keys the requirement to behaviour -- source rendering and document access -- and Phase 3 changes both. The classifier not matching src/components/** is the PR #1489 gap recorded at pr-policy.mjs:62, not an exemption. - Resolve the scope contradiction: the brief claimed everything stays in src/components/document-viewer/** while Task 3 authorised wiring src/app/api/images/signed-urls/route.ts, which is clinical-risk. That is now an explicit, discouraged scope exception. - Correct the signed-URL warning. Both identity bugs are already fixed on main (authorizationIdentity() helper, identity in the dedupe key, cache write outside the shared promise, tests/auth-signed-url-cache.dom.test.tsx). The brief now says so and requires that coverage stay green, rather than reading as an open disclosure with a "consider" remedy. - Drop a literal NUL byte that had landed in the prose, and remove the trailing-space code span (MD038). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ER2xPFzPzoS8fAxkgHC8yo
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4VxLcvHim6btP5Zu2hFAo
…r predicate (#1776) * Record DocumentViewer nav non-adoption and merge the duplicated anchor predicate /issues #288 asked whether DocumentViewer should converge onto the shared InPageNavHeader template. Evaluated and declined on the merits; the decision and its blocking reasons are now recorded in docs/search-chrome-behaviour.md so it reads as closed rather than as a migration waiting for an owner. The premise that four modules are duplicated does not hold. Only the ~70-line header row and its sheet-state plumbing are duplicated: the scroll spy, segment track, section list, jump, and anchor measurement are already single implementations that both paths import. Adoption would instead require InPageNavHeader to grow escape hatches for its one non-conforming consumer — controlled sheet state (DocumentViewer observes it for chrome hold, opens it from a second trigger in the composer dock, and blurs the composer first), sheet content slots (density toggle, portal/headerLeading), and an opt-out of its own chrome metrics (different scope, extra property, headerHidden consumed by the desktop rail) — on a component seven routes already mount. It would also break the DocumentViewer literals pinned by header-scroll-hide-contract and document-section-nav-contract, which are the contract this change exists to preserve. Converged what genuinely was duplicated: the visible-element predicate existed twice, character for character, in use-section-spy.ts and use-page-section-weights.ts. It is now one exported resolveVisibleElement(ids), with resolveSectionElement(id) as the alias-aware wrapper over it. Semantics are unchanged. useResolvedPageSections keeps its third, deliberately different predicate; converging that one would change resolution behaviour on seven live routes with no test covering it. Adds tests/in-page-nav-document-viewer-convergence.dom.test.tsx: behavioural cover for the merged predicate (alias fallback, zero-rect skip, absent section) plus static guards that the in-page-nav path keeps importing the shared spy, track, list and metrics rather than forking them, so the divergence cannot widen from two header rows to two of everything. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4VxLcvHim6btP5Zu2hFAo * Record the #288 convergence handoff in the branch review ledger Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4VxLcvHim6btP5Zu2hFAo --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…system rows Archived as verified-delivered or duplicate: #303, #284 (dup of #296), #149, #159, #286, #287, #288, #256, #261, #291. Re-scoped with re-measured evidence: #210 (gate was never missing; the defect is the .next/dev types include), #262 (aliases 228 -> 193), #266 (counts moved, 23 unadopted holds), #275 (premise 'only one implementation' is false — the values leaked to five files). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017paT42ZVMf8jaLtkjFxdy5
Summary
Adds operational scripts for the public access rollout follow-up:
npm run check:retrieval-owner— validates live Supabase hasretrieval_owner_matches, reports indexed public document count, and confirms hybrid RPCs accept the public sentinel (00000000-0000-0000-0000-000000000000).npm run promote:public-documents— dry-run by default;--applypromotes indexedlocally_reviewed/approveddocuments toowner_id IS NULLand clears owner on related tables.Live verification (Clinical KB Database)
Ran against
sjrfecxgysukkwxsowpy:retrieval_owner_matchessentinelmatch_document_chunks_textwith sentinelUsage
Notes
--applymutates production data; dry-run first.