Layer: delivery, made configurable. Proof: make prove LEVEL=workflows.
A factory that runs the right workflow for the ticket. A bug runs red, fix, mutation. A feature runs spec, human gate, tests, build. Each workflow is a file, and every gate is code that reads exit codes, not the model's word.
The delivery level has one fixed order. A bug, a refactor and a UI change need different evidence, and a fixed order either skips evidence or asks for evidence the task cannot give.
Run a bug and a refactor through the same stages. The bug never proves its test failed first. The refactor never proves behaviour stayed put.
.factory/workflows/<name>.yamlholds one workflow. Each step names a stage, an agent from.claude/agents, the checks it must pass, an optional loop with a cap, and an optional human gate. The first line names the method and its source.factory/engine/workflow.tsparses a workflow with zod and refuses an unknown check or a loop on a check the step does not run.factory/engine/interpret.tsruns the steps in order. A loop repeats the agent with the failing checks' evidence until they pass or the cap is hit, then hands the ticket to a human.factory/engine/checks/holds the checks.redfails a test that already passes on the base commit.lockhashes every test file in runner state the agent cannot write.plan-driftfails a diff that strays fromplan.md.factory/engine/review.tsruns review lenses in parallel, then three verifiers vote on each finding and only two votes keep it. A reply that is not findings is a failed review.factory/engine/risk.tssets the tier from the paths changed. An agent's approval never counts and an approval covers one commit.factory/engine/bands.tsturns a metric breach into a response: log, diagnose, or write anintent.md..claude/settings.jsondenies reading.factory/holdout/**, so the builder cannot see the cases that grade it.
The bug workflow cannot reach its fix step until a test has failed on the base commit, and it cannot finish if the fix moved that test.
- Read
.factory/workflows/bug-tdd.yamlandfeature-bdd.yamlside by side. - Run
npx vitest run factory/engineand read the dry run for each workflow. - Change
maxon a loop to 1 and watch the dry run inworkflows.test.tsstop at the cap.
make prove LEVEL=workflows runs the engine tests: every workflow parses and runs in order, red refuses a passing test, lock catches an edited test, a one-vote finding is dropped, a CI workflow change is the high risk tier, and a 3 sigma breach writes an intent.
Track A: add a typo workflow for a one-line docs fix with only the prose check, and see the workflow test pick it up. Track B: add a check that fails when a changed file has no test beside it, and give it a failing input first.
Which check would your team trust to say done, and what would it have to read to earn that?
