Skip to content

feat: public corpus promotion and retrieval-owner verification tooling - #288

Closed
BigSimmo wants to merge 11 commits into
cursor/content-access-review-a385from
cursor/public-corpus-promotion-d970
Closed

feat: public corpus promotion and retrieval-owner verification tooling#288
BigSimmo wants to merge 11 commits into
cursor/content-access-review-a385from
cursor/public-corpus-promotion-d970

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Adds operational scripts for the public access rollout follow-up:

  • npm run check:retrieval-owner — validates live Supabase has retrieval_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; --apply promotes indexed locally_reviewed / approved documents to owner_id IS NULL and clears owner on related tables.

Live verification (Clinical KB Database)

Ran against sjrfecxgysukkwxsowpy:

Check Result
retrieval_owner_matches sentinel ✅ true
Indexed public documents 1935
match_document_chunks_text with sentinel ✅ 5 results
Promotion candidates (default owner) 0 (corpus already promoted)

Usage

npm run check:retrieval-owner
npm run promote:public-documents          # dry-run
npm run promote:public-documents -- --apply
npm run promote:public-documents -- --owner-id <uuid> --limit 10 --apply

Notes

  • Promotion is idempotent when no candidates remain.
  • --apply mutates production data; dry-run first.
  • App layer must still send the public sentinel in production RAG paths (separate rollout).
Open in Web Open in Cursor 

BigSimmo and others added 11 commits July 5, 2026 22:49
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>
…ripts

Add check:retrieval-owner to validate the live sentinel migration and promote:public-documents with dry-run/--apply for locally reviewed docs.
@supabase

supabase Bot commented Jul 5, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


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

@BigSimmo
BigSimmo marked this pull request as ready for review July 5, 2026 17:05
@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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.

@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.

@BigSimmo

BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

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

BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

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.

@BigSimmo BigSimmo closed this Jul 5, 2026
@BigSimmo
BigSimmo deleted the cursor/public-corpus-promotion-d970 branch July 9, 2026 13:01
cursor Bot pushed a commit that referenced this pull request Aug 8, 2026
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>
cursor Bot pushed a commit that referenced this pull request Aug 8, 2026
…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>
BigSimmo pushed a commit that referenced this pull request Aug 9, 2026
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
BigSimmo pushed a commit that referenced this pull request Aug 9, 2026
BigSimmo added a commit that referenced this pull request Aug 9, 2026
…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>
BigSimmo pushed a commit that referenced this pull request Aug 12, 2026
…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
Sign up for free to 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.

1 participant