Skip to content

Record the Phase 6 and 7 decisions, and the clinician check that comes first - #2412

Merged
BigSimmo merged 2 commits into
mainfrom
claude/ward-flow-phase-6-7-kickoff
Aug 27, 2026
Merged

Record the Phase 6 and 7 decisions, and the clinician check that comes first#2412
BigSimmo merged 2 commits into
mainfrom
claude/ward-flow-phase-6-7-kickoff

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Aug 27, 2026

Copy link
Copy Markdown
Owner

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 by npm 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 --check on 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.mjs classifies this change as clinicalRisk: true. The trigger is the single path data/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.

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

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

  • The two open readings of the bed-category model are deliberately left unresolved and are listed under "Still open" in the decisions document, rather than being settled by assumption inside a specification where they would be harder to find.

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.md is 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.md records 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.md is a paste-in design-session prompt (specs only, no implementation) with inline constraints and read order.

docs/README.md indexes the three files; data/repo-awareness-snapshot.json is regenerated to catalogue them (document counts 476→479, catalogued 103→106).

Reviewed by Cursor Bugbot for commit aad9b04. Configure here.

…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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitaiBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 11 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 346f3e90-9297-4ead-848d-0c1d8d83ed63

📥 Commits

Reviewing files that changed from the base of the PR and between 5d848e0 and 4a7bb3a.

⛔ Files ignored due to path filters (4)
  • docs/README.md is excluded by !docs/**, !**/*.md
  • docs/ward-flow-clinician-check.md is excluded by !docs/**, !**/*.md
  • docs/ward-flow-phase-6-7-decisions.md is excluded by !docs/**, !**/*.md
  • docs/ward-flow-phase-6-7-kickoff-prompt.md is excluded by !docs/**, !**/*.md
📒 Files selected for processing (1)
  • data/repo-awareness-snapshot.json

Comment @coderabbitai help to get the list of available commands.

@cursor

cursorBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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)

@supabase

supabaseBot commented Aug 27, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

…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>
@BigSimmo
BigSimmo merged commit f924650 into mainAug 27, 2026
29 checks passed
@BigSimmo
BigSimmo deleted the claude/ward-flow-phase-6-7-kickoff branch August 27, 2026 05:52
BigSimmo pushed a commit that referenced this pull request Aug 27, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@BigSimmo