Repository navigation
Sign-in, Terms and server checks fail closed; declaration at first open (S2) - #3838
Conversation
- N-06: server-rendered clinical pages show the sign-in card when the server client is missing, instead of opening the record. - N-03: the browser gate for scoring, therapy ranking and patient details fails closed in a production build with no Supabase config, unless it is a deliberate demo deploy. - D26-40: the signed link to a shared document's original checks the health professional declaration on the account, as Answer does. - R-05: THIRD_PARTY_ORIGINALS_ADMIN_ONLY limits shared originals to administrators. Off by default. - PD-03: the sign-up form links the privacy notice beside the Terms. - PP-04: saves recheck the live account instead of trusting the proxy's locally verified claims, and banned accounts are refused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bo66x2f17KZ9k3KNquiG4i
…he account record (S2) The server-rendered medicine and differential pages now treat a banned account as signed out (PP-04). The signed-in Terms prompt no longer hides on this device's copy alone, because Answer and original documents check the account record on the server (D26-40). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
…owner decision 26 Oct) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
…laration (D26-07) The owner chose to move the declaration from the first Ask to first open, before any clinical tool. A signed-in account without the declaration on its account record now sees a card in place of each clinical tool, whose button reopens the Terms prompt. The server-rendered medicine and differential pages check the account record too and refresh once it is saved. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
…opens above it (D26-07) "Review the Terms" on a locked calculator reopened the Terms prompt behind the calculator: the sheet sat in the page on the same modal rung and painted over the overlay root. It now portals into OverlayPortal's modal layer like every Sheet, and its stack and focus effects wait for the portalled panel. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 56 minutes. View limit details
Comment |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
… wording Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Generated by Claude Code |
|
Generated by Claude Code |
|
Review record Generated by Claude Code |
Requested by Josh · project thread
Summary
Stream S2 of the 26 Oct master plan: checks that happened only in the browser, or that opened when something was missing, now run on the server and fail closed. It also builds the health professional declaration at first open (D26-07), which Josh chose on 26 Oct and which is recorded in
docs/decisions/2026-10-26-health-professional-declaration-at-first-open.md, and turns R-05 on by default after his yes to question 5.clinicalPageSignInRequiredreturned "no sign-in needed" when the server Supabase client was missing. It now shows the sign-in card in that case. It also shows it for a blocked account, and for a signed-in account that has not made the declaration. Demo mode and local no-auth development are unchanged.NEXT_PUBLIC_DEMO_MODE=true).THIRD_PARTY_ORIGINALS_ADMIN_ONLY, defaulttrue. The original file of any document the caller does not own goes only to administrators, checked on a live account lookup that refuses on failure. Cited excerpts, page images and registry pages stay open. Setting it tofalsein Railway reopens originals. Its decision entrydocs/decisions/2026-10-26-third-party-pdfs-admin-only.md(merged from Reconcile 25 ledger inbox requests #3842) now points atsrc/lib/env.ts.New wording, approved by Josh on 26 Oct (decision card; recorded in
docs/decisions/2026-10-26-sign-in-and-declaration-card-wording-approved.md):Not changed, and why:
/loginstill lands on Favourites. That redirect was a deliberate choice (audit L3,next.config.ts). A different landing page is a design change for S5./therapy-compass-data/*.jsonis a public static file. Someone using developer tools could run scoring signed out. The instruments and bands are public, so moving scoring to the server is a large change for little gain. That judgement is for Josh and counsel./api/images/*/signed-url, figure crops, cover pages) do not get the declaration or admin check. They appear inside answers and search results./api/medications, differentials, search) check sign-in only, not the declaration. The pages that use them are behind the declaration card.use-dashboard-search-execution.ts; the results are hidden behind the card. That file belongs to S5.RAG impact: no retrieval behaviour change. No protected search file is touched.
Verification
npm run verify:cheap: lock parity, Codex hooks, diff integrity, lint and typecheck passed. Unit suiteTests 4 failed | 33533 passed | 19 skipped. All four failures were the repo-awareness tests refusing a decision file I created while the run was going ("Untracked Markdown documents would be omitted"). After committing it,tests/repo-awareness-gate.test.tsandtests/repo-awareness-generator.test.ts:Tests 58 passed (58).main(no conflicts): typecheck passed, eslint on every changed file clean, the 15 changed and neighbouring test filesTests 176 passed (176).Tests 219 passed (219).New tests prove each check fails closed:
Risk and rollout
THIRD_PARTY_ORIGINALS_ADMIN_ONLY=falsein Railway.Clinical Governance Preflight
PsychSift Production(sjrfecxgysukkwxsowpy)Evidence / not applicable / unresolved:
Ready for review: Josh approved the wording on 26 Oct. Up to date with main.
🤖 Generated with Claude Code
https://claude.ai/code/session_016iRNGzm9De17uFBsQkHDGp