diff --git a/data/outstanding-issues-snapshot.json b/data/outstanding-issues-snapshot.json index 7e579749ee..7b3712365c 100644 --- a/data/outstanding-issues-snapshot.json +++ b/data/outstanding-issues-snapshot.json @@ -2,7 +2,7 @@ "version": "outstanding-issues-snapshot-v1", "ledger_revision": { "sha": "707b965965a9b843c13deb6b5c9ddd158fe2631d", - "committed_at": "2026-08-25T17:45:01+00:00" + "committed_at": "2026-08-25T17:45:01Z" }, "counts": { "open": 91, @@ -10,7 +10,7 @@ "p2": 57, "p3": 33, "queued": 9, - "pending": 7, + "pending": 10, "resolved": 412 }, "queue": [ @@ -966,17 +966,35 @@ "summary": "Component metrics stay in :root, not @theme — record the rule where reviewers read it, because bots keep re-raising it", "created_at": "2026-08-26" }, + { + "request_id": "970bbb8b-4dbe-4e27-97a4-80142db94d7d", + "action": "add", + "summary": "Ward Flow: six agreed enhancements not yet assigned to a phase", + "created_at": "2026-08-26" + }, { "request_id": "b85ad821-4c9b-4925-b86b-2d5767052b20", "action": "add", "summary": "Scope the component-metric rule: keep one-consumer values local; use :root only for shared off-scale CSS custom properties, not @theme", "created_at": "2026-08-26" }, + { + "request_id": "cfa44b9c-3d68-4030-b1e3-3d8f182ca3d4", + "action": "add", + "summary": "Ward Flow's bed-release state model is unvalidated by any ward clinician", + "created_at": "2026-08-26" + }, { "request_id": "d2a6122a-4fcd-4429-92a7-6004fa19eb24", "action": "add", "summary": "Docstring coverage on the answer-source changes sits at 62.5% against CodeRabbit's 80% advisory threshold", "created_at": "2026-08-25" + }, + { + "request_id": "ecabc51d-034a-4a68-91cd-280214aac6bf", + "action": "add", + "summary": "Ward Flow Phase 5: bed availability becomes real - discharge lifecycle, egress board, predicted capacity, freshness everywhere", + "created_at": "2026-08-26" } ] } diff --git a/data/repo-awareness-snapshot.json b/data/repo-awareness-snapshot.json index fa2481f60e..ade3508593 100644 --- a/data/repo-awareness-snapshot.json +++ b/data/repo-awareness-snapshot.json @@ -1,8 +1,8 @@ { "version": "repo-awareness-snapshot-v1", "captured_revision": { - "sha": "bf415957c82a3e03ef9c740b24e88832fe84a984", - "committed_at": "2026-08-26T11:16:25+08:00" + "sha": "6cd6ba816d2eef8a4642529701ed7d7656c09510", + "committed_at": "2026-08-26T10:14:41+08:00" }, "routes": { "modes": [ @@ -2952,6 +2952,11 @@ "section": "superpowers", "catalogued": false }, + { + "path": "docs/superpowers/plans/2026-08-26-ward-flow-phase-5-bed-availability.md", + "section": "superpowers", + "catalogued": false + }, { "path": "docs/superpowers/plans/2026-08-26-ward-flow-sidebar-house-pattern.md", "section": "superpowers", @@ -3237,6 +3242,11 @@ "section": "superpowers", "catalogued": false }, + { + "path": "docs/superpowers/specs/2026-08-26-ward-flow-phase-5-bed-availability-design.md", + "section": "superpowers", + "catalogued": false + }, { "path": "docs/testing.md", "section": "root", @@ -3532,11 +3542,26 @@ "section": "ward-flow-phase-3-workspace", "catalogued": false }, + { + "path": "docs/ward-flow-phase-5-handover.md", + "section": "root", + "catalogued": false + }, + { + "path": "docs/ward-flow-phase-5-kickoff-prompt.md", + "section": "root", + "catalogued": false + }, { "path": "docs/ward-flow-phase-handoff.md", "section": "root", "catalogued": false }, + { + "path": "docs/ward-flow-roadmap.md", + "section": "root", + "catalogued": false + }, { "path": "docs/ward-management-context.md", "section": "root", @@ -3625,9 +3650,9 @@ } ], "counts": { - "documents": 436, + "documents": 441, "catalogued": 102, - "uncatalogued": 334, + "uncatalogued": 339, "sections": 18 } }, diff --git a/docs/outstanding-issues-inbox/970bbb8b-4dbe-4e27-97a4-80142db94d7d.json b/docs/outstanding-issues-inbox/970bbb8b-4dbe-4e27-97a4-80142db94d7d.json new file mode 100644 index 0000000000..57974d507d --- /dev/null +++ b/docs/outstanding-issues-inbox/970bbb8b-4dbe-4e27-97a4-80142db94d7d.json @@ -0,0 +1,14 @@ +{ + "version": 2, + "id": "970bbb8b-4dbe-4e27-97a4-80142db94d7d", + "createdOn": "2026-08-26", + "action": "add", + "payload": { + "pri": "P3", + "type": "rec", + "summary": "Ward Flow: six agreed enhancements not yet assigned to a phase", + "detail": "Ward prediction track record; 'why not here' across the whole state for one patient; a sixty-second self-driving guided tour; out-of-area ledger; 'waiting since' promoted in the priority queue; named moments on the demo clock. All accepted by the product owner 2026-08-26 and described in docs/ward-flow-roadmap.md.", + "source": "Product-owner direction, 2026-08-26", + "issueUlid": "01M0XVHQ3D875H6TZWM5JT85YW" + } +} diff --git a/docs/outstanding-issues-inbox/cfa44b9c-3d68-4030-b1e3-3d8f182ca3d4.json b/docs/outstanding-issues-inbox/cfa44b9c-3d68-4030-b1e3-3d8f182ca3d4.json new file mode 100644 index 0000000000..cf667489fe --- /dev/null +++ b/docs/outstanding-issues-inbox/cfa44b9c-3d68-4030-b1e3-3d8f182ca3d4.json @@ -0,0 +1,14 @@ +{ + "version": 2, + "id": "cfa44b9c-3d68-4030-b1e3-3d8f182ca3d4", + "createdOn": "2026-08-26", + "action": "add", + "payload": { + "pri": "P2", + "type": "issue", + "summary": "Ward Flow's bed-release state model is unvalidated by any ward clinician", + "detail": "predicted -> confirmed -> blocked -> released is a software model of how a bed comes free. A bed may be confirmed and blocked simultaneously in reality, and 'predicted' may compress several states a charge nurse would separate. Cheap to change while synthetic; recorded in the Phase 5 spec as D14 and as the assumption most likely to be wrong. Check before Phase 7 builds on it.", + "source": "Ward Flow Phase 5 design, 2026-08-26", + "issueUlid": "01M0XVHNB49GPWT3G522RG4YDC" + } +} diff --git a/docs/outstanding-issues-inbox/ecabc51d-034a-4a68-91cd-280214aac6bf.json b/docs/outstanding-issues-inbox/ecabc51d-034a-4a68-91cd-280214aac6bf.json new file mode 100644 index 0000000000..b4b0ddf494 --- /dev/null +++ b/docs/outstanding-issues-inbox/ecabc51d-034a-4a68-91cd-280214aac6bf.json @@ -0,0 +1,14 @@ +{ + "version": 2, + "id": "ecabc51d-034a-4a68-91cd-280214aac6bf", + "createdOn": "2026-08-26", + "action": "add", + "payload": { + "pri": "P2", + "type": "task", + "summary": "Ward Flow Phase 5: bed availability becomes real - discharge lifecycle, egress board, predicted capacity, freshness everywhere", + "detail": "Binding spec: docs/superpowers/specs/2026-08-26-ward-flow-phase-5-bed-availability-design.md. Extends Phase 4's existing BedRelease concept rather than starting over. Settled direction and decisions: docs/ward-flow-roadmap.md.", + "source": "Product-owner direction, 2026-08-26", + "issueUlid": "01M0XVHM5H48HF8WJ52BHSR72A" + } +} diff --git a/docs/superpowers/plans/2026-08-26-ward-flow-phase-5-bed-availability.md b/docs/superpowers/plans/2026-08-26-ward-flow-phase-5-bed-availability.md new file mode 100644 index 0000000000..3696d3b35c --- /dev/null +++ b/docs/superpowers/plans/2026-08-26-ward-flow-phase-5-bed-availability.md @@ -0,0 +1,865 @@ +# Ward Flow Phase 5 — Bed availability becomes real + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development +> (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use +> checkbox (`- [ ]`) syntax for tracking. + +**Goal:** wards record when their beds are actually coming free, and the coordinator's capacity +figure becomes a number that can be planned against for the rest of today. + +**Architecture:** extend the `BedRelease` concept Phase 4 already built — it has a unit, an expected +time, a confidence, a blocker chosen from a fixed list, and a ward-only flag event — with a state +machine, a sibling `LeaveBed` type, band derivations over today, and a discharge board that renders +them. Every number stays a pure derivation from `WardFlowState`; no screen computes its own version. + +**Tech Stack:** TypeScript 6 strict, React 19, Next.js 16 App Router, CSS modules with `@theme` +tokens, Vitest (`tests/**/*.test.ts`, `tests/**/*.dom.test.tsx`), Playwright (`tests/ui-ward-*.spec.ts`, +project `chromium-mockups`). + +**Spec:** `docs/superpowers/specs/2026-08-26-ward-flow-phase-5-bed-availability-design.md` +**Direction and settled decisions:** `docs/ward-flow-roadmap.md` + +## Global Constraints + +Every task's requirements implicitly include all of these. + +- **Never invent a legal figure.** No figure or requirement from the Mental Health Act may be cited, + paraphrased or inferred anywhere in code, copy, comment, test or fixture. +- **Synthetic data only.** No name, date of birth, medical record number, address, diagnosis, + narrative history or treatment. **Sex is the only permitted patient attribute**, and per spec D11 + neither `BedRelease` nor `LeaveBed` may carry even that. Free text counts as data. +- **Neither `BedRelease` nor `LeaveBed` may gain a field describing the departing or absent patient.** + `tests/ward-flow-reducer.test.ts`'s bed-release privacy suite asserts this against the type's own + field set. Do not weaken it; extend it. +- **`confirmedBy` is a role, never a person** — a unit or service label such as + `"NUM RPH Adult Secure"`. Never a personal name. +- **Blockers are chosen, never typed.** Every blocker value comes from `BED_RELEASE_BLOCKERS`. +- **Local and offline checks only.** Never run `verify:release`, `eval:*`, `check:supabase-project`, + `test:live`, or anything touching OpenAI, Supabase, hosted CI or a live database. +- **Read counts, never exit codes.** `node scripts/run-playwright.mjs` exits `0` on test failure and + on lock refusal alike. Quote the `N passed` line. On `DATABASE_HEAVY_RUN_ADMISSION_BUSY` or an + `EPERM … owner.json` stack trace the command did not run — retry, do not treat as a pass. +- **Every `