Skip to content

fix: deploy public production access for psychiatry.tools#272

Closed
BigSimmo wants to merge 15 commits into
mainfrom
cursor/deploy-production-access-c40b
Closed

fix: deploy public production access for psychiatry.tools#272
BigSimmo wants to merge 15 commits into
mainfrom
cursor/deploy-production-access-c40b

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Deploys the production public-access fixes to main so psychiatry.tools stops showing API unavailable for anonymous/mobile visitors.

Includes:

  • Public /api/setup-status for anonymous production users
  • Production rate-limit fallback when durable RPC is unavailable
  • Dashboard resilience and production-friendly error copy
  • Document read access hardening for anonymous public catalogue
  • Mobile anonymous smoke coverage

Verification

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact checked — access/rate-limit only, no new clinical decision output

Deploy note

Merge triggers production rollout to psychiatry.tools. Apply any pending Supabase migrations on live after deploy.

Open in Web Open in Cursor 

BigSimmo and others added 10 commits July 3, 2026 21:00
The golden retrieval set was 100% lexical fast-path (embedding_skipped_rate=1.0), so
it could not measure whether a re-index changes vector/embedding retrieval quality.

- forceEmbedding option on searchChunksWithTelemetry (SearchChunksArgs): bypasses every
  lexical text-fast-path so retrieval always exercises the embedding/vector stage.
  Diagnostic/eval-only; folded into the search cache key; never set on production paths.
- eval-retrieval.ts: per-case `forceEmbedding` field + a global `--force-embedding` flag.
- 10 `vector-*` cases (psychiatric monographs: PTSD, OCD, panic, anorexia, GAD, Tourette,
  postnatal, bipolar, ADHD, opioid) with forceEmbedding=true. Each is a clinical query that
  must be answered by vector retrieval of the right monograph — verified live at
  document_recall@5=1.0, content_recall@5=1.0, all via strategy=hybrid (embedding used).

Rationale: forcing embedding is the correct instrument for re-index measurement — you want
to measure the vector index directly, not have a lexical shortcut mask a regression. Wording
alone can't reliably force the vector path (the fast-path is driven by emergent lexical-match
strength), so the flag makes these probes deterministic.

Live golden eval: 34/34 pass (24 existing + 10 new), no regression. verify:cheap green (980).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wire forceEmbedding through eval runners and retrieval cache keys, bypass coverage/lexical shortcuts when forced, and add golden-case failure metrics so vector regressions cannot hide behind text-fast-path or cache hits.
- Degrade invalid bearer tokens to anonymous scope instead of 401
- Allow public document read routes (list, detail, signed-url, search, images)
- Align registry routes with medications/differentials auth-signal short-circuit
- Let DocumentViewer load public sources without requiring sign-in
- Add regression tests and update access-control expectations
Create missing retrieval-support indexes (trgm, composite btree, partial
miss log) that were absent or only present under legacy names on live.
Update search_schema_health() to accept verified functional equivalents
during rollout. Set search_path for pg_trgm gin_trgm_ops in extensions.

Verified on linked project: search_schema_health() ok=true, missing=[].
…board

Delete post-extraction dead code left in the monolith and trim unused imports. Also fix minor lint issues in favourites-hub, visual-evidence, and services-navigator.
@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.

@supabase

supabase Bot commented Jul 5, 2026

Copy link
Copy Markdown

Updates to Preview Branch (cursor/deploy-production-access-c40b) ↗︎

Deployments Status Updated
Database Sun, 05 Jul 2026 14:43:08 UTC
Services Sun, 05 Jul 2026 14:43:08 UTC
APIs Sun, 05 Jul 2026 14:43:08 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Sun, 05 Jul 2026 14:43:10 UTC
Migrations Sun, 05 Jul 2026 14:43:13 UTC
Seeding ⏸️ Sun, 05 Jul 2026 14:43:03 UTC
Edge Functions ⏸️ Sun, 05 Jul 2026 14:43:03 UTC

❌ Branch Error • Sun, 05 Jul 2026 14:43:13 UTC

ERROR: syntax error at or near "$" (SQLSTATE 42601)
At statement: 1
create or replace function public.retrieval_owner_matches(owner_filter uuid, row_owner_id uuid)
returns boolean
language sql
immutable
parallel safe
set search_path = public, pg_temp
as $
   ^

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@BigSimmo
BigSimmo enabled auto-merge July 5, 2026 14:21
@BigSimmo
BigSimmo force-pushed the cursor/deploy-production-access-c40b branch from a834c69 to f67dcd0 Compare July 5, 2026 14:42
@BigSimmo

BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #274 (merged to main). Public production access rollout is complete on main.

@BigSimmo BigSimmo closed this Jul 5, 2026
auto-merge was automatically disabled July 5, 2026 17:16

Pull request was closed

@BigSimmo
BigSimmo deleted the cursor/deploy-production-access-c40b branch July 9, 2026 13:01
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