Repository navigation
Overnight sweep: small security, privacy and correctness fixes from the audits - #3849
Conversation
- Admin Requests: a request flagged as holding a patient detail no longer puts its message into an Email draft link (only onClick guarded it). - Teaching: a supervisor's direct EPA record now refuses a note that looks like a patient detail or is too long, matching the request path. - classify-documents keeps a reviewer's hidden label hidden and pages the existing-label read so no label loses its review state. - embed-registry-records pages every record loader past the 1000-row cap. - Operator export SQL no longer emits one all-null record for an empty release. - compare-retrieval-eval --fail-on-regression now fails on a doc or content recall drop or recall below the pinned 1.0. - eval-rag refuses unknown or mistyped flags, and --fail-on-threshold fails when no case was selected. - On Call editor: correct the clearWhenEmpty comment to match handleSave. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A3iqZF1bkjWhCnrvYZPYJo
…n reconcile - /?mode=medications and /?mode=medication now open Medication mode instead of silently falling back to Answer (design audit D26-52, a11y A11Y-13 title). - issues:reconcile repairs the mojibake arrow in the ledger preamble (#WWTRM5). A batch with no requests stays byte for byte, so other PRs still match. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A3iqZF1bkjWhCnrvYZPYJo
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
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. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Page generated labels and preserve metadata scripts/classify-documents.ts |
Generated labels are loaded in ordered pages. Upserts retain label_review_status and hidden from existing metadata. |
Registry record pagination
| Layer / File(s) | Summary |
|---|---|
Add shared paging to record loaders scripts/embed-registry-records.ts |
Registry, medication, and differential loaders use a shared paging helper and add id as the final sort key. |
Retrieval recall gate
| Layer / File(s) | Summary |
|---|---|
Check recall and gate the command scripts/compare-retrieval-eval.ts, tests/compare-retrieval-eval.test.ts |
The script reports document and content recall failures and sets a failing exit status when the regression flag is enabled. Tests cover the recall conditions. |
RAG evaluation argument checks
| Layer / File(s) | Summary |
|---|---|
Validate arguments and selected cases scripts/eval-rag.ts |
Argument parsing rejects positional and unknown flags. Threshold checking fails when no cases are selected. |
Ledger encoding repair
| Layer / File(s) | Summary |
|---|---|
Repair markdown before applying requests scripts/ledger-inbox.mjs, tests/ledger-inbox.test.ts |
Nonempty request batches repair the known corrupted arrow sequence. Tests also verify that an empty batch leaves the input unchanged. |
Population export aggregation
| Layer / File(s) | Summary |
|---|---|
Filter null release rows scripts/sql/operator-export-site-content-population.sql |
The JSON aggregate excludes rows with a null release_id. |
Search heading hierarchy
| Layer / File(s) | Summary |
|---|---|
Add headings to search and recommendation content src/components/dsm/dsm-search-page.tsx, src/components/therapy-compass/screens/search-screen.tsx, src/components/therapy-compass/screens/recommend-screen.tsx |
The diagnosis and therapy search screens add level-two headings. The recommendation screen uses an h2 for “Ranked clinical matches.” |
On-call editor save behavior comment
| Layer / File(s) | Summary |
|---|---|
Update the save behavior description src/components/on-call/on-call-entry-editor.tsx |
The comment now describes how empty optional fields and list and escalation-step fields are saved. |
Draft request email action
| Layer / File(s) | Summary |
|---|---|
Select the email action for blocked requests src/components/work-screens/admin/requests-page.tsx |
Draft requests with a patient-related problem use a button instead of a mailto link. |
Legacy home mode redirects
| Layer / File(s) | Summary |
|---|---|
Redirect legacy medication modes src/lib/legacy-home-redirect.ts, tests/own-page-mode-home.test.ts |
The medication and medications mode values redirect to prescribing. Tests verify query preservation. |
Direct EPA note validation
| Layer / File(s) | Summary |
|---|---|
Validate notes before recording src/lib/teaching/assessments/model.ts, tests/teaching-assessments-model.test.ts |
Direct EPA recording rejects notes that fail text validation. Tests cover patient-identifying and overlong notes. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Possibly related PRs
- BigSimmo/PsychSift#3790: Adds review carry-forward and generation snapshots for generated indexing data; this pull request also preserves review metadata during label updates.
- BigSimmo/PsychSift#3781: Adds protected retrieval evaluation requirements; this pull request adds a recall gate to the comparison script.
- BigSimmo/PsychSift#3780: Records the ledger arrow encoding issue; this pull request implements the corresponding repair.
Suggested labels: 🕐 40+ Minutes
Suggested reviewers: claude
Merge Risk: 
Minimal · up to 26a9e
-
This change contains small security, privacy and correctness fixes with no identified merge-blocking issue. Normal checks apply, including confirming that the two reported test failures are environmental.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description includes the required Summary, Verification, Risk and rollout, Clinical Governance Preflight, and Notes sections. It documents the changed areas, test results including known unrelated failures, risks, rollback, production effects, and governance evidence.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 16 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 ESLint
-
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install timed out. The project may have too many dependencies for the sandbox.
Comment @coderabbitai help to get the list of available commands.
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
…11Y-12, D26-43) Recommend's 'Ranked clinical matches' label becomes the h2 it looks like, and Therapy search and DSM search results get a visually hidden h2 above the h3 result titles. No visual change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A3iqZF1bkjWhCnrvYZPYJo
|
Lighthouse budget failed on 26a9e22. This looks like runner noise, not this PR.
The workflow run is still in progress, so the failed job can't be re-run yet. I'll re-run it once when the run finishes. Generated by Claude Code |
Requested by Josh · project thread
Summary
Ordinary code fixes for open audit rows that were still present on main (checked against
4705d27a7). No database migration, no protected retrieval file, no clinical wording, no CI workflow file.href(onlyonClickguarded it, so middle click or copy link skipped the check). Security test row.scripts/classify-documents.tskeeps a reviewer'shidden/label_review_statuson regenerated labels and pages the existing-label read. Whole-codebase row.scripts/embed-registry-records.tspages each record loader past the 1000-row cap. Whole-codebase row.scripts/sql/operator-export-site-content-population.sqlno longer emits one all-null record when the active release is empty (operator read-only query, not a migration). Whole-codebase row.scripts/compare-retrieval-eval.ts --fail-on-regressionfails on a doc or content recall drop or recall below the pinned 1.0. Security test row, new tests.scripts/eval-rag.tsrefuses unknown or mistyped flags, and--fail-on-thresholdfails when no case was selected. Security test row.clearWhenEmptycomment now matches whathandleSavedoes (every emptied optional field clears). Whole-codebase row, comment only./?mode=medicationsand/?mode=medicationnow open Medication mode instead of silently falling back to Answer (design audit D26-52, a11y A11Y-13 wrong title). New tests.issues:reconcilerepairs the mojibake arrow in the ledger preamble (#WWTRM5). A batch with no requests stays byte for byte, socheck:ledger-write-disciplinestill matches every other PR. New tests.h2it already looks like; the two search pages get a visually hiddenh2. No visual change.Already fixed on main, no change needed: changed-file names injecting CI scope outputs (
ci-change-scope.mjsrefuses control characters), canary case summary "all passed" for a missing section, bulk reindex refresh after a failed batch (the activeuse-dashboard-bulk-actionshook does it), disallowed ARIAlistitemonarticle(fixed in cf4a754),/api/local-project-idon the deployed site (LS-14, returns 404).Areas touched: Personal practice, Answer engine, App experience, Clinical reference content, Knowledge and records, Source intake and indexing
RAG impact: no retrieval behaviour change — no ranking-protected file changed. The eval scripts touched only fail more strictly.
Verification
npm run typecheckpass; eslint and prettier clean on changed files; fullnpm run testtwice (before and after the heading commit):Test Files 2 failed | 2120 passed, the only failures arecloud-platform-smoke(wants npm 11.17.0) andrag-plan-package-parity(wants origin/main), both known container-environment failures, unrelated to this diff.Risk and rollout
Clinical Governance Preflight
PsychSift Production(sjrfecxgysukkwxsowpy)Evidence / not applicable / unresolved:
Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01A3iqZF1bkjWhCnrvYZPYJo
Summary by CodeRabbit