Bonfire

The 7-Stage Pipeline

The standard_build workflow — 7 stages, 4 quality gates, 2 bounce-back loops.

The canonical workflow is standard_build() in workflow/standard.py (lines 37-89). Every other workflow in Bonfire derives from this reference pipeline.

The stages

SCOUT → KNIGHT → WARRIOR → PROVER → BARD → WIZARD → HERALD
  observe  contract  execute  verify  publish  audit  announce

Quality gates

Gates are enforced at stage boundaries by engine/gates.py. A stage cannot advance until its gate passes.

StageGateOn failure
ScoutAdvances unconditionally
KnightcompletionAdvances only if Knight produced test files
Warriortest_passRetry up to max_iterations=3; after 3, escalates
ProververificationBounces to Warrior for rework
BardAdvances unconditionally
Wizardreview_approvalBounces to Warrior for rework
HeraldAdvances unconditionally

The two bounce-back loops

Prover to Warrior

The Prover re-runs the tests independently. If the Prover finds a regression the Warrior missed, the pipeline bounces back to the Warrior stage. The Prover is an independent auditor — the Warrior cannot skip it.

Wizard to Warrior

The Wizard reviews the pull request. If the Wizard rejects it (quality, style, architecture, accessibility), the pipeline bounces back to the Warrior for rework. This is the structural reason shipped code earns "Wizard-approved" status.

Both loops respect max iteration counts. After exhaustion, the pipeline escalates rather than spinning.

Checkpoint semantics

State persists to disk between stages via engine/checkpoint.py. A crash at stage 4 resumes at stage 4. Combined with gate enforcement, this means:

  • A checkpoint after a test_pass gate is a safe resume point — all prior tests are green.
  • A checkpoint after a review_approval gate means the PR has been Wizard-approved.

Pipeline as data

The standard_build() factory returns a WorkflowPlan — a frozen Pydantic model. The plan is:

  • Diffablegit diff two plans to see what changed
  • Versionable — commit plans alongside code
  • Serializablemodel_dump_json() for wire transport
  • Introspectable — iterate stages, query gates, check dependencies

This is the foundational difference from graph-based workflow frameworks where the workflow shape is embedded in Python code.

On this page