What each role takes in and what it gives back. We do not look inside: a role is a subagent with its own context window, and the only things tying it to the route are documents, code, journal events and structured output. Everything below is read off the engine source, not off the design.
Words underlined with dots are defined entities, and they lead to the catalogue. This page introduces no terms of its own.
The same machinery, cut in different directions. This page is the cut by role. The start is «The firm2 engine»; why it is built this way — decisions and invariants.
The colour of the stripe on every input and output card is the kind. Exactly these seven kinds travel the route, and exactly they mark up the catalogue: the kind answers the question «who made this and what holds it up».
.firm/events/, append-only (ADR-0003, 0006). Written by code, not by the model..firm/config, the board, firm-state findings, the code graph. Computed from the journal on every request.Roles do not live on their own: they are launched by a route command, and during the build by the builder script. The marker FIRM2-TICKET in the prompt is what binds the stage event to the task.
openspec init, .firm/config, the first commit. On an increment the step is skipped.docs/backlog/G-XXX-<slug>/. It does not create a delivery (ADR-0012).openspec/changes/<change>/, tasks T-XXX.md, a prototype. The finale is the human gate.These three come before a single line of code. Their output is documents, and it is exactly that which the human approves at the gate.
«What and why», never «how». It runs the interview itself, but the one who asks the human is the Orchestrator: the role has no direct channel.
What it does not do: it does not create the delivery folder (ADR-0012), does not cut tasks, does not design. The folder is created by the Orchestrator before the role is launched.
«How». Two stages in one prompt — grooming and planning — plus a third role during the build: the adjudicator, when the QA panel splits.
The role has exactly one stage in the journal — adjudicate. During grooming and planning the Architect is called WITHOUT a marker, and the reason is written next to the launch: an adjudicate event during planning would attribute to the delivery a stage that never happened — that is not a hole but a lie, and doctor does not catch lies. Since 0.4.96 this is checked: a call without a marker and without a stated reason is a finding.
Tasks are the load-bearing entity of the route. The label ui: true sends the task to the Designer, high-complexity raises the Developer to opus, short-lane closes the task without test and review if the diff stayed inside the declared paths, security-sensitive switches on the QA panel. The price of each label is on the states page.
One prototype for the whole delivery, and the human needs it at the gate — before development. Shown after the build, it influences nothing.
A machine check at the gate: firm-state criteria produces a finding if there are ui: true tasks but no mockup; if the mockup has no section for a task; if the mockup pulls a resource from the network. Judgement about the drawing stays with the human (ADR-0009).
Three stages of the cycle per task, each in its own worktree. The output schema is set by the builder, the prompt carries the markers FIRM2-TICKET / FIRM2-CHANGE / FIRM2-ATTEMPT, and the stage events are written by runtime hooks — not by the model.
Implements one ticket and nothing else. Tests are not its business: they are written by the Tester — so that the checker is not the checked.
Escalation is a mechanism, not a word in a status. Run into bad architecture or bad requirements — escalate: true, and the task goes to adjudication; patching around it is forbidden.
Writes and runs tests against the criteria. Does not touch production code — otherwise the difference between «works» and «verified» disappears.
A long run is carried by the engine, not by the role. A 10-minute call ceiling against a 43-minute suite is not cured by asking: the run is started and awaited by a separate command, and the end of a stage while a run is going is written as the event guard/suite-abandoned and returns the role to work. A run is presented not in prose but by an identifier and an exit code.
The supervisory layer: «was it done right». A sceptic — on reasoned doubt it rejects. On a risky task a panel is assembled.
What it does not do: it does not fix code — the role has neither Write nor Edit. An axis for which the project has no written file is declared unchecked: a skip named a skip costs dearly once; named a pass, it costs every time afterwards (ADR-0007).
What was taken away from the role. Attributing a new red to the task — a comparison of three lists, two of which the role did not take — is computed by the engine before the review stage: a proven guard/new-red returns the task to work without opening a review. This is not a ban in words but a withdrawn assertion.
These two work not with a task but with the whole delivery — which is why they have no ticket, and the prompt says FIRM2-TICKET: MR.
Closes the delivery documentarily: an immutable snapshot of the spec into the archive, the deltas into the live specs, and the human layer separately.
The engine's most frequent role: sixteen call sites in the builder plus the framing of the delivery — preflight at the start and packaging at the end.
The price of visibility: mechanical calls write no events, so the token accounting on the dashboard is understated — about five prompts per task never reach it. That is a choice: journalling them would double the journal for the sake of intervals that contain no decisions.
This page is cut by role, the catalogue by things, and at first glance one should lie neatly on the other. It does, exactly up to the middle, and that is the most interesting thing in the table: documents and code have a role as their author, while events, projections and receipts have no role-author at all. They are created by code, and that is precisely why they are believed.
| Entity | Created by | Read by | Where it lives |
|---|---|---|---|
| Topic dossier | PM, Designer, Architectthree stages into one tree | the human; PM and Architect during planning | docs/backlog/G-XXX-*/ |
| Spec delta | Architect | Developer, Tester, Reviewer, Technical writerits scenarios are the acceptance criteria | changes/<change>/specs/ |
| Task | Architect | all build roles and the builder itselfthe task's labels decide whom to call and on which model | changes/<change>/tasks/ |
| Prototype | Designer | the human at the gate — before development | docs/design/<change>/ |
| Task code | Developer | Tester, Reviewer | branch task/T-XXX |
| Tests | Tester | Reviewer, DevOps during packaging | the same branch |
| Standards | the human and the project, not a role | Developer, Tester, Designer, Reviewernot whole: the engine selects by the diff | docs/standards/ |
| Verdict | Reviewer, Architect at adjudication | the hook (which turns it into an event), DevOps before the merge, the builder | structured output → event |
| Bug | Reviewer, Tester, Architect | Architect, the human, doctor |
docs/bugs/ |
| Spec archive | Technical writer | search across closed deliveries | changes/archive/ |
| PR / MR | DevOps | Reviewer (a comment), the human | GitHub or GitLab |
| Event | code: subagent hooks, the git hook, record, the guards |
all projections | .firm/events/ |
| Task diff and work map | code (through a DevOps call) | Reviewer and Tester — in the stage prompt | not stored |
| Red snapshot | code (through a DevOps call) | the new-red gate; the Reviewer sees the gate's state | not stored |
| Board and statuses | code, from the journal on every request | the builder, the Reviewer (about other tasks), the human | not stored |
| Receipt | code: the tree's fingerprint in the acceptance event | the guard before the merge — a verdict issued to another tree will not pass | a field of the event |
What follows from this. A role is the author only where judgement is needed: requirements, task cutting, code, tests, a verdict. Everywhere a fact is needed — what exactly changed, what was red before, who accepted what, what it cost — there is no role-author and there must be none: those are exactly the assertions a role can neither carry out nor measure. Hence the boundary in the catalogue too: for half the entities the answer to «who creates it» is not a role but the name of a script.
No role writes an event itself — that is a load-bearing part of the route (ADR-0002). The model returns structured output, and the event is made out of it by code.
| Writer | When | Stages | Bound by |
|---|---|---|---|
The SubagentStart / Stop hookthe stage is derived from the agent type |
the start and finish of any role in the table | dev · test · review · adjudicate · design · docs | the FIRM2-TICKET marker in the prompt; for a delivery — MR |
The git hook post-mergea step inside the engine can be bypassed, the hook cannot |
a task merge and a delivery release | merge · release | the second parent of the merge commit (ADR-0005) |
firm-event recordthe boundaries the hooks cannot reach |
the human gate, a manual merge, cancelling a task | demo · gate · lifecycle · merge/failed | --ticket is mandatory; the stage name is checked against a dictionary |
The PreToolUse guardscannot be bypassed: refusal before the tool runs |
an attempt to do something forbidden | guard | the task tree or the branch; without a ticket — the label MR |
Guards stand on PreToolUse and answer with a refusal before the tool has run. That is why they are the only part of the route that does not depend on whether a role read its prompt.
| Guard | What it catches | Event |
|---|---|---|
| write-guard | a write outside its own worktree and into the project's shared household | refusal |
| bash-guard | lifting the sandbox from a task tree | guard/sandbox-off |
| secret-scan | a secret in a commit or in a file | guard/secret |
| test-criteria-guard | removing a criterion check without a stated reason | guard/test_criteria |
| review-receipt | a merge on a verdict issued to another tree | guard/review-stale |
| egress | sending outward — a receipt in the journal (ADR-0014) | guard/egress |
| pause | starting a new task while a pause is in force | guard/pause-held |
Four things without which the picture would be more convenient and less true.
doctor are stored nowhere — they are computed from the journal on every request. Exactly how — seven steps on the states page.Where the numbers come from. The formal half of this page — models, tools, stages, call schemas, output keys, techniques and templates — is read off the source by node firm2/scripts/roles.mjs --json; a divergence between a call schema and a role's prompt is caught by the preflight (step 3у), so the page does not go stale silently. The rest — the input cards, the wordings, the «entity → role» map and this section — is judgement, and nothing derives it.