Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
92097e5
docs(ed-care-plans): land approved plan and apply four user decisions
BigSimmo Aug 20, 2026
3997ea3
docs(ed-care-plans): revise clinical content after design review
BigSimmo Aug 20, 2026
8a2e6a6
docs(care-plan): rename to Care Plan and apply the grilling-round design
BigSimmo Aug 20, 2026
bfbee15
feat(care-plan): define synthetic clinical domain
BigSimmo Aug 20, 2026
e5b3f4c
fix(care-plan): apply product rename and widen amendable fields
BigSimmo Aug 21, 2026
3423449
docs(care-plan): fix four defects the Task 1 implementer surfaced
BigSimmo Aug 21, 2026
2f5a6f3
fix(care-plan): move fictional numbers into the reserved fiction range
BigSimmo Aug 21, 2026
59d101f
fix(care-plan): restore the real crisis lines on the after-hours path
BigSimmo Aug 21, 2026
9d72974
fix(care-plan): make the clinical language guards able to fail
BigSimmo Aug 21, 2026
7b28645
docs(care-plan): derive review state instead of storing it
BigSimmo Aug 21, 2026
8652e73
fix(care-plan): guard fixture prose against impossible chronology
BigSimmo Aug 21, 2026
e796775
feat(care-plan): enforce longitudinal plan lifecycles
BigSimmo Aug 21, 2026
9600e12
docs(care-plan): fix three plan defects Task 2 surfaced
BigSimmo Aug 21, 2026
0e1fb4a
fix(care-plan): raise a participation trigger, drop the connectivity …
BigSimmo Aug 21, 2026
bdcf2f0
docs(care-plan): rule on three findings from the Task 2 review
BigSimmo Aug 21, 2026
def541e
fix(care-plan): reach the withdrawn cohort and cover the safety-plan …
BigSimmo Aug 21, 2026
9227ec4
docs(care-plan): commit the SDD ledger and session handoff
BigSimmo Aug 21, 2026
0447f35
docs(care-plan): record the relocated worktree verification state
BigSimmo Aug 21, 2026
809f360
docs(care-plan): add the complete cross-session work ledger
BigSimmo Aug 21, 2026
ff796ec
style(care-plan): format the handoff documents
BigSimmo Aug 21, 2026
4e34a0a
docs(care-plan): correct the relocation advice after a fourth destruc…
BigSimmo Aug 21, 2026
f01b858
docs(care-plan): the worktree destructions had a known cause, already…
BigSimmo Aug 21, 2026
3febc69
Merge remote-tracking branch 'origin/main' into claude/ed-care-plans-…
BigSimmo Aug 21, 2026
94ffdcd
docs(care-plan): record the origin/main merge and the new worktree
BigSimmo Aug 21, 2026
d421bc2
Merge remote-tracking branch 'origin/main' into claude/ed-care-plans-…
BigSimmo Aug 21, 2026
9d3a104
feat(care-plan): add gated clinical route shell
BigSimmo Aug 21, 2026
bb68ea8
fix(care-plan): keep the synthetic marker in print and key route focu…
BigSimmo Aug 21, 2026
a219158
docs(care-plan): close Task 3 in the ledger with its rulings
BigSimmo Aug 21, 2026
0c9b32c
feat(care-plan): deliver searchable clinical snapshot
BigSimmo Aug 21, 2026
773da7b
fix(care-plan): make the snapshot's safety guards able to fail
BigSimmo Aug 21, 2026
f2f6389
docs(care-plan): record Task 4 rulings and deferred minors
BigSimmo Aug 21, 2026
d66e7a3
fix(care-plan): keep the shell owning focus on every address change
BigSimmo Aug 21, 2026
9bab6ad
docs(care-plan): close Task 4 in the ledger
BigSimmo Aug 21, 2026
891f4bf
feat(care-plan): add management plan reading and print
BigSimmo Aug 22, 2026
90c1d01
fix(care-plan): record a print intent offline and state each plan fac…
BigSimmo Aug 22, 2026
f0a59d5
docs(care-plan): close Task 5 and Stage A in the ledger
BigSimmo Aug 22, 2026
f0ab0d4
docs(care-plan): record the Stage A checkpoint and what it could not …
BigSimmo Aug 22, 2026
01f386a
feat(care-plan): implement governed management plan authoring
BigSimmo Aug 22, 2026
65f9309
fix(care-plan): restore the pinned boundary link and show a first ver…
BigSimmo Aug 22, 2026
2113fe9
fix(care-plan): let the shared error summary keep focus on a failed s…
BigSimmo Aug 22, 2026
e02a03a
docs(care-plan): close Task 6 in the ledger with four rulings
BigSimmo Aug 22, 2026
2be157f
feat(care-plan): track ED presentation continuity
BigSimmo Aug 22, 2026
a8a8264
fix(care-plan): keep ED presentation corrections whole and visible
BigSimmo Aug 22, 2026
5e8f812
docs(care-plan): close Task 7 in the ledger with three rulings
BigSimmo Aug 22, 2026
87b28b3
feat(care-plan): add printable personal safety plans
BigSimmo Aug 22, 2026
79cfa97
fix(care-plan): never print blanks about a person's life on their own…
BigSimmo Aug 22, 2026
5694acf
docs(care-plan): close Task 8 and add two systemic lessons
BigSimmo Aug 22, 2026
f4de820
feat(care-plan): add patient-facing plan and resources
BigSimmo Aug 22, 2026
37e46ca
Merge main into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
6d95245
docs(ledger): record PR #2291 review
BigSimmo Aug 22, 2026
9621f51
Merge main into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
a896867
docs(ledger): record PR #2291 final main sync
BigSimmo Aug 22, 2026
f93b220
Merge main into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
f236113
docs(ledger): record PR #2291 current-main sync
BigSimmo Aug 22, 2026
61c6b56
fix(care-plan): guard staleness, contact launch, and patient-plan app…
claude Aug 22, 2026
a47059e
fix(care-plans): guard blocked CMHT contact actions
BigSimmo Aug 22, 2026
da41707
docs(ledger): record PR #2291 CI repair
BigSimmo Aug 22, 2026
70e700d
Merge origin/claude/ed-care-plans-impl-7f44cd (owner's live main-sync…
claude Aug 22, 2026
4b5448d
style: prettier format for contact-actions.tsx
claude Aug 22, 2026
620743d
Merge origin/claude/ed-care-plans-impl-7f44cd (owner's live contact-g…
claude Aug 22, 2026
6a755d8
docs(ledger): record PR #2291 Run PR sweep
claude Aug 22, 2026
646edf9
Merge branch 'main' into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
cb6d65e
Merge branch 'main' into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
e51cf76
Merge branch 'main' into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
30b5d41
docs(pr): sync Care Plan PR policy body via CI
cursoragent Aug 22, 2026
dee4113
Merge origin/claude/ed-care-plans-impl-7f44cd into local PR policy bo…
cursoragent Aug 22, 2026
97f7391
fix(care-plan): bound he/him possessive rewrite and unstale handover …
cursoragent Aug 22, 2026
af44416
Merge branch 'main' into claude/ed-care-plans-impl-7f44cd
BigSimmo Aug 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions PR_POLICY_BODY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Summary

Adds a gated, synthetic Care Plan prototype: clinicians can read approved Management Plans, author governed revisions, record ED presentations, and generate patient-facing Care Plans from an approved source. Patient copies stay readable when the source changes or is withdrawn, with a visible needs-updating warning (including on print). Contact and print actions honour the mutation guard instead of launching when blocked.

## Verification

- [x] `npm run verify:pr-local` — hosted Static PR checks, Safety and config checks, Unit coverage, and Build passed on head `cb6d65eec6e84598b771c3241d10db25b77af943`
- [x] `npm run verify:ui` — hosted Production UI critical and Production UI (1/2/3) passed on the same head
- Retrieval/ranking evals not applicable: this PR does not change retrieval, ranking, selection, chunking, or scoring behaviour.
- `npm run verify:release` not run: not a release/handoff-confidence request; no provider-backed gates authorised.
Comment thread
cursor[bot] marked this conversation as resolved.

## Risk and rollout

- Risk: medium — patient-facing Care Plan authoring, print, and crisis-support contact surfaces are new, but they run as a synthetic in-memory prototype behind the existing admin-gated route family with no persistence or live provider calls.
- Rollback: revert the squash merge. No migrations, schema, or production config ship with this change.
- Provider or production effects: None
- RAG impact: no retrieval behaviour change — Care Plan prototype and tests only; no rag/, retrieval RPC, ranking-config, or golden-fixture files.

## Clinical Governance Preflight

- [x] Source-backed claims still require linked source verification before clinical use
- [x] No patient-identifiable document workflow was introduced or expanded without explicit governance approval
- [x] Supabase target remains `Clinical KB Database` (`sjrfecxgysukkwxsowpy`)
- [x] Service-role keys and private document access remain server-only
- [x] Demo/synthetic content remains clearly separated from real clinical sources
- [x] Source metadata, review status, and outdated/unknown-source behavior remain conservative
- [x] Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed
Comment thread
cursor[bot] marked this conversation as resolved.

This change is a clinician-facing synthetic prototype, not validated clinical decision support. Fixtures are labelled synthetic; there is no live patient document store, no service-role exposure, and no SaMD claim.

## Notes

Codex P1 review threads on stale print warnings, withdrawal staleness, print/contact guards, and superseded Patient Plan approval were addressed on this branch and resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-22 | PR-2291 | 37e46caac7b777517d61d56c30d3582d98963a8f | Run PR: main merge and six P1 review fixes | main merged; six P1 fixes published; local runtime blocked before executable gates | git diff --cached --check PASS; unmerged=0; setup blocked npm 11.9.0 vs 11.17.0; format executor disconnected; no local tests |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-23 | PR-2291 | a47059e2b2534151a463199f09bfb30afa1c6c44 | Run PR: CI repair for blocked CMHT contact actions | published the omitted contact-action guard, workspace forwarding, and management caller after CI failures | targeted care-plan DOM suite PASS (221/221); tsc --noEmit PASS; Prettier check PASS; git diff --cached --check PASS |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-22 | claude/ed-care-plans-impl-7f44cd (PR #2291) | 620743d434dfcc158811720ca53d09caf9c4b750 | Run PR sweep: CI fix + threads + drift | Before: mergeable_state dirty (main-sync merge conflict never attempted — hard-stopped and reported per clinical-content-conflict policy since the PR branch and main both independently built the care-plan feature after PR #2274 landed), PR mergeability + PR policy both failing, 0 of 6 unresolved P1 review threads addressed, real CI (pr-required) never triggered. After: PR owner (BigSimmo) resolved the main-sync merge conflict live and independently fixed all 6 P1 Codex findings on the branch while this sweep was in progress; this session's own independent fixes for the same 6 findings were reconciled against the owner's landed versions (kept the owner's naming/implementation where duplicated, kept this session's unique patient-plan-print-stale-in-subtree fix which the owner's merge did not touch, removed this session's now-dead-code duplicate blocks e.g. two near-identical withdrawal stale-trigger blocks and two approve-patient-plan-version refusal blocks left by concurrent independent 3-way merges, added 3 new regression tests). mergeable_state now blocked (not dirty) — no more content conflict. PR mergeability: success. PR policy: still failing (only blocker: PR body Clinical Governance Preflight all 7 boxes unchecked plus advisory warnings on blank Summary/Verification/Risk sections — PR body left untouched per this sweep's explicit instruction not to edit it). Real CI (pr-required aggregate) triggered for the first time on this PR and was still in progress after 25 minutes of observation (Build, Unit coverage, Static PR checks, Production UI x4, Advisory UI, Lighthouse budget all in_progress; Change scope/Gitleaks/Semgrep/Safety and config checks/GitGuardian all green) — not yet settled at end of this sweep's observation window. All 6 review threads already resolved by BigSimmo before this session's push landed; nothing left to reply/resolve. 3 commits pushed: 61c6b562 (own fixes), 70e700db (merge #1, resolving owner's first live main-sync push), 620743d4 (merge #2, resolving owner's second live push that independently fixed the exact same contact-guard finding). | Local only, no provider-backed checks run: npm run typecheck (clean, 4695 files), npm run lint (clean, 4695 files), node scripts/run-vitest.mjs run tests/care-plan-patient-plan.test.ts tests/care-plan-linked-routes.dom.test.tsx tests/care-plan-prototype-state.test.ts tests/care-plan-domain.test.ts tests/care-plan-route-files.test.ts (440 passed), npm run test full suite (8476 passed, 1 skipped, 1 unrelated pre-existing async-timer-after-teardown flake in caring-contact-shell-frame.tsx unrelated to this diff), npx prettier --check on touched files (clean). No eval:rag, eval:quality, eval:retrieval:quality, verify:release, check:supabase-project, or test:live run. |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-22 | PR-2291 | 9621f5138f5c7919633602c08f7b313e8dc16259 | Run PR: final main sync after review fixes | latest main merged cleanly after review fixes; executable local gates remain blocked by runtime | git merge-tree --write-tree 62cfcab483077d437a513b33eec87272852fa197 6d95245204e344335bd6ea10798d8b74111c9fcf PASS; git diff --cached --check PASS; local setup/format/test unavailable |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-22 | PR-2291 | f93b2209ebb9a41aca3159be9ba4f2c8e0bdf289 | Run PR: final current-main sync after review fixes | newly advanced main merged cleanly; executable local gates remain blocked by runtime | git merge-tree --write-tree 3e5c2234b93183d41815886c1b49b947ba544aeb a8968673796710de95cc660802e75c8dbd5e4972 PASS; git diff --cached --check PASS; local setup/format/test unavailable |
72 changes: 72 additions & 0 deletions docs/care-plan/CLAUDE-START-HERE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Care Plan — Claude start here

**Last updated:** 22 August 2026 (Australia/Perth)
**Implementation status:** Tasks 1–8 complete, reviewed and committed. Task 9 (Patient Plan) is on this branch. Tasks 10–11 not started.
**Design status:** Approved
**Working directory:** live state is `origin/claude/ed-care-plans-impl-7f44cd` (PR #2291). Local Windows worktree paths in older notes are historical.
**Branch:** `claude/ed-care-plans-impl-7f44cd`

## One-minute start

**This file is orientation. The live state of the build lives in two others — read those first:**

1. [`session-handoff-2026-08-21.md`](./session-handoff-2026-08-21.md) — where things stand, the thirteen binding product decisions, the environment hazard, and the prompt to start the next session.
2. [`sdd-ledger.md`](./sdd-ledger.md) — task progress, all 25 controller rulings with what each costs if wrong, the deferred minors, and four systemic lessons.

**Where to work.** Branch `claude/ed-care-plans-impl-7f44cd`. The authoritative copy is `origin/claude/ed-care-plans-impl-7f44cd`. **Do not create or use any worktree under `.claude/worktrees/`** — that location destroyed this work three times on 21 August 2026. Nothing committed was ever lost; commit at the end of every task. Do not treat dated Windows paths in older handovers as the live checkout.

**The product in one line.** A synthetic, memory-only, reset-on-refresh prototype under `/mockups/care-plan` that lets a clinician look up the approved management plan for someone who presents repeatedly to an emergency department in psychiatric crisis. Reading is the primary use; authoring is supporting machinery.

Read these files in order before writing code:

1. [`AGENTS.md`](../../AGENTS.md) — binding repository rules.
2. [`CLAUDE.md`](../../CLAUDE.md) — Claude orientation and repository map.
3. [`claude-build-handover-2026-08-21.md`](./claude-build-handover-2026-08-21.md) — current state, approvals, boundaries, precedents, and exact next action.
4. [`2026-08-20-care-plan-design.md`](../superpowers/specs/2026-08-20-care-plan-design.md) — approved product and visual specification; this is the product authority.
5. [`care-plan-context.md`](../care-plan-context.md) — binding domain language.
6. [`2026-08-20-care-plan-implementation.md`](../superpowers/plans/2026-08-20-care-plan-implementation.md) — executable nine-task, file-by-file, test-first build plan.
7. [`conversation-transcript-2026-08-21.md`](./conversation-transcript-2026-08-21.md) — portable transcript of the complete visible Codex conversation through the handover request.
8. [`verification-log-2026-08-21.md`](./verification-log-2026-08-21.md) — exact planning and handover evidence, plus what has not run.

The visual-direction source files are outside Git and remain available at:

`C:\Users\joshs\.codex\visualizations\2026\08\20\01a01fb2-575f-7c11-a245-332db7a85a25\care-plan\.superpowers\brainstorm\17559-1787239654\content\care-plan-directions.html`

The previous localhost visual server is no longer running. Open the HTML file directly or start a new task-owned visual server if comparison is needed.

## Copy/paste prompt for Claude

```text
Resume the Care Plan build on branch claude/ed-care-plans-impl-7f44cd.

Read, in order: docs/superpowers/specs/2026-08-20-care-plan-design.md (binding),
docs/care-plan-context.md (binding glossary), and the Global Constraints and
Delivery Stages sections of
docs/superpowers/plans/2026-08-20-care-plan-implementation.md.

Then read docs/care-plan/sdd-ledger.md — the SDD ledger. Tasks 1–8 are complete;
Task 9 (Patient Plan) is on this branch. Resume at the first task without a
complete line. The ledger also carries every controller ruling.

Execute with superpowers:subagent-driven-development. Eleven tasks. Stop at the Stage
A checkpoint after Task 5 and report to the user; do not start Task 6 on your own
judgment.

Synthetic, memory-only, provider-free throughout. Local commits are authorised;
nothing else is — no push, PR, merge, rebase, deployment, or provider access.
```

## Current Git checkpoint

Captured on 21 August 2026:

- `HEAD`: `eeea74a160c19553f94347dda5102b2dff2ed591`
- Upstream: `origin/main`
- `origin/main` at the final 00:51 AWST snapshot: `1cc0d298774e4dc2ec8dd04d03ecf4fe789d5564`
- State at that snapshot: branch is four commits behind `origin/main`; no branch movement was performed.
- Working tree: the planning and handover documents are untracked; product code is untouched.
- Commits/pushes/PRs/deployments: none for Care Plan.

## Exact first action

After the read order and Git preflight, begin implementation-plan **Task 1: domain types, deterministic fixtures, selectors, and privacy invariants**. Do not start with page scaffolding.
Loading
Loading