ENRU
firm2 · reference

firm2 entities

~/firm2 $ cat README_entitiescollapsed

Eighty-two definitions: what a thing is, what it is made of, where it lies in the repository and who creates it. The route diagrams and the analyses link here and introduce no words of their own: if a term is not on this page, it does not exist.

The page stands on its own: it can be copied whole and put anywhere — there is no external data in it, and all the code is a dozen lines that open a collapsed section when a link points inside it.

~/firm2 $ cat §0-seven-kindscollapsed

§0Seven kinds

The kind answers the question «who made this and what holds it up». Every entity below carries exactly one.

DocumentText in the repository. Written by a role, read by a human and by the next role.
Code and testsWhat is executed. The only thing that travels into the product.
Journal eventAn immutable fact. Written by engine code, not by the model.
Structured outputA role's JSON against a schema. The engine reads fields, not prose.
Configuration and measurementA number declared by a human or computed by a machine.
External systemgit, the runtime, openspec, the browser — what the engine does not control.
HumanA decision the engine does not take on their behalf (ADR-0009).
~/firm2 $ cat §1-discoverycollapsed

§1Discovery

Everything that lives before a delivery. Discovery does not materialise it: grooming ends with a dossier in the backlog, and the change folder is created by planning (ADR-0012).

Topic G-XXXDocument

The subject discovery runs on: one human wish, not yet laid out as work. Its identity is a number, reserved before a single file exists.

Where
docs/backlog/G-XXX-<slug>/ on the grooming branch
Created by
the human, with the command /firm-discovery
States
grooming → groomed → planned, with the engine's checks

RequestDocument

A topic that has only a number and a subject. It creates no branch, no worktree and no dossier: it takes a number and says what the matter is.

Why
so that a wish can be written down without starting discovery
Next
discovery turns it into a dossier, or it just lies there

Topic dossierDocument

The result of discovery: a folder of four files by which the human decides what to build next. No fifth file is created in it — anything that does not help that decision is superfluous here.

Composition
requirements.md · decisions.md · code-impact.md · screens.md (UI only)
Where
docs/backlog/G-XXX-<slug>/
Held by
status groomed without a dossier is called a divergence by the engine: something declared ready that does not exist
Template
templates/groom-dossier.md

requirements.mdDocument

What the human wants and how they will check they got it. Written by the PM after interviewing the human.

Composition
the human's task as a paragraph · numbered requirements · business acceptance criteria · open questions
Frontmatter
groom, release (the dashboard groups topics by it), br_refs
Boundary
rules are written in the BRD, here only BR-N references

decisions.mdDocument

The Architect's decisions as a list: what was chosen, why, what was rejected and what we pay for it.

Boundary
a hard-to-reverse decision is an ADR, here only a line with a link

code-impact.mdDocument

What will have to change in the code: modules, files, risks. The reason the dossier exists as a separate document at all — without that answer the human can judge neither the size nor the risk.

Written by
the Architect, reading the code rather than the design

screens.mdDocument

A list of screens and states. A list only: the prototype is drawn during planning, once it is known that the topic is going into work.

When
only if the topic is about an interface

BacklogDocument

All of the project's dossiers in one folder. There are many discoveries, and far from every one reaches planning — that is a normal state of the backlog, not an unfinished job.

Where
docs/backlog/
Read by
the human — when choosing the next delivery
Measurement
firm-state.mjs groom cost — what discovery cost, by topic

Open questionHuman

The place where a role does not know the answer and is obliged to say so rather than invent it. A non-empty open-questions section keeps a topic from the status «ready» and is named to the human item by item.

Held by
ADR-0007: uncertainty stops the action and demands a question
Rule
an empty section is better than a guess in its place

Topic recordConfiguration

What the engine knows about a topic: the number, the slug, the declared status. It lies in the main tree and gets into no branch — the record is visible to every session at once.

Where
.firm/groom/G-XXX.json
Created by
firm-state.mjs groom new
If missed
a topic created without it does not exist for the engine: it is not in the list, stages will not bind to it, and it will not enter the cost measurement
Slug
a short Latin name — both the branch groom/G-XXX-<slug> and the dossier folder are built from it
~/firm2 $ cat §2-deliverycollapsed

§2Delivery

The unit of release. Everything in this section is born during planning and dies with the delivery — except tasks, whose numbers are unique across the whole project.

Delivery changeDocument

A set of tasks with a shared spec and a shared branch — the root entity of the whole build route. It lives in two places at once, and that is deliberate: the spec is versioned together with the code.

Where
openspec/changes/<change>/ + branch feature/<change>
Composition
proposal.md · design.md · specs/ · tasks/ · prototype
Created by
the PM during planning; closed by the Technical writer with the spec archive before the merge into main
Identity
the name of the spec folder

proposal.mdDocument

The dossier laid out as a delivery document by OpenSpec conventions. Not a renamed dossier and not a copy: the delivery document has its own audience and its own lifetime.

Written by
the PM, at step 1 of planning
Boundary
the dossier's open questions are either closed here or carried over explicitly; one assembled out of guesses does not go to the gate

design.mdDocument

The approach, the boundaries, the contracts. No code: implementation listings are the Developer's work, while a structure tree and interface contracts belong here.

Written by
the Architect
Contains
module boundaries; C4 and sequence diagrams live separately, in docs/architecture/, because they outlive the delivery

Module boundariesDocument

The section of design.md where every path is declared touched or frozen, and for a touched one the condition is named — what exactly edits it and in which task. This is the only place from which the machine knows who owns a file.

Read by
the cut-closure check: who else reads the removed name and whose task that is
Why
a removal that is not ordered by its readers breaks them at the moment its own task merges

Spec deltaDocument

A contract change in three sections — ADDED / MODIFIED / REMOVED. Every acceptance criterion must have at least one scenario.

Where
openspec/changes/<change>/specs/
Form
scenarios under the heading #### Scenario:
Checked by
the format gate

tasks.mdDocument

The delivery split into tasks. The order of the lines is the dependency: the build cycle goes strictly top to bottom, and what must come earlier stands higher.

Form
a list line + labels as inline tags at the end
Written by
the Architect, having first read the project's cutting rules

Task T-XXXDocument

The unit of work of one executor: acceptance criteria, dependencies, labels. The number is unique within the project, not within the delivery — there is one journal, and two live deliveries with T-001 would glue together.

Where
openspec/changes/<change>/tasks/T-XXX.md
Identity
the id from the frontmatter, not the file name
File
append-only: two roles from two trees write into it, and the conflict is sorted out by code, not by git
Status
in the header it is a cache, the truth is in the journal

Acceptance criterionDocument

A checkable statement on which the Reviewer passes a verdict. The machine checks not the meaning but the form: a number without saying what measured it, and a quantifier without a named set, are findings, not nit-picking.

Checked by
the criteriaFindings family in lib/firm.mjs
Rule
a threshold is expressed in what was measured; a rule without a measurement is taste

Task labelsConfiguration

Inline tags with which the Architect switches the build machinery for a single task.

Full list
on the states page — with the price of each and the model it raises
Which
high-complexity — the Developer on Opus · fact-sensitive — the QA panel and a fact check · short-lane — test and review do not open if the diff stayed inside short_lane.paths · security-sensitive — the QA panel and a security axis in the verdict, cancels the short lane · ui — the task enters the prototype

EpicDocument

A grouping of a delivery's tasks. Created when there are more than three tasks — that is a default threshold, not a law: the PM may override it but must write why.

PrototypeDocument

One HTML file for the whole delivery: every screen and state, laid out by task. The human needs it before development starts — shown after the build, it influences nothing.

Where
docs/design/<change>/ui.html
Written by
the Designer, stage design, under ticket MR
When
there is at least one task with the label ui: true, otherwise the step is skipped entirely

Delivery ticket MREvent

The same event binding as a task's, but for a delivery-level stage — review of the whole diff, the prototype, the release. No task with that number exists, and it never reaches the board.

Lives
only in the journal

ReleaseConfiguration

Two different meanings, and they are easy to confuse. The target release is the human's declaration of which product version a topic belongs to; it stands in the requirements frontmatter, and the dashboard groups the backlog by it. The delivery release is the end of the route: the release stage, after which tasks get the status released.

Target
release: 3.2 in requirements.md; if it is not set, the topic falls into the group «no release assigned», and that is honest: it is the human's decision
Of a delivery
the event is written by the git hook post-merge on the merge into main
Order
the engine neither computes nor proposes the order of releases

groom landCode

The step at which a topic stops being a topic: the engine merges the grooming branch into the base and gives back the worktree. The only place in the whole of grooming where the engine changes history — and therefore the only one where it has four refusals in a row.

How
firm-state.mjs groom land G-XXX
Refuses if
the main tree is not on the base · it has uncommitted changes · work is left in the grooming tree · the branch has no commits
Conflict
it rolls back itself (merge --abort), so the human sorts it out in a clean tree
Returns
change_name — the proposed delivery name, <date>-<slug>

Delivery reviewEvent

Supervision not of a task but of the whole diff of the delivery against main: what is invisible piece by piece — divergences between tasks, debugging traces, things forgotten. Bound by the ticket MR.

Alongside
the full test suite, the linter and packaging the PR — DevOps work

PR / MRExternal system

A merge request in the repository host. Which one exactly — GitHub or GitLab — is declared in the project config; the engine opens it itself, and the delivery review's verdict is posted into it.

Not to be confused
with the MR ticket in the journal: that one is an event binding, not a page in a host

Spec archiveDocument

The spec of a closed delivery, moved into an immutable folder. It is done before the merge into main and after the demo gate — not earlier: an archived spec of a delivery that was not accepted leaves two states of one delivery, the live one and the archived one, and a human has to sort them out.

Where
openspec/changes/archive/<date>-<change>/
Done by
the Technical writer; the same role pours the contents into the live documentation
Consequence
task search can look into the archive too — otherwise a closed delivery loses its history
~/firm2 $ cat §3-workcollapsed

§3Work

The task cycle. The section's main peculiarity: half of these things are stored nowhere — they are derived from the journal, and the engine knows exactly what it wrote down itself.

WorktreeExternal system

A separate git worktree folder for one task. It is created exactly at the delivery's head — a circumstance that looks technical and cost two defects in a day.

Where
../<project>.worktrees/ — outside the repository
Gets
only what is versioned; .env and node_modules do not appear in it by themselves — hence a separate environment setup step
Removed by
firm-state.mjs prune, recognising an empty tree by four conditions

Task branchExternal system

task/T-XXX. It counts as merged only by the second parent of the merge commit: a branch with no commits of its own is indistinguishable from a merged one to every naive check.

Held by
ADR-0005 · the merge must be --no-ff, to leave a trace
Boundary
something merged by hand through --ff or rebase the engine cannot tell apart, and it asks the human

SlotConfiguration

The right to run one task at a time. The ceiling is parallelism from the config.

Counted by
computeBoard

StageEvent

A span of one role's work on one ticket. Not stored: a stage exists exactly when the journal holds a pair of events with one (ticket, stage) — a start and a closing outcome.

Which
thirteen, as a list with their authors: dev · test · review · adjudicate · design · docs · merge · demo · gate · release · lifecycle · guard · groom
Consequence
an unclosed stage is indistinguishable from a running one — only by age (a 6-hour threshold)
Measurement
stage-bill.mjs: duration, waiting in polling, full suite runs, budget

AttemptEvent

One entry of the Developer into a task. There is no separate counter: attempts are counted as the number of dev/started events. There are three, and adjudication does not reset them.

Exhausted
the task is taken down (superseded) and replaced by a new one — the Architect's decision
Marker
FIRM2-ATTEMPT

RunExternal system

One launch of the builder. It has no identity in the repository — no file, no number, no «started» record — and that is the main source of complexity in the whole engine.

Consequences
a run that is taken down leaves open stages, and only a human can close them · the pause is a flag file, because a workflow script has no filesystem access · a restart recomputes the task list from scratch
Where
workflows/firm2-build.js

Work mapStructured output

The addresses of what the task really touched, laid into the next stage's assignment. There is a single point to it: the Tester gets addresses instead of grep reconnaissance.

Code graphExternal system

An external dependency index (codegraph). It answers the question an edit to a shared function should start with: who depends on it.

Commands
fn-impact <name> · diff-impact
Measurement
measured on stages and rejected: 7% of moves instead of the expected 36% — it stays a request, not a mechanism
Two answers
«built» and «fresh» are different: the engine tells them apart

Suite runStructured output

A long test run carried by the engine, not by a role: a 10-minute call ceiling against a 43-minute suite is not cured by asking.

How
suite-run.mjs start / wait; presented as proof — an id and an exit code, not prose
Holds
a second identical run from the same tree is rejected; the end of a stage while a run is going writes guard/suite-abandoned and returns the role to work

Red snapshotMeasurement

A list of failing tests taken at three points: at the branch point, on the target branch and at the task's head. The difference between these lists is the only thing that establishes «the red was introduced by the task».

Holds
ownNewRed — returns the task to work before review; delivery_red_check — the same at delivery level
Why the machine
attribution is a comparison of three lists, two of which the role did not take; the role cannot see an error in it
Caution
«the field was not presented» and a substring match of names are read towards «do not block»

Task diffStructured output

The composition of the work, taken by the engine rather than retold by a role. It is taken at the single moment when the work will not change any more and is only about to be judged: after the test stage and before the review.

Where it goes
into the Reviewer's prompt — so that it judges by files, not by a story
It also
decides the short lane: the claim is checked against the real diff

Short laneCode

Skipping the test and review stages for a task whose real diff stayed inside the declared paths. Code decides: the role claims it with a label, the engine checks it against the diff.

Event
guard/short-lane — a name of its own, not a forged «accepted by review»: there was no review, and the journal must say so
Configuration
short_lane.paths in the config; without the key the label does not work, and the engine says so
Cancelled by
the label security-sensitive

QA panelCode

Three independent reviewers on one task instead of one — on risky tasks and on every attempt. The idea of a panel is the independence of the votes, not the ability of one reviewer.

Switched on by
the labels high-complexity, fact-sensitive, security-sensitive
Split
the disagreement is settled by the Architect — the adjudicate stage
A lost vote
the event guard/qa-member-lost: the panel was incomplete. That is a failure of the rigging, not an assessment of the work

AdjudicationHuman

The examination of a task that left the cycle without acceptance. It is run by the Orchestrator, it calls the Architect, and the human decides. There are three outcomes, and the most frequent is not taking the task down but returning it.

Resolved
lifecycle/arbitrated — the task goes from the start of the cycle; attempts are not reset
Superseded
lifecycle/superseded — cut too coarsely, new tasks are created in its place
Cancelled
lifecycle/cancelled
The decision
the text of the decision reaches the executor verbatim — it is laid into the next stage's prompt on its own line, after the remarks of the previous review

EscalationEvent

An honest stop: the role has hit a wall and says so instead of a fourth lap round the circle. A regular move of the route, not a failure — what is expensive is not admitting a dead end but going round the circle in silence.

From where
the role returned «the problem is above» · the attempts ran out · the panel turned out to be incomplete
What it does
moves the task to blocked and hands it to adjudication

Branch point and target branchExternal system

Two git snapshots without which one cannot say «this red was introduced by the task». The branch point is the state the task departed from; the target branch is the delivery it will merge into.

Why
the name of a failing test that is on neither of the two belongs to the task — see the red snapshot
Taken by
the engine; the role did not take them and cannot see an error in the comparison
~/firm2 $ cat §4-the-journalcollapsed

§4The journal

The truth about what happened. It is written by code — the runtime hooks, the git hook and the commands — not by a role's retelling of its own work (ADR-0002).

JournalEvent

Every event of the project over its whole life, previous engines included. Append-only: a mistake is corrected by a new event that names the file of the wrong one.

Where
.firm/events/
Held by
ADR-0006 · holes are found by firm-event.mjs doctor

EventEvent

An immutable fact: (ts, change, ticket, stage, event, actor, …). One file per event — because events are written in parallel from three worktrees, and a shared journal would give a merge conflict on every commit.

File name
<stamp>-<ticket>-<stage>-<outcome>.json, with a number when taken
Time
always UTC with Z: the journal is sorted by comparing strings
Held by
ADR-0003

OutcomeEvent

How a stage ended. Two distinctions in this list are not pedantry but the price of defects: abandoned ≠ never happened, and the time of the event ≠ the time it was noticed.

Which
thirteen: started · finished · accepted · rejected · escalated · arbitrated · failed · superseded · cancelled · abandoned · retracted · paused · resumed — each taken apart on the states page
abandoned
the stage was running and was interrupted, there will be no finish
retracted
the event did not happen at all, it was recorded by mistake

MarkerEvent

A line in the stage prompt by which the hook binds an event to a task. The runtime does not pass a subagent its own identifier — so the binding rests on a marker, not on the agent's name.

Which
FIRM2-TICKET: T-XXX or MR · FIRM2-GROOM: G-XXX · FIRM2-ENGINE · FIRM2-ATTEMPT
If removed
the hook writes an event with ticket: unknown and returns exit 2 — a hole in the journal forever
Held by
ADR-0004

VerdictStructured output

The Reviewer's structured answer on a task. The engine reads fields, not prose, and the acceptance event carries the tree's fingerprint: a verdict certifies content, not intent.

Fields
verdict (accepted/rejected) · escalate · criteria_results · notes
Held by
ADR-0013
Rejected
the task returns to work, attempt +1

ReceiptEvent

A trace of what went outward. There is no payload in it — only a hash: a receipt must not become a second place where what was sent is kept.

Composition
digest — sha256 over the canonical content — and prev, the digest of the previous receipt of the same task
What it catches
a deleted receipt breaks the chain, a changed one does not add up
Held by
ADR-0014

AnnulmentEvent

The statement «the former event did not happen»: the outcome retracted plus the field corrects with the name of the wrong file.

Why
otherwise there is nothing to correct a false «merged» with: a second merge/finished merely adds a second lie to the first

ReconciliationExternal system

Reading git as the source of truth where an event may not have been written. It is needed because a merge conflict is finished by the human in their own terminal, outside the session.

Rule
it appends the event with the time of the merge commit, not the current time
Where
reconcileMerges

BoardStructured output

A projection of the journal: tasks, statuses, dependencies, slot occupancy. Read-only — the board decides nothing and is nothing but a view onto the events.

Where
computeBoard; for the human there is the dashboard, which is regenerated on every event and therefore not committed

Task statusStructured output

A conclusion from events, not a stored field. What stands in the task's frontmatter is a cache; a divergence between runs is not an error but the norm.

Which
twelve, with a transition diagram: todo · ready · in_progress · in_test · in_review · rework · accepted · merged · released · blocked · superseded · cancelled
blocked
entered by escalated, left by arbitrated
Where
statusFromEvents; a stale cache is shown by doctor as stale_cache

ProjectionStructured output

Any answer computed from the journal afresh: the board, the statuses, timing, the token count, the dashboard, doctor's findings. A projection stores nothing — so it cannot be «fixed», only a new event can be appended.

DashboardStructured output

The human view of a delivery: tasks, statuses, releases, cost. It answers one question — can this be shipped.

Where
.firm/dashboard.html
Why it is not committed
it is regenerated on every event — in a branch it would conflict on every merge

doctorCode

A search for holes in the journal: unclosed stages, accepted but not merged, duplicate numbers, bugs hanging on dropped tasks, a status cache that diverges from what the events imply.

How
firm-event.mjs doctor
Boundary
it names and does not fix: which replacement fixes which bug is the Architect's decision

Timing and the token countMeasurement

What the work cost. Timing distinguishes calendar time from active time; the token count is broken down by stage and model, and for a stage one can see how long it stood waiting.

By what
stage-bill.mjs · context-bill.mjs · groom cost
What was found
the very first run over a wave: 7.3 hours out of 15.1 hours of tool work — waiting in polling loops
Boundary
a threshold is expressed in what was measured; the budgets stand in characters, not in tokens — the engine has no exact tokeniser
~/firm2 $ cat §5-project-and-enginecollapsed

§5The project and the engine

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.