Repository navigation
feat(audit): comprehensive repository audit remediation and frontend hardening - #3538
Conversation
- Reject non-finite clinical inputs - Reject unsafe lithium dose targets - Reject pediatric adult-equation estimates
- Align Tall Man lettering - Apply Tall Man lettering in displays - Restrict Tall Man registry lookups
…eep robust chunking negation
…wer prompt; drop duplicate #main-content - adaptiveAnswerInstructions now carries the same <user_query> trust boundary as the legacy prompt (covered by the answer input version bump in this PR). - DSM and First Nations layouts keep a <main> landmark without duplicating the shell's #main-content id; the DSM record page no longer nests a main.
… chunking
- sanitizePromptUserQuery keeps a raw < and > ("<5 mg"); strips only the
source fence markers and the query's own <user_query> tags.
- Calculators give no result for missing or NaN/infinite inputs (CG and
CKD-EPI age, CKD-EPI non-finite output, QTc RR interval and output).
- Chunker version ratchet test: chunk output is pinned to CHUNKER_VERSION
(already bumped to 1.1.0 in this PR), so boundaries cannot change silently.
…ition sentences, redact grouped MRNs, enforce cache bounds, and reset unsupported therapy review claims
Resolved conflicts in: - src/components/clinical-dashboard/medication-record-page.tsx (unmerged) Co-authored-by: CodeRabbit <noreply@coderabbit.ai> CodeRabbit-Task-Id: 4ca314c6-bd15-45e0-b4f0-4ba23d5d305a
CodeRabbit's af1d589 already landed the lithium, MRN and cache fixes; this keeps the extra pieces: - chunking: also keep does/shall not, cannot and can't with the action they govern; chunker version 1.2.0 with a re-recorded ratchet fingerprint. - bounded-ttl-cache: note why eviction checks iterator completion; extra LRU test for an undefined oldest key. - tests: negative lithium level, grouped MRN storage, negation sweep. - docs: name the review protocol as an input, not the report.
…ed assets af1d589 regenerated the therapy data assets (therapies-index.0258501ace4a62fd, therapies.72ac900e1632e4e2) but the owner manifest still listed the removed 3c76b7eccd22d9b5 / 347aed41cad36f23 files, so Change scope failed with site-content-owner-manifest-missing-owner.
Spies and stubbed globals are now restored after every Node test. The two suites that relied on beforeAll/module-scope fixtures (work-page-stars, rag-query-log-failure) now create them per test. Owner ruling 13 Oct 8:40 PM AWST.
…ening' into feat/audit-remediation-full-hardening
…R code generation
…ways on release records trigger (#AD3F5B, #4W704K)
|
Code review by qodo was updated up to the latest commit 7587d66 |
|
Code review by qodo was updated up to the latest commit 95b5ee5 |
|
Code review by qodo was updated up to the latest commit 462238f |
|
Code review by qodo was updated up to the latest commit 25b93d2 |
CI failed: The CodSpeed benchmark job failed while uploading results because CodSpeed rejected GitHub OIDC authentication (401) since no CodSpeed GitHub App is installed for the account or org; this is unrelated to the PR's ledger and audit changes.OverviewOne unique failure pattern was found across 4 jobs (45 logs analyzed in total). The failure is an authentication problem in the CodSpeed benchmark upload step, not a code defect, and the analyzer judged it unrelated to this PR. FailuresCodSpeed results upload rejected with 401 Unauthorized (confidence: high)
Summary
Code Review ✅ Approved 10 closed / 10 findings🔴 High risk · Forcing RLS across control-plane tables and making registrar tables service-role-only changes data access; policy gaps could block legitimate operations or expose records. Audit remediation for the PsychSift repo adds RLS hardening, touch-target and Tall Man lettering fixes, frontend performance changes, and ledger batch fixes. Resolved this session: public caching of canonical clinical lists, a duplicate migration version, registrar self-sign-off, the proxy signing key reuse, the QR scanner stream attachment, dead ✅ 10 closed✅ Bug: Live canonical clinical lists are now cached publicly for up to a day
✅ Bug: Two migrations share version 20261013140000
✅ Security: Registrars can create and sign off their own assessments
✅ Bug: schema.sql not updated for new tables, purge function and FORCE RLS
✅ Security: Proxy claim signing key now doubles as a bearer secret sent on requests
...and 5 more closed from earlier reviews VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Approved For more verification details, comment Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Important Your trial ends in 7 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
…y/auth bugs, and record Josh Simpson clinical sign-offs (#3571) * feat: wire PR #3538 components, fix clinical math/Tall Man/RAG latency/auth bugs, and prepare governance sign-off tooling * feat(governance): record Josh Simpson clinical sign-offs across therapies, MHA sections, specifiers, TGA sources, forms, services, and interaction lexicon * fix: Reject registration of used links * fix: Await supervisor link registration * fix: Use actual weight for non-obese patients * fix: 3 findings — Make scratchpad saves explicitly ephemeral; Remove dea - Make scratchpad saves explicitly ephemeral - Remove dead editor event handling - Use hydration-safe shared-device state * fix: Detect conflicts against stored shifts * fix: 2 findings — Recover lateral table extensions; Preserve wrapped and - Recover lateral table extensions - Preserve wrapped and single-column rows * fix: 2 findings — Reject unimplemented execution mode; Require clinical - Reject unimplemented execution mode - Require clinical content pins * fix: Recognize third-person clozapine actions * fix: remove corrupted file tails and restore note editor textarea id The last automated fix commits left stray fragments after the end of note-editor.tsx, assessments-help.tsx and extract_pdf_assets.py (a broken textarea id, an await in a non-async handler, and a Python syntax error). Restore the id, make the supervisor-link handler async with network error handling, and delete the trailing fragments. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019gkjxLBxo8mu4sm1AkFxGA * fix: typecheck errors, exact team counts, and roster conflict checks against saved shifts - Manual shifts: compare new shifts against the saved roster (not against themselves) and pass the loaded shifts to the add-shift form. - Owner team counts: page through every membership row instead of capping at 10,000. - Fix TypeScript errors on the branch: error responses on the EPA link route now set headers through a local helper, the display-link ownership check uses a narrow client type, and test fixtures match current types. - First-publication tests: fixtures carry a synthetic content pin now that sign-offs without one are refused. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019gkjxLBxo8mu4sm1AkFxGA * fix: update the note editor's onChange ref in an effect (lint: no ref writes during render) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019gkjxLBxo8mu4sm1AkFxGA * fix(pr-3571): resolve review thread findings and sync design-system adoption * fix(pr-3571): resolve remaining typecheck and build import errors * fix(pr-3571): resolve CI test partitions, Next PageProps, and review threads * chore(pr-3571): refresh repo-awareness-snapshot for new EPA magic-link route * fix(lint): resolve react-hooks/set-state-in-effect and next relative location assign --------- Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Summary
Areas touched: App experience, Knowledge and records, Personal practice, Clinical reference content, Data platform and access, Delivery and assurance, Design system, Answer engine, Prototypes, Source intake and indexing
RAG impact: no retrieval behaviour change — frontend UI/UX audit remediation, touch target upgrades, and tall man test alignments
Verification
npm run check:design-system-contract: 0 violations across 2,631 filesnpm run check:type-scale: passednpm run check:icon-scale: passednpm run check:design-drift-ratchet: passednpx vitest run tests/tall-man-lettering.test.ts tests/design-system-contract-utils.test.ts: 67/67 passingProduction UI/Production UI critical) is the requested verification surface.Risk and rollout
Notes
Summary by cubic
Ships the comprehensive repository audit remediation: clinical safety, security, and frontend hardening across the app, plus the follow-on fixes that landed on the branch since.
Migration and rollout
20261013170000_force_rls_control_plane.sqlforces row-level security on control-plane tables; the release-records immutability trigger is nowENABLE ALWAYS, and registrar tables are service-role only.schema.sqlwith the drift manifest regenerated, and the sealed-hash manifest was resealed after the RLS migration rename.strongSupportLabelCapped; the bootstrap tracks the active owner ref./mockupsto/admin/developer-hubwith permanent redirects and in-app navigation wired in./open-shiftspast the 10% tolerance.Key changes
LORazepam; touch targets in agreement parts, CME kit, and handoff strip rise from 44px to 48px.viewsections with optimistic locking on safe-number edits.mainlandmark without duplicating the shell's#main-content.needs_reviewwithout re-signing; the ledger inbox processes queued adds before the close/update that targets them (disambiguating mutations that share a prefix with their add), and now queues three performance and retrieval optimization follow-ups (GIN index on release records, chunking regex caching, and result-list virtualization) — the command-palette debounce follow-up was retracted as unsupported, since the search surface already defers its query.Written for commit 25b93d2. Summary will update on new commits.
Summary by Gitar
verifyProxyAuthSecretwithPROXY_AUTHgating and the/api/proxyrouteindexing-v3-agentnow requires a service secret and a valid JWT viaauthorizeIndexingAgentRequestsrc/lib/calculators/clinical-mathregistrar_assessmentsandregistrar_training_milestonestablessrc/lib/search/my-work-grammar.tssrc/components/clinical-notes/note-editor.tsxfixturecaching when the canonical source is degradedsrc/components/forms/wa-mha-form-print.tsxchunkTextWithOverlapinsrc/lib/chunking.tskeeps negated clinical prohibitions within a single chunkneeds_review, and later-added NICE reference text hidden inrepository-providers.tsThis will update automatically on new commits.