Batch 3: shift change and follow-up (items 11, 12, 21, 22, 23, 28; D-136)

Merged
BI
1d ago
+4673-1278

Requested by josh · project thread

Batch 3 of the feature build plan. Synthetic data only. Josh approved the design review page (D-74) and every recommendation on 11 Nov 2026, recorded as D-136 items 4 to 6. Ready, with auto-merge on.

Design review: https://claude.ai/artifact/NeuHK4hVKrCkg5d6AVDXuQ

What changes

  • 11 Night shift on the morning look: the first look of a shift reads from the previous shift's start, in Home Activity (Changes) and in the shift digest. It adds new absent-without-leave and transfer lines, read from recorded times. Bed changes are not included, because there is no stored snapshot. The copied digest keeps no names, UMRNs or ids. The digest stores its last read time in sessionStorage, a time only (D-72).
  • 12 Bed round answers: a Bed round card on the bed meeting agenda ("17 of 22 confirmed", Confirmed HH:MM / Not confirmed), with a Not confirmed filter. The fixed ward order is kept (D-126 guard).
  • 21 Hand over your work: "Your open work" sits at the top of the Handover page once 30 minutes or less of the shift remain (handoverOwnWorkLead, D-136). Hand an item to a role, and the receiver taps Accept. An item always has exactly one owner, and sign-out is never blocked. New events: HAND_OVER_ITEM, ACCEPT_HANDED_ITEM.
  • 22 Community first contact: "Community team first saw them: 12 Nov" beside the discharge follow-up reply. Read-only, with no overdue colour.
  • 23 Carer call back: a new kind of promise due, with a typed "Best after" time and no carer name or number. A call back asked for on a bed request stays the same promise once the person has a stay. New events: RECORD_CARER_CALLBACK, MARK_CARER_CALLBACK_MADE.
  • 28 Returned to ED: "Please review: returned to ED" shows on the taking team's page when a person with an alternative marked Tried returns to ED within 7 days (diversionReturnReview, D-136). It is derived only, with no new record. community/diversion-return-review.ts joins the D-14 allowlist (D-136 item 5).
  • Access: commandScopeRefusal checks callbackId and handedItemId against the desk's own records, like every other record pointer.
  • Rulings: D-136 covers the batch. Shared parts sit at the ward root so screen-to-screen imports stay at 564 (M139).

Known gap (follow-up)

  • In shared mode, item 28 can miss a return. The server sends the community desk a scoped view, and that view drops a later ED request the team cannot see. Closing this needs a server-side projection of the prompt, which is a backend and D-14 boundary change kept out of this batch. The local demo shows the prompt.

Checks

Run locally on b4aaa5f5b (review fixes), all passing:

  • npx vitest run tests/ward-handover-own-work.test.ts tests/ward-role-access.test.ts tests/ward-role-record-id-privacy.test.ts tests/ward-audit-server-scope.test.ts: 147 passed (14 in the batch file, including the two new tests for the review findings).
  • npx vitest run tests/ward-patient-link-default-deny.test.ts tests/ward-inline-form-holds.test.ts: 8 passed.
  • npx vitest run tests/decision-log-integrity.test.ts: 4 passed.
  • node docs/ward-flow/journey/verify.mjs --check: passed. The digests for the four edited sources were refreshed after checking that the edits change only the new events' behaviour.
  • npm run typecheck: passed on the merge with main (81b2b0881). The pre-commit lint and typecheck of the 5 changed files passed on b4aaa5f5b.

Hosted CI:

  • On 305d8d5fc, before the review fixes: every quick check passed (4 unit shards, static checks, production build with the phone limits, backend, coverage).
  • On b4aaa5f5b: the full run is in progress, including the browser, phone and accessibility checks.

Other evidence:

  • Phone limits: seven routes raised by 0.6 to 1.7 KB, within the 5 KB rule. The record is in docs/script-budget-history/2026-11-11-pr1605-batch-3-shift-change.md.
  • Browser: Chromium at 1280 and 400, light and dark, on a local dev server, before the review fixes.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01GxPPxkWmB3aquWnS7ScPRS