Build a Continuous Software Engine

Build and Test Your Engine

Start by landing one change in a throwaway Git repo. Make sure a bad review or a crash cannot advance the branch incorrectly before adding a planner, a second repo, or fleet supervision.

Build in This Order

Build in the language the operator chose. If they named a target repo, keep it as the target. Otherwise, start with the local fixture and later use the engine’s own repo to test whether it can improve itself. Use other targets only with explicit authorization. Configure the engine source repo, target branch, authorized providers and limits, and check commands separately. Stay in disposable local repos until you have permission to use a real target, credentials, or remote.

  1. Land one change locally. Use fixture builder and reviewer adapters with real Git and real checks. Verify that an accepted change lands once, a bad verdict leaves the branch unchanged, and recovery after a crash or ledger wipe does not land it again. Expose run, status, and a credential-free selfcheck.
  2. Give the builder real tools. Show that it can read, edit, and run tests in its workspace, but cannot write outside it, alter verification policy, or leave child processes running. Use the engine’s normal entry point and independent review to land a real change to the engine itself.
  3. Keep one repo moving. Add persistent scheduling, a bounded planner, approval waits, recovery, and budgets. Check that the planner pursues the approved objective after the seed queue drains, and that unrelated work keeps moving while a goal waits. Inject a regression and make sure only the change that caused it is charged. With a broken tip and no safe rollback, admit only repair work. Restart mid-run and show what wakes next. Pass the single-repo cases in proof rows 1–7 before handoff.
  4. Add a second repo and a peer. Run the same executable, loop, planner, and repair cycle against a second repo with its own config, checks, and state, rather than putting external targets on a weaker one-shot queue that pushes operators into writing wrapper scripts. Race two peers and check that only one lands, sync preserves human work, and downstream artifacts stay current (proof row 8). A language port is not a second-repo test.
  5. Test fleet operation. Add resumable events, bounded operator views, discovery, and fleet supervision. Show that status responds while probes stall, unsafe upgrades are blocked or rolled back, and the engine meets the final readiness bar.

When to Hand Off

One change to the engine itself is not enough. Wait until step 3 passes, including the human-approved reviewer quality baseline. Give the operator the verified commit, the run, status, drain, and selfcheck commands, the evidence location, and any known limits. If a check is missing, delay handoff but keep unrelated authorized work moving. The engine can continue with steps 4–5 under the same approved objective if authorized.

Record the approved objective, current milestone, how you verified it, and what remains in version control. Seed one small goal for the next missing check; let the planner propose the next step when the queue drains. Never let a worker replace or restart its own engine. Stop when the readiness checks pass and the objective is met. Get human approval before changing the language, target, providers, or direction. A blocker does not authorize a change in scope.

Never build an outer bootstrap driver or wrapper script around the engine to feed goals or drive repairs while the engine is still incomplete. While the engine is below the self-sustaining threshold, work directly with your coding agent (such as Copilot, Claude, or Codex) to build and fix the engine itself until watch mode, diagnostic repair retries, planning, and native dashboard state reading live inside the engine and it can take over on its own repository and external targets without a wrapper.

First Run: A Local Fixture

Use a disposable local repo without credentials or network access. Create and commit these four executable files on engine-demo; the guide does not ship them:

  • greet prints bye with no arguments and version with any argument.
  • check fails unless ./greet prints hello.
  • health checks that ./greet --version prints version. It already passes on the seed commit.
  • metric prints 1 if ./check passes and 0 otherwise. It exits zero either way.

The fixture builder changes only the no-argument output. Here’s one way to express the settings in engine.json. Read settings from a trusted source, never the candidate’s working tree.

{
  "branch": "engine-demo",
  "checks": ["./check"],
  "healthChecks": ["./health"],
  "protectedPaths": ["engine.json", "goals/**", "check", "health", "metric"],
  "limits": { "attemptSeconds": 60, "maxAttempts": 3 },
  "models": { "code": "fixture-builder", "review": "fixture-reviewer" }
}

Run engine selfcheck with credentials unset and the network off. It creates throwaway repos with the greet contract, checks that check initially fails, and runs fixture providers through the real loop. Exit zero only if all three cases pass:

  • A valid accept advances the ref once.
  • An incomplete verdict ({"accept":true}) leaves the ref unchanged.
  • After a crash between ref advance and ledger update, and separately after a ledger wipe, replay does not rebuild or land the change again.

Example status lines: greet landed; evidence runs/a1/ and greet rejected: malformed verdict; evidence runs/a2/. Authorized readers can inspect those runs directly. This checks the basic loop, not live tool use or final readiness.