Implementation plan / Session plan
Session Plan¶
The work of the vertical slices cut into sessions. A session is one AI agent session: one agent starts with an empty context, reads what its card lists, does one bounded piece of work, proves it with a check, writes a handover and stops. The slice plan says what is released and in what order; this plan says what each agent session is given and what it must leave behind.
There are 338 sessions: 7 foundation sessions and 331 across the 30 slices (33 contract, 127 build, 64 screens, 29 integrate, 9 readiness, 33 gate evidence, 36 fix). Every functional requirement (304) and every screen (146) is in exactly one session.
Order is expressed as "after", as in the slice plan. No durations are implied, and the number of sessions is not a measure of effort.
1. How a slice is cut into sessions¶
Every slice is cut the same way, so that an agent meeting any card knows where it stands.
flowchart LR
PC(["Earlier slice:<br/>contracts"]) -.-> C
PI(["Earlier slice:<br/>scenario passes"]) -.-> I
PG(["Earlier slice:<br/>gate evidence"]) -.-> G
C["Contract<br/>contracts, stubs,<br/>failing scenario test"] --> B1["Build<br/>module A"]
C --> B2["Build<br/>module B"]
B1 --> B3["Build<br/>unit A, part 2"]
B2 --> B4["Build<br/>unit C, which needs A"]
B3 --> B4
C --> U["Screens<br/>against the stubs"]
B4 --> I["Integrate<br/>scenario passes"]
U --> I
I --> R["Readiness<br/>Tier 1 only"]
R --> G["Gate evidence<br/>fresh session"]
G -->|failures| X["Fix"]
X --> G2["Gate evidence<br/>next round"]
G -->|no failures| H(["Owner signs<br/>the slice gate"])
G2 --> H
In the diagram, B1 to B4 are build sessions on deployable units A, B and C. A dotted arrow comes from a slice this one comes after.
| Kind | Applies to | What the session does | Leaves behind | Ends when |
|---|---|---|---|---|
| Contract | Every slice | Fixes what the slice exposes before any of it is built: the API and event contracts each domain in the slice offers, a stub for every upstream module the slice needs but does not build, and the end-to-end scenario as an automated test that fails. Fields follow architecture section 6.6: the shared type library, the attributes of section 7.3 where listed, and for any entity section 7.3 does not detail, its attributes written into section 7.3 of the owning specification in the same pull request. | Contract files, stubs, the failing scenario test, the section 7.3 additions, and a list of the contract points each build session must meet. | Contracts pass the compatibility check; every contract field traces to a requirement, a business rule or a section 7.3 attribute; stubs run in the integration environment; the scenario test runs and fails only because the behaviour is not built. |
| Build | Every slice | Implements the listed requirements of one module behind the contracts: domain logic, persistence, events, authorization, audit, and the tests of section 15.2 that trace to them. | Service code and migrations, unit and contract tests tagged with requirement and test identifiers. | Every acceptance criterion of the listed requirements has a passing test; the listed test scenarios pass; the contract tests pass; the change touches only the files of its deployable unit, plus its contract tests and migrations. |
| Screens | Every slice; each screen has a folder of its own, so screen sessions have no order between them | Builds the listed screens in the application shell from their briefs, against the contracts and their stubs, side by side with the build sessions. | Screen code in the folder of each screen in the domain workspace, component tests, accessibility checks. | Each screen meets its brief and the clinical UX safety rules; component and accessibility checks pass; the screen works against the stubs of the contracts; the change touches only the folders of its screens. |
| Integrate | Every slice | Joins the build and screen sessions of the slice: replaces stubs with the built services, for the screens as well, runs the end-to-end scenario with its failure branches, and repairs what breaks between domains. | A passing scenario test, the interface checks of the slice (acknowledgement, error handling, replay, reconciliation, monitoring), and a list of defects fixed. | The scenario passes from first step to last, through the screens and the built services, with no manual repair; the scenarios of the slices this one comes after still pass. |
| Readiness | Tier 1 slices | Drafts what the slice needs to carry patients safely, which no build session produces: the downtime procedure and restoration reconciliation for each workflow of the slice, runbook entries for its alerts and recovery, the operational readiness items its gate lists, and the safety scenario reports the gate asks for (identity, critical result, medication, as applicable). | Draft downtime procedures and runbook entries, the readiness items with their evidence, the safety scenario reports, and a draft traceability matrix of the slice. | Every readiness item and gate criterion of the slice that needs a document has one, reviewed by the service owner and ready for the departments to rehearse. |
| Gate evidence | Every slice; run again after each round of fixes | Run by a session that wrote none of the slice. Runs the slice gate, collects the evidence in the form PRS section 17.3 requires, and reports what fails. It does not fix: a failure returns to the session that owns it. | The evidence record of the slice gate and a pass or fail report against each "done when" line of the slice. | Every "done when" line of the slice has evidence or a recorded failure. Each failure is filed as a fix issue against the session that owns it (session plan, section 3). The gate itself is passed by the owner who signs it, not by the session. |
| Fix | When a gate records a failure | Repairs one failure a gate evidence session recorded, in the work of the session that owns it. Finished sessions are not reopened; the fix is a session of its own. | The repair, a test that fails before it and passes after, and a note in the handover of what the gate line now shows. | The failed gate line's check passes; the tests of the owning session and of the slice scenario still pass. |
- Build sessions are cut by deployable unit (35 units, from architecture section 5.2; each Domain 2 module is a platform unit of its own). The slice's requirements in one unit are packed into sessions of at most 4, module by module, and a larger module is split evenly. Sessions on one unit follow one another, within a slice and from one slice to the next, so no two sessions running side by side change the same codebase. A session also comes after the session that builds an upstream module its requirements name, where that module is in the slice; otherwise units are built side by side behind the contracts.
- Builds on. 33 build sessions extend a module that an earlier slice started. Their card names the earlier sessions, and the agent reads their handovers first.
- Screen sessions take the screens first released in the slice, by domain, at most 3 per session. They start once the contracts are fixed and work against the stubs, side by side with the build sessions; the integrate session runs them against the built services. Each screen has a folder of its own in the domain workspace and registers itself with the shell from there, so screen sessions have no order between them, in one domain or across slices.
- Readiness sessions come in the 9 Tier 1 slices, between integration and the gate. They draft the downtime procedure, runbooks and readiness evidence the gate asks for (ACC-007), which no build session produces; people then rehearse and approve them.
- Fix sessions. A gate evidence session does not fix. It files each failure as a fix issue against the session that owns the work (section 3). The build adds a fix session for each row, and a further gate evidence session for each round. Finished sessions are never reopened, and the gate sessions of the next slices come after the last gate round.
- Slices overlap. A slice does not wait for the slices it comes after to pass their gates. Its first session comes after the session that fixes the contracts of each of those slices, so it builds against their contracts and stubs while they are still being built. Its integrate session comes after theirs, since its scenario runs on their built services, and its gate evidence session comes after their last gate round, so slices still pass their gates in slice order. The first slice comes after the foundation sessions. What this costs is in section 8.
- Contract sessions. A slice crossing more than 8 modules in more than one domain gets one contract session per domain. They run side by side, each on the contract files of its own domain, except the one for the most downstream domain (by domain wave, then by how many of the slice's other requirements need the domain): it comes after the others, checks that the references between the domains' contracts resolve, and writes the failing scenario test. 4 slices are split this way.
- A slice with a single build session has no contract session: the build session fixes the contracts and writes the failing scenario test first. If the slice also has no screens, the same session ends by making the scenario pass, and there is no integrate session. This applies to 4 slices: OR-8, BC-1, BC-10, XF-1. The gate evidence session is never folded: what is built is always checked by a session that did not build it.
2. Rules for every session¶
- You own the code base. Claude owns this code base (ADR-HIS-041): what it is for, aligned with the specifications, and how it is built are its call, and it keeps building on it. Every session agent and review agent works as that owner: it takes the technical decisions the card leaves open, records those that shape later sessions as the next decision record, and is answerable for the quality of what it leaves behind. Ownership covers how the system is built; the rules below still hold, above all rule 3 on behaviour and rule 1 on scope.
- One card, one pull request. The session does what its card lists and nothing else. Work it finds outside the card goes in the handover as a follow-up, not in the change.
- Start cold. A session has no memory of earlier sessions. What it needs is in the agent instruction file of the repository, the card's "Reads", and the handovers of the sessions it comes after. If that is not enough to do the work, the card is wrong: stop and say so.
- The specification decides. Behaviour comes from the requirement, its acceptance criteria and the business rules it cites. A session does not change a specification to fit the code; the one addition it makes is a contract session writing missing entity attributes into section 7.3 ahead of the code (architecture section 6.6), for the domain leads to approve. Where the specification is silent, ambiguous or contradicts another, the session stops on that point and records the question on its issue; it does not guess clinical, financial or access behaviour.
- Contracts change in the open. Contracts are fixed by the contract session. A later session that needs a contract changed records the change and its reason in the handover and marks the session Blocked unless the change is backward compatible and passes the compatibility check.
- Every acceptance criterion has a test, and every test names its requirement. Tests carry the requirement identifier and, where one exists, the test scenario identifier of section 15.2, so the gate session can assemble evidence without reading the code.
- Synthetic data only. No session uses or asks for real patient data (architecture section 10.2).
- Every cross-cutting duty applies. Authorization through the policy decision point, audit, consent and segmentation, correlation identifiers and telemetry are part of every build session, as section 9 and section 10 of the owning specification require; they are not left to a later session. The non-functional targets on the card are designed for from the start, and runtime targets are measured at integration, not first discovered at the gate.
- Safety controls are not traded away. A card with a "Safety" row implements a control for a safety-critical function of section 11.1. The control is built as specified, its verification passes, and a change to it updates the hazard log. A card with a "Safety duty" row follows that duty; the named safety review is given on the merged work, and what it finds becomes a fix session.
- Stop clean. A session that cannot finish leaves the code building and the tests it wrote passing, pushes its branch, and writes what remains as a comment on its issue, which it labels
blocked. The next run of the same card starts from that branch and that comment. - Side by side means separate. Each session works in a git worktree of its own, on its own branch
session/<SESSION-ID>cut from main, with an integration environment named after the session. It touches only their own deployable unit, the folders of their own screens, or the contract files of their own domain. The plan never puts two build sessions on one unit side by side, in one slice or across slices; the build checks this. A screen session changes nothing in the workspace outside the folders of its screens: a component two screens need comes from the design system, and one that is missing is built inside the screen folder and recorded in the handover as a follow-up for the design system. - Reviewed before merge. Every session ends in a pull request that passes the pipeline and is reviewed before it is merged (FR-ISE-REL-001). The review is by a review agent that wrote none of it, and the launcher merges what it approves, with no person in between, for every kind of session (ADR-HIS-040). What a review does not approve goes back to the session until it does. Approvals and signatures named under "Needs a person" are given by people, but they no longer hold up the merge; they are given on the merged work (section 4). A session is Done when its pull request is merged.
- An earlier slice may not have passed its gate. A session can build on the contracts of a slice that is still being built or checked. It works against those contracts and their stubs, never against unmerged code. If a fix in an earlier slice changes a contract in a way that is not backward compatible, every session not yet Done that uses the contract is marked Blocked until the change is merged, and a Done session it breaks gets a fix session at its own gate.
3. Starting and ending a session¶
To start a session, give an agent this, with the session identifier and the number of its issue filled in; the launcher below does so:
Run session <SESSION-ID> of the HIS session plan. Its GitHub issue is #<ISSUE>.
You own this code base (ADR-HIS-041): what it is for, aligned with the specifications, and how it is
built are your call, and you keep building on it. Take the technical decisions the card leaves open
and record those that shape later sessions as the next decision record in docs/architecture/decisions/.
The specification still decides behaviour (rule 3) and the card still bounds the work (rule 1).
1. Read docs/implementation_plan/delivery/sessions.md, sections 2 to 4.
2. Read the card of <SESSION-ID> in docs/implementation_plan/delivery/sessions/<GROUP>.md, and the
comments on issue #<ISSUE> (gh issue view <ISSUE> --comments): they hold answers from people.
3. Read everything the card lists under "Reads", and the handover of each session under "After"
in docs/implementation_plan/delivery/handovers/.
4. Before changing anything, state the scope in your own words and list anything the card or the
specification leaves unclear.
5. Do the work of the card and nothing outside it, until the "Ends when" check holds. Work only in
this checkout and on its branch, and start the integration environment only under the name of
this session.
6. Stop only if you cannot go on without an answer from a person: a question under rule 3, a
decision the work depends on that is not settled, or work that cannot be finished in this
session. Then commit and push the branch, write the question or what remains as a comment on
issue #<ISSUE>, add the label blocked (gh issue edit <ISSUE> --add-label blocked) and stop.
Approvals and reviews listed under "Needs a person" are not a reason to stop: they are given
on the pull request.
7. Otherwise write docs/implementation_plan/delivery/handovers/<SESSION-ID>.md, push the branch and
open the pull request against main (gh pr create) with "Closes #<ISSUE>" as the first line of its
description. Under a heading "Needs a person", list each approval or review the card names and
any question left; write "None" if there is none. Do not edit session-status.csv or
session-fixes.csv and do not run the plan build: they are written from GitHub when the pull
request is merged.
Handover. Each session writes delivery/handovers/<SESSION-ID>.md. It is the only thing a later session knows of this one, so it states:
- what was built and where it is;
- how to run its checks, and their result;
- each requirement and test scenario of the card, with the test that covers it;
- anything done differently from the specification or the contract, and why;
- questions left for a person, and follow-up work found outside the card.
Sessions on GitHub. Every session has an issue in the repository, titled with the session identifier and labelled with its kind and group; the slice is its milestone. sync_github.py creates the issues of a slice when its first session can start, links each issue to the issues it is blocked by, and keeps their state:
| State | When | Who sets it |
|---|---|---|
| Waiting | A session it comes after is not done, or the issue carries the label hold |
The sync |
| Ready | Every session it comes after is done; the issue carries the label ready |
The sync |
| Running | The issue carries the label running |
The launcher, when it starts the session |
| Paused | The issue carries the label paused; the agent is interrupted, and its worktree and conversation are kept |
A person, with the launcher |
| Blocked | The issue carries the label blocked, with the question in a comment |
The session, when it stops; a person removes the label once it is settled, and the session is then run again from its branch |
| In review | A pull request from branch session/<SESSION-ID> is open |
The session, by opening it |
| Done | The issue is closed | Merging the pull request, whose description starts with "Closes #n" |
The sync runs as a GitHub Actions workflow on every push to main and on every change of an issue or pull request. A person can hold a session back with the label hold. If delivery/github.json names a project board, the sync also sets the field "Session status" of each issue there.
Running sessions side by side. launch_sessions.py runs on the server where the agents work. It starts the sessions GitHub shows as Ready, each in its own worktree and its own terminal window, up to a limit that fits the server, and removes the worktree of a session when its issue is closed:
python3 docs/implementation_plan/tools/launch_sessions.py list what is running, in review, blocked, ready
python3 docs/implementation_plan/tools/launch_sessions.py start --max 3 start ready sessions, up to 3 running
python3 docs/implementation_plan/tools/launch_sessions.py watch --max 3 the same, again every five minutes
python3 docs/implementation_plan/tools/launch_sessions.py pause RC-1-S04 interrupt a session (or --all); its place is freed
python3 docs/implementation_plan/tools/launch_sessions.py resume RC-1-S04 continue it (or --all), also after a server restart
A session starts from origin/main, and one that is Ready always finds the work it comes after already merged. When a session's pull request is open and its checks pass, the launcher has a review agent review it, read-only and with the card, the diff and the handover (REVIEW_PROMPT in sessions_def.py). If the review approves, the launcher merges the pull request; if it asks for changes, the launcher passes them to the session, which fixes them on its branch, and the next push is reviewed again; a branch that conflicts with main goes back to the session to bring up to date. Failing checks go back to the session without a review. AUTO_MERGE in sessions_def.py can name kinds, labels or paths that a person merges instead (labelled merge-by-person); it names none. --no-merge leaves every merge to a person. To stop new sessions from starting, stop watch; to keep one session from starting, label its issue hold. A paused session continues its own conversation when resumed, so nothing it had in hand is lost.
Usage limits. All sessions draw on the one Claude plan of the account, with a five-hour and a weekly allowance. Every session runs on Opus, and the launcher keeps them within the allowance by running fewer at once rather than by changing model. Each session reports the account's usage through its status line (usage_hooks.py), and the launcher starts no new session while the five-hour usage is at or above 80%, or while the weekly usage runs more than 10 points ahead of an even pace through the week (--five-hour-hold, --weekly-margin; list shows the figures and any hold). Sessions already running carry on. When one hits a limit, Claude Code waits and continues it after the reset; where it does not (after three hits in a row, or a wait of more than a day), watch continues it a few minutes after the reset. Sessions run with prompt suggestions and session recaps off, since those requests also count against the allowance.
Permissions. An agent session runs without asking only the commands listed in SESSION_PERMISSIONS of sessions_def.py: reading files, git on its own branch, and gh on its own issue and pull request. It may never force-push, push to main, merge, close issues or run the plan build. Every other command waits for a person in its window, so a session that needs, for example, Docker or a package manager asks before using it. Edit the list there to widen or narrow it; it applies to sessions started or resumed after the change.
Status. session-status.csv holds one row per session that has started: session, status (In progress, Blocked or Done), pull_request, notes. A session with no row is Not started. The file is written by the sync from the state of the issues, and the plan is rebuilt and committed with it; nobody edits it by hand, and sessions do not touch it, since every pull request would then change the same files. The build refuses a session marked In progress or Done while a session it comes after is not Done.
Fixes. A gate evidence session files one issue for each failure it records:
gh issue create --label kind:fix --title "RC-1-S27-F1 Fix: <the problem, in one sentence>" --body "Round: 1
Owner session: RC-1-S08
Gate line: <the done-when line or gate criterion that failed>"
The identifier is that of the first gate session of the slice followed by -F and a number; the round is 1 for failures of the first gate run, 2 for those of the second, and so on; the owner is the session of the slice whose work failed. The sync writes these issues into session-fixes.csv, and the build adds a fix session for each and a further gate evidence session, <gate session>-G<n+1>, for each round; each then has an issue of its own. Fixes of one round on the same unit, or on the screens of one domain, follow one another.
4. Where a person is needed¶
A review agent reviews every pull request and the launcher merges what it approves; no person merges (rule 11). People still give the approvals, reviews and signatures below. They are given on work that is already merged, and a finding from them comes back as a fix session or a follow-up, not as a held merge:
| Point | Who | Why |
|---|---|---|
| End of each contract session | Leads of the domains in the slice | The contracts bind every build session that follows; an error here is repeated in each |
| A question raised under rule 3 | Owner of the specification | Clinical, financial and access behaviour is not for an agent to settle |
| After merge of a card with a safety duty (44 cards) | As named on the card: the clinical safety officer, with a pharmacist, HIM or registration governance, the privacy officer, clinical engineering, AI governance or the SaMD design authority by area | Architecture section 13: safety-significant changes need a hazard review; the blood bank is a SaMD under design control |
| A requirement that cites an open decision | Decision lead in the decision plan | Marked "Needs a person" on the card |
| After each readiness session | The departments that use the workflows, and the service owner | The downtime procedure is rehearsed by the people who will follow it (ACC-007); a session can only draft it |
| After each gate evidence session | Clinical owner for a Tier 1 slice, business owner otherwise | The slice gate is passed by signature (ACC-002), on the evidence the session collected; a failure becomes a fix session |
| Stage gates and go-live | As in stage gates | Not session work |
50 cards outside the readiness and gate sessions carry a "Needs a person" line: FN-S01, RC-1-S08, RC-1-S09, RC-1-S21, RC-1-S23, RC-3-S05, RC-4-S02, RC-4-S03, RC-5-S06, RC-5-S11 to RC-5-S14, OR-1-S02 to OR-1-S06, OR-2-S04, OR-2-S06, OR-3-S03, OR-3-S04, OR-5-S04, OR-5-S05, OR-7-S04, OR-7-S07, OR-8-S01, PA-2-S02, PA-2-S03, PA-2-S05, PA-3-S03, PA-3-S04, PA-3-S06, BC-1-S01, BC-10-S01, BC-6-S03, BC-6-S04, BC-6-S07, BC-6-S09, OR-6-S03 to OR-6-S06, OR-6-S08, OR-6-S09, BC-8-S03, XF-1-S01, XF-2-S03 to XF-2-S05.
5. Progress and what can start now¶
| Group | Sessions | Done | In progress | Blocked |
|---|---|---|---|---|
| FN Foundation for agent work | 7 | 7 | 0 | 0 |
| RC Registration to care delivery | 148 | 109 | 2 | 0 |
| OR Order to result | 65 | 0 | 0 | 0 |
| PA Pathway activation | 33 | 0 | 0 | 0 |
| BC Billing and coding | 76 | 0 | 0 | 0 |
| XF Outside the four flows | 9 | 0 | 0 | 0 |
| All | 338 | 116 | 2 | 0 |
Can start now (14): every session they come after is Done.
| Session | Kind | Scope |
|---|---|---|
| RC-1-S28-F35 | Fix | ess-governance audits refusals of configuration actions without the item reference or recordNotCreated, so they are quarantined |
| RC-1-S28-F36 | Fix | the gateway's rendered reference configuration is stale again against the contracts on main (RC-4-S01, F33), so platform/gateways ci.sh fails |
| RC-5-S11 | Screens | CLI screens (part 1 of 4) |
| RC-5-S12 | Screens | CLI screens (part 2 of 4) |
| RC-5-S13 | Screens | CLI screens (part 3 of 4) |
| RC-5-S14 | Screens | CLI screens (part 4 of 4) |
| RC-5-S15 | Screens | ESS screens |
| RC-6-S02 | Contract | Contracts and stubs: D2 ISE |
| OR-1-S01 | Contract | Contracts, stubs and the failing scenario test |
| PA-1-S01 | Contract | Contracts, stubs and the failing scenario test |
| BC-1-S01 | Build | Revenue cycle |
| BC-4-S01 | Contract | Contracts, stubs and the failing scenario test |
| BC-6-S01 | Contract | Contracts, stubs and the failing scenario test |
| BC-8-S01 | Contract | Contracts, stubs and the failing scenario test |
6. Sessions by slice¶
| Slice | Title | Phase | After | Contract | Build | Screens | Integrate | Readiness | Gate | Fix | Sessions | Most side by side |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FN | Foundation for agent work | Before 1 | – | – | – | – | – | – | – | – | 7 | 3 |
| RC-1 | Register a patient and open an encounter on the platform | 1 | Foundation | 3 | 17 | 5 | 1 | 1 | 4 | 36 | 67 | 16 |
| RC-2 | Outpatient visit: book, arrive, queue and be seen | 2 | RC-1 | 1 | 5 | 3 | 1 | 0 | 1 | 0 | 11 | 7 |
| RC-3 | Inpatient stay: admit, allocate a bed, transfer and discharge | 2 | RC-1 | 3 | 14 | 6 | 1 | 1 | 1 | 0 | 26 | 14 |
| RC-4 | Emergency arrival: unidentified patient, triage and emergency access | 2 | RC-2, RC-3 | 1 | 3 | 1 | 1 | 1 | 1 | 0 | 8 | 4 |
| RC-5 | Document care in the clinical record | 3 | RC-3 | 2 | 8 | 5 | 1 | 1 | 1 | 0 | 18 | 10 |
| RC-6 | Patient digital access: enrol, appointments, messages and forms | 5 | RC-2 | 3 | 9 | 4 | 1 | 0 | 1 | 0 | 18 | 8 |
| OR-1 | Order entry and result display against a simulated fulfilment service | 3 | RC-5 | 1 | 3 | 2 | 1 | 1 | 1 | 0 | 9 | 4 |
| OR-2 | Laboratory order to validated result | 4 | OR-1 | 1 | 4 | 1 | 1 | 0 | 1 | 0 | 8 | 2 |
| OR-3 | Critical result: notify, acknowledge, escalate and close | 4 | OR-2 | 1 | 2 | 1 | 1 | 1 | 1 | 0 | 7 | 3 |
| OR-4 | Imaging order to report | 4 | OR-1 | 1 | 2 | 1 | 1 | 0 | 1 | 0 | 6 | 3 |
| OR-5 | Pathology, blood bank and procedure or consultation fulfilment | 4 | OR-2 | 1 | 3 | 2 | 1 | 1 | 1 | 0 | 9 | 5 |
| OR-6 | Medication order to bedside administration (closed loop) | 4 | OR-1, BC-6 | 1 | 5 | 3 | 1 | 1 | 1 | 0 | 12 | 5 |
| OR-7 | Surgical case, critical care and therapy | 4 | OR-1, RC-3 | 1 | 3 | 3 | 1 | 1 | 1 | 0 | 10 | 5 |
| OR-8 | Release results and documents to the patient | 5 | OR-2, RC-6 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 4 | 1 |
| PA-1 | Publish an approved guideline and pathway | 3 | RC-1 | 1 | 5 | 3 | 1 | 0 | 1 | 0 | 11 | 4 |
| PA-2 | Eligibility evaluation and clinician-confirmed activation | 4 | PA-1, RC-5, OR-2 | 1 | 3 | 1 | 1 | 0 | 1 | 0 | 7 | 3 |
| PA-3 | Pathway execution through the owning domains | 4 | PA-2, OR-1 | 1 | 4 | 1 | 1 | 0 | 1 | 0 | 8 | 4 |
| PA-4 | Pathway and clinical quality outcome evaluation | 6 | PA-3, BC-8 | 1 | 2 | 2 | 1 | 0 | 1 | 0 | 7 | 4 |
| BC-1 | Eligibility and coverage at registration | 5 | RC-2 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 4 | 1 |
| BC-2 | Clinical event to priced charge | 5 | OR-1, RC-3, BC-1, BC-6 | 1 | 2 | 1 | 1 | 0 | 1 | 0 | 6 | 2 |
| BC-3 | Patient account, invoice and payment | 5 | BC-2 | 1 | 4 | 3 | 1 | 0 | 1 | 0 | 10 | 5 |
| BC-4 | Record assembly, document stewardship and chart completion | 3 | RC-5 | 1 | 4 | 2 | 1 | 0 | 1 | 0 | 9 | 3 |
| BC-10 | Encounter coding to billing readiness | 5 | BC-4 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 4 | 1 |
| BC-5 | Claim to remittance and finance posting | 5 | BC-1, BC-3, BC-10 | 1 | 2 | 1 | 1 | 0 | 1 | 0 | 6 | 2 |
| BC-6 | Stock ledger, procurement and departmental consumption | 4 | RC-1 | 1 | 5 | 3 | 1 | 0 | 1 | 0 | 11 | 5 |
| BC-7 | Disclosure, retention and legal hold | 5 | BC-4 | 1 | 5 | 2 | 1 | 0 | 1 | 0 | 10 | 4 |
| BC-8 | Governed data platform fed by flow events | 5 | RC-3 | 1 | 4 | 2 | 1 | 0 | 1 | 0 | 9 | 4 |
| BC-9 | Operational, revenue-cycle and management reporting | 5 | BC-8, BC-2 | 1 | 2 | 2 | 1 | 0 | 1 | 0 | 7 | 3 |
| XF-1 | Data portability and exit export | 3 | RC-3 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 2 | 1 |
| XF-2 | Governed AI, research extracts and maturity scorecard | 6 | BC-8 | 1 | 3 | 1 | 1 | 0 | 1 | 0 | 7 | 3 |
The longest chain of sessions that must follow one another is 30 long. At its widest the plan has 39 sessions with no order between them; how many actually run side by side is a matter of review capacity, since every session ends with a person (rule 11).
7. Checks on this plan¶
- Coverage. All 304 functional requirements are in exactly one build session and all 146 screens in exactly one screen session; the build script fails otherwise.
- Order. Every session comes after sessions that precede it in the plan, so there is no cycle. Within a slice, an upstream module named by a requirement is built first when it is in the same slice. Across slices, contracts come after contracts, integration after integration and gate after gate.
- No shared codebase side by side. No two build sessions on one deployable unit can run side by side, anywhere in the plan; the build script fails otherwise. Every screen is in exactly one screen session and has a folder of its own, so no two screen sessions change the same files. Every module is in exactly one unit of sessions_def.py.
- Safety. 53 build sessions carry a "Safety" row from section 11.1 of the specifications, and 44 build or screen sessions a safety duty with a named review. Every identifier in SAFETY_REVIEW exists, and every non-functional category is placed in exactly one class; the build fails otherwise.
- Fixes. Every row of session-fixes.csv, written from the fix issues, names a gate session and an owning session of the same slice; rounds run without a gap.
- Tests. 413 test scenarios of section 15.2 are listed on the build session of the requirement they trace to; a scenario tracing to requirements in two sessions is listed on both. Tests of non-functional and cross-cutting requirements are run by the gate evidence sessions.
- Screen design. Every screen has design detail: 91 have a design brief and 55 a detailed entry in section 6.3 of their specification, which their cards link to instead.
8. Limits¶
- Overlapping slices trade rework for speed. A slice is built on contracts whose own slice has not passed its gate. A gate failure that changes a contract reaches every later session that used it (rule 12); a failure that leaves the contracts alone does not. Screens are built against stubs, so a stub that differs from the built service shows only at integration. Gates still pass in slice order, so nothing is released on an unchecked slice. To go back to strict order, make a slice start after the gate of the slices before it in build_sessions.py.
- Screen folders rest on the workspace layout. Screen sessions run side by side only because foundation session FN-S06 lays out every domain workspace with one folder per screen and registration from that folder. If that layout is not accepted, put the screen sessions of a domain back one after another in build_sessions.py. Components built inside a screen folder can be duplicated between screens until the design system takes them up.
- Contract sessions side by side can disagree. Two domains fixed at the same time can name a shared entity or event differently; the last contract session of the slice is where that is found and repaired, before any build session starts.
- Fix sessions are outside the side-by-side check. A fix changes a unit or screen folder that a later slice may be working on at the same time. It is small and merges first; the open sessions on that unit rebase on it.
- The cut is mechanical. Sessions follow slice, module and the caps in sessions_def.py (4 requirements, 3 screens). A requirement can be far larger or smaller than its neighbours. If a session proves too large, it stops clean (rule 9) and is run again; if a module is consistently too large, lower the cap.
- Session identifiers are positional. Changing the slicing, the units, the caps or the screen inventory renumbers sessions. Do it between slices, and rename the issues and the handover files to match by hand: the sync recognises an issue by the session identifier at the start of its title.
- The unit grouping is the architecture's proposal. Architecture section 5.2 says each unit's final shape is recorded in a decision record when its first slice is built. If a unit is split or merged there, change UNITS to match.
- Non-functional requirements have no sessions of their own. Each is placed by its category, through NFR_CLASS in sessions_def.py. Code-level targets (security, interoperability, observability, localization, time integrity) go on every build card of the domain. Runtime targets (performance, latency, reliability, scalability, isolation, degraded operation, durability, recoverability) are checks of the integrate session. Availability, maintainability and portability are evidenced by the readiness session, or by the gate where a slice has none. Usability and accessibility go on screen cards. Section 10 does not say which module a target binds, so a card lists all of its domain's targets in the class.
- Safety rows are derived from section 11.1. A requirement that section 11.1 cites as a safety control puts the function on the card of the session that builds it. A control the table states without citing a requirement is not found. Which areas need a person's safety review before merge is a hand-kept list (SAFETY_REVIEW in sessions_def.py).
- Enabling work listed in the backlog of each domain (external integrations, data migration) is session work only where a slice requirement calls for it. Migration and rollout belong to the per-domain plans still to be written.
- Dependencies inside a slice come from the "Upstream dependencies" line of each requirement. One the specifications do not state is not found; the contract session is where it should surface.
Data: data/sessions.csv. To change the cut, edit tools/definitions/sessions_def.py and run tools/build.py.