fix: keep Safety Plan Generator identifier-free#1119
Conversation
Remove patient identifier entry from the transient planner, clarify export boundaries, and add component plus Chromium privacy proofs. Verification: verify:cheap; focused Playwright; production build and client-bundle secret scan.
…patient-data-contract
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe safety-plan builder no longer collects patient identifiers and now marks identifiers for addition after export. Privacy documentation, catalog metadata, page copy, and DOM/browser tests describe and verify browser-local working content with explicit copy and print/PDF export boundaries. ChangesSafety-plan privacy contract
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Clinician
participant SafetyPlanGenerator
participant Browser
participant ClinicalRecordProcess
Clinician->>SafetyPlanGenerator: Enter identifier-free working content
SafetyPlanGenerator->>Browser: Keep content in current tab
Clinician->>SafetyPlanGenerator: Copy or print/PDF
SafetyPlanGenerator->>Browser: Write clipboard or invoke print
Browser->>ClinicalRecordProcess: Handle exported content and add identifiers
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/ui-tools.spec.ts`:
- Around line 2203-2205: Remove the duplicate const testWindow declaration in
tests/ui-tools.spec.ts around lines 2203-2205, retaining only one declaration in
the evaluate block. Rerun the focused Chromium check, then update its recorded
result in docs/branch-review-ledger.md at line 23.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e676393b-b4b0-4639-8af6-7c6326bd223a
📒 Files selected for processing (9)
docs/branch-review-ledger.mddocs/privacy-impact-assessment.mdsrc/app/privacy/page.tsxsrc/app/safety-plan/page.tsxsrc/components/patient-safety-plan.tsxsrc/lib/tools-catalog.tstests/patient-safety-plan-privacy.dom.test.tsxtests/privacy-ui.test.tstests/ui-tools.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2a132b707
ℹ️ 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".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Why
Ledger issue #60 identified a direct contradiction: the privacy contract said not to enter patient identifiers while the Safety Plan Generator asked for a name or initials and included it in copy/print output. The safe default is now identifier-free without adding storage or provider transmission.
Areas touched
src/components/patient-safety-plan.tsx/safety-planmetadata and shared tools catalogue copy/privacyanddocs/privacy-impact-assessment.mdVerification
node scripts/run-vitest.mjs run --reporter=dot tests/privacy-ui.test.ts tests/patient-safety-plan-privacy.dom.test.tsx— 5/5 passed, including after merging currentorigin/main.npm run test:e2e -- tests/ui-tools.spec.ts --project=chromium --grep "safety-plan working content"— 1/1 passed against an isolated production build.npm run verify:cheap— all 21 gates passed; 366 test files, 3,245 tests passed, 1 skipped.npm run check:production-readinesswith the existing canonical environment loaded read-only — READY; no provider call.npm run build— 1,677 static pages generated; client-bundle secret scan passed.npm run check:rag:fixtures— 36 golden cases / 21 suites passed.npm run typecheck— passed.git diff --checkand changed-file Prettier — passed.npm run verify:pr-localpassed runtime, formatting, lint and typecheck, then stopped when the unrelatedreconciliation-preflightsubprocess exceeded its 30-second test timeout under full-suite load. That test passed 5/5 isolated, and the preceding full suite inverify:cheappassed. The unchanged five-minute gate was not retried; its prevented build and fixture steps were run directly and passed.Checks not run
npm run verify:ui: the changed production path has a focused Chromium production-build scenario; the full unrelated Chromium catalogue was not repeated locally.Risk and rollout
RAG impact: no retrieval behaviour change — no retrieval, ranking, generation, source-selection or RAG fixture content changed.
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy).Summary by CodeRabbit
Privacy & Data Handling
Documentation
Tests