Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
daab244
Record D-134: ward arrival and beds batch rulings
claude Nov 10, 2026
54bc7ef
Plan staffing for an arrival on the ward's incoming card (D-117 item 3)
claude Nov 10, 2026
347abd0
Merge branch 'feat/arrival-staffing-prompt' into claude/project-threa…
claude Nov 10, 2026
17226f3
WIP: overnight intake window (feature item 13)
claude Nov 10, 2026
e9dd7ef
Add a review time to single bed closures (item 6)
claude Nov 10, 2026
3bcaec2
Merge commit 'e9dd7efb' into claude/project-thread-03eds3
claude Nov 10, 2026
21df5db
Add item 18: Left the ward, waiting for transport
claude Nov 10, 2026
404873b
Merge commit '21df5db2' into claude/project-thread-03eds3
claude Nov 10, 2026
b9cb589
Overnight intake window: hero placement, sweeps and tests (feature it…
claude Nov 10, 2026
f4e31ee
Merge commit 'b9cb589e' into claude/project-thread-03eds3
claude Nov 10, 2026
34ca919
Fold Left the ward into They have left, and pad the intake windows card
claude Nov 10, 2026
f7e8e52
Ask "Has their transport come?" in the kit field style
claude Nov 10, 2026
cad0251
Place Waiting for transport under Before handover instead of on top o…
claude Nov 10, 2026
8f66a0d
Show a closed bed's review time on its ward tile
claude Nov 10, 2026
0707648
Ward arrival and beds batch: suite fixes
claude Nov 10, 2026
05e1bdd
Record Josh's approval, the ED advocate line and item 4 wording (D-13…
claude Nov 11, 2026
0501256
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
09d4e0e
Mark D-133 as claimed by open PR #1606
claude Nov 11, 2026
2609a59
Fix static checks: journey reviews, line caps
claude Nov 11, 2026
cfa9895
Load the intake hours editor on demand and raise phone limits within …
claude Nov 11, 2026
9d28c4c
Keep screen-to-screen imports at 564 and use kit parts
claude Nov 11, 2026
0556101
Record Josh's sign-off of the held items and the legal wording allowa…
claude Nov 11, 2026
171ca08
Give the intake hours refusal a next step and refresh the M101 inventory
claude Nov 11, 2026
47b0ead
Merge main into ward arrival and beds batch
claude Nov 11, 2026
21120ba
Format regenerated journey and error inventory files
claude Nov 11, 2026
5988e5c
Ask about pending transport from the bed drawer too, and set phone li…
claude Nov 11, 2026
0663e37
Keep the visible text in the closed bed review link's name
claude Nov 11, 2026
03b30a7
Merge main into ward arrival and beds batch
claude Nov 11, 2026
4088197
Merge main into claude/project-thread-03eds3
claude Nov 11, 2026
606168e
Merge main into claude/project-thread-03eds3
claude Nov 11, 2026
b718abb
Merge main into ward arrival and beds batch
claude Nov 11, 2026
e8b3261
Format the regenerated journey files
claude Nov 11, 2026
40471ea
Merge main (with #1609) into Batch 2
claude Nov 11, 2026
fcaae24
Always cover Collected in the engine fuzz run
claude Nov 11, 2026
8893ba5
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
a36170f
Merge main (with #1605 batch 3) into ward arrival and beds batch
claude Nov 11, 2026
1a40423
Keep the provider and storage fence under the 1500-line cap after the…
claude Nov 11, 2026
1fda9f2
Merge main (with #1615) into ward arrival and beds batch
claude Nov 11, 2026
b7f6d6b
Format the re-recorded storage verdicts fixture
claude Nov 11, 2026
a1dc464
Merge main (#1607, #1628) into Batch 2
claude Nov 11, 2026
c42db5c
Keep the ward board under 1500 lines after merging main
claude Nov 11, 2026
145e4ea
Refresh the journey digests for the moved ward board lines
claude Nov 11, 2026
1fb5f48
Raise the referrals phone limit to 590.8 KB after merging main
claude Nov 11, 2026
9fedfa8
Merge main (#1603 batch 4) into Batch 2
claude Nov 11, 2026
ab7eabf
Keep the shift-change drill inside the 12-hour sign-in limit
claude Nov 11, 2026
30d46fe
Merge main (#1624 performance audit) into Batch 2
claude Nov 11, 2026
c16105b
Raise the expected-reds file floor to 1400
claude Nov 11, 2026
dcacdb5
Merge main (#1629 shared-mode ED returns) into Batch 2
claude Nov 11, 2026
8cb4851
Draw Home's since line and Beds that fit in Home's first frame
claude Nov 11, 2026
9e7516f
Hold Home's columns until its two early cards arrive
claude Nov 11, 2026
e6ad3e7
Keep the Home cards wait constant private (knip)
claude Nov 11, 2026
03316aa
Answer CodeRabbit's review of the ward arrival and beds batch
claude Nov 11, 2026
66426eb
Name the Home cards wait as a loading pause in the invented-figures c…
claude Nov 11, 2026
412a3f5
Tell the person what to do when intake hours are not saved
claude Nov 11, 2026
f9f98d3
Answer CodeRabbit's second review of the ward arrival and beds batch
claude Nov 11, 2026
10e27f8
Let browser setup go on when the runner's apt mirror is unreachable
claude Nov 11, 2026
6d3db1d
Pass the launch probe its inputs as arguments, not built code (CodeQL)
claude Nov 11, 2026
df22272
Take out the browser setup fallback
claude Nov 11, 2026
85558d8
Move the Going to drop-down allowance with its field
claude Nov 11, 2026
22aef8a
Bring in the offline browser setup from #1631
claude Nov 11, 2026
179c078
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
0611e35
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
b6c43a9
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 11 Nov 2026, Ward arrival and beds batch (PR #1608)

Changed on top of `main` at `5b08a5e`. Each raise is under 5 KB, within the per-screen allowance in HOW-WE-WORK section 6:

| Screen | Old | New | Raise |
| --------------------------------------- | ----- | ----- | ----- |
| Home `/ward-flow` | 575.4 | 577.9 | 2.5 |
| Referrals `/ward-flow/referrals` | 583.6 | 586.3 | 2.7 |
| ED `/ward-flow/ed` | 535.4 | 537.6 | 2.2 |
| Ward `/ward-flow/ward/rph-adult-secure` | 613.8 | 617.2 | 3.4 |
| Movement `/ward-flow/movements/WF-001` | 609.8 | 612.4 | 2.6 |
| Capacity `/ward-flow/capacity` | 654.3 | 658.2 | 3.9 |
| ED desk `/ward-flow/ed/arm-ed` | 667.4 | 672.2 | 4.8 |
| Bed meeting `/ward-flow/bed-meeting` | 592.2 | 593.0 | 0.8 |
| Statistics `/ward-flow/statistics` | 632.6 | 634.9 | 2.3 |

Measured by hosted CI on the PR head after merging `main` at `5b08a5e`: home 577.5, referrals 585.9, ed 537.2, ward 616.8, movement 612.0, capacity 657.8, ed desk 671.8, bed meeting 592.6, statistics 634.5. Each limit is the measurement plus 0.4.

Why it changed: items 6, 7, 13 and 18 add two events (`SET_INTAKE_WINDOW`, `MARK_TRANSPORT_COLLECTED`), the bed closure review time and the transport wait to the shared engine, storage checks and history words that every screen loads (about 1.5 to 2 KB). Capacity also carries the two new cards, and the ward screen the intake line and arrival staffing note.

Trim tried: the ward hero's intake hours editor now loads as its own chunk when Edit is first pressed (`ward-intake-window-dialog.tsx`), which took the ward screen from 618.5 to 615.7 KB. The engine additions are the smallest that record and check the new facts. No other safe trim was found.

After merging `main` at `35c7ccd`, which raised five of these screens by 0.3 to 0.4 KB, each limit is main's new limit plus this PR's same raise. No raise grew.

After merging `main` at `f0db2be`, which includes #1609 and raised these screens again, each limit is main's new limit plus this PR's same raise. No raise grew.

After merging `main` at `daacf21` (#1607 and #1628), each limit is again main's new limit plus this PR's same raise. No raise grew.

Hosted CI on `145e4ea` measured referrals at 590.4 KB merged with `main` at `daacf21`, over its 589.6 limit. Main's own build failed in the gate, so it could not say whose growth it was. Referrals is now 590.8 (measurement plus 0.4), a raise of 3.9 KB over main's 586.9. That is within the 5 KB a PR may raise a screen. Trim tried: none safe beyond the earlier lazy intake dialog.

After merging `main` at `30abc7a` (#1603), each limit is again main's new limit plus this PR's raise (referrals 3.9).

After merging `main` at `e5a8191` (#1624), each limit is again main's new limit plus this PR's same raise. No raise grew.
586 changes: 294 additions & 292 deletions docs/ward-flow/OWNER-RULINGS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ward-flow/backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Old lists that may still hold open work. Check each item against source before a

Agreed by Josh or required by a decision, with no build or check yet.

- Ward risk flags on bed requests backed by a full referral: the request card receives no referral data today, so it shows no flags. The ward can still open the full referral (D-79). Separate work (D-117 item 3). ([decisions.md](decisions.md#d-117-care-plans-follow-up-frequent-presenter-count-tribunal-date-and-ward-flags-10-november-2026))
- Clinical values still synthetic (six added since D-63, four more under D-106) need a sourced value and Josh's signature. ([clinical-values.md](clinical-values.md))
- Review the per-client sign-in limits before any real user signs in (D-97 item 6, WF-B008). ([decisions.md](decisions.md#d-97-owner-answers-on-seven-open-items-n21-n25-n26-n29-n40-n41-and-wf-b008-8-november-2026))
- Desk walk, part 2: Patient, movement and referral detail pages, break glass, cover, the phone layout and the shared signed-in server. ([desk walk](evidence/desk-walk-2026-11-08.md))
Expand All @@ -60,6 +59,7 @@ Agreed by Josh or required by a decision, with no build or check yet.
- Documentation and working-rules audit (D-107, #1555) and clinical values audit (D-106, #1556).
- Legal times kept as typed with no countdowns (D-93), and the outage copy stays print or saved file only (D-72); ED long-wait next steps worded (D-108, #1560).
- Q383 (check the Railway front-door settings before #1345 merged): not kept as open work; #1345 merged.
- Ward risk flags on bed requests (D-117 item 3): the ward's request card now reads the referrals sent to that ward (its inbox, FD-23), and shows "Plan staffing for this arrival" when the referral records aggression or absconding. Movement and referral only, never the patient record (R-2026-09-04-A). ([decisions.md](decisions.md#d-117-care-plans-follow-up-frequent-presenter-count-tribunal-date-and-ward-flags-10-november-2026))
- Q384 done: `Ward Flow hold` has been a required check in the "Protections" ruleset since 3 November, so the `hold` label blocks merges (audit A8-08). ([design handover](../design/handover/README.md#q382-to-q389-threads-started-3-november-2026))

Merged into `main` in the last two weeks (26 October to 9 November 2026).
Expand Down
2 changes: 2 additions & 0 deletions docs/ward-flow/code-map/engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ fails when a `ward-flow-*-events.ts` file is missing from this list.
| `ward-flow-bed-events.ts` | `reduceBedEvent` | bed releases, leave beds, capacity checks, discharge barriers and criteria, `PLACE_IN_BED` |
| `ward-flow-bed-meeting-events.ts` | `reduceBedMeetingEvent` | `RECORD_BED_MEETING_ACTION`, `COMPLETE_BED_MEETING_ACTION` |
| `ward-flow-diagnosis-events.ts` | `reduceWardDiagnosis` | `RECORD_WARD_DIAGNOSIS` |
| `ward-flow-intake-window-events.ts` | `reduceIntakeWindowEvent` | `SET_INTAKE_WINDOW` (tonight's intake window for one ward, 10 Nov 2026) |
| `ward-flow-loop-check-events.ts` | `reduceLoopCheckEvent` | acceptance conditions, cancelled-move checks, closure transition items, restriction reviews |
| `ward-flow-observation-events.ts` | `reduceObservationLevelEvent` | `RECORD_OBSERVATION_LEVEL` |
| `ward-flow-overridable-events.ts` | none (type only) | `OverridableWardFlowEvent`: the four events a recorded reason can get past (moved out of `ward-flow-events.ts`) |
| `ward-flow-pilot-control-events.ts` | `reducePilotControlEvent` | `SET_SITE_FEATURE_SWITCH`, `RECORD_DOWNTIME_PACK_PRINTED`, `RECORD_OUTAGE_WINDOW` (Batch 4, 10 Nov 2026) |
| `ward-flow-placement-events.ts` | `reducePlacementEvent` | `PULL_PATIENT`, `RELEASE_PULL`, `RELEASE_HELD_BED`, `RELEASE_DIVERTED_BED`, `RELEASE_AND_REOPEN_SEARCH`, `STEP_BACK_STAGE` |
| `ward-flow-protected-record-events.ts` | `reduceProtectedRecordEvent` | the protected record path: discharge records, audit reviews and their undo, discharge, follow-up and admission care |
Expand Down
26 changes: 25 additions & 1 deletion docs/ward-flow/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ Checked 9 November 2026 (D-107 audit). "Partly replaced" means part of the entry
| [D-130](#d-130-audit-follow-ups-every-remaining-recommendation-approved-10-november-2026) | Audit follow-ups: every remaining recommendation approved | Active |
| [D-131](#d-131-hard-case-demo-data-allowed-and-the-movement-diagram-follows-the-engine-10-november-2026) | Hard-case demo data allowed, and the movement diagram follows the engine | Active |
| [D-132](#d-132-audit-fixes-group-1-docs-and-ci-guards-10-november-2026) | Audit fixes group 1: docs and CI guards; Claude-authored sensitive changes warn | Active |
| [D-134](#d-134-ward-arrival-and-beds-batch-how-to-hold-advocate-line-night-list-and-the-feature-freeze-10-november-2026) | Ward arrival and beds batch: held split, advocate line, night list, feature freeze | Active |
| [D-135](#d-135-batch-4-outages-and-pilot-control-pack-age-and-plan-answers-10-november-2026) | Batch 4, outages and pilot control: pack age and plan answers | Active |
| [D-136](#d-136-feature-batch-3-shift-change-and-follow-up-two-signed-values-10-november-2026) | Feature batch 3: two signed values (7-day diversion return, 30-minute handover list) | Active |
| [D-137](#d-137-feature-build-batch-5-count-leak-first-tv-change-mark-and-qr-library-10-november-2026) | Feature build batch 5: count leak first, TV change mark 15 minutes, QR library | Active |
Expand Down Expand Up @@ -1705,6 +1706,29 @@ is inferred.
- **Why:** these were the confirmed, low-risk audit findings; failing agent commits now would block almost every engine or legal PR, because no approval route exists yet.
- **Boundary:** synthetic data only. No clinical rule, signed value or release changes. D-82 (5 KB phone limit raises) and D-107 (no merge queue) stand.

## D-134. Ward arrival and beds batch: how to hold, advocate line, night list and the feature freeze (10 November 2026)

- **Date:** 10 November 2026, about 1:02 AM to 1:08 AM AWST on 11 November (17:02 to 17:08 UTC on 10 November). **Decided by:** Josh, on two decision cards in the Ward Flow project thread "Build ward arrival and bed features", then "Yes to all recommendations please" to the thread's numbered questions. Numbered D-134 because the numbers before it were taken first. D-133 is claimed by open PR #1606.
- **Decision:**
1. **Held split:** items 6 (bed closure review time), 7 (plan staffing for an arrival), 13 (overnight intake window) and 18 (left the ward, waiting for transport) go in one PR that may merge once green. Items 4 (young person on an adult ward) and 15 (interpreter, Aboriginal liaison and advocate lines at arrival) go in a second PR with the `hold` label until Josh signs them off.
2. **Advocate line (item 15):** "Mental Health Advocacy Service told" shows on the arrival checklist for every patient the app already treats as detained, the same group the existing support and advocacy notification checklist covers, and reuses that record.
3. **Item 4:** nothing is built until Josh gives the legal duty and the exact notice wording.
4. **Night list (item 13):** a "Tonight's intake windows" card on the Capacity page, beside "Closed beds past review", in the neutral service-then-name order (D-126).
5. **Feature freeze:** Josh's instruction to begin the feature batches replaces D-128 item 9 for the 27 items he chose on 10 November. Other features stay frozen until #1564 to #1577 close.
6. **Design review first:** Josh approves the batch's design review page before its PR is opened (D-74, D-107).
- **Addendum, 11 November 2026, about 10:19 AM AWST (02:19 UTC):** Josh wrote "Go ahead with all recommendations now for me" in the project thread "Perfect the ranked feature list", and the same words two minutes later in this batch's thread "Build ward arrival and bed features". They answer this batch's two open cards with their recommended options, and the item 4 design that thread drew:

7. **Design approval:** the review page for items 6, 7, 13 and 18 is approved as drawn (version 3: "Has their transport come?" is two buttons, not a drop-down).
8. **ED may record the advocate line (item 15):** ED can record "Mental Health Advocacy Service told" on an accepted move of a detained patient before arrival. The ward sees it and can change it after arrival. It uses the one existing advocacy record.
9. **Item 4 wording and behaviour (replaces item 3):** the patient card of a patient under 18 on a ward that is not a youth ward shows "Under 18 on an adult ward. Check the Mental Health Act 2014 requirements for a child on an adult ward, including notifying the Chief Psychiatrist." It shows automatically from the date of birth and the ward type. It has one optional typed field, "Chief Psychiatrist notified at", never pre-filled (D-93). Once a time is entered it stays visible but goes quiet. It goes away at 18 or on a move to a youth ward. It never blocks a bed offer and never pre-selects anything. It quotes no section number or time limit, because neither has been verified. It stays in the held PR.

- **Addendum, 11 November 2026, about 11:05 to 11:24 AM AWST (03:05 to 03:24 UTC):** Josh wrote "I approve all your recommendations" in this batch's thread, then "I sign off on everything here" to the project's PR summary, which listed the held PR #1609 as waiting on his sign-off.

10. **Held items signed off:** items 4 and 15 (#1609) are signed off, so its `hold` label comes off and it may merge once green.
11. **Legal wording check:** the legal language check lets through only his exact item 4 sentence ("check the Mental Health Act 2014 requirements for a child on an adult ward"). It tells staff to check the Act rather than claiming authority. "2014" stays in the notice.

- **Boundary:** synthetic data only. Information and prompts only: nothing ranks or recommends a ward or bed (D-71), and no clinical value changes. Approves no merge or release.

## D-135. Batch 4, outages and pilot control: pack age and plan answers (10 November 2026)

- **Date:** 10 November 2026 (`2026-11-10`). **Decided by:** Josh, choosing "Older than 24 hours" on a decision card in the Batch 4 thread (17:04 UTC), and saying "Go ahead with all your recommendations" for the feature build plan in the project chat (17:04 UTC). D-132 is claimed by open PR #1601. D-133 is claimed by open PR #1606 (Batch 1). D-134 is claimed by open PR #1608 (Batch 2).
Expand Down Expand Up @@ -1744,7 +1768,7 @@ is inferred.

## D-138. Phone alert urgency by kind (10 November 2026)

- **Date:** 10 November 2026 (`2026-11-10`). **Decided by:** Josh, picking item 23 of the audit fix build plan (Ward Flow project thread "Fix audit app and backend issues", audit fix group 2), which counts as his yes to audit decision 20. Numbered D-138 because D-132 to D-137 belong to other threads. D-133 is claimed by open PR #1606. D-134 is claimed by open PR #1608, and D-135 is claimed by open PR #1603, and D-136 is claimed by open PR #1605, and D-137 is claimed by open PR #1607. On 11 November 2026 Josh told every thread to go ahead with its recommendations, which approved the Settings line as drawn in the design review.
- **Date:** 10 November 2026 (`2026-11-10`). **Decided by:** Josh, picking item 23 of the audit fix build plan (Ward Flow project thread "Fix audit app and backend issues", audit fix group 2), which counts as his yes to audit decision 20. Numbered D-138 because D-132 to D-137 belong to other threads. D-133 is claimed by open PR #1606. D-135 is claimed by open PR #1603, and D-136 is claimed by open PR #1605, and D-137 is claimed by open PR #1607. On 11 November 2026 Josh told every thread to go ahead with its recommendations, which approved the Settings line as drawn in the design review.
- **Decision:** act-now phone alerts stay high urgency and buzz again when replaced. Jobs and team alerts go out at normal urgency and replace their earlier alert quietly. Settings shows when this device last received an alert, from the time only (never the alert's words).
- **Boundary:** synthetic data only. Changes no signed clinical value or clinical rule, and approves no merge or release.

Expand Down
Loading
Loading