Skip to content

Fix public answer search when anonymous limiter is unavailable - #315

Merged
BigSimmo merged 3 commits into
mainfrom
cursor/fix-public-answer-search-2a07
Jul 6, 2026
Merged

Fix public answer search when anonymous limiter is unavailable#315
BigSimmo merged 3 commits into
mainfrom
cursor/fix-public-answer-search-2a07

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep unauthenticated answer/search/read requests working by falling back to the in-memory limiter when the durable anonymous limiter is unavailable.
  • Preserve fail-closed behavior for authenticated owner-scoped limits and non-read anonymous buckets unless the existing production/local fallback flag applies.
  • Add a visible non-production demo fallback for invalid Supabase API-key configuration across /api/search, /api/answer, and streamed /api/answer/stream, while production remains fail-closed.
  • Add regression coverage for anonymous search, non-streamed answers, streamed answers, upload fallback boundaries, and production guards.

Verification

  • npm run verify:cheap
  • npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed
  • npm run verify:release before release or handoff confidence claims
  • npm run format:check
  • npm run eval:retrieval:quality (must stay 23/23) when retrieval, ranking, selection, chunking, or scoring behavior changed — not run; rate-limit/fallback access fix does not change retrieval/ranking/scoring.
  • npm run eval:rag -- --limit 15 + npm run eval:quality -- --rag-only when answer generation, the synthesis prompt, or answer post-processing changed — not run; no synthesis/prompt/post-processing changes.
  • npm run check:production-readiness when clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changed
  • npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • 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 was checked when clinical decision-support behavior changed

Notes

  • Current Cloud Agent Supabase keys are rejected by Supabase as an unregistered API key; this PR keeps non-production/preview search usable with clearly marked synthetic fallback data, but production still requires corrected live Supabase secrets.
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 6, 2026 05:25
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

supabase Bot commented Jul 6, 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 ↗︎.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo marked this pull request as ready for review July 6, 2026 06:16
@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.

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.

2 participants