Complete remaining Therapy Compass sign-offs, DID specifier fix, display.revoke guard, and ledger inbox updates
User description
Summary
- Complete the remaining 26 Therapy Compass profiles (
#05WXHX): Populate governed guideline and clinical literature references (references,sourceNotes,evidenceNotes, andsources[0].reference) for the remaining 26 Therapy Compass profiles insrc/data/therapies-source.json, sign all 26 off as"Psych Sift", and regenerate the derived Therapy indexes, catalogue assets, signable-slug projection (205 / 205 signed,0 waiting), site-content change owners, and static manifest baseline. - Clarify & re-sign the Dissociative Identity Disorder possession-form specifier (
"fix DID"): Updatespecifier:dis:dissociative-identity-disorder:features:with-without-possession-formindata/specifiers-content.jsonsodefinition.meaningstates explicitly that neither DSM-5-TR nor ICD-11 (6B64) defines a separate possession-form specifier (both manuals encompass presentations with or without possession-form experiences directly within the core diagnostic criteria), and re-sign as"Psych Sift"with a fresh content SHA-256 pin. - Harden
public.teaching_command('display.revoke')againstNULLcreated_by(#VDAXJX): Add migration20261017120000_teaching_display_revoke_null_creator_guard.sqland updatesupabase/schema.sql,supabase/applied-migration-hashes.json,supabase/drift-manifest.json, andtests/teaching-migration-contract.test.tssodisplay.revokeusesif coalesce(v_link.created_by = p_actor_id, false) is not true and v_role <> 'organiser' then raise exception 'teaching_role_denied'; end if;. - Queue task-ledger inbox updates (
#6VPJ99,#QP7H3X,#NBJQD8,#VDAXJX,#05WXHX,#4DFNHJ): Queue 5donerequests and 1updaterequest underdocs/outstanding-issues-inbox/(conflict-free alongside open reconciliation PR#3609).
Verification
- Checks run:
npm run check:migration-immutability→Migration immutability check passed (318 sealed migrations).npm run check:function-grants→Function grant check passed.npm run check:therapy-data-index→Therapy indexes are current (205 records).npm run check:specifiers-search-index→Specifiers search index is current (585 specifier items across 20 categories (71 source-verified)).npm run check:ledger-write-discipline→Ledger write discipline passed for 3b7b6e84012f..HEAD.npm run check:outstanding-issues→Ledger inbox check passed: 27 pending request(s), 2087 applied. Outstanding-issues guard passed: 896 rows (109 open, 787 archived)npx vitest run tests/specifiers-content.test.ts tests/therapy-3510-needs-review.test.ts tests/therapy-source-governance.test.ts tests/sign-off-today.test.ts tests/sign-off-queue.test.ts tests/developer-sign-off-page.dom.test.tsx tests/teaching-migration-contract.test.ts tests/site-content-manifest.test.ts→Test Files 8 passed (8), Tests 184 passed (184)
Risk and rollout
- Risk: Low — additive
CREATE OR REPLACE FUNCTION public.teaching_command(...)single-line role guard hardening (coalesce(v_link.created_by = p_actor_id, false) is not true), static clinical reference/sign-off metadata updates, and immutable inbox files. - Rollback: Revert PR commit; re-apply previous
teaching_commanddefinition from20261016134500_teaching_admin_attendance_export.sqlif needed. - Provider or production effects: Merging applies
20261017120000_teaching_display_revoke_null_creator_guard.sql(CREATE OR REPLACE FUNCTION public.teaching_command) to Supabase; zero external paid AI/provider calls.
Notes
- PR
#3609(chore(ledger): reconcile 21 pending inbox requests and record prlanded proofs) is already open with auto-merge armed on GitHub to reconcile the 21 base inbox records, so this PR queues the 6 new ledger updates indocs/outstanding-issues-inbox/without conflicting with#3609.
Summary by cubic
Completes Therapy Compass sign-off by adding guideline and clinical literature references to the remaining 26 profiles, bringing all 205 profiles to signed-off status and regenerating the derived indexes, catalogue assets, and static manifest baseline. Also re-signs the Dissociative Identity Disorder possession-form specifier, hardens public.teaching_command('display.revoke') against NULL created_by, and queues five ledger inbox updates.
Bug Fixes
display.revokenow checkscoalesce(v_link.created_by = p_actor_id, false) is not true and v_role <> 'organiser', so a display link whose creator was deleted can only be revoked by an organiser.- The DID possession-form specifier now states that neither DSM-5-TR nor ICD-11 (6B64) defines a separate possession-form specifier.
- The therapy references fix five review findings plus the follow-up MBT/MBTI citation wording: the CBT-I evidence level, behaviour therapy attribution, consecutive authority-tag parsing after closing parentheses, habit-reversal literature, and removal of a candidate guideline citation.
- Later-added citation detection now covers the 2026-10-09 and 2026-10-17 sweeps (
isLaterAddedReference), and year-only parentheses are no longer misread as source authorities.
Ledger inbox
- Queues
donefor#NZ4X41,#6VPJ99,#VDAXJX, and#4DFNHJ;updatefor#Z3GZ5P; leaves the medication lexicon and source-review items open.
CodeAnt-AI Description
Finish Therapy Compass reviews and clarify DID and display-link safeguards
What Changed
- Added governed guideline and research references to the remaining 26 Therapy Compass profiles and marked all 205 profiles reviewed; later-added citations are distinguished from imported material.
- Clarified that DSM-5-TR and ICD-11 include possession-form experiences within Dissociative Identity Disorder criteria rather than defining a separate specifier.
- Display-link revocation now denies non-organisers when creator information is missing; organisers can still revoke links.
Impact
✅ All 205 Therapy Compass profiles reviewed
✅ Clearer DID possession-form guidance
✅ Safer display-link revocation when creator details are missing
💡 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.
Summary by CodeRabbit
- Updates
- Therapy Compass now shows all 205 therapy records as reviewed, with no therapy records waiting for sign-off.
- Added clarification that DSM-5-TR and ICD-11 include possession and non-possession presentations within the core criteria for dissociative identity disorder, without a separate possession-form specifier.
- Therapy Compass distinguishes later-added guideline citations from references in the original source register.
- Security
- Revoking a teaching display link without a recorded creator now requires organiser access.