Repository navigation
fix(clinical,teaching,roster): remediate adversarial audit findings across calculators, handover privacy, EPA magic links, QR check-in, and roster swaps - #3574
Conversation
…cross calculators, handover privacy, EPA magic links, QR check-in, and roster swaps
There was a problem hiding this comment.
BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 23 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
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. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
PR Summary by QodoRemediate clinical, teaching, handover, and roster audit findings
AI Description
Diagram
High-Level Assessment
Files changed (39)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9c3002c4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
1 issue found across 40 files
Confidence score: 3/5
- Crossing the 1280px breakpoint in
src/components/calculators/search-page.tsxremounts the calculator and loses entered values, open state, and active tab. Keep the panel state above the responsive branches.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/components/calculators/search-page.tsx">
<violation number="1" location="src/components/calculators/search-page.tsx:608">
P2: Crossing the 1280px breakpoint unmounts the current calculator panel and mounts a new one, discarding all entered values, the open state, and the active tab. Preserve the panel state above the responsive branches, or keep one instance mounted while changing its layout.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Auto-fix isn't included in your plan ↗ |
Code Review by Qodo
No findings for this group No findings for this group No findings for this group Resolved findings 1.
|
- Honor shared-device scratchpad privacy - Load scratchpad after hydration - Synchronize scratchpad changes across tabs
Qodo Fixer✅ Committed (5) · ☑ Fixed (5) Commits pushed directly to this PR — no separate fix PR opened. Process — 5 fixed
|
CodeAnt Nitpicks5 code suggestions1. Lowercasing uppercase tokens lets non-whitelisted patient initials in
|
|
CodeAnt nitpicks and the breakpoint comment:
Generated by Claude Code |
|
Code review by qodo was updated up to the latest commit c583f57 |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016imb8DCuk85z3FWRDDyZx5
|
Code review by qodo was updated up to the latest commit ceaaeef |
The manager reads a checkable rule warning before approving, so the approval now sends acknowledgeRuleWarnings, matching the decision sheet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016imb8DCuk85z3FWRDDyZx5
|
Code review by qodo was updated up to the latest commit 422c629 |
- Camera-denied copy no longer points to a code field 'below', which the code sheet does not have. - Hide the test-only gap summary from screen readers, which already hear each gap in its roster row. - Forms review note spells the reviewer attribution as Psych Sift. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016imb8DCuk85z3FWRDDyZx5
Code Review ✅ Approved 2 closed / 2 findings🔴 High risk · Changes renal-clearance and lithium-dose calculations plus handover privacy and assessment access; errors could mislead treatment or expose sensitive notes. Clinical scratchpad and handover privacy changes are approved. Scratchpad no longer saves every keystroke on shared devices, and the shared-device guard now clears previously stored scratchpad content instead of leaving it behind. ✅ 2 closed✅ Security: Scratchpad saves every keystroke, even on shared devices
✅ Edge Case: Shared-device guard skips deletes and leaves old scratchpad stored
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Approved For more verification details, 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 5 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
|
Code review by qodo was updated up to the latest commit 6432f13 |
|
Production UI (3) failed on 6432f13 at one test, I don't believe this failure comes from this PR. The PR doesn't touch prescribing search, the medication results, the bottom search dock or scrolling. The only change since 422c629, where this same shard passed, is two lines of camera-denied wording, one sr-only attribute and a note in the forms review JSON. I'll re-run the failed job once when the run finishes. If it fails a second time, I'll treat it as real and look into it. Generated by Claude Code |
Main carries #3574 (squash of this branch's earlier commits) and #3575, which already ships a stricter sign-off pin check. This merge keeps main's pin check, adds this branch's --execute credential guard, drops a broken bot commit (b0adab7), and repairs two others (stray JSX after the handover page's last line, and a setState-in-effect lint error in the note editor). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016imb8DCuk85z3FWRDDyZx5
User description
Summary
ClinicalMathPanel,calculators/search-page.tsx,renal.ts,types.ts):age,weightKg,creatinine,heightCm,qtMs,hrBpm,lithiumLevel,currentDoseMg,targetLevel) to""so no fabricated patient numbers (92.25 mL/min,875 mg/day) or falseLevel status: invalid (target 0–0 mmol/L)warnings render before clinician input.Number.parseFloatwith strict numeric parsing (parseStrictNumber), use88.42(CREATININE_UMOL_PER_MG_DL) for creatinine unit conversion, distinguishweightBasis: "adjusted"(ABW) vs"ideal"(IBW) in Cockcroft-Gault results, and mount only a single<ClinicalMathPanel />in the DOM across desktop/mobile viewports.note-editor.tsx,handover-page.tsx,handover.ts):ClinicalNoteEditorchanges and saves oncheckPatientDetail(src/lib/work-text/patient-detail-check.ts) with an accessiblerole="alert"privacy banner (data-testid="note-editor-privacy-warning"), and only show"Saved"/"Save now"when anonSavehandler is provided.scratchpadTextintoOnCallHandoverPagebacked byloadOnCallHandoverScratchpad/saveOnCallHandoverScratchpad(withwritePatientLabelsexpiry wrapper andonCallDeviceStoreChangedEventsync) so toggling"Make table"->"Back to the form", switching specialty, or reloading never drops de-identified shift notes.respond/[token]/route.ts,magic-link.ts,teaching-code-sheet.tsx,qr-check-in-helper.tsx,teaching-qr-checkin-sheet.tsx,teaching-organise.tsx,organise-sheets.tsx,repository.ts):503 assessment_store_unavailable) inproductionon/api/teaching/assessments/respond/[token](matchingdual-sign-off/route.ts), requirerequireAuthenticatedUseronPUT, boundmagicRateLimitStoreeviction, and validate clinician names viacheckEpaClinicianName(Dr J. Smith,Ms Taylor) without weakening globalcheckPatientDetail./teaching/c/<token>projector QR URLs in bothTeachingCodeSheetandTeachingQrCheckinSheet, remove duplicate manual entry / filter inputs, fetch term attendance counts forAttendanceGapsSheet, and verify activeon_call_service_membersmembership beforedisplay.revoke.roster/team/repository.ts,roster-decision-sheet.tsx,needs-you-strip.tsx,roster-safe-number.tsx):verifySwapApproveRulesto active managers on non-expired'accepted'swaps with non-superseded shifts so non-managers, swap parties, expired swaps, and superseded shifts reach SQLroster_command's authoritative status/role transitions.acknowledgeRuleWarnings: truewhen rule warnings are uncheckable or acknowledged, keepRosterDecisionSheetopen on409 roster_swap_rule_warning, and guardRosterSafeNumber"Overwrite with my changes"against a third concurrent edit arriving after the conflict banner opened.source-acquisitions.json,forms-content-review.json,service-records-review.json,publish-site-content-first-catalogue.ts,apply-specifier-worksheet.mjs):#05WXHX) conservative (validationStatus: "unverified",documentStatus: "review_due",disposition: "rejected") with no unverified dates or attestations, enforce"Psych Sift"display-name sign-off (2026-10-16-psych-sift-display-name-sign-off.md), validate 64-hexreviewedContentSha256on catalogue publication, and flush blockquote buffers across blank lines.ragRanking: false).Areas touched: Personal practice, Clinical reference content, App experience, Delivery and assurance, Answer engine, Knowledge and records
Clinical Governance Preflight
PsychSift Production(sjrfecxgysukkwxsowpy)Verification
Paste the decisive line from whatever you ran — exit code 0 alone is not proof.
npm run typecheck:[gate-receipts] recorded a pass for "typecheck:internal" (10171 input files).npx eslint --max-warnings=0 <33 changed code files>:0 errors, 0 warningsnpm run check:diff-integrity -- --base origin/main:[diff-integrity] OK — inspected 39 changed file(s) against origin/main (10 test file(s) checked for floor drops).npm run check:forms-review-sheet:Wrote docs/evidence/forms-operational-guidance-review.md.(clean check)npm run source-acquisitions:check-order&npm run check:source-acquisitions:Source acquisition ledger passed.npx vitest run <14 affected suites>:Test Files 14 passed (14) | Tests 344 passed (344)tests/note-editor-caret.dom.test.tsx,tests/qr-check-in-helper.dom.test.tsx,tests/attendance-roster.dom.test.tsx,tests/clinical-math-bounds.test.ts) and delegated to hosted GitHub CI browser shards.eval:retrieval:quality,eval:rag,eval:quality) not run because zero RAG/retrieval/answer-generation files were changed (ragRanking: false).Risk and rollout
Worth a line for clinical, data, auth/privacy, migration, dependency, or deployment changes.
git revert); no database migrations or external state changes are included.Notes
docs/branch-review-records/2a6b620065f5371039438fdbff73be97da6baf6c40dace3596e26c7bad0047dd.record.md.Summary by CodeRabbit
New Features
Improvements
CodeAnt-AI Description
Prevent unsafe clinical results and protect handover, teaching, and roster workflows
What Changed
Impact
✅ No fabricated clinical results before patient input✅ Shift notes survive reloads without saving detected patient details✅ Invalid teaching check-in links are rejected💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.