What lives longer than any delivery: the project's configuration, the places where the engine decides for itself, and the long-lived documents.
.firm/configConfiguration
The human's declaration about the project. Everything written in it is stronger than the engine's computation — which is why there are exactly as many keys here as a human is willing to keep in their head.
- Mandatory
- engine: firm2 · engine_root · the git hook post-merge — without these three no journal is kept
- Common
- parallelism · short_lane.paths · planning_rules ·
browser_harness · stack.task_tests_excluded · active_change
engine_rootConfiguration
The path to the engine's source. Through it scripts/ are read live — which means edits to them reach projects at once, without raising a version.
- The opposite
- commands, roles and workflows are taken from the plugin cache and lag behind
Plugin versionConfiguration
Not bookkeeping but a delivery mechanism. An update compares the version in the manifest: if the version is unchanged there is nothing to update, even if the contents changed.
- When to raise it
- you touched commands/ · agents/ · hooks.json · workflows/
- The project sees
- engine_version against the actual one; /firm-adopt pulls it up
- Caveat
- commands and roles are picked up only in a new session
GateHuman
The interval of waiting for the human's decision — also a pair of events, like any stage. Two gates on the route, and each has two outcomes, not one.
- Gate 1
- the tech spec: accepted → the build; sent back → back to the planning roles
- Gate 2
- the demo: accepted → the release; rejected (demo/rejected) → bugs
- Held by
- ADR-0009: the engine does not close someone else's stage and does not dispose of someone else's time
Format gateExternal system
A machine check of the spec before the gate: openspec validate <change> --strict --json.
- Careful
- the nameless form checks nothing — it answers «nothing to validate» with exit code 1
GuardCode
The place where a rule is executed by code, not by a prompt: the tool simply does not let it be done otherwise — it refuses, computes the thing itself, or sends the work back. There is exactly one criterion: the machine holds what a role cannot carry out or cannot measure.
- Examples
- suite-run · ownNewRed ·
task-merge · requireKnownFlags · bash-guard
- Where a guard is wrong
- where a role merely made a mistake, the place stays with the prompt
- Held by
- every guard is checked by the preflight: if the mechanism disappears, the version does not go up
FindingStructured output
What the machine names but does not forbid. Every measurement's exit code is always zero: a finding is a candidate, and the decision is the human's.
- Difference from a guard
- a guard stops, a finding only speaks
- Measurements
- mass · groom cost · test-audit · context-bill · stage-bill
Bug BUG-XXXDocument
A defect found by a review, a panel or a human. The links are one-way: a bug has fix_task and tickets, a task has no links to bugs.
- Where
- docs/bugs/BUG-XXX.md
- Consequence
- replacing a task leaves its bugs hanging into the void; doctor names candidates for re-hanging but does not re-hang them itself
- Number
- reserved at the moment it is issued — .firm/ids/<ID>.json
BRD and BR-NDocument
The project's long-lived business rules. They live in one place: dossiers and specs carry only BR-N references, otherwise a rule would be in two places and one day they would diverge.
ADRDocument
A hard-to-reverse decision, written down as a decision. The boundary is simple: what goes into an ADR is what is expensive to undo. The engine itself has fourteen.
- Where
- docs/adr/
- Rule
- an edit that diverges from an ADR is fine, but the ADR is fixed first, not the code silently
CONTEXT.mdDocument
The project's living glossary: domain terms, growing from delivery to delivery. Specs refer to it and do not duplicate it.
- Maintained by
- the PM and the Architect, with the technique firm-domain-model
RoleCode
An agent with its own prompt, output schema and journal stage. There are eight: PM, Architect, Designer, Developer, Tester, Reviewer-QA, DevOps, Technical writer.
- Where
- agents/, called with the prefix firm2:
- Cross-check
- roles.mjs reads off the formal part of every role and checks the sides against each other — who calls it, which schema is passed, what the role declared as its output
TechniqueCode
A skill — a reusable procedure a role applies. There are ten: seven adapters to external sets and three native ones.
- Held by
- ADR-0011: a role does not call someone else's skill directly — an engine technique stands between them
- Native
- firm-human-docs · firm-verify · firm-test-audit
EngineCode
firm2 itself: one plugin holding the route commands, eight roles, ten techniques, the builder, the hooks and the scripts. A project connects it with two config keys and one git hook.
- Version
- visible to the project as engine_version against the actual one; pulled up by /firm-adopt
- Boundary
- no external dependencies — the checking tools live only in development
OrchestratorCode
The session that runs the route: it reads the command, calls the roles, writes events at the boundaries the hooks cannot reach. The only channel between a role and the human — roles have no direct channel, the questions go through it.
- Not a role
- it is not in agents/: it executes a command, not a role's prompt
- What it does not do
- it does not close someone else's stage and does not decide for the human
Stage subagentExternal system
A separate model launch that executes one stage. The runtime does not tell it its own identifier — hence the whole mechanism of markers.
- Window
- its own, and it cannot be added to the session's window — those are different accounts
- Events
- the start and the end are written by the SubagentStart / SubagentStop hooks
Route commandDocument
The steps of the route, written as text and executed by the Orchestrator. There are five, and each is a separate session.
- Which
- /firm-setup — once per project · /firm-adopt — accept a new engine version · /firm-discovery — discovery · /firm-plan — planning · /firm-build — the build
- Where
- commands/; they reach a project through the plugin cache, which means they require a version bump
PreflightCode
The engine's check of itself before delivery: the linter, syntax, module linking, launching every CLI, the invariant tests and a run over a disposable synthetic project with a real merge through a conflict.
- How it holds
- it is built into the version bump: it did not pass — the version does not go up, so there is physically nothing to travel into projects
- The trick
- it checks the other side too: it plants a false «merged», and doctor must return ok: false
- Why
- it was put in after a day in which three defects travelled into four live projects in a row — all three were found by runs costing five million tokens
MeasurementMeasurement
The answer to the question «what does this cost». There are five measurements, and not one of them is a gate: the exit code is always zero, a finding is a candidate, and the decision is the human's.
- Which
- the mass of the repository · the price of discovery by topic · the payback of the tests · the context bill · the stage bill
- Rule
- a threshold is expressed in what was measured. A rule without a measurement is taste, and that applies to the engine's own rules too
InvariantDocument
A statement about the route that must always be true — numbered, so that code and analyses can refer to it. There are fifteen.
- Where
- docs/domain-model.md, I-1…I-14 and I-9a
- What holds them
- tests in tests/ and steps of the preflight
- Why
- three defects of one day were mistakes not in the code but in the language: «merged», «abandoned» and «the time of the event» meant something other than the code thought
Plugin cacheExternal system
The copy of the plugin from which the runtime takes the commands, the roles and the builder. It lags behind the source — and that is not a defect but how delivery is built.
- What comes from here
- commands/, agents/, hooks.json, workflows/
- What goes past it
- scripts/ — they are read through engine_root, straight from the source
- Caveat
- commands and roles are picked up only in a new session
SandboxExternal system
A runtime restriction: writing outside an allowlist of paths is forbidden. A stage cannot lift it — that is a guard's refusal with an exit code, not a request in a prompt: switching it off removes the protection from the whole machine for the sake of one command.
- Holds
- bash-guard.mjs
- Consequence
- some tools simply do not work under it, and that has to be known in advance — «not checked» must differ from «clean»
Project stackConfiguration
How the project is built, tested and linted. The engine runs projects with different stacks and does not invent their commands — it takes the declared ones.
- Where
- stack.test_cmd, stack.lint_cmd, the language and the package manager in the config
- Alongside
- stack.task_tests_excluded — what is deliberately left out of the task suite; what was not run is named in the wave's report
Browser harnessConfiguration
Ready-made rigging for a live interface check: build, launch the browser, connect, measure, clean up. The implementation belongs to the project — the engine does not write it — but the path must go into the config, and then it reaches the stage in the prompt.
- Where
- browser_harness in the config
- The price of skipping it
- measured: 30 browser checks, zero imports of a shared module, ~400 lines of rigging per task; the delivery produced 605 lines of product against 8530 lines of checks
- Link
- the label needs-browser — the criteria are closed only by a live run
StandardsDocument
The project's written rules: how we write code, tests, interfaces. Three roles read them — and read them not whole: the engine selects the files whose declared paths intersect the task's real diff.
- Where
- docs/standards/ — common.md, the project's language, ui.md; alongside, lint-policy.md. The starting blanks are in the engine, templates/standards/
- Selection
- firm-state standards --ticket T-XXX: selects by the paths key in a standard's header against the diff of the task's branch
- Without selection
- without --ticket and --files there is no selection and that is said out loud: the default «everything applies» is safer than the default «nothing applies». A git refusal is read the same way — openly, otherwise an axis is dropped in silence
- What holds it
- an axis for which the project has no written file is declared unchecked by the verdict, not passed (ADR-0007)
How to read this together with the rest. This page answers «what is it». How the entities move along the route — on the BPMN diagrams in «The firm2 route». Which states they can be in, what the task labels mean and which role runs on which model — on the page
«States and labels». What exactly goes in and out of each of the eight roles — in «Eight black boxes». The truth of the code is in
firm2/docs/domain-model.md and
firm2/docs/adr/: on a divergence they are right, and this page must be fixed.