Skip to content

fix(sign-off): reset the agent-recorded Therapy Compass and DID sign-offs to needs_review - #3623

Merged
BigSimmo merged 16 commits into
mainfrom
fix/reset-agent-recorded-signoffs
Oct 17, 2026
Merged

BigSimmo merged 16 commits into
mainfrom
fix/reset-agent-recorded-signoffs

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

User description

Owner ruling (17 Oct 2026, 22:12 AWST): the sign-offs recorded in #3613 for 26 Therapy Compass records and the reworded DID "With/without possession form" specifier were not the owner's. They return to needs review until the owner signs each one with the interactive tool.

Evidence: all 27 were stamped reviewedBy: "Psych Sift" at the identical round time 2026-10-17T12:15:00.000Z, across two different tools. therapy:review and clinical:review both need an interactive terminal and stamp the real time with milliseconds.

Neither tool has a revoke mode, so this PR resets status in the data (owner-approved). No attestation is recorded or re-pinned:

  • src/data/therapies-source.json: 26 records → needs_review, checklist unticked, pre-sign-off reviewCompleteness, reviewedBy/reviewedAt/reviewedContentSha256 removed (wake-therapy's original nulls restored). The references Complete remaining Therapy Compass sign-offs, DID specifier fix, display.revoke guard, and ledger inbox updates #3613 added stay, so npm run therapy:review offers all 26.
  • data/specifiers-content.json: DID item → clinician-review-pending, changedSinceReview: true, reviewer/date/pin removed.
  • Regenerated: therapy index/assets, specifier search index, signable-therapy projection (from the tool's own walk queue), site-content manifest baseline and change owners, repo-awareness snapshot.
  • Tests now pin the restored counts (therapy 26 waiting, specifiers 515; signable now 29).
  • docs/decisions/2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.md records the ruling; the Complete remaining Therapy Compass sign-offs, DID specifier fix, display.revoke guard, and ledger inbox updates #3613 decision is marked superseded.
  • Ledger (sanctioned tooling only): cancels the pending done for #NZ4X41 (b1de924a) and queues an update saying 26 records await owner sign-off.

Local runs: typecheck, 86 therapy/specifier/sign-off/site-content test files (1099 tests), plus the ledger, decisions, organisation, index and snapshot checks.


Summary by cubic

Resets the sign-offs recorded in #3613 for 26 Therapy Compass records and the reworded DID possession-form specifier to needs_review: none were the owner's, so each returns to the sign-off queue until the owner signs it with the interactive therapy:review/clinical:review tools.

  • The 26 therapies return to needs_review with unticked checklists and no reviewer, date, or content pin; the DID specifier returns to clinician-review-pending with changedSinceReview set.
  • Unsigned records fail closed: therapy and specifier clinical prose is withheld from site content and Clinical Ask answers, showing only name and category, until the owner signs them.
  • The therapy catalogue is regenerated with a new --revoke-previous flag so pre-deploy bundles fall back to the current alias instead of serving the revoked pre-reset generation, and the retired assets are dropped from the change-owner manifest so the change-scope check passes.
  • therapy:review writes the signable projection inside its transaction so a signed therapy leaves the owner's to-do list, and clinical:review clears changedSinceReview when it records a specifier signature.
  • Adds decision records for both rulings, cancels the pending #NZ4X41 done in the ledger, and queues an update for the owner to sign each record.

Written for commit 4e20992. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Clinical Review
    • Returned 26 therapy records and one diagnostic specifier to pending review. Their sign-offs and review details are no longer shown as complete.
    • Pending-review counts now reflect the updated records.
  • Clinical Information
    • Evidence and catalogue details for items without completed clinical review are limited to their name and category.
  • Sign-Offs
    • Updated the available sign-off queue to include records awaiting review.

CodeAnt-AI Description

Restore review status and withhold unsigned clinical guidance

What Changed

  • Returns 26 therapy records and the DID possession-form definition to review, so they no longer appear as signed off.
  • Keeps unsigned clinical details out of answer evidence and site-content indexing while leaving records searchable by name and category. Signed content becomes available again after review.
  • Prevents older catalogue versions from showing the revoked therapy approvals as current.

Impact

✅ Unsigned therapy text excluded from answers
✅ 26 therapy sign-offs returned to the owner queue
✅ Revoked approvals removed from older catalogue versions

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

…offs to needs_review

Owner ruling 17 Oct 2026 22:12 AWST. #3613 stamped 26 Therapy Compass records and
the reworded DID possession-form specifier as signed by "Psych Sift" at an
identical round time (2026-10-17T12:15:00.000Z) without the interactive
therapy:review / clinical:review tools. Neither tool has a revoke mode, so this
resets status in the data (owner-approved) without recording any attestation:

- therapies-source.json: 26 records back to needs_review, checklist unticked,
  pre-sign-off reviewCompleteness, reviewer/date/content pin removed
- specifiers-content.json: DID item back to clinician-review-pending, reviewer,
  date and pin removed
- regenerate therapy indexes/assets, the specifier search index, the signable
  therapy projection, the site-content manifest baseline and change owners
- tests pin the restored counts (26 therapy waiting, 515 specifiers)
- decision record; mark the #3613 sign-off decision superseded
- ledger: cancel the pending done for #NZ4X41 and queue an update instead
@BigSimmo
BigSimmo enabled auto-merge (squash) October 17, 2026 15:50

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

@supabase

supabase Bot commented Oct 17, 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 ↗︎.

@codeant-ai

codeant-ai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed 03de015 Oct 17, 2026 · 17:53 17:57
✅ Incremental review completed 16832fa Oct 17, 2026 · 16:51 16:56
✅ Reviewed your PR f509027 Oct 17, 2026 · 15:50 15:57

@codeant-ai

codeant-ai Bot commented Oct 17, 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

@coderabbitai

coderabbitai Bot commented Oct 17, 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 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 117 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: c20571bd-6008-47c8-8880-597d0bdd981a
📥 Commits

Reviewing files that changed from the base of the PR and between cc3a62d and 4e20992.

📒 Files selected for processing: 34
  • data/repo-awareness-snapshot.json
  • data/specifiers-content.json
  • data/specifiers-search-index.json
  • docs/decisions/2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.md
  • docs/decisions/2026-10-17-remaining-therapy-compass-sign-offs.md
  • docs/decisions/2026-10-18-unsigned-clinical-text-withheld-from-site-content.md
  • docs/organisation/retired-rules.json
  • docs/outstanding-issues-inbox/d4b025bd-9c1a-4ee1-828b-b75ccb82cf5d.json
  • docs/outstanding-issues-inbox/e1b160fe-f9b2-434d-94f3-ad3904bc470d.json
  • public/therapy-compass-data/therapies-index.d8df74c4fd75e0e4.json
  • public/therapy-compass-data/therapies.46f71b9451eeb269.json
  • public/therapy-compass-data/therapies.9be87b25ad2919f8.json
  • public/therapy-compass-data/therapies.ef7cc00086cabce3.json
  • scripts/build-therapies-index.mjs
  • scripts/lib/clinical-record-review-contract.mjs
  • scripts/review-therapy.mjs
  • src/data/therapies-index.json
  • src/data/therapies-source.json
  • src/data/therapy-catalogue-assets.ts
  • src/data/therapy-signable-slugs.json
  • src/lib/clinical-ask/catalogue-evidence.ts
  • src/lib/site-content/adapters/index.ts
  • src/lib/site-content/adapters/specifiers.ts
  • src/lib/site-content/site-content-change-owners.json
  • tests/clinical-ask-catalogue-evidence.test.ts
  • tests/clinical-signoff-kinds.test.ts
  • tests/developer-sign-off-page.dom.test.tsx
  • tests/fixtures/site-content/static-manifest-baseline.json
  • tests/owner-sign-off-today.dom.test.tsx
  • tests/sign-off-queue.test.ts
  • tests/sign-off-today.test.ts
  • tests/therapy-3510-needs-review.test.ts
  • tests/therapy-compass-mode-wiring.test.ts
  • tests/therapy-ranking.test.ts
📝 Walkthrough

This change returns 26 therapy records and one DID possession-form entry to pending review. It updates sign-off queue data, limits clinical evidence and specifier details for records awaiting review, and records the reset in decision and inbox files.

Changes: Review status reset

Layer / File(s) Summary
Reset review state and record decisions
src/data/therapies-index.json, src/data/therapies-source.json, data/specifiers-content.json, data/specifiers-search-index.json, docs/decisions/*, docs/outstanding-issues-inbox/*, data/repo-awareness-snapshot.json, tests/therapy-3510-needs-review.test.ts
Twenty-six therapy records and the DID possession-form entry return to pending review. Review metadata and checklist values are cleared or reset. Decision and inbox records document the change.
Update therapy sign-off queue
src/data/therapy-signable-slugs.json, src/data/therapy-catalogue-assets.ts, src/lib/site-content/site-content-change-owners.json, tests/sign-off-queue.test.ts, tests/sign-off-today.test.ts, tests/developer-sign-off-page.dom.test.tsx, tests/owner-sign-off-today.dom.test.tsx
The signable therapy list, catalogue metadata, and producer asset path are updated. Queue and ledger tests reflect 26 pending therapy records and revised signed totals.
Limit clinical evidence for pending records
src/lib/clinical-ask/catalogue-evidence.ts, src/lib/site-content/adapters/specifiers.ts, tests/clinical-ask-catalogue-evidence.test.ts, tests/clinical-signoff-kinds.test.ts, tests/therapy-ranking.test.ts
Therapy evidence extracts and specifier definition fields now depend on review status. Tests cover pending-record output and therapy search reachability.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: cursoragent

Merge Risk: 🟡 Moderate · up to cc3a6

A changed specifier definition can appear in site content while its review state is unverified. Align the definition gate with the freshness check before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 11 files. (11 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the main change: resetting agent-recorded Therapy Compass and DID sign-offs to needs_review.
Description check Passed The description clearly explains the reset rationale, affected records, generated data, behavior changes, ledger updates, and verification performed. It does not reproduce the template's explicit Risk…
Full details: Description check

Explanation

The description clearly explains the reset rationale, affected records, generated data, behavior changes, ledger updates, and verification performed. It does not reproduce the template's explicit Risk and rollout or Notes sections, and it does not provide decisive command output, but it is substantially complete and directly related to the pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 11 files. (11 skipped: 11 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T15:54:38.060832Z f509027 PR opened
ℹ️ 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.

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Oct 17, 2026
@claude

claude Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Reset invalid Therapy Compass and DID sign-offs to pending review

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Return 26 Therapy Compass records and one DID specifier to pending review after the owner rejected
 their recorded sign-offs.
• Restore the therapy review queue and refresh derived catalogue and site-content data without
 recording new attestations.
• Pin corrected sign-off counts, document the ruling, and reopen the outstanding therapy sign-off
 issue.
Diagram

graph TD
  R["Owner ruling"] --> T["Therapy source"] --> P["Therapy projections"] --> Q["Sign-off queue"] --> I["Interactive review tools"]
  R --> D["DID specifier"] --> M["Site manifest"]
  D --> Q
  T --> M
Loading
High-Level Assessment

Use the owner-approved source-data reset and regenerate its projections. Neither interactive tool supports revocation; adding that capability would be a broader workflow change, while leaving the disputed attestations in place would misrepresent owner approval.

Files changed (20) +760 / -854

Bug fix (7) +346 / -478
specifiers-content.jsonReturn the DID specifier to clinician review +2/-5

Return the DID specifier to clinician review

• Marks the possession-form item pending and changed since review, removing its disputed reviewer, date, and content pin.

data/specifiers-content.json

d4b025bd-9c1a-4ee1-828b-b75ccb82cf5d.jsonCancel the pending therapy-issue completion +10/-0

Cancel the pending therapy-issue completion

• Queues cancellation of the completion request for #NZ4X41 because its 26 therapy sign-offs remain outstanding.

docs/outstanding-issues-inbox/d4b025bd-9c1a-4ee1-828b-b75ccb82cf5d.json

e1b160fe-f9b2-434d-94f3-ad3904bc470d.jsonReopen the therapy sign-off work in the ledger +13/-0

Reopen the therapy sign-off work in the ledger

• Queues an issue update stating that all 205 therapies have references but 26 await interactive owner sign-off.

docs/outstanding-issues-inbox/e1b160fe-f9b2-434d-94f3-ad3904bc470d.json

therapies-index.jsonReflect 26 pending therapies in the catalogue index +26/-26

Reflect 26 pending therapies in the catalogue index

• Changes the indexed review status of the affected therapies from reviewed to needs_review.

src/data/therapies-index.json

therapies-source.jsonRemove 26 disputed therapy attestations +262/-337

Remove 26 disputed therapy attestations

• Restores needs_review status, unticked checklists, and earlier completeness scores while retaining added references. Removes the disputed reviewer, date, and content pins; wake therapy regains its original null attestation fields.

src/data/therapies-source.json

therapy-catalogue-assets.tsRefresh therapy asset references and pending count +5/-5

Refresh therapy asset references and pending count

• Points to the regenerated content-addressed catalogue assets and changes the first-paint needs-review count from zero to 26.

src/data/therapy-catalogue-assets.ts

therapy-signable-slugs.jsonRestore the 26 therapies to the signable projection +28/-105

Restore the 26 therapies to the signable projection

• Lists the affected therapy slugs for review and removes their disputed entries from the signed-by projection.

src/data/therapy-signable-slugs.json

Tests (9) +391 / -374
clinical-ask-catalogue-evidence.test.tsTest retrieval against actual pending therapies +6/-16

Test retrieval against actual pending therapies

• Uses the restored needs-review records rather than temporarily mutating a reviewed record, while retaining the evidence-order assertion.

tests/clinical-ask-catalogue-evidence.test.ts

clinical-signoff-kinds.test.tsLimit sign-off fixture edits to reviewed specifiers +1/-1

Limit sign-off fixture edits to reviewed specifiers

• Restricts reviewer-stamp changes in the test fixture to defined items already marked clinician-reviewed.

tests/clinical-signoff-kinds.test.ts

developer-sign-off-page.dom.test.tsxUpdate developer sign-off page expectations +2/-2

Update developer sign-off page expectations

• Expects 29 signable records and 179 signed therapies in the paginated domain view.

tests/developer-sign-off-page.dom.test.tsx

static-manifest-baseline.jsonRefresh the site-content manifest baseline +317/-317

Refresh the site-content manifest baseline

• Updates lineage digests and marks the affected therapy and DID records unverified, review-due, and ineligible. Refreshes the baseline metadata and digest.

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

owner-sign-off-today.dom.test.tsxCorrect owner-panel signed-off totals +2/-2

Correct owner-panel signed-off totals

• Expects 675 signed items overall and 195 attributed to Psych Sift after removing 27 disputed attestations.

tests/owner-sign-off-today.dom.test.tsx

sign-off-queue.test.tsPin restored sign-off queue and ledger counts +18/-20

Pin restored sign-off queue and ledger counts

• Expects 26 waiting therapies, 515 waiting specifiers, and 29 immediately signable records. Updates signed, waiting, and signer totals and verifies the therapy queue uses needs_review.

tests/sign-off-queue.test.ts

sign-off-today.test.tsPin the therapy records offered for sign-off +29/-1

Pin the therapy records offered for sign-off

• Asserts that the review list contains the exact 26 therapy slugs before the two existing signable source records.

tests/sign-off-today.test.ts

therapy-3510-needs-review.test.tsKeep wake therapy outside the signed-off set +10/-2

Keep wake therapy outside the signed-off set

• Retains assertions for the five earlier signed therapies and separately verifies wake therapy awaits a named owner review.

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

therapy-ranking.test.tsTest discoverability using an actual unsigned therapy +6/-13

Test discoverability using an actual unsigned therapy

• Replaces temporary record mutation with an existing needs-review therapy to verify it remains discoverable and routable.

tests/therapy-ranking.test.ts

Documentation (3) +22 / -1
repo-awareness-snapshot.jsonCatalogue the new reset decision +5/-0

Catalogue the new reset decision

• Adds the new decision record to the repo-awareness snapshot.

data/repo-awareness-snapshot.json

2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.mdRecord the owner's sign-off reset ruling +16/-0

Record the owner's sign-off reset ruling

• Documents why the 27 attestations were rejected, what was reset, and the requirement for owner sign-off through the interactive tools.

docs/decisions/2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.md

2026-10-17-remaining-therapy-compass-sign-offs.mdSupersede the earlier therapy sign-off decision +1/-1

Supersede the earlier therapy sign-off decision

• Marks the decision claiming completion of the remaining therapy sign-offs as superseded by the reset ruling.

docs/decisions/2026-10-17-remaining-therapy-compass-sign-offs.md

Other (1) +1 / -1
site-content-change-owners.jsonTrack the current therapy catalogue asset +1/-1

Track the current therapy catalogue asset

• Replaces an older content-addressed full-catalogue asset path with the regenerated one in site-content change ownership.

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

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 17, 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 17, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 4e20992a
Scan Time: 2026-10-17 18:33:20 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

@qodo-code-review

qodo-code-review Bot commented Oct 17, 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. Signed therapies remain on the to-do list ✗ Dismissed
Description
therapy:review updates the source and catalogue assets but does not update the newly populated
therapy-signable-slugs.json projection. After the owner signs any of the 26 reset records, the
owner dashboard still counts it as signable, omits its reviewer attribution, and the projection
consistency test fails.
Code

src/data/therapy-signable-slugs.json[R2-4]

+  "slugs": [
+    "behaviour-therapy",
+    "cognitive-behavioural-therapy-for-insomnia-cbt-i",
Relevance

●●● Strong

Accepted precedent requires sign-off transactions and projections to share authoritative reviewer
metadata and remain synchronized.

PR-#3603
PR-#3607

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds the 26 slugs to a static projection. The sign-off transaction runs only the therapy
index generator, while the dashboard requires both a reviewed index record and matching projection
metadata to count a signature.

src/data/therapy-signable-slugs.json[1-28]
scripts/review-therapy.mjs[530-552]
scripts/review-therapy.mjs[609-612]
src/lib/developer-area/sign-off-queue.ts[1450-1480]
tests/sign-off-today.test.ts[294-316]

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

## Issue description
Signing a reset therapy updates the canonical record but leaves the owner-dashboard projection stale.
## Fix Focus Areas
- src/data/therapy-signable-slugs.json[1-28]
- scripts/review-therapy.mjs[530-610]
- src/lib/developer-area/sign-off-queue.ts[1450-1480]
## Recommended Fix
Regenerate the signable slugs and signed reviewer metadata from the updated source as part of the therapy sign-off transaction, including that projection in its rollback handling. Test signing one of the reset records and verify the dashboard and projection consistency test reflect the signature.

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


2. Signed specifier definition stays hidden ✗ Dismissed
Description
signSpecifierReview retains the reset DID item's changedSinceReview: true when it records a new
signature. Once the owner signs it through clinical:review, the sign-off predicate counts it as
reviewed, but the new site-content gate still withholds its definition and marks it unverified.
Code

data/specifiers-content.json[R5451-5452]

+                    "clinicianReviewStatus": "clinician-review-pending",
+                    "changedSinceReview": true
Relevance

●●● Strong

Accepted precedents require sign-off gates to honor current review state and content pins before
publishing definitions.

PR-#3603
PR-#2838

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The reset sets the flag, the sign-off writer spreads the old review fields without clearing it, and
site-content publication independently requires the flag to be false. The sign-off predicate and
pending-count calculation do not check that flag.

data/specifiers-content.json[5448-5452]
scripts/lib/clinical-record-review-contract.mjs[608-639]
src/lib/specifiers-content.ts[71-87]
src/lib/site-content/adapters/specifiers.ts[25-50]

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 reset marks the DID specifier changed since review, but the interactive sign-off writer does not clear that flag, so site content continues withholding its definition after signing.
## Fix Focus Areas
- data/specifiers-content.json[5448-5452]
- scripts/lib/clinical-record-review-contract.mjs[608-619]
- src/lib/site-content/adapters/specifiers.ts[25-50]
## Recommended Fix
Keep the flag true while the item awaits review, then set `changedSinceReview` to false in the specifier sign-off writer when it records a valid new signature and content pin. Test the DID item through sign-off and site-content generation.

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


3. Search answers cite unsigned therapy text ✗ Dismissed
Description
therapySiteContentRecord still puts the full clinical prose of needs_review therapies into its
indexable body, while the new catalogue evidence gate removes that prose only from direct catalogue
retrieval. After site-content sync, indexed retrieval can pass those therapies’ clinical text to
synthesis as needs-review evidence, and answer governance can accept claims it directly supports.
Code

src/data/therapies-source.json[727]

+    "reviewStatus": "needs_review",
Relevance

●●● Strong

Recent governance precedents accept fail-closed filtering that prevents unsigned clinical content
reaching synthesis.

PR-#2838
PR-#2811

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed source status makes these therapies unsigned. The site-content adapter retains their
clinical prose in the body and marks them unverified; sync indexes that body, and indexed retrieval
passes its contents onward without filtering by review state. Synthesis receives the evidence, while
the claim governor checks textual support rather than requiring a reviewed source.

src/data/therapies-source.json[724-734]
src/lib/site-content/adapters/index.ts[158-188]
src/lib/site-content/site-content-sync.ts[148-165]
src/lib/clinical-ask/indexed-evidence.ts[42-76]
src/lib/clinical-ask/orchestrator.ts[133-176]
src/lib/clinical-ask/response-governance.ts[82-103]

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 26 therapies reset to `needs_review` still contribute full clinical prose to the site-content search index, bypassing the direct Clinical Ask catalogue gate.
## Fix Focus Areas
- src/data/therapies-source.json[727-734]
- src/lib/site-content/adapters/index.ts[158-188]
- src/lib/clinical-ask/indexed-evidence.ts[42-76]
## Recommended Fix
Build the indexable site-content body from name and category only when a therapy needs review, while preserving the full body for reviewed therapies. Regenerate the affected site-content baseline and add a test showing that indexed evidence cannot supply unsigned therapy prose to Clinical Ask.

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


View resolved (4)
4. Old clients show revoked sign-offs ✗ Dismissed
Description
THERAPY_CATALOGUE_ASSETS_PREVIOUS.full retains the generation that preceded the reset, while
fetchCatalogue lets older bundles fetch their compiled hashed URL without checking current review
status. A client loaded before deployment can therefore continue presenting the 26 therapies under
their revoked approvals during the retention window.
Code

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

+  full: "therapies.46f71b9451eeb269.json",
Relevance

●●● Strong

Recent precedents accept preventing stale approvals from appearing current after content or
review-state changes.

PR-#3506
PR-#3143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The source-governance skill requires conservative behavior for stale or unapproved sources. The
changed mapping retains the pre-reset full generation; the generator documents why that generation
remains available, and the client fetches its bundle-selected hashed URL before trying the current
alias.

src/data/therapy-catalogue-assets.ts[3-14]
scripts/build-therapies-index.mjs[252-258]
src/components/therapy-compass/data/use-therapy-data.ts[46-58]
Skill: source-governance

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 retained previous full catalogue lets pre-deployment clients fetch the generation from before the 26 sign-offs were reset.

## Fix Focus Areas
- src/data/therapy-catalogue-assets.ts[12-15]
- scripts/build-therapies-index.mjs[252-281]
- src/components/therapy-compass/data/use-therapy-data.ts[46-58]

## Recommended Fix
Add an explicit revocation path for a previous generation containing invalid sign-offs rather than retaining it under its old URL. Make older clients obtain the current, unsigned data through the existing alias fallback, and cover the deployment-straddling case with a focused regression test.

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


5. Unsigned DID text can reach synthesis ✓ Resolved
Description
catalogueBody retains the DID definition in the site-content corpus despite the reset to
clinician-review-pending, bypassing the direct catalogue path that withholds unsigned definition
wording. After a corpus sync, indexed retrieval can pass that wording to Clinical Ask synthesis as
needs-review evidence, where it can still support an answered response.
Code

data/specifiers-content.json[R5451-5452]

+                    "clinicianReviewStatus": "clinician-review-pending",
+                    "changedSinceReview": true
Relevance

●●● Strong

Clinical Ask precedents require reviewed supporting evidence and prevent unsigned extracts from
reaching public answers.

PR-#2811
PR-#2293

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The source-governance skill calls for conservative behavior when approval is absent or a source is
stale. The reset removes approval, but site-content serialization retains the definition and indexed
retrieval can carry it into synthesis.

data/specifiers-content.json[5434-5452]
src/lib/site-content/adapters/specifiers.ts[25-45]
src/lib/clinical-ask/catalogue-evidence.ts[192-209]
src/lib/clinical-ask/indexed-evidence.ts[41-58]
src/lib/clinical-ask/orchestrator.ts[147-177]
Skill: source-governance

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 DID definition is withheld from direct catalogue evidence but remains available to answer synthesis through the indexed site-content corpus after its review reset.

## Fix Focus Areas
- data/specifiers-content.json[5448-5452]
- src/lib/site-content/adapters/specifiers.ts[25-45]
- src/lib/clinical-ask/indexed-evidence.ts[41-58]
- tests/clinical-ask-catalogue-evidence.test.ts[55-70]

## Recommended Fix
Apply the same unsigned-definition withholding to the site-content body or exclude that text from indexed answer evidence while review is pending. Test both catalogue and indexed retrieval for this DID item after corpus generation.

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


6. Unsigned therapies can inform answers ✓ Resolved
Description
therapyEvidence sends the clinical summaries of the newly unsigned therapies to synthesis, and
governClinicalAskDraft does not require cited evidence to be reviewed. When a question matches one
of these records and reviewed corroboration is unavailable, Clinical Ask can still return an
answered response supported by its unsigned content.
Code

src/data/therapies-index.json[172]

+    "reviewStatus": "needs_review",
Relevance

●●● Strong

Mixed reviewed and unreviewed supporting evidence was explicitly identified as unsafe and required a
reviewed-only gate.

PR-#2811

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The clinical skill requires conservative failure behavior for patient-safety-sensitive content. The
changed status makes this therapy unsigned, while the cited retrieval and answer paths still permit
its clinical text to support an answer.

src/data/therapies-index.json[169-172]
src/lib/clinical-ask/catalogue-evidence.ts[208-225]
src/lib/clinical-ask/orchestrator.ts[147-177]
src/lib/clinical-ask/response-governance.ts[88-105]
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 reset makes 26 therapies unsigned, but their clinical text can still support a synthesized Clinical Ask answer.

## Fix Focus Areas
- src/data/therapies-index.json[169-172]
- src/lib/clinical-ask/catalogue-evidence.ts[208-225]
- src/lib/clinical-ask/orchestrator.ts[147-177]
- tests/clinical-ask-catalogue-evidence.test.ts[44-53]

## Recommended Fix
Keep the records discoverable with their pending-review labels, but prevent their unsigned clinical text from serving as answer support unless the required reviewed evidence is available. Add a focused regression test using a reverted therapy with no reviewed corroboration.

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


7. Specifier totals miss one pending item ✓ Resolved
Description
Resetting the DID item's clinicianReviewStatus to clinician-review-pending leaves
stats.itemsPendingClinicianReview at 514 in the source and search index, although the pending
total is now 515. When the dataset or its exported search metadata is read, it reports the old
count; regenerating the index alone will preserve that error because the generator copies the source
stats.
Code

data/specifiers-content.json[R5451-5452]

+                    "clinicianReviewStatus": "clinician-review-pending",
+                    "changedSinceReview": true
Relevance

●●● Strong

Generated review counts must match status changes; prior reconciliation updated unsigned-count
expectations and artifacts.

PR-#3143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed DID item is pending, while the source and exported index both retain the prior count of
514. The queue test expects 515 pending specifiers, and the index generator copies content.stats
rather than recalculating it.

data/specifiers-content.json[5448-5453]
data/specifiers-content.json[20-24]
data/specifiers-search-index.json[14-19]
tests/sign-off-queue.test.ts[52-56]
scripts/build-specifiers-search-index.mjs[72-80]

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 DID reset adds one pending clinician review, but source and search-index metadata still report 514 rather than 515.
## Fix Focus Areas
- data/specifiers-content.json[20-24]
- data/specifiers-search-index.json[14-19]
## Recommended Fix
Set the source `itemsPendingClinicianReview` count to 515, regenerate the specifier search index with the existing build script, and add a test comparing the reported pending count with the item review states.

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


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 9 rules
✅ Skills: review, drift
✅ Cross-repo context — repo relationships
  Explored: repo: BigSimmo/Medications (sha: 93e6ccc7) — View relationship
✅ REVIEW.md
Review mode: Auto: ⚖️ Balanced: Ledger reopening adds consequential state-transition and identity-validation logic.

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 4e20992

Results up to commit f509027 ⚖️ 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. Unsigned DID text can reach synthesis ✓ Resolved
Description
catalogueBody retains the DID definition in the site-content corpus despite the reset to
clinician-review-pending, bypassing the direct catalogue path that withholds unsigned definition
wording. After a corpus sync, indexed retrieval can pass that wording to Clinical Ask synthesis as
needs-review evidence, where it can still support an answered response.
Code

data/specifiers-content.json[R5451-5452]

+                    "clinicianReviewStatus": "clinician-review-pending",
+                    "changedSinceReview": true
Relevance

●●● Strong

Clinical Ask precedents require reviewed supporting evidence and prevent unsigned extracts from
reaching public answers.

PR-#2811
PR-#2293

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The source-governance skill calls for conservative behavior when approval is absent or a source is
stale. The reset removes approval, but site-content serialization retains the definition and indexed
retrieval can carry it into synthesis.

data/specifiers-content.json[5434-5452]
src/lib/site-content/adapters/specifiers.ts[25-45]
src/lib/clinical-ask/catalogue-evidence.ts[192-209]
src/lib/clinical-ask/indexed-evidence.ts[41-58]
src/lib/clinical-ask/orchestrator.ts[147-177]
Skill: source-governance

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 DID definition is withheld from direct catalogue evidence but remains available to answer synthesis through the indexed site-content corpus after its review reset.

## Fix Focus Areas
- data/specifiers-content.json[5448-5452]
- src/lib/site-content/adapters/specifiers.ts[25-45]
- src/lib/clinical-ask/indexed-evidence.ts[41-58]
- tests/clinical-ask-catalogue-evidence.test.ts[55-70]

## Recommended Fix
Apply the same unsigned-definition withholding to the site-content body or exclude that text from indexed answer evidence while review is pending. Test both catalogue and indexed retrieval for this DID item after corpus generation.

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


2. Unsigned therapies can inform answers ✓ Resolved
Description
therapyEvidence sends the clinical summaries of the newly unsigned therapies to synthesis, and
governClinicalAskDraft does not require cited evidence to be reviewed. When a question matches one
of these records and reviewed corroboration is unavailable, Clinical Ask can still return an
answered response supported by its unsigned content.
Code

src/data/therapies-index.json[172]

+    "reviewStatus": "needs_review",
Relevance

●●● Strong

Mixed reviewed and unreviewed supporting evidence was explicitly identified as unsafe and required a
reviewed-only gate.

PR-#2811

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The clinical skill requires conservative failure behavior for patient-safety-sensitive content. The
changed status makes this therapy unsigned, while the cited retrieval and answer paths still permit
its clinical text to support an answer.

src/data/therapies-index.json[169-172]
src/lib/clinical-ask/catalogue-evidence.ts[208-225]
src/lib/clinical-ask/orchestrator.ts[147-177]
src/lib/clinical-ask/response-governance.ts[88-105]
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 reset makes 26 therapies unsigned, but their clinical text can still support a synthesized Clinical Ask answer.

## Fix Focus Areas
- src/data/therapies-index.json[169-172]
- src/lib/clinical-ask/catalogue-evidence.ts[208-225]
- src/lib/clinical-ask/orchestrator.ts[147-177]
- tests/clinical-ask-catalogue-evidence.test.ts[44-53]

## Recommended Fix
Keep the records discoverable with their pending-review labels, but prevent their unsigned clinical text from serving as answer support unless the required reviewed evidence is available. Add a focused regression test using a reverted therapy with no reviewed corroboration.

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


3. Specifier totals miss one pending item ✓ Resolved
Description
Resetting the DID item's clinicianReviewStatus to clinician-review-pending leaves
stats.itemsPendingClinicianReview at 514 in the source and search index, although the pending
total is now 515. When the dataset or its exported search metadata is read, it reports the old
count; regenerating the index alone will preserve that error because the generator copies the source
stats.
Code

data/specifiers-content.json[R5451-5452]

+                    "clinicianReviewStatus": "clinician-review-pending",
+                    "changedSinceReview": true
Relevance

●●● Strong

Generated review counts must match status changes; prior reconciliation updated unsigned-count
expectations and artifacts.

PR-#3143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed DID item is pending, while the source and exported index both retain the prior count of
514. The queue test expects 515 pending specifiers, and the index generator copies content.stats
rather than recalculating it.

data/specifiers-content.json[5448-5453]
data/specifiers-content.json[20-24]
data/specifiers-search-index.json[14-19]
tests/sign-off-queue.test.ts[52-56]
scripts/build-specifiers-search-index.mjs[72-80]

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 DID reset adds one pending clinician review, but source and search-index metadata still report 514 rather than 515.
## Fix Focus Areas
- data/specifiers-content.json[20-24]
- data/specifiers-search-index.json[14-19]
## Recommended Fix
Set the source `itemsPendingClinicianReview` count to 515, regenerate the specifier search index with the existing build script, and add a test comparing the reported pending count with the item review states.

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


Results up to commit e4634d9 ⚖️ 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. Old clients show revoked sign-offs ✗ Dismissed
Description
THERAPY_CATALOGUE_ASSETS_PREVIOUS.full retains the generation that preceded the reset, while
fetchCatalogue lets older bundles fetch their compiled hashed URL without checking current review
status. A client loaded before deployment can therefore continue presenting the 26 therapies under
their revoked approvals during the retention window.
Code

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

+  full: "therapies.46f71b9451eeb269.json",
Relevance

●●● Strong

Recent precedents accept preventing stale approvals from appearing current after content or
review-state changes.

PR-#3506
PR-#3143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The source-governance skill requires conservative behavior for stale or unapproved sources. The
changed mapping retains the pre-reset full generation; the generator documents why that generation
remains available, and the client fetches its bundle-selected hashed URL before trying the current
alias.

src/data/therapy-catalogue-assets.ts[3-14]
scripts/build-therapies-index.mjs[252-258]
src/components/therapy-compass/data/use-therapy-data.ts[46-58]
Skill: source-governance

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 retained previous full catalogue lets pre-deployment clients fetch the generation from before the 26 sign-offs were reset.

## Fix Focus Areas
- src/data/therapy-catalogue-assets.ts[12-15]
- scripts/build-therapies-index.mjs[252-281]
- src/components/therapy-compass/data/use-therapy-data.ts[46-58]

## Recommended Fix
Add an explicit revocation path for a previous generation containing invalid sign-offs rather than retaining it under its old URL. Make older clients obtain the current, unsigned data through the existing alias fallback, and cover the deployment-straddling case with a focused regression test.

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


2. Search answers cite unsigned therapy text ✗ Dismissed
Description
therapySiteContentRecord still puts the full clinical prose of needs_review therapies into its
indexable body, while the new catalogue evidence gate removes that prose only from direct catalogue
retrieval. After site-content sync, indexed retrieval can pass those therapies’ clinical text to
synthesis as needs-review evidence, and answer governance can accept claims it directly supports.
Code

src/data/therapies-source.json[727]

+    "reviewStatus": "needs_review",
Relevance

●●● Strong

Recent governance precedents accept fail-closed filtering that prevents unsigned clinical content
reaching synthesis.

PR-#2838
PR-#2811

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed source status makes these therapies unsigned. The site-content adapter retains their
clinical prose in the body and marks them unverified; sync indexes that body, and indexed retrieval
passes its contents onward without filtering by review state. Synthesis receives the evidence, while
the claim governor checks textual support rather than requiring a reviewed source.

src/data/therapies-source.json[724-734]
src/lib/site-content/adapters/index.ts[158-188]
src/lib/site-content/site-content-sync.ts[148-165]
src/lib/clinical-ask/indexed-evidence.ts[42-76]
src/lib/clinical-ask/orchestrator.ts[133-176]
src/lib/clinical-ask/response-governance.ts[82-103]

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 26 therapies reset to `needs_review` still contribute full clinical prose to the site-content search index, bypassing the direct Clinical Ask catalogue gate.
## Fix Focus Areas
- src/data/therapies-source.json[727-734]
- src/lib/site-content/adapters/index.ts[158-188]
- src/lib/clinical-ask/indexed-evidence.ts[42-76]
## Recommended Fix
Build the indexable site-content body from name and category only when a therapy needs review, while preserving the full body for reviewed therapies. Regenerate the affected site-content baseline and add a test showing that indexed evidence cannot supply unsigned therapy prose to Clinical Ask.

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


Results up to commit 16832fa 🧠 Deep


🐞 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. Signed therapies remain on the to-do list ✗ Dismissed
Description
therapy:review updates the source and catalogue assets but does not update the newly populated
therapy-signable-slugs.json projection. After the owner signs any of the 26 reset records, the
owner dashboard still counts it as signable, omits its reviewer attribution, and the projection
consistency test fails.
Code

src/data/therapy-signable-slugs.json[R2-4]

+  "slugs": [
+    "behaviour-therapy",
+    "cognitive-behavioural-therapy-for-insomnia-cbt-i",
Relevance

●●● Strong

Accepted precedent requires sign-off transactions and projections to share authoritative reviewer
metadata and remain synchronized.

PR-#3603
PR-#3607

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds the 26 slugs to a static projection. The sign-off transaction runs only the therapy
index generator, while the dashboard requires both a reviewed index record and matching projection
metadata to count a signature.

src/data/therapy-signable-slugs.json[1-28]
scripts/review-therapy.mjs[530-552]
scripts/review-therapy.mjs[609-612]
src/lib/developer-area/sign-off-queue.ts[1450-1480]
tests/sign-off-today.test.ts[294-316]

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

## Issue description
Signing a reset therapy updates the canonical record but leaves the owner-dashboard projection stale.
## Fix Focus Areas
- src/data/therapy-signable-slugs.json[1-28]
- scripts/review-therapy.mjs[530-610]
- src/lib/developer-area/sign-off-queue.ts[1450-1480]
## Recommended Fix
Regenerate the signable slugs and signed reviewer metadata from the updated source as part of the therapy sign-off transaction, including that projection in its rollback handling. Test signing one of the reset records and verify the dashboard and projection consistency test reflect the signature.

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


2. Signed specifier definition stays hidden ✗ Dismissed
Description
signSpecifierReview retains the reset DID item's changedSinceReview: true when it records a new
signature. Once the owner signs it through clinical:review, the sign-off predicate counts it as
reviewed, but the new site-content gate still withholds its definition and marks it unverified.
Code

data/specifiers-content.json[R5451-5452]

+                    "clinicianReviewStatus": "clinician-review-pending",
+                    "changedSinceReview": true
Relevance

●●● Strong

Accepted precedents require sign-off gates to honor current review state and content pins before
publishing definitions.

PR-#3603
PR-#2838

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The reset sets the flag, the sign-off writer spreads the old review fields without clearing it, and
site-content publication independently requires the flag to be false. The sign-off predicate and
pending-count calculation do not check that flag.

data/specifiers-content.json[5448-5452]
scripts/lib/clinical-record-review-contract.mjs[608-639]
src/lib/specifiers-content.ts[71-87]
src/lib/site-content/adapters/specifiers.ts[25-50]

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 reset marks the DID specifier changed since review, but the interactive sign-off writer does not clear that flag, so site content continues withholding its definition after signing.
## Fix Focus Areas
- data/specifiers-content.json[5448-5452]
- scripts/lib/clinical-record-review-contract.mjs[608-619]
- src/lib/site-content/adapters/specifiers.ts[25-50]
## Recommended Fix
Keep the flag true while the item awaits review, then set `changedSinceReview` to false in the specifier sign-off writer when it records a valid new signature and content pin. Test the DID item through sign-off and site-content generation.

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


Grey Divider

Qodo Logo

Comment thread data/specifiers-content.json Resolved
Comment thread src/data/therapies-index.json Resolved
Comment thread data/specifiers-content.json Resolved
@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: Unsigned DID text can reach synthesis
  • ☑ Fixed: Unsigned therapies can inform answers
  • ☑ Fixed: Specifier totals miss one pending item

Comment thread tests/therapy-ranking.test.ts Resolved
@codeant-ai

codeant-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. With an empty question, therapy search returns alphabetical browse results, so this test never detects needs-review records being boosted for real clinical queries.

Possible bug · tests/clinical-ask-catalogue-evidence.test.ts:46

@codeant-ai

codeant-ai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

CodeAnt PR Risk: Medium Risk

  • The PR needs attention before merging: 26 unreviewed therapy records remain discoverable and routable with clinical text in the catalogue.
  • Clinical Ask withholds unsigned therapy text, but public catalogue routes remain available; confirm those pages clearly disclose that the content is unreviewed.

Assessed commit: 16832faffe45

gitar-bot[bot]

This comment was marked as resolved.

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 17, 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 ef9bfa6

Comment thread src/data/therapies-source.json Resolved
Comment thread src/data/therapy-catalogue-assets.ts Resolved
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit e4634d9

@codeant-ai codeant-ai Bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XL This PR changes 500-999 lines, ignoring generated files labels Oct 17, 2026
Comment thread src/data/therapy-signable-slugs.json Resolved
Comment thread data/specifiers-content.json Resolved
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 16832fa

…ire the pre-reset catalogue, keep sign-off projections current

Owner ruling 18 Oct 2026 00:10 AWST (keep the gating and the 515 count).

- site-content: a needs_review therapy is indexed by name and category only, so
  its unsigned prose cannot reach answer evidence through the site-content index;
  static-manifest baseline regenerated (26 therapy records)
- build-therapies-index: --revoke-previous retires the retained previous
  generation; regenerated with it so pre-deploy clients fall back to the
  current alias instead of the pre-reset catalogue with revoked sign-offs
- therapy:review writes therapy-signable-slugs.json inside its rollback-protected
  transaction, so a newly signed therapy leaves the owner to-do list
- clinical:review clears changedSinceReview when it records a specifier signature
- docs/decisions entry for the ruling; code comments point at it
- tests for each
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 17, 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 dfb28b2

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Auto-fix isn't included in your plan ↗

Upgrade to Team

BigSimmo and others added 2 commits October 18, 2026 01:53
… change-owner manifest

Root cause of the 'Change scope' failure: 4737972 retired the previous therapy
catalogue generation (--revoke-previous), but site-content-change-owners.json still
named those two hashed files, and ci-change-scope.mjs requires every listed
owner path to exist (validateSiteContentChangeOwners). The owner list keeps the
current generation and the public/therapy-compass-data/** glob.
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 17, 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)

Root cause of the Static PR checks failure on ab19fdd: the 2026-10-18 decisions
entry made the committed snapshot's documentation list stale (regenerated with
npm run snapshot:repo-awareness).

@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 17, 2026

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

🔴 High risk · Resetting 26 therapy and one DID sign-off and withholding unsigned clinical text from answers could leave users without relevant guidance until re-review.

Resets the 26 Therapy Compass sign-offs and the DID possession-form specifier to pending review, withholding unsigned clinical prose from site content and clinical answers. Stale retired-rules entry, site-content manifest baseline, and missing 18 Oct ruling decision record have been addressed.

✅ 3 closed
✅ Quality: Stale retired-rules entry still says wake-therapy is signed off

📄 docs/decisions/2026-10-17-remaining-therapy-compass-sign-offs.md:3-5 📄 tests/therapy-3510-needs-review.test.ts:41-46
This PR puts wake-therapy-sleep-deprivation-chronotherapy back in needs_review, and the new test checks that it stays there. But docs/organisation/retired-rules.json still has the wake-therapy-needs-review-hold entry (around line 85). That entry, which comes from the decision this PR supersedes, says wake therapy "now carries … clinician sign-off … rather than remaining held in needs_review". That summary is now false.

The entry also keeps flagging accurate wording. Its pattern matches wake-therapy-sleep-deprivation-chronotherapy … (must remain|stays|held in) needs_review, so any future doc or comment that correctly says the record stays in needs_review would fail the retired-rule check. The repo's decision policy asks for retired-rules to be updated when a ruling reverses a rule. Here the ruling reverses a retirement, so the entry should be edited too.

Fix: remove the entry, or mark it superseded by 2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.md with a corrected summary. The hold is in force again until the owner signs the record with therapy:review.

✅ Bug: Specifier body change leaves site-content manifest baseline stale

📄 src/lib/site-content/adapters/specifiers.ts:25-36 📄 tests/fixtures/site-content/static-manifest-baseline.json
After 154545d, catalogueBody leaves out definition.meaning/clinicalNote for every catalogue specifier without clinician review. In the current data that is 495 items, each with the placeholder text "Pending clinician verification…". contentHashFor hashes title + body, so the contentHash of each of those specifiers:* records changes.

tests/fixtures/site-content/static-manifest-baseline.json was last regenerated in 0892d75, before this commit, and none of the later commits touch it. CI runs scripts/build-site-content-manifest.ts --check (ci.yml:361). Per line 187, that check fails whenever the computed manifest differs from the baseline, so this PR should fail CI. Regenerate the baseline (and any change-owner/manifest artifacts the earlier commit refreshed) with the sanctioned manifest builder and commit it.

✅ Quality: 18 Oct 00:10 AWST owner ruling cited in code but not in docs/decisions

📄 src/lib/site-content/adapters/specifiers.ts:26-28 📄 docs/decisions/2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.md
The new comment in catalogueBody says an owner ruling (18 Oct 2026 00:10 AWST) is why unsigned or changed-since-review specifier definitions are now kept out of site content. That ruling isn't recorded anywhere else in the repo. A search for 00:10 AWST finds only this file, and the reset decision docs/decisions/2026-10-17-agent-recorded-therapy-and-did-sign-offs-reset.md doesn't mention site content or this gate. The repo policy says every owner decision must get a docs/decisions/ entry in the same change, because chat history doesn't carry over to other tools. As it stands, the reason this gate exists and why about 500 baseline hashes changed can only be traced through a code comment. Fix: add a decision entry, or add a section to the reset decision, that records the ruling and the fail-closed rule, and point the code comment at it.

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 4 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 4e20992

@BigSimmo
BigSimmo merged commit 5851b1f into main Oct 17, 2026
42 checks passed
@BigSimmo
BigSimmo deleted the fix/reset-agent-recorded-signoffs branch October 17, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔴 Large blast radius size:XXL This PR changes 1000+ lines, ignoring generated files 🕐 40+ Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant