Skip to content

Implementation plan / Tools

Plan Tools

The scripts in this folder generate the plan pages, the design inventories and their data from the domain specifications, the hand-authored definition files and the decision outcomes. They need Python 3.

Build

python3 docs/implementation_plan/tools/build.py

build.py runs the steps below in order, stops at the first one that fails, and ends with the link check. A build that changes nothing leaves every file byte for byte as it was.

Step Script Reads Writes
1 apply_decisions.py decisions/outcomes.csv; definitions/tech_stack.csv; definitions/decisions_def.py; section 18.3 of the specifications Status column of section 18.3 of each specification; data/decision-register.csv; decisions/technology-stack.md
2 extract.py The specifications delivery/backlog.md and delivery/backlog/; delivery/dependency-graph.md; decisions/blocking-decisions.md; most of data/
3 build_gates.py, which first runs build_slices.py definitions/slices_def.py; the specifications; the PRS delivery/slices.md and delivery/slices/; delivery/stage-gates.md and delivery/gates/; data/slices.csv
4 build_decisions.py definitions/decisions_def.py; data/decisions.csv; data/slices.csv decisions/decision-plan.md; data/decision-plan.csv
5 build_screens.py definitions/screens_def.py; definitions/roles_def.py; the specifications; data/slices.csv; docs/design/screen-briefs/ docs/design/screen-inventory.md; data/screens.csv
6 build_roles.py definitions/roles_def.py; the specifications; data/screens.csv docs/design/user-roles.md; data/roles.csv, data/role-actors.csv, data/role-screens.csv
7 build_sessions.py definitions/sessions_def.py; definitions/slices_def.py; delivery/session-status.csv; delivery/session-fixes.csv; data/slices.csv, data/backlog.csv, data/module-dependencies.csv, data/screens.csv, data/decisions.csv; section 15.2 of the specifications; docs/design/screen-briefs/ delivery/sessions.md and delivery/sessions/; data/sessions.csv
8 check_links.py Every Markdown file under docs/ Nothing; fails on a broken link or a duplicate anchor

Step 1 runs before step 2 because it changes the specifications that step 3 reads. After step 1, build_adrs.py writes the decision records of the 32 technology selections and the index of all records into docs/architecture/decisions/; records from ADR-HIS-033 on are written by hand and only listed.

Two scripts are not build steps; both use the GitHub CLI and are described in the session plan, section 3. sync_github.py keeps one GitHub issue per session, writes delivery/session-status.csv and delivery/session-fixes.csv from the state of the issues, and runs the build; a workflow runs it on every push to main and every change of an issue or pull request. launch_sessions.py runs on the server and starts the sessions GitHub shows as ready, each in its own git worktree and tmux window, holding new sessions back when the plan's usage is high; usage_hooks.py is the status line and hook each session runs to report that usage.

Any step can also be run on its own, in the same order, for example python3 docs/implementation_plan/tools/build_gates.py after changing the slicing.

Hand-authored inputs

File What it holds
definitions/slices_def.py The slices, their order, their scenarios and which requirements each takes. build_slices.py checks that every requirement is in exactly one slice
definitions/decisions_def.py The decision themes, their leads, working positions and cost judgements, and the anchor decisions. build_decisions.py checks that every open decision is in exactly one theme
definitions/screens_def.py Design patterns, overlaps between screens, form factors, and the screens moved to a later main slice than the derived one (DEFER, each with its reason; the target must come after the derived slice). An overlap counts as resolved when it names its resolution in first batch design readiness; a screen counts as having a brief when docs/design/screen-briefs/ holds one
definitions/roles_def.py The user roles, the actors merged into each and their work context. build_roles.py checks that every actor is in exactly one role or listed as a system actor, and that every screen is used by at least one role
definitions/sessions_def.py The session kinds, the deployable units and their modules, the areas that need a safety review before merge (SAFETY_REVIEW), where each category of non-functional requirement is checked (NFR_CLASS), the most requirements and screens one session takes, and the foundation sessions. build_sessions.py checks that every module is in exactly one unit, every requirement and screen in exactly one session, and that no two sessions on one unit or domain workspace can run side by side
../delivery/session-status.csv Progress of the sessions: one row per session that has started, with status In progress, Blocked or Done, the pull request and notes. Written by sync_github.py from the GitHub issues, not by hand. build_sessions.py refuses a session marked In progress or Done while a session it comes after is not Done
../delivery/session-fixes.csv Failures recorded by gate evidence sessions: one row per fix, with its round, the session that owns the work, the gate line and the problem. Written by sync_github.py from the fix issues, not by hand. build_sessions.py adds a fix session per row and a further gate evidence session per round
../decisions/outcomes.csv The decision outcomes (next section)
definitions/tech_stack.csv The 32 technology stack rows: item, scope, options, the recommendation proposed for review, the decisions each settles, stage, first slice and constraints. Prepared on 15 November 2026; the selection made for each row is in outcomes.csv
The ACC-to-stage mapping in build_gates.py What each acceptance gate must show at each stage

Recording decisions

outcomes.csv is the record of decision outcomes. It has one row per decision that belongs to a theme (DEC-...) and one per row of definitions/tech_stack.csv (TS-01 to TS-32). The columns are described at the top of outcomes.py. The ones that matter most:

  • settled: yes means the chosen option is the outcome, and the specification records the decision as "Resolved". no means the chosen option only says how or when the decision will be made; the decision stays open and the specification records the agreed approach.
  • chosen_option: the outcome, or the agreed approach. For a decision whose outcome is the technology selected on technology stack rows, it reads "See the Tech stack sheet" and the outcome is composed from those rows.
  • proposed_outcome: a draft outcome under review. It does not reach the specifications.
  • status: Open, Under evaluation, Proposed, Decided or Deferred.

To record an outcome, edit the row in outcomes.csv and run the build. For a decision that is made, set status to Decided, settled to yes, put the outcome in chosen_option (moving it from proposed_outcome if it was drafted there), and fill decided_by and date_decided. The build stops if a row has status Decided without settled set to yes.

The specification Status text uses the date decided, or failing that the date in recorded. Update by hand any requirement in the specifications that assumed a different outcome.

Method and its limits

  • Backlog. One item per functional requirement, with priority, criticality and PRS source copied from the requirement. An epic is a module.
  • Dependencies. Taken from the text: the "Upstream dependencies" line of each requirement, each module overview's dependency list, and the cross-domain table in section 17.4. A dependency the specifications do not state is not found.
  • Waves. A domain is placed after another when clearly more of its requirements need that domain than the reverse (the rule and its threshold are stated in the dependency graph and are constants at the top of extract.py). Items in the same wave have no ordering constraint and can be built in parallel. The domain sequence is the reliable result; the module sequence inside a domain rests on small counts and is a guide only: the session plan orders work by the upstream modules each requirement names (reviewed 2026-11-24).
  • Need is not the same as blocked. Many dependencies can be satisfied by an agreed contract and a stub. Deciding which are true blockers belongs to the per-domain plans still to be written.
  • Decisions. Classified by whether a Must requirement cites them. Themes are assigned by keyword; reviewed 2026-11-24, and with every decision settled they only group the record.
  • The technology stack rows are a snapshot. Scope, options, recommendations, stages and slices in definitions/tech_stack.csv were prepared on 15 November 2026 and are not regenerated. If the decision plan changes, update them by hand.
  • Sessions. Cut mechanically: build sessions by deployable unit in a slice, packed module by module up to the size limit, one after another on the same unit (across slices too), and ordered across units by the upstream modules the requirements name. Slices overlap: a slice starts on the contracts of the slices before it, integrates after they integrate and is gated after their gates. Session identifiers are positional and change if the slicing, the limits or the screen inventory change.
  • No effort or duration. Requirement counts are not a measure of size.