Skip to content

Walk back the riskiest unreviewed parts of PR #3538 - #3553

Merged
BigSimmo merged 9 commits into
mainfrom
claude/project-thread-4nhja3
Oct 15, 2026
Merged

BigSimmo merged 9 commits into
mainfrom
claude/project-thread-4nhja3

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

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.

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

🤖 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.

Written for commit 1095b5a. Summary will update on new commits.

View guided diff Turn on auto-fix

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.

- WA MHA 6A/6B print component: remove fabricated default patient,
  clinician, clinical reasoning and pre-ticked Chief Psychiatrist consent;
  blank fields now print as 'Not entered'. Mark it not for use until the
  statutory text has legal and clinical sign-off.
- Restore 'This final point is a clinical inference.' in Advocacy-informed
  therapeutic work, so the inference no longer reads as RANZCP's; rebuild
  the therapy index and site-content baseline.
- Guard the sixth therapy record #3538 reset to needs_review.
- Medicines and differentials list routes: restore the earlier rule that
  only the uninitialised seed gets long public caching, so corrections to
  live records are not held in shared caches for up to an hour.
- Ledger inbox: cancel four pending 'done' requests for components no page
  renders, and queue the follow-ups (MHA form, Tall Man list check, 30-day
  cleanup, bundle budget raise).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZemPFt7NxcpnCTge8cLbg
@BigSimmo BigSimmo self-assigned this Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 84 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: BigSimmo/PsychSift/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: a0096eb0-012b-498c-b061-afded23b8b85
📥 Commits

Reviewing files that changed from the base of the PR and between e0c62df and 1095b5a.

📒 Files selected for processing: 19
  • docs/outstanding-issues-inbox/0a3b873b-ce2c-486b-ab9c-b364129022e9.json
  • docs/outstanding-issues-inbox/0f007792-605d-4f25-af8d-89f7c2ed95be.json
  • docs/outstanding-issues-inbox/145b648c-1cc9-4283-a136-2d0e02ac53cf.json
  • docs/outstanding-issues-inbox/15c1027e-6835-49eb-bd98-54f697b3388c.json
  • docs/outstanding-issues-inbox/5357c11a-9e2e-4f23-9474-87e40db67b3d.json
  • docs/outstanding-issues-inbox/8eed5dff-8f00-4b4d-9e42-22d3588d9164.json
  • docs/outstanding-issues-inbox/9f5e9e17-6b34-4f91-adc2-ba1275821021.json
  • docs/outstanding-issues-inbox/ecbe4970-41ef-45e7-b731-6f31a5df480c.json
  • public/therapy-compass-data/therapies.72ac900e1632e4e2.json
  • public/therapy-compass-data/therapies.8147276e2221ad3d.json
  • src/app/api/differentials/route.ts
  • src/app/api/medications/route.ts
  • src/components/forms/wa-mha-form-print.tsx
  • src/data/therapies-source.json
  • src/data/therapy-catalogue-assets.ts
  • src/lib/site-content/site-content-change-owners.json
  • tests/fixtures/site-content/static-manifest-baseline.json
  • tests/therapy-3510-needs-review.test.ts
  • tests/wa-mha-form-print.dom.test.tsx
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 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

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Oct 15, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 15, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@codeant-ai

codeant-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 1095b5a3
Scan Time: 2026-10-15 14:58:25 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@BigSimmo
BigSimmo marked this pull request as ready for review October 15, 2026 11:53

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed 572f53b Oct 15, 2026 · 13:22 13:24
✅ Reviewed your PR e5aea11 Oct 15, 2026 · 11:53 11:58

@codeant-ai

codeant-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T11:58:04.830905Z e5aea11 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Oct 15, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Restore clinical safeguards and conservative catalogue caching

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Remove fabricated WA MHA print defaults and keep the unsigned component unwired.
• Restore therapy inference attribution and restrict long public caching to uninitialised catalogue
 seeds.
• Cancel premature ledger completions and record clinical, cleanup, and bundle-budget follow-ups.
Diagram

graph TD
  A["Form inputs"] --> B["WA print"]
  C["Canonical read"] --> D["List APIs"] --> E{"Seed only?"} --> F["Cache headers"]
  G["Therapy source"] --> H["Generated assets"]
Loading
High-Level Assessment

The targeted rollback is appropriate: it removes fabricated defaults and excessive caching without treating unverified, unwired work as complete. Immediate deletion of the PR #3538 leftovers was considered but conflicts with the 30-day dead-code guard; the ledger records their later review or removal instead.

Files changed (17) +346 / -229

Bug fix (4) +27 / -17
route.tsLimit extended caching of differential lists to uninitialised seeds +5/-4

Limit extended caching of differential lists to uninitialised seeds

• Both presentation and differential list responses now set the fixture flag only when the observed source is 'seed_uninitialized'. Live records and temporary degraded reads no longer receive the extended public-cache treatment.

src/app/api/differentials/route.ts

route.tsLimit extended caching of medication lists to uninitialised seeds +3/-3

Limit extended caching of medication lists to uninitialised seeds

• Restores source-based fixture selection so live or temporarily degraded medication lists are not given extended public caching.

src/app/api/medications/route.ts

wa-mha-form-print.tsxRemove fabricated defaults from WA MHA print output +18/-9

Remove fabricated defaults from WA MHA print output

• Missing patient, clinician, date, and clinical-reasoning fields now display “Not entered”; Chief Psychiatrist consent defaults to pending. A comment marks the unwired component as not for use until its statutory text receives legal and clinical sign-off.

src/components/forms/wa-mha-form-print.tsx

therapies-source.jsonRestore clinical-inference attribution in advocacy therapy +1/-1

Restore clinical-inference attribution in advocacy therapy

• Restores the explicit inference marker in the advocacy-informed therapeutic work caution so that point is not presented without qualification alongside the RANZCP attribution.

src/data/therapies-source.json

Tests (3) +220 / -209
static-manifest-baseline.jsonRefresh the site-content static manifest baseline +209/-209

Refresh the site-content static manifest baseline

• Updates generation metadata and therapy lineage digests, including the corrected advocacy record’s content hash. The manifest digest changes to match the refreshed baseline.

tests/fixtures/site-content/static-manifest-baseline.json

therapy-3510-needs-review.test.tsGuard the sixth therapy record awaiting review +2/-0

Guard the sixth therapy record awaiting review

• Adds wake therapy to the sign-off guard, requiring 'needs_review' status, cleared prior sign-off, and an unchecked review checklist.

tests/therapy-3510-needs-review.test.ts

wa-mha-form-print.dom.test.tsxTest that blank WA MHA forms contain no invented details +9/-0

Test that blank WA MHA forms contain no invented details

• Adds a Form 6B rendering test that rejects the former fictional details and pre-obtained consent text while checking for visible “Not entered” placeholders.

tests/wa-mha-form-print.dom.test.tsx

Documentation (8) +96 / -0
0a3b873b-ce2c-486b-ab9c-b364129022e9.jsonQueue post-window cleanup of PR #3538 leftovers +14/-0

Queue post-window cleanup of PR #3538 leftovers

• Records a task to review or remove unused routes, scripts, pages, and unwired components after the dead-code window. It also notes clinical-math corrections needed before calculator use.

docs/outstanding-issues-inbox/0a3b873b-ce2c-486b-ab9c-b364129022e9.json

0f007792-605d-4f25-af8d-89f7c2ed95be.jsonRecord unapproved bundle-budget increases +14/-0

Record unapproved bundle-budget increases

• Queues measurement or owner approval for the production and route budget increases from PR #3538 rather than reverting an unmeasured baseline.

docs/outstanding-issues-inbox/0f007792-605d-4f25-af8d-89f7c2ed95be.json

145b648c-1cc9-4283-a136-2d0e02ac53cf.jsonCancel completion request for unused support-label script +10/-0

Cancel completion request for unused support-label script

• Cancels the script-based done request because nothing runs the script and its thresholds do not govern production labels. The separate storage-version request is left intact.

docs/outstanding-issues-inbox/145b648c-1cc9-4283-a136-2d0e02ac53cf.json

15c1027e-6835-49eb-bd98-54f697b3388c.jsonQueue verification of the live Tall Man drug list +14/-0

Queue verification of the live Tall Man drug list

• Requests owner comparison of medication lettering against the ACSQHC national list, identifying doubtful patterns and exact-name matching as concerns.

docs/outstanding-issues-inbox/15c1027e-6835-49eb-bd98-54f697b3388c.json

5357c11a-9e2e-4f23-9474-87e40db67b3d.jsonCancel completion request for an unwired component +10/-0

Cancel completion request for an unwired component

• Cancels a pending done request because a tested component that no page renders is not complete for clinicians.

docs/outstanding-issues-inbox/5357c11a-9e2e-4f23-9474-87e40db67b3d.json

8eed5dff-8f00-4b4d-9e42-22d3588d9164.jsonFlag unverified WA MHA statutory print text +14/-0

Flag unverified WA MHA statutory print text

• Records the Form 6A/6B component’s unresolved legal and clinical questions and its unwired status. Calls for sign-off or deletion after the dead-code window.

docs/outstanding-issues-inbox/8eed5dff-8f00-4b4d-9e42-22d3588d9164.json

9f5e9e17-6b34-4f91-adc2-ba1275821021.jsonCancel another unwired-component completion request +10/-0

Cancel another unwired-component completion request

• Withdraws a pending done request for a component that exists with tests but is not rendered by any app page.

docs/outstanding-issues-inbox/9f5e9e17-6b34-4f91-adc2-ba1275821021.json

ecbe4970-41ef-45e7-b731-6f31a5df480c.jsonCancel remaining unwired-component completion request +10/-0

Cancel remaining unwired-component completion request

• Withdraws another pending done request because the tested component is not available to clinicians through an app page.

docs/outstanding-issues-inbox/ecbe4970-41ef-45e7-b731-6f31a5df480c.json

Other (2) +3 / -3
therapy-catalogue-assets.tsAdvance generated therapy asset references +2/-2

Advance generated therapy asset references

• Points the full catalogue at its new content hash and retains the prior full-catalogue hash as the previous asset reference. The index references remain unchanged.

src/data/therapy-catalogue-assets.ts

site-content-change-owners.jsonAlign therapy content ownership with the new asset hash +1/-1

Align therapy content ownership with the new asset hash

• Replaces the older full-catalogue asset path in the therapy ownership list with the newly generated path.

src/lib/site-content/site-content-change-owners.json

@qodo-code-review

qodo-code-review Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group

Grey Divider


Resolved findings

1. The form still asserts an unchecked rule ✓ Resolved
Description
The Form 6B threshold in src/components/forms/wa-mha-form-print.tsx renders “Chief Psychiatrist
involvement required” as statutory content even though the component's wording is unchecked and the
documented prerequisite is Chief Psychiatrist consent. When the metadata guides completion, a reader
can treat contact or review as sufficient and rely on an unverified requirement in the rendered
statutory findings and other patient-facing or clinically relevant guidance.
Code

src/components/forms/wa-mha-form-print.tsx[R44-45]

+    threshold:
+      "Criteria met; Chief Psychiatrist involvement required (status shown below); physical health transfer risk is significant",
Relevance

●●● Strong

Recent precedents accept blocking or correcting unverified clinical/statutory claims pending
sign-off.

PR-#3538
PR-#3206
PR-#3412

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed threshold is rendered directly in the statutory findings section, while the component's
own notes say that its statutory wording has not been checked and still identify documented Chief
Psychiatrist consent as the Form 6B requirement. The official-form register describes the related 6B
attachment as a report to the Chief Psychiatrist, and the indexed flowchart says the order is made
when the Chief Psychiatrist consents, showing that “involvement” weakens and contradicts the
source-backed prerequisite; the clinical review guidance further requires tracing such claims and
using conservative behavior for patient-facing or clinically relevant content.

src/components/forms/wa-mha-form-print.tsx[44-45]
src/components/forms/wa-mha-form-print.tsx[39-50]
src/components/forms/wa-mha-form-print.tsx[198-207]
src/lib/form-register.ts[83-89]
data/forms-page-snapshot.json[4640-4640]
Skill: clinical

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Form 6B threshold renders “Chief Psychiatrist involvement required” as a statutory requirement even though the wording is unverified and the documented prerequisite is Chief Psychiatrist consent. This can make printed guidance appear satisfied by contact or review without consent, while presenting an unchecked legal assertion as authoritative.

## Fix Focus Areas
- src/components/forms/wa-mha-form-print.tsx[44-45]
- src/components/forms/wa-mha-form-print.tsx[198-207]

## Recommended Fix
Change the threshold wording to state that Chief Psychiatrist consent is required, without implying that consent has already been obtained. Because the statutory wording is not verified, use draft-safe wording such as “Chief Psychiatrist status: Not verified” or omit the requirement until legal and clinical sign-off confirms it; keep the rendered status explicitly pending by default and show “Obtained and documented in clinical record” only when the explicit prop is true.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Unknown ages print an adult limit ✓ Resolved
Description
WaMhaFormPrint now prints “Not entered” for an omitted date of birth but retains `isChild =
false`, which selects the adult classification and 21-day maximum. Rendering the component without
age information therefore presents a specific statutory period for a patient whose age has not been
established.
Code

src/components/forms/wa-mha-form-print.tsx[73]

+  patientDob = NOT_ENTERED,
Relevance

●●● Strong

Conservative clinical defaults are consistently accepted when unknown or unreviewed data could imply
unsafe guidance.

PR-#3412
PR-#3219

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The clinical skill requires conservative failure behavior. The changed missing-date default makes
age unknown, but the retained boolean default still drives the printed adult period.

src/components/forms/wa-mha-form-print.tsx[72-87]
src/components/forms/wa-mha-form-print.tsx[127-155]
Skill: clinical

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
An omitted date of birth now prints as unknown, but the form still defaults to the adult classification and statutory period.
## Fix Focus Areas
- src/components/forms/wa-mha-form-print.tsx[72-87]
- src/components/forms/wa-mha-form-print.tsx[127-155]
- tests/wa-mha-form-print.dom.test.tsx[44-58]
## Recommended Fix
Represent an unspecified child/adult status explicitly and do not print an age-specific maximum until that status is supplied or established. Test the omitted-status case as well as explicit child and adult cases.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. One therapy edit re-embeds every therapy ✓ Resolved
Description
Advancing the full-catalogue asset name changes the lineage source ID for every therapy, even though
this PR changes the content of only one therapy record. During the next site-content sync, the
planner classifies the other therapies as changed and refuses to reuse their existing embeddings,
sending their unchanged text for embedding again.
Code

src/data/therapy-catalogue-assets.ts[3]

+  full: "therapies.8147276e2221ad3d.json",
Relevance

●●● Strong

Site-content precedents accept fixes preventing stale or unchanged records from bypassing correct
cache and processing boundaries.

PR-#2967
PR-#2943

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each therapy's lineage source ID includes the shared hashed catalogue filename, so the filename
change alters lineage for records whose content did not change; the baseline shows such a record's
lineage digest changing. The sync planner requires matching publication and lineage fingerprints to
reuse an embedding, and the runner embeds every changed record for which reuse is false.

src/lib/site-content/adapters/index.ts[43-48]
src/lib/site-content/adapters/index.ts[183-188]
tests/fixtures/site-content/static-manifest-baseline.json[9568-9574]
src/lib/site-content/site-content-sync.ts[219-246]
src/lib/site-content/site-content-sync.ts[355-381]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Changing one therapy advances the shared catalogue asset name, changing every therapy's lineage fingerprint and forcing embeddings to be regenerated for unchanged text.

## Fix Focus Areas
- src/lib/site-content/adapters/index.ts[186-186]
- src/lib/site-content/site-content-sync.ts[233-246]
- tests/fixtures/site-content/static-manifest-baseline.json[9568-9571]

## Recommended Fix
Preserve the updated provenance, but allow an existing embedding to be reused when the embedding model and normalized text are unchanged despite a lineage-only change. Add a sync-planner test covering a catalogue asset rename with unchanged therapy text.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View resolved (1)
4. Printed forms lack a use warning ✓ Resolved
Description
WaMhaFormPrint puts the “NOT FOR USE YET” warning in a source comment, not in its rendered output.
If the component is rendered or printed before sign-off, its unverified statutory directions appear
beneath a government heading without a visible warning.
Code

src/components/forms/wa-mha-form-print.tsx[R64-67]

+ * NOT FOR USE YET. Nothing renders this component. Its statutory text (section lists, the
+ * 6B Chief Psychiatrist wording, examination timing and copy recipients) has not been checked
+ * against the Act, and the app's own forms register describes the 6B attachment as a report to
+ * the Chief Psychiatrist rather than a consent. It needs legal and clinical sign-off before it
Relevance

●●● Strong

Clinical and print warnings are expected to be reader-visible; source comments do not protect
rendered statutory content.

PR-#2312
PR-#2838

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The clinical skill calls for clear clinical disclaimers and conservative failure behavior. The new
warning is JSDoc only, while the component renders a government heading and statutory content.

src/components/forms/wa-mha-form-print.tsx[64-68]
src/components/forms/wa-mha-form-print.tsx[95-125]
Skill: clinical

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The unverified statutory content is marked not for use only in a source comment; that warning does not reach a printed form.
## Fix Focus Areas
- src/components/forms/wa-mha-form-print.tsx[64-68]
- src/components/forms/wa-mha-form-print.tsx[89-117]
- tests/wa-mha-form-print.dom.test.tsx[44-58]
## Recommended Fix
Render a prominent, print-visible not-for-use warning until legal and clinical sign-off is complete, and assert its presence in the component test.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ Skills: 5 invoked
  source-governance
  data
  testing-review
  review
  drift
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: ⚖️ Balanced: Comparison failure: full PR diff.

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 1095b5a

Results up to commit e5aea11 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group


Resolved findings

1. One therapy edit re-embeds every therapy ✓ Resolved
Description
Advancing the full-catalogue asset name changes the lineage source ID for every therapy, even though
this PR changes the content of only one therapy record. During the next site-content sync, the
planner classifies the other therapies as changed and refuses to reuse their existing embeddings,
sending their unchanged text for embedding again.
Code

src/data/therapy-catalogue-assets.ts[3]

+  full: "therapies.8147276e2221ad3d.json",
Relevance

●●● Strong

Site-content precedents accept fixes preventing stale or unchanged records from bypassing correct
cache and processing boundaries.

PR-#2967
PR-#2943

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each therapy's lineage source ID includes the shared hashed catalogue filename, so the filename
change alters lineage for records whose content did not change; the baseline shows such a record's
lineage digest changing. The sync planner requires matching publication and lineage fingerprints to
reuse an embedding, and the runner embeds every changed record for which reuse is false.

src/lib/site-content/adapters/index.ts[43-48]
src/lib/site-content/adapters/index.ts[183-188]
tests/fixtures/site-content/static-manifest-baseline.json[9568-9574]
src/lib/site-content/site-content-sync.ts[219-246]
src/lib/site-content/site-content-sync.ts[355-381]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Changing one therapy advances the shared catalogue asset name, changing every therapy's lineage fingerprint and forcing embeddings to be regenerated for unchanged text.

## Fix Focus Areas
- src/lib/site-content/adapters/index.ts[186-186]
- src/lib/site-content/site-content-sync.ts[233-246]
- tests/fixtures/site-content/static-manifest-baseline.json[9568-9571]

## Recommended Fix
Preserve the updated provenance, but allow an existing embedding to be reused when the embedding model and normalized text are unchanged despite a lineage-only change. Add a sync-planner test covering a catalogue asset rename with unchanged therapy text.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Unknown ages print an adult limit ✓ Resolved
Description
WaMhaFormPrint now prints “Not entered” for an omitted date of birth but retains `isChild =
false`, which selects the adult classification and 21-day maximum. Rendering the component without
age information therefore presents a specific statutory period for a patient whose age has not been
established.
Code

src/components/forms/wa-mha-form-print.tsx[73]

+  patientDob = NOT_ENTERED,
Relevance

●●● Strong

Conservative clinical defaults are consistently accepted when unknown or unreviewed data could imply
unsafe guidance.

PR-#3412
PR-#3219

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The clinical skill requires conservative failure behavior. The changed missing-date default makes
age unknown, but the retained boolean default still drives the printed adult period.

src/components/forms/wa-mha-form-print.tsx[72-87]
src/components/forms/wa-mha-form-print.tsx[127-155]
Skill: clinical

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
An omitted date of birth now prints as unknown, but the form still defaults to the adult classification and statutory period.
## Fix Focus Areas
- src/components/forms/wa-mha-form-print.tsx[72-87]
- src/components/forms/wa-mha-form-print.tsx[127-155]
- tests/wa-mha-form-print.dom.test.tsx[44-58]
## Recommended Fix
Represent an unspecified child/adult status explicitly and do not print an age-specific maximum until that status is supplied or established. Test the omitted-status case as well as explicit child and adult cases.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Printed forms lack a use warning ✓ Resolved
Description
WaMhaFormPrint puts the “NOT FOR USE YET” warning in a source comment, not in its rendered output.
If the component is rendered or printed before sign-off, its unverified statutory directions appear
beneath a government heading without a visible warning.
Code

src/components/forms/wa-mha-form-print.tsx[R64-67]

+ * NOT FOR USE YET. Nothing renders this component. Its statutory text (section lists, the
+ * 6B Chief Psychiatrist wording, examination timing and copy recipients) has not been checked
+ * against the Act, and the app's own forms register describes the 6B attachment as a report to
+ * the Chief Psychiatrist rather than a consent. It needs legal and clinical sign-off before it
Relevance

●●● Strong

Clinical and print warnings are expected to be reader-visible; source comments do not protect
rendered statutory content.

PR-#2312
PR-#2838

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The clinical skill calls for clear clinical disclaimers and conservative failure behavior. The new
warning is JSDoc only, while the component renders a government heading and statutory content.

src/components/forms/wa-mha-form-print.tsx[64-68]
src/components/forms/wa-mha-form-print.tsx[95-125]
Skill: clinical

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The unverified statutory content is marked not for use only in a source comment; that warning does not reach a printed form.
## Fix Focus Areas
- src/components/forms/wa-mha-form-print.tsx[64-68]
- src/components/forms/wa-mha-form-print.tsx[89-117]
- tests/wa-mha-form-print.dom.test.tsx[44-58]
## Recommended Fix
Render a prominent, print-visible not-for-use warning until legal and clinical sign-off is complete, and assert its presence in the component test.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 11ce38b 🚀 Fast


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group


Resolved findings

1. The form still asserts an unchecked rule ✓ Resolved
Description
The Form 6B threshold in src/components/forms/wa-mha-form-print.tsx renders “Chief Psychiatrist
involvement required” as statutory content even though the component's wording is unchecked and the
documented prerequisite is Chief Psychiatrist consent. When the metadata guides completion, a reader
can treat contact or review as sufficient and rely on an unverified requirement in the rendered
statutory findings and other patient-facing or clinically relevant guidance.
Code

src/components/forms/wa-mha-form-print.tsx[R44-45]

+    threshold:
+      "Criteria met; Chief Psychiatrist involvement required (status shown below); physical health transfer risk is significant",
Relevance

●●● Strong

Recent precedents accept blocking or correcting unverified clinical/statutory claims pending
sign-off.

PR-#3538
PR-#3206
PR-#3412

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed threshold is rendered directly in the statutory findings section, while the component's
own notes say that its statutory wording has not been checked and still identify documented Chief
Psychiatrist consent as the Form 6B requirement. The official-form register describes the related 6B
attachment as a report to the Chief Psychiatrist, and the indexed flowchart says the order is made
when the Chief Psychiatrist consents, showing that “involvement” weakens and contradicts the
source-backed prerequisite; the clinical review guidance further requires tracing such claims and
using conservative behavior for patient-facing or clinically relevant content.

src/components/forms/wa-mha-form-print.tsx[44-45]
src/components/forms/wa-mha-form-print.tsx[39-50]
src/components/forms/wa-mha-form-print.tsx[198-207]
src/lib/form-register.ts[83-89]
data/forms-page-snapshot.json[4640-4640]
Skill: clinical

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Form 6B threshold renders “Chief Psychiatrist involvement required” as a statutory requirement even though the wording is unverified and the documented prerequisite is Chief Psychiatrist consent. This can make printed guidance appear satisfied by contact or review without consent, while presenting an unchecked legal assertion as authoritative.

## Fix Focus Areas
- src/components/forms/wa-mha-form-print.tsx[44-45]
- src/components/forms/wa-mha-form-print.tsx[198-207]

## Recommended Fix
Change the threshold wording to state that Chief Psychiatrist consent is required, without implying that consent has already been obtained. Because the statutory wording is not verified, use draft-safe wording such as “Chief Psychiatrist status: Not verified” or omit the requirement until legal and clinical sign-off confirms it; keep the rendered status explicitly pending by default and show “Obtained and documented in clinical record” only when the explicit prop is true.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread src/data/therapy-catalogue-assets.ts Resolved

Copy link
Copy Markdown
Owner Author

Re Qodo finding 1 ("One therapy edit re-embeds every therapy"): confirmed, and not fixing it in this PR.

Path traced: any edit to src/data/therapies-source.json advances the content-addressed catalogue file name, and src/lib/site-content/adapters/index.ts folds that name into every therapy's lineage source ID. So the next site-content sync re-embeds all 205 therapies, not just the one record that changed. This is existing behaviour, and every therapy edit triggers it, including #3538 and #3398. It is not introduced here.

Why it stays as is: the fix changes the site-content lineage contract and the embedding reuse rules, which is well outside a one-sentence clinical text restoration. The cost is one batch of embedding calls on the next sync, and nothing is wrong in the output. Worth its own change if it matters to the owner.


Generated by Claude Code

- Leave unknown age unclassified
- Print a visible use warning
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

✅ Committed (3) · ☑ Fixed (3)

Grey Divider

Commits pushed directly to this PR — no separate fix PR opened.

Process — 3 fixed
  • ☑ Fixed: Unknown ages print an adult limit
  • ☑ Fixed: One therapy edit re-embeds every therapy
  • ☑ Fixed: Printed forms lack a use warning

@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 15, 2026 12:00
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 15, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

…he MHA print draft

Addresses review findings on #3553: the not-for-use note now prints on the
form itself, and an omitted age class prints 'Not determined' rather than
the adult 21-day period.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZemPFt7NxcpnCTge8cLbg
Qodo pushed two commits to this branch. The form fix duplicated 2f6ae67,
so this branch's version is kept. The embedding-reuse change drops the
lineage check from site-content sync, a behaviour change the PR author
declined in review; it is not taken here and needs its own reviewed PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZemPFt7NxcpnCTge8cLbg

Copy link
Copy Markdown
Owner Author

Qodo pushed two commits to this branch (9a8a2d9, 3f74b53). They are merged in 5cee6af, but their changes are not kept:

  • 9a8a2d9 (MHA form warning and unknown age) duplicated 2f6ae67, so this branch's version stays.
  • 3f74b53 removes the lineageFingerprint check from embedding reuse in site-content-sync.ts. That changes when stored embeddings are trusted, which I had declined in review as out of scope. It needs its own reviewed PR, not a bot push onto a clinical fix.

The tree at 5cee6af is identical to 2f6ae67.


Generated by Claude Code

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 15, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

… was obtained

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZemPFt7NxcpnCTge8cLbg
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 5cee6af

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 15, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 11ce38b

Copy link
Copy Markdown
Owner Author

Re Qodo finding "The form still asserts an unchecked rule": agreed, fixed in the next commit (not yet pushed). The 6B threshold now reads "Chief Psychiatrist consent required (status shown below)", which keeps the stronger consent prerequisite without claiming consent was obtained. The whole component remains unwired and carries the visible not-for-use warning until legal and clinical sign-off.


Generated by Claude Code

…olvement

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZemPFt7NxcpnCTge8cLbg
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 15, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 7e3657a

@codeant-ai

codeant-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; the visible changes do not show a confirmed blocking issue.
  • The WA form now uses blank defaults and a prominent draft warning, but its statutory wording still needs legal and clinical sign-off before it is wired into a page.
  • The API routes extend public caching only for an uninitialized seed corpus, avoiding longer caching of degraded responses that may recover.

Assessed commit: 572f53b6f50e

…-4nhja3

# Conflicts:
#	tests/fixtures/site-content/static-manifest-baseline.json

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@gitar-bot

gitar-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · WA mental-health form output changes consent and period wording; unverified statutory details could mislead if the component is later used clinically.

Walks back the unreviewed parts of PR #3538: blank WA MHA form fields now print "Not entered", consent defaults to pending with a not-for-use note, the clinical inference marker is restored, and public caching for medicine and differential lists is limited to uninitialised seeds. Resolved the age classification and max period print spacing issue. No open issues remain.

✅ 1 closed
✅ Quality: Age classification and max period print run together with no gap

📄 src/components/forms/wa-mha-form-print.tsx:144-151
The Maximum Initial Period span is nested inside the Age Classification span, so it is not a direct child of the flex flex-wrap gap-x-4 row and gets no gap. When isChild is supplied, the printed form reads "Age Classification: AdultMaximum Initial Period: 21 days (Adult)" with no space. The test only checks toHaveTextContent("21 days (Adult)"), so it passes anyway. Make the max-period span a sibling flex item, as below.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 6 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 1095b5a

@BigSimmo
BigSimmo merged commit c452ce6 into main Oct 15, 2026
41 checks passed
@BigSimmo
BigSimmo deleted the claude/project-thread-4nhja3 branch October 15, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔴 Large blast radius size:L This PR changes 100-499 lines, ignoring generated files 🕐 40+ Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants