Walk back the riskiest unreviewed parts of PR #3538

Merged
BI
1mo ago
+380-235

User description

Requested by Josh · project thread

Summary

Before: PR #3538 merged without human review. It left an unused WA MHA Form 6A/6B print component that printed a fictional patient, a fictional doctor, invented clinical reasoning and a pre-ticked "Chief Psychiatrist consent" whenever a field was blank. It removed the "This final point is a clinical inference." marker from Advocacy-informed therapeutic work, so an inference read as RANZCP's. It also let signed-out visitors' medicine and differential lists be held in shared caches for up to an hour (and served stale for up to a day).

After: blank MHA form fields print "Not entered" and consent defaults to pending, with a not-for-use note until the statutory text has legal and clinical sign-off. The inference marker is back. The list routes return to the earlier rule that only the uninitialised seed gets long public caching. The ledger no longer records four unwired components as done, and the follow-ups are queued.

  • WA MHA print component: fabricated defaults removed, new test that no invented content prints.
  • Therapy: inference marker restored; therapy index and site-content static baseline regenerated (the asset hash moved); the sixth record #3538 reset to needs_review is now under the same guard test.
  • /api/medications and /api/differentials: fixture back to observed.source === "seed_uninitialized", exactly as before #3538.
  • Ledger inbox: cancels the pending "done" requests for #3B4S3Z, #WVS32F, #ZTDZ4Z and the script-based #1A1H9N one; adds issues for the MHA component, a Tall Man list check against ACSQHC, the 30-day leftover cleanup, and the unrecorded bundle budget raise.

How: deleting the MHA component, /api/proxy, the support-label script and the duplicate developer pages was the first plan, but check:dead-code-candidate refuses anything introduced within 30 days. They are neutralised or logged for removal after 13 Nov 2026 instead. The bundle budget raise is logged rather than reverted, since resetting a baseline without measuring would only turn CI red.

Areas touched: Clinical reference content, Knowledge and records, App experience, Delivery and assurance

Verification

  • npm run verify:cheap: Test Files 1881 passed (1881), Tests 29881 passed | 5 skipped, exit 0
  • npm run check:therapy-data-index: Therapy indexes are current (205 records).
  • npm run check:diff-integrity: PASS — 2 changed test file(s), 4 -> 5 test case(s)

Existing route tests pass with both the old and the #3538 caching rule, so neither direction was pinned by a test.

Risk and rollout

  • Risk: low. No migration, no search ranking or retrieval file, no auth change. Clinical text change is a restoration of the previously signed wording, and the record stays needs_review.
  • Rollback: revert this commit.
  • Provider or production effects: None. Merging deploys the app as usual.

Notes

  • Full review of #3538: project file reviews/pr-3538-review-2026-10-15.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TZemPFt7NxcpnCTge8cLbg

Generated by Claude Code


Summary by cubic

Walks back the riskiest unreviewed parts of PR #3538, which merged without human review and shipped fabricated clinical content and over-broad public caching.

  • The WA MHA Form 6A/6B print component prints "Not entered" for blank fields, leaves age unclassified when unknown, states the 6B threshold as Chief Psychiatrist consent required rather than obtained, and prints a visible "DRAFT, NOT FOR CLINICAL OR LEGAL USE" warning; it stays marked not-for-use until the statutory text is legally and clinically signed off.
  • Restores "This final point is a clinical inference." to Advocacy-informed therapeutic work so the inference no longer reads as RANZCP's, and regenerates the therapy index and site-content baseline; the sixth record reset to needs_review now carries the same guard test.
  • /api/medications and /api/differentials return to long public caching only for uninitialised seeds, so corrections to live records are not served stale from shared caches for up to an hour.
  • Ledger inbox cancels four pending "done" items for components no page renders and queues follow-ups for the MHA form, the Tall Man list check against ACSQHC, the 30-day cleanup, and the unapproved bundle budget raise.

Summary by Gitar

  • Age handling:
    • Unknown isChild now prints "Not established" and omits the maximum initial period in the WA MHA form
  • Site-content sync:
    • Existing embeddings are reused when only lineageFingerprint changes and the text is unchanged

This will update automatically on new commits.


CodeAnt-AI Description

Remove invented form details and keep recovering catalogue data fresh

What Changed

  • WA mental health form drafts now show “Not entered” for blank details, leave age-based periods undetermined until age is specified, and print a warning that the draft is not for clinical or legal use.
  • Restored the note that advocacy-related guidance includes a clinical inference.
  • Medicine and differential lists receive long public caching only when serving the uninitialised seed, so a temporary fallback does not keep stale data in shared caches.

Impact

✅ No invented details on blank form drafts
✅ Clear warning on unverified WA form drafts
✅ Fresher medicine and differential lists during recovery

💡 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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.