ENRU
A parallel development engine · a description of what was built

The firm2 route

~/firm2 $ cat README_routecollapsed

Four processes, two human gates and a task cycle driven by code, not by a model. Every process is started by a human. Drawn in BPMN: a rectangle — work, a diamond — a fork with two exits, a circle — an event, a cylinder — a store, a dashed line — a message between participants.

engine version 0.4.150 snapshot 22.11.2026 source docs/how-it-works.md, the route commands
~/firm2 $ cat legendcollapsed
Legend

What is drawn with what

The names on the diagrams are terms from the entity catalogue: what a dossier, a delivery, a verdict or a receipt is, what each consists of and where it lies in the repository, is defined there, and the diagrams introduce nothing beyond that list. Words with a dotted underline are catalogue terms, not synonyms: each has a definition, a composition and an address in the repository, and the underline leads straight to it. Entity names in the diagram captions are underlined the same way. Statuses, outcomes, task labels and role models live on the third page — states and labels. What exactly goes in and out of each of the eight roles — in «Eight black boxes».

Start event
An event in the journal
End of the route
The work of a stage
Done by engine code
Fork: one branch
Runs many times
Fork: every branch
The event journal
Sequence flow
Message, record
~/firm2 $ cat diagram-1-the-mapcollapsed
Diagram 1 · the map

Four processes, not one route

This is not a single chain from idea to release. There are four processes, each with its own launch, its own frequency and its own end, and each is started by a human: the engine starts nothing by itself. Discovery and delivery are linked not by an arrow but by the topic backlog: discovery puts a dossier there, delivery takes out what the human chose.

01 · SETUPonce per project 02 · ENGINEwhen a version ships 03 · DISCOVERYmany, in parallel 04 · DELIVERYone live at a time /firm-setup stack, hook, sandbox the project can keep a journal .firm/config · git hook boundaries · code graph a version shipped /firm-adopt what changed — out loud declared version = actual scripts/ edits arrive without this /firm-discovery diagram 2 topic dossier, status groomed requirements · decisions code impact · screens topic backlog docs/backlog the human chose a topic and a release /firm-plan diagram 3 gate 1 /firm-build diagrams 3 and 4 gate 2 merge and release git writes the release remarks — edits for roles not ok — remarks into the build the topic lands in the backlog the human takes one
The processes run at different frequencies, and that is not decoration but a property of the route: setup — once, accepting a version — as versions ship, discovery — as many as you like alongside a running delivery, delivery — strictly one live. Hence the form of the link: discovery puts a dossier into the backlog and ends there, while a delivery is chosen out of it by the human as a separate decision, whenever they want — one at any moment in time.
~/firm2 $ cat diagram-2-discoverycollapsed
Diagram 2 · discovery

Grooming a topic ends in a dossier, not in a delivery

The human starts the process and ends it too: they decide to groom a topic, answer the PM's questions through the orchestrator and look at the finished dossier. Discovery does not create a delivery and does not cut tasks — decision ADR-0012: cutting into tasks something whose release has not been chosen yet means doing the work twice. A topic may lie in the backlog for as long as it likes and never travel into a delivery.

HUMAN ORCHESTRATOR ROLES decided to groom /firm-discovery the topic gets a number its own tree from main no bother to the delivery PM requirements and business criteria answers questions are rare Designer a list of screens, no prototype yet Architect decisions, ADRs, code impact commit the dossier status groomed looks at the dossier this is not counted a gate The process ends with the dossier in the backlog. The topic waits to be chosen as long as it needs, and may never travel into a delivery. questions answers
The PM's questions go to the human through the orchestrator: roles have no direct channel, they return mode: "questions" and wait to be resumed with the answers. The boundary «discovery → planning» is deliberately not counted a gate: these are different sessions, and the human launching the next command is itself an act of approval.
~/firm2 $ cat diagram-3-deliverycollapsed
Diagram 3 · delivery

From a chosen topic to a release

A delivery begins not with an idea but with a finished dossier that the human picked out of the backlog: the engine shows topics with status groomed, grouped by release, and waits for a decision — the order of releases is none of its business. Both gates have two exits, and their return paths differ: before the build the human's remarks are edits for roles, after the build they are bugs.

HUMAN ORCHESTRATOR ROLES ENGINE CODE topic backlog picks a topic and a release — not the engine /firm-plan --from G-XXX one live delivery groom land branch merged, folder created PM: proposal.md dossier → delivery requirements Architect design.md, module boundaries, tasks as files, depends_on Designer one prototype per delivery format gate validation, criteria, user path, the shape of the plan gate 1: tech spec /firm-build the task cycle — diagram 4 packaging and MR review full suite, lint, PR, the whole feature → main diff gate 2: demo Tech writer spec archive, live docs merge into main post-merge writes the release delivery released ok remarks — edits for roles, the build has not started ok not ok: demo/rejected, remarks are already bugs topics with status groomed, by release
Both return paths are drawn because both are real and lead to different places. From the tech-spec gate the work goes back to the planning roles: the build has not started, and a remark is an edit to the spec, not a defect. From the demo gate a «not ok» is written as the event demo/rejected with a reason, and the remarks enter the build as bugs.
~/firm2 $ cat diagram-4-the-corecollapsed
Diagram 4 · the core

The cycle of one task

All of the engine's machinery lives here. A task runs in its own worktree outside the repository, the stages are called one after another, and between them stand forks computed by code, not by a role: a short-lane claim is judged against the real diff, a new red by comparing three lists of names. There are three attempts, and they are counted by the journal — by the number of Developer entries, not by a separate counter that would reset on a restart. Any «rejected» creates a bug, even when the decision is not to fix it.

slot is free worktree links to dependencies Developer code by criteria diff inside short_lane? guard/short-lane no supervision opens work map files and line ranges Tester tests and the run red introduced by the task? Reviewer-QA a panel of three on risky ones verdict merge into delivery and tree cleanup task merged guard/new-red no review opens Architect bug and verdict blocker? fewer than three attempts? counted by the journal escalated delivery adjudication /firm-build step 3 — human and Architect what did the human decide? superseded — lifecycle/superseded the replacements enter the cycle in their turn cancelled — lifecycle/cancelled the bug's trace remains, even if nobody fixed it yes no, or the probe is silent — the full cycle no, or nothing to compare yes, introduced rejected back to work blocker — also back to work yes: attempt +1 no: exhausted blockage resolved — lifecycle/arbitrated: the task goes from the start of the cycle, attempts are not reset not_blocker
The red gate passes no judgement: it compares the names from the task's run with two snapshots the engine has already taken — the branch point and the target branch. A name that is on neither was introduced by the task, and such a rejection needs no supervision, it has been computed. Only the proven blocks: «no field», «no snapshot taken» and a substring match of names are all read towards «do not block», and the gate's state travels into the Reviewer's prompt — so that «could not compute» is not read as «clean».

Exhausting the attempts takes nothing down automatically — the engine has no such right (ADR-0009). The cycle simply ends without acceptance and writes escalated into the journal: the task stays unmerged and moves to blocked, while the run carries on with the other tasks. It is sorted out beyond the cycle — at step 3 of the /firm-build command, where the Orchestrator runs the adjudication and calls the Architect, and the decision is made by the human. Adjudication has three outcomes, and the most frequent one is not taking the task down. First: the blockage is resolved and the task returns to the cycle from the start (lifecycle/arbitrated); the attempts are not reset — the count runs over the whole life of the task. The text of the decision is not a note here but a working document: it reaches the executor verbatim, on its own line in the next stage's prompt, after the remarks of the previous review. Second: the task was cut too coarsely and is superseded by new ones (lifecycle/superseded, with superseded_by in the old one's header), and then the replacements enter the cycle in their turn; the superseded task's branch and tree are not deleted, and the bugs hanging on it are moved across — otherwise doctor returns bugs_on_terminal_tasks. Third: the task is cancelled without a replacement (lifecycle/cancelled). The decision must be laid down as an event, not merely as a field in the header: otherwise the argument computation of the next run would hand the dropped task back as input — that is how, on the pilot, a superseded task arrived in the build a third time.

The planner is code too

  • the ceiling on concurrent tasks is set by parallelism, each task — in its own tree ../<repo>.worktrees/T-XXX;
  • a task without parallel_safe runs alone; while others are in work it waits, but it may be skipped in favour of the next ones — otherwise slots stand idle for nothing;
  • a task with the label needs-browser goes before equals in readiness: its tail determines when the whole run ends;
  • the run plan is topped up as it goes: a task that is workable now is pulled into the queue — one top-up per task and only while a planned task is still in work;
  • before each new task a pause is checked; tasks already started are taken to the end, merge included.
~/firm2 $ cat diagram-5-the-journalcollapsed
Diagram 5 · the journal

Who writes the events

Stage transitions are written by code — the runtime hooks and the git hook — because a step inside the engine can be bypassed and a hook cannot. The model writes no events at all. One file per event: parallel task branches merge without conflicts. Everything shown to a human is computed from the journal on every request, so there is nothing for it to fall out of sync with.

stage subagent SubagentStart / Stop git merge the post-merge hook route commands boundaries hooks cannot reach firm-event.mjs derives stage from role, ticket — from the marker .firm/events one file per event task statuses and the board timing: calendar and active stage tokens, split by model dashboard: can this be shipped stage count and discovery price doctor: holes, unclosed stages
An event is bound to a task by the marker FIRM2-TICKET: T-XXX, which the builder puts into every stage prompt: without it the hook writes an event with ticket: unknown and returns an error. The status in the task card is a derived cache; the journal is authoritative, and on a disagreement it wins.
StageWho runs itEvents
devDeveloperstarted · finished · escalated
testTesterstarted · finished · escalated
reviewReviewer-QA, a panel of up to three votesstarted · accepted · rejected · escalated
adjudicateArchitect on a split panelrejected · accepted
mergethe git hook post-mergefinished · failed
releasethe same hook, by the delivery branch namefinished
guard/*engine code, no roleshort-lane · new-red · suite-abandoned · egress
lifecycle/*the human, through recordarbitrated · superseded · cancelled
~/firm2 $ cat the-principlecollapsed
The principle

The machine holds what a role cannot carry out or cannot measure

A rule in a prompt is a request, and a role goes around it when it cannot be carried out. That is why part of the rules is executed not by a role but by code: the tool simply does not let it be done otherwise — it refuses with an exit code, computes the needed number itself, or returns the work one step back without asking the role. That is what «holds» means: not an agreement in text but a prohibition or a computation in the mechanism. The list of such places grows with every analysis and deliberately carries no number in its heading — each has a measured reason, and each stands on the preflight: if the mechanism disappears, the version does not go up, so there is physically nothing to travel into projects.

The boundary is the same for all of them and is also their criterion: the machine holds what a role cannot carry out or cannot measure. Where a role merely made a mistake, the place stays with the prompt — a prohibition instead of an explanation teaches it to go around the prohibition.

A long suite run is carried by the engine

suite-run.mjs start / wait

The ceiling of a single tool call is 10 minutes, the project's full suite runs for 43. The ban on pushing a run into the background was broken on two attempts out of two, and the second time the prompt forbade it verbatim. A ban without a workable path is a ban that gets gone around.

A work map instead of grep reconnaissance

firm-state.mjs task-diff --hunks

A measurement over 172 stages of one delivery: out of 5677 shell calls, 2038 were searches through the code, 11.8 per stage. Two thirds of the moves went into the question «what did the Developer do». The carrier is line ranges, not a patch: the median patch is 55,342 characters against 1,799 for a list.

Attributing a red is a comparison, not a role's word

ownNewRed · delivery_red_check

A role that proved attribution by comparing 460 failures on the base with 9104 on the delivery was comparing different suites. The assertion was taken away from it, not forbidden in words.

A task's cut is closed over its readers

criteria · closureFindings

A criterion promising the absence of a name is checked by grep: a reader in the file of a task that is not an ancestor of this one by depends_on is a breakage scheduled for the future. The reason is measured: one such task cost 13.2M tokens against 2.7M for its replacement.

«Not checked» is a different answer from «clean»

the cleanup schema, the checked field

Under the sandbox the step returned an empty list three times and noted in prose that this meant «did not look». The field is machine-readable, the note is not, and the wave's report looked like «no litter» with eleven orphans standing.

An unknown flag is rejected, not read as a default

requireKnownFlags, five CLIs

The price of letting it through is measured: prune --help wiped out two worktrees. Destructive commands have a dry run, and the refusal itself says so.

~/firm2 $ cat boundariescollapsed
Boundaries

What the engine deliberately does not do

  • Does not close someone else's stage and does not dispose of someone else's time. A finding is a candidate, the decision is the human's; the exit code of every measurement is always zero.
  • Does not fix itself from a project. The engine's code is shared by every project under firm2; an edit from one build would travel into the others. A defect that is found is described in words and worked around within the delivery.
  • Does not rewrite the journal after the fact. A wrong binding is fixed at read time: the journal is a record of what was known at that moment. A correction or an annulment is also an event.
  • Does not carry secrets into a worktree and does not install tools: a global package changes the whole machine, and that is the human's decision.
  • Does not write the cutting rules on the project's behalf. They are derived by measuring its own failed attempts; what belongs to the engine is the pointer to them and their delivery into the planning prompt.