Skip to content

Factory · Layers 4 and 5 · Construction

Build a working mock, then the real product.

Construction happens in your environment, by your agent. Factory hands out one component at a time with exactly the context it needs, and records what was built, what was checked and what went wrong.

What it holds

  • Runs: a mock or product build pinned to exact design revisions.
  • Claims: one component handed to one agent invocation, with a token and expiry.
  • Reports: delivered results with exact artifact identities, checks and evidence.
  • Issues: blockers and design flaws, routed to whoever must resolve them.
  • Scenario results and the user's acceptance.

Why it exists

A design is only proven when it runs. The executable mock wires real components together with synthetic data and replaced external systems, so design gaps surface cheaply. The actual product is a separate run with its own acceptance, so a passing mock is never mistaken for a finished product.

A small example

Illustrative sequence of Factory commands for the booking app.

start_run          deliverable: mock, pinned spec 4 · model 2 · architecture 3
claim_next_work    → booking-service (leaf), token + bounded context
report_system      delivered: git:acme/booking@<sha>, check "no double booking": passed
claim_next_work    → root (integrate), with exact child results
record_scenario    double-booking: passed, with retained evidence
accept_run         mock accepted by the user

start_run          deliverable: product, adopts the accepted mock

You choose the parallelism

Factory never starts agents. Your harness decides how many workers to run and starts each one; Factory only says which work is eligible and records the outcome. Code, tests and builds stay in your own tools and repositories.

How it is checked

  • Claims are atomic: two agents cannot build the same component at once, and a stale claim is fenced off.
  • A delivery needs one passing check per obligation, backed by retained evidence.
  • A parent integrates the exact results of its children and cannot edit them; defects are returned for repair.
  • A flaw in the spec, data model or architecture pauses the whole run until you decide how to resolve it.
  • The product run must adopt an accepted mock, and each is accepted separately.

Tools

  • mfm_factory_mutatewritesSubmit Factory Command. Submit one typed Factory command.
  • mfm_factory_projectreadsRead Factory Project. Read a bounded project overview at one checkpoint: variants, design revisions and runs with their state and counts.
  • mfm_factory_readreadsRead Factory Record. Read an exact Factory record, its version and recorded provenance.
  • mfm_factory_changesreadsObserve Changes. Observe committed domain changes without claiming work or acknowledging for other observers.

Your agent's step-by-step procedure for this layer is in references/construction.md of the mfm-factory skill. This page explains the concepts; the skill is the operating guide.

All Factory tools