Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
99cf008
feat(ward-flow): Ward Flow prototype baseline — routes, model, spec a…
BigSimmo Aug 18, 2026
f047863
feat(ward-flow): add the injectable clock the model will run on
BigSimmo Aug 18, 2026
b2f7cf3
feat(ward-flow): define the phase 1 domain types
BigSimmo Aug 18, 2026
3cf1e89
feat(ward-flow): add eligibility gates with destination-only authoris…
BigSimmo Aug 18, 2026
20bdbc8
feat(ward-flow): model sites with emergency departments and units
BigSimmo Aug 18, 2026
e378b70
fix(ward-flow): replace unused @ts-expect-error with explicit cast in…
BigSimmo Aug 18, 2026
1425b38
feat(ward-flow): build movements at realistic metro pressure
BigSimmo Aug 18, 2026
b2388cd
refactor(ward-flow): migrate every route onto the phase 1 model
BigSimmo Aug 18, 2026
f060ae7
fix(ward-flow): address Task 6 review round 1 — honesty, non-ordinal …
BigSimmo Aug 18, 2026
cba50d8
fix(ward-flow): address Task 6 review round 2 — cover elapsedLabel, f…
BigSimmo Aug 18, 2026
6adab9a
docs(ward-flow): correct ADR 1 and reconcile the glossary with the ph…
BigSimmo Aug 18, 2026
24ddf25
docs(ward-flow): add the durable phase handoff
BigSimmo Aug 18, 2026
787029a
fix(ward-flow): repair whole-branch review defects across Phase 1 mod…
BigSimmo Aug 18, 2026
de7b92f
docs(ward-flow): record the Phase 1 closing state and parked rulings
BigSimmo Aug 18, 2026
8c33cd1
docs(ward-flow): add the Phase 2 plan and the fresh-session kickoff b…
BigSimmo Aug 18, 2026
00a21bc
docs(ward-flow): add the complete context document
BigSimmo Aug 18, 2026
3dbdd5e
feat(ward-flow): define the operational score with no urgency component
BigSimmo Aug 18, 2026
d1b2a3c
style(ward-flow): apply prettier to the ward management console
BigSimmo Aug 18, 2026
f2b98d8
fix(ward-flow): correct the operational score's fraction, transport a…
BigSimmo Aug 18, 2026
ef4e62c
feat(ward-flow): derive per-department pressure from open movements
BigSimmo Aug 18, 2026
992c3e6
fix(ward-flow): make edPressure injectable and close three unfalsifia…
BigSimmo Aug 18, 2026
ec2e594
feat(ward-flow): add the coordinator screen shell and five regions
BigSimmo Aug 18, 2026
015079f
fix(ward-flow): address Task 3 review — lint, broken journeys, overfl…
BigSimmo Aug 18, 2026
d7f5b76
feat(ward-flow): add the emergency department pressure strip
BigSimmo Aug 18, 2026
ae79943
Merge origin/main into codex/ward-management-design
claude Aug 18, 2026
b6452ff
Merge remote-tracking branch 'origin/main' into codex/ward-management…
claude Aug 18, 2026
579461d
Merge branch 'main' into codex/ward-management-design
BigSimmo Aug 18, 2026
e7a43d3
fix: register ward specs in PR shard groups, wire contextual back-nav
claude Aug 18, 2026
2a2ae1e
Merge remote-tracking branch 'origin/codex/ward-management-design' in…
claude Aug 18, 2026
b329e41
Merge branch 'main' into codex/ward-management-design
BigSimmo Aug 18, 2026
dc80137
Merge branch 'main' into codex/ward-management-design
BigSimmo Aug 18, 2026
d5fce2c
fix(ward-management): correct Favourites destination and disable unwi…
claude Aug 18, 2026
69cf6d6
Merge branch 'main' into codex/ward-management-design
BigSimmo Aug 18, 2026
538a238
Merge branch 'main' into codex/ward-management-design
BigSimmo Aug 18, 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
44 changes: 44 additions & 0 deletions design-qa.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
# Ward Flow constellation design QA

## Comparison setup

- Visual target: `C:\Users\joshs\.codex\generated_images\01a00060-be1a-7252-922f-b9dfc7a496b3\exec-c93f388a-175c-463d-89bd-db70dadc014f.png`
- Implementation: `artifacts/ward-management/ward-constellation-final-1440x1024.png`
- Combined source-and-implementation view: `artifacts/ward-management/design-qa-constellation-comparison.png`
- Source dimensions: 1487 x 1058 pixels, normalized to 1440 x 1024 for comparison.
- Implementation viewport: 1440 x 1024 CSS pixels at density 1.
- Compared state: Flow coordinator, WF-204 selected, Fiona Stanley proposed, placement awaiting authorised confirmation.

## Fidelity review

| Surface | Result | Evidence |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Typography | Passed | The graphite hierarchy, tabular operational figures, compact labels, and restrained microcopy preserve the reference's clinical command-centre character with stronger scanning contrast. |
| Spacing and layout | Passed | The slim independent priority queue, central statewide network, and right-hand decision rail keep the reference's three-zone structure. The added local mode strip and role-focus band make the broader system legible without crowding the decision surface. |
| Colour and state | Passed | Clinical blue remains the only structural accent. Green, amber, and red are reserved for capacity and exception meaning and are always reinforced by text, rank, or iconography. |
| Assets and icons | Passed | Existing Clinical KB branding and product iconography are used consistently. The constellation remains a schematic operational view rather than implying geographic precision. |
| Copy and data | Passed | Synthetic identifiers, WA service names, catchment, legal status, setting, wait, transport readiness, and capacity evidence are clear. AI is labelled as a best-fit proposal and requires an authorised human confirmation. |

## Intentional improvements from the source

1. Replaced literal route-line density with four stable service clusters around a statewide coordination hub.
2. Added eight persistent Ward Flow modes so every major operational task is reachable from the same local navigation.
3. Made the priority queue independently scrollable and kept role-based ordering visible rather than hiding it behind controls.
4. Turned the shortlist into an explainable, ranked proposal with catchment, setting, availability, transport, and wait-time evidence.
5. Added a plain-language no-automatic-allocation boundary directly beside the confirmation action.
6. Kept the full constellation as a dedicated wide command view while preserving the denser command home for routine work.

## Functional and responsive evidence

- All eight Ward Flow routes were opened and checked at 1440 x 1024 with no page-level horizontal overflow.
- Flow coordinator, ED clinician, and ward coordinator role changes alter the operational focus and queue order.
- Queue selection, ranked fit review, and authorised confirmation were exercised in the browser.
- The 390 x 844 phone fallback was checked across every mode with no page-level horizontal overflow.
- Fresh browser console on the final constellation route contained no warnings or errors.
- Focused Chromium coverage includes role switching, queue collapse, all mode links, confirmation, phone layout, dark mode, forced colours, and print.

## Final review

The implementation retains the reference's visual intent and decision hierarchy while improving system navigation, privacy signalling, role clarity, and AI governance. No P0, P1, or actionable P2 fidelity issue remains.

final result: passed
70 changes: 45 additions & 25 deletions docs/codebase-index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,31 +67,32 @@ Smaller top-level directories that are easy to miss:

### Product pages (`src/app/`)

| Route | File |
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `/` | `src/app/(search-app)/page.tsx` |
| Shared mode-home route group (`/(search-app)`) | `src/app/(search-app)/` |
| Mode homes (`/services`, `/dsm`, `/documents/…`, …) | `src/app/(search-app)/` shared shell group |
| `/applications` | `src/app/applications/route.ts` |
| `/differentials`, `/diagnoses`, `/presentations`, `/compare` | `src/app/(search-app)/differentials/` |
| `/dsm`, `/dsm/search`, `/dsm/compare`, `/dsm/diagnoses/[slug]` | `src/app/(search-app)/dsm/` |
| `/documents/search`, `/source`, `/evidence`, `/[id]` | `src/app/(search-app)/documents/` |
| `/factsheets`, `/factsheets/search`, `/factsheets/[slug]` | `src/app/(search-app)/factsheets/` |
| `/dictionary`, Search, Browse, Topics, Definition, Compare, Sources | `src/app/(search-app)/dictionary/` |
| `/favourites` | `src/app/(search-app)/favourites/page.tsx` |
| `/forms`, `/forms/[slug]` | `src/app/(search-app)/forms/` |
| `/medications`, `/medications/[slug]` | `src/app/(search-app)/medications/` |
| `/privacy` | `src/app/privacy/page.tsx` → `privacy-quiet-signal-page.tsx` + `privacy-page-content.tsx` |
| `/reference/colour-coding` | `src/app/reference/` |
| `/safety-plan` | `src/app/safety-plan/page.tsx` |
| `/calculators` | `src/app/(search-app)/calculators/page.tsx` |
| `/services`, `/services/[slug]` | `src/app/(search-app)/services/` |
| `/therapy-compass` | `src/app/(search-app)/therapy-compass/` |
| `/tools` | `src/app/(search-app)/tools/` |
| `/specifiers`, `/specifiers/[slug]`, `/specifiers/builder`, `/specifiers/compare`, `/specifiers/map` | `src/app/(search-app)/specifiers/` |
| `/formulation`, `/formulation/[slug]`, `/formulation/builder`, `/formulation/compare`, `/formulation/map` | `src/app/(search-app)/formulation/` |
| `/mockups/*` | `src/app/mockups/` (404 in production) |
| `/auth/callback` | `src/app/auth/callback/route.ts` |
| Route | File |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `/` | `src/app/(search-app)/page.tsx` |
| Shared mode-home route group (`/(search-app)`) | `src/app/(search-app)/` |
| Mode homes (`/services`, `/dsm`, `/documents/…`, …) | `src/app/(search-app)/` shared shell group |
| `/applications` | `src/app/applications/route.ts` |
| `/differentials`, `/diagnoses`, `/presentations`, `/compare` | `src/app/(search-app)/differentials/` |
| `/dsm`, `/dsm/search`, `/dsm/compare`, `/dsm/diagnoses/[slug]` | `src/app/(search-app)/dsm/` |
| `/documents/search`, `/source`, `/evidence`, `/[id]` | `src/app/(search-app)/documents/` |
| `/factsheets`, `/factsheets/search`, `/factsheets/[slug]` | `src/app/(search-app)/factsheets/` |
| `/dictionary`, Search, Browse, Topics, Definition, Compare, Sources | `src/app/(search-app)/dictionary/` |
| `/favourites` | `src/app/(search-app)/favourites/page.tsx` |
| `/forms`, `/forms/[slug]` | `src/app/(search-app)/forms/` |
| `/medications`, `/medications/[slug]` | `src/app/(search-app)/medications/` |
| `/privacy` | `src/app/privacy/page.tsx` → `privacy-quiet-signal-page.tsx` + `privacy-page-content.tsx` |
| `/reference/colour-coding` | `src/app/reference/` |
| `/safety-plan` | `src/app/safety-plan/page.tsx` |
| `/calculators` | `src/app/(search-app)/calculators/page.tsx` |
| `/services`, `/services/[slug]` | `src/app/(search-app)/services/` |
| `/therapy-compass` | `src/app/(search-app)/therapy-compass/` |
| `/tools` | `src/app/(search-app)/tools/` |
| `/specifiers`, `/specifiers/[slug]`, `/specifiers/builder`, `/specifiers/compare`, `/specifiers/map` | `src/app/(search-app)/specifiers/` |
| `/formulation`, `/formulation/[slug]`, `/formulation/builder`, `/formulation/compare`, `/formulation/map` | `src/app/(search-app)/formulation/` |
| `/ward-management`, `/constellation`, `/network`, `/queue`, `/capacity`, `/movements`, `/exceptions`, `/transport`, `/governance`, `/patients/[patientId]` | `src/app/ward-management/` — Ward Flow synthetic patient-flow prototype |
| `/mockups/*` | `src/app/mockups/` (404 in production) |
| `/auth/callback` | `src/app/auth/callback/route.ts` |

### API routes (`src/app/api/`)

Expand DownExpand Up@@ -323,6 +324,25 @@ sequenceDiagram
- Registry modes: services, forms, medications, differentials; Formulation is a local mechanism and structured-draft workspace
- Demo mode: synthetic data when Supabase unavailable (`demo-data.ts`, `isDemoMode()` in `env.ts`)

### Ward Flow (`src/app/ward-management/`, `src/components/ward-management/`)

Synthetic prototype for WA metro psychiatry patient flow: getting a patient from an emergency
department to an inpatient psychiatric bed. Offline and fixture-backed — no provider calls, no
persistence, no patient-identifiable data. Advisory only: the system proposes destinations with
visible reasons and a human confirms or overrides.

- **Design spec:** `docs/superpowers/specs/2026-08-18-ward-flow-metro-patient-flow-design.md`
- **Glossary:** `docs/ward-management-context.md` · **Decisions:** `docs/ward-management-decisions.md`
- **Route/role map:** `docs/ward-management-mode-map.md`
- **Model:** `src/components/ward-management/ward-clock.ts` (the only module that reads the
wall clock), `ward-model.ts` (domain types only), `ward-eligibility.ts` (the eight
placement gates), `ward-sites.ts` (17 sites, 8 emergency departments, 22 units),
`ward-movements.ts` (48 movements, 6 bed releases), `ward-derivations.ts` (shared pure UI
derivations)
- **Surfaces:** `ward-management-console.tsx` (command), `ward-management-modes.tsx` (mode
workspaces), `ward-management-network.tsx` (network diagram), `ward-management-navigation.tsx`
- **Tests:** `tests/ward-management.test.ts`, `tests/ui-ward-management.spec.ts`

### Global search composer placement rules

One shared composer (`master-search-header.tsx`) serves every mode. Placement:
Expand Down
Loading
Loading