Record the Phase 6 and 7 decisions, and the clinician check that comes first - #2412
Conversation
…s first Three documents, no product code. Together they are everything needed to open the Phase 6 and 7 design conversation without re-deriving anything. docs/ward-flow-clinician-check.md - a one-page, plain-English check of the four-stage bed model for a ward clinician. It needs no software knowledge, states the three places the model is most likely wrong (can a bed be confirmed and blocked at once; is "predicted" one state or several; does a bed ever go backwards), and asks for nothing in writing. This is the single most valuable validation available and the only outstanding item that gets more expensive the longer it waits, because Phase 6 is built entirely from these numbers. docs/ward-flow-phase-6-7-decisions.md - the owner's answers to every question that had to be settled first, recorded so they survive the conversation they were given in. The recurring failure in this project is a decision that lived only in chat and was later re-derived or contradicted; PR #2405 exists because of exactly that. Notable: the bed categories are NOT one flat list of eight labels but four dimensions that combine (age, legal status, sex, forensic), which the owner stated explicitly and which materially changes the data model. Two readings are recorded as assumed and flagged as still open rather than quietly adopted. docs/ward-flow-phase-6-7-kickoff-prompt.md - the paste-in prompt for a fresh session, following the Phase 5 kickoff pattern that worked. It states the constraints inline so they bind before any linked document is read, and it explicitly forbids writing product code, because this is a design conversation producing two specifications. The permitted referral fields are age band, sex, and whether a secure bed is needed - nothing else. Voluntary/Involuntary is admitted as a plain label only; the absolute prohibition on any Mental Health Act figure, timeframe, threshold or duration is restated in all three documents and is unchanged. Verified: docs:check-index "all 62 repository roots/modules/routes and all schema tables are indexed"; docs:check-inventory "278 script files, 280 npm scripts"; docs:check-links "3778 repo path references resolve"; sitemap:check exit 0; check:repo-awareness-snapshot "in step (195 pages, 479 documents, 2630 reviews)"; prettier --check clean on every changed file; and a grep sweep of all three new documents for legal-figure patterns returned nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 97 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (1)
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_cceba955-2003-4508-b0db-20942068f01d) |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
…ndesignated The owner answered both open readings on 2026-08-27, and one of them was recorded wrongly here. Forensic: CONFIRMED as assumed. It is a fourth independent dimension and combines with the other three, so an "Adult, Involuntary, Male-only, Forensic" bed is expressible. It does not stand alone or replace the others. Sex designation: CORRECTED. The earlier assumption said every bed is designated female or male. It is the other way round - most beds are undesignated, and only some are female-only or male-only. Undesignated is the normal case and must be the default, not an exceptional value bolted on. That correction carries a trap worth stating plainly, so both documents now state it: sex designation is a constraint on who may occupy a bed, NOT an attribute to compare for equality. A matching rule of the form "bed sex equals patient sex" would exclude every referral from every undesignated bed, which is the majority of them, and would break matching almost entirely. The rule is "does this bed accept this person". It is also why sex is one of the three permitted referral fields: without it a referral cannot be tested against a designated bed at all. Both readings move out of "Still open", which now contains only whatever the clinician check returns. This is exactly why the two readings were written down as assumptions rather than folded silently into a specification - one of them was wrong, and it was found in a minute rather than after Phase 7 was built on it. Verified: docs:check-links "3778 repo path references resolve"; check:repo-awareness-snapshot "in step (195 pages, 479 documents, 2630 reviews)"; prettier --check clean on both changed files; legal-figure grep sweep of both documents returned nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Summary
Three documents, no product code. Together they are everything needed to open the Phase 6 and 7 design conversation without re-deriving anything already settled.
docs/ward-flow-clinician-check.md— a one-page, plain-English check of the four-stage bed model, written for a ward clinician with no software knowledge. It names the three places the model is most likely wrong (can a bed be confirmed and blocked at once; is "predicted" one state or several; does a bed ever go backwards), and asks for nothing in writing. This is the single most valuable validation available, and the only outstanding item that gets more expensive the longer it waits — Phase 6 is built entirely from these numbers and Phase 7 builds further on top.docs/ward-flow-phase-6-7-decisions.md— the product owner's answers to every question that had to be settled first, recorded so they survive the conversation they were given in. The recurring failure in this project is a decision that lived only in chat and was later re-derived or contradicted; #2405 exists because of exactly that.Worth a reviewer's attention: the bed categories are not one flat list of eight labels. The owner stated explicitly that the legal-status pair cuts across the age categories, so a bed is a combination — an Adult, Involuntary, Male bed — across four dimensions (age, legal status, sex, forensic). That materially changes the data model, and reading the list flat would have produced the wrong one. Two further readings are recorded as assumed and still open rather than quietly adopted: whether Forensic is a fourth independent dimension, and whether every bed is sex-designated.
docs/ward-flow-phase-6-7-kickoff-prompt.md— the paste-in prompt for a fresh session, following the Phase 5 kickoff pattern that worked. Constraints are stated inline so they bind before any linked document is read, and it explicitly forbids writing product code, because this is a design conversation producing two specifications.On clinical safety: the permitted referral fields are age band, sex, and whether a secure bed is needed — nothing else. Voluntary/Involuntary is admitted as a plain label only. The absolute prohibition on any Mental Health Act figure, timeframe, threshold or duration is restated in all three documents and is unchanged by anything here.
Verification
Verification run. Results below, each quoted from the gate.
npm run docs:check-index— "all 62 repository roots/modules/routes and all schema tables are indexed."npm run docs:check-inventory— "Docs inventory current: 278 script files, 280 npm scripts."npm run docs:check-links— "docs link check passed: 3778 repo path references resolve."npm run sitemap:check— exit 0.npm run check:repo-awareness-snapshot— "in step with data/repo-awareness-snapshot.json (195 pages, 479 documents, 2630 reviews)". The snapshot was regenerated bynpm run snapshot:repo-awareness, never hand-edited; it initially refused because the new documents were unstaged, which is that gate working as designed.npx prettier --checkon every changed file — "All matched files use Prettier code style!"A grep sweep of all three new documents for legal-figure patterns (section numbers, hour/day/week durations, "within N", form numbers) returned nothing.
No gate was skipped, no assertion deleted, no test loosened, no tolerance lowered. No provider-backed gate was run.
Risk and rollout
Risk: low — documentation only; no runtime code, configuration, schema or product surface is touched, so no user-facing behaviour can change.
Rollback: revert the single commit.
Clinical Governance Preflight
Completed because
scripts/pr-policy.mjsclassifies this change asclinicalRisk: true. The trigger is the single pathdata/repo-awareness-snapshot.json, a generated index of the repository's own documents. The section is completed in full rather than waved away, because the classifier's judgement is what governs the merge.Clinical KB Database(sjrfecxgysukkwxsowpy)Each holds: this PR adds three documents and regenerates a document index. No ingestion, answer-generation, retrieval, ranking, source-rendering, document-access, privacy or production-environment code is touched; no Supabase configuration changes; no key handling changes; and no clinical decision-support behaviour changes, so the SaMD classification is unaffected. The clinician-check page carries an explicit footer stating that it describes a prototype for thinking with, is not clinical decision support, contains no real patient information, and makes no statement about any legal requirement.
Notes
Note
Low Risk
Documentation and generated repo index only; no runtime, schema, or clinical decision-support behavior changes.
Overview
Adds three Ward Flow documents (no product code) so Phase 6 and 7 design can start without re-deriving settled choices or losing chat-only decisions.
ward-flow-clinician-check.mdis a one-page ward-facing sanity check of the four-stage bed-free model (Predicted → Confirmed → Blocked → Released), highlighting the three likeliest mismatches with reality and sequencing it before further build.ward-flow-phase-6-7-decisions.mdrecords owner answers for the morning coordinator page (Phase 6) and referral “front door” (Phase 7): headline “beds available now,” fixed morning snapshot with live drill-down, minimal synthetic referral fields, multi-dimensional bed categories (not a flat label list), coordinator accept/decline/queue outcomes, and explicit Mental Health Act figure prohibitions with Voluntary/Involuntary labels allowed.ward-flow-phase-6-7-kickoff-prompt.mdis a paste-in design-session prompt (specs only, no implementation) with inline constraints and read order.docs/README.mdindexes the three files;data/repo-awareness-snapshot.jsonis regenerated to catalogue them (document counts 476→479, catalogued 103→106).Reviewed by Cursor Bugbot for commit aad9b04. Configure here.