A fully generic, model-driven state machine for guiding agents through a
software development lifecycle. The entire machine — stages, transitions,
gates, required artifacts, review skills, agent commands, system prompts —
lives in the model definition's globalArguments as data. The engine ships
no lifecycle concepts: adversarial review, comprehensive testing, release,
and UAT stages are expressible (see examples/), never assumed.
How it works
An instance is a factory serving many work items concurrently — every
method takes workItem, and all run data is namespaced per work item:
swamp model create @adam/software-factory my-factory
swamp model edit my-factory # fill globalArguments: stages
swamp model method run my-factory start --input workItem=ISSUE-42
The driver loop is the same for every factory: status returns a
self-describing packet (current stage, work spec with run-data bindings
resolved, per-gate transition readiness, context manifest); the driver does
the stage's work, records products, and advances. Gates are hard
enforcement — evaluated in pre-flight checks and re-validated inside
advance.
Methods
start — validate the graph and start a work item at the initial stage
(refuses to restart; resume with status)
status — the driver's entrypoint: what a work item requires right now,
or a factory-wide overview of all runs
resolve_findings — resolution notes on kind: findings artifacts
approve / reject — human gate decisions, cycle-scoped
advance — move along a gated transition
summary — full implementation history of a work item as markdown,
rendered statically from the run data (no LLM); also persisted via the
@adam/software-factory/work-item-summary report
artifact-exists, artifact-fresh (subject-version + recordedThisCycle),
findings-clear, human-approval, evidence-recorded (cycle-scoped, field
matching), cooldown, max-cycles (routing), cel (CEL predicates over run
data), workflow-succeeded (verified against swamp's own workflow run
records, not driver attestation).
Every stage carries maxCycles (default 5): entries past the limit park the
run for an explicit human cycle-override approval.
Run data
All resources are versioned, immutable, and namespaced per work item:
state-<workItem>, artifact-<workItem>-<name>,
evidence-<workItem>-<name>, approval-<workItem>-<gateId>, and an
append-only journal-<workItem>.
02Models1
software_factory.tsv2026.06.15.1
fnstart()
Validate the definition and start a run for a work item at the initial stage. Fails if that work item already has a run (resume with
Record a human rejection for a human-approval gate, with a reason.
Argument
Type
Required
Description
gateId
string
yes
actor
string
yes
note
string
yes
Why this was rejected
fnadvance(transition: string)
Move a work item along a named transition. Gates are evaluated in pre-flight checks and re-validated here.
Argument
Type
Required
Description
transition
string
yes
fnstatus(confirm: string)
What is required right now for a work item — or, without workItem, an overview of every run on this factory.
Argument
Type
Required
Description
confirm
string
yes
Must be the literal string 'reset'
fnsummary(confirm: string)
Render the full implementation history of a work item — every stage visit, artifact version, finding, approval, and transition — as a markdown report built statically from the recorded run data.
Argument
Type
Required
Description
confirm
string
yes
Must be the literal string 'reset'
fnvalidate()
Lint the definition: meta-schema + graph rules. Fails when errors exist.
fndescribe()
Render the state machine (Mermaid) plus stage/transition tables.
03Reports1
@adam/software-factory/work-item-summarymethod
work_item_summary_report.ts
Linear implementation history of a factory work item, rendered statically from its recorded run data
software-factory
04Stats
A
100 / 100
Downloads
42
Archive size
92.6 KB
✓Has README or module doc2/2earned
✓README has a code example1/1earned
✓README is substantive1/1earned
✓Most symbols documented1/1earned
✓No slow types (deprecated)1/1earned
✓Dependencies pass trust audit2/2earned
✓Has description1/1earned
✓Platform support declared (or universal)2/2earned