Conceptual Architecture Guide
How to Build Your Own Continuous Software Engine
Stop trying to make an AI finish a giant task in one great prompt. Build a deterministic engine around coding agents so your repository makes continuous, verified progress while you focus on direction and taste.
For the story behind the repeated attempts and lessons that shaped this guide, read Building a Continuous Software Engine the Hard Way.
From Prompting to Building an Engine
Most engineers move through three stages when working with coding models. Each stage takes reliability out of fragile, one-off chats and puts it into durable machinery you can inspect, test, and trust.
Prompt Engineering
Craft a better single message and hope the model produces working code in one shot.
Agent Engineering
Give the model tools in a chat loop and supervise it step by step until one task finishes.
Engine Architecture
Wrap fresh agent sessions inside deterministic state, verification, recovery, and steering primitives.
Why call it an engine instead of a factory? A factory optimizes for stamping out identical copies of the same widget. Software work is the opposite: every bug fix, vertical slice, refactor, and experiment is unique. You want the consistency, speed, and safety of a reliable machine—without pretending software development is an assembly line.
The key insight is counterintuitive: making an AI system more autonomous requires making the loop around it less magical and more boring. Coding agents excel at reading a codebase, implementing a focused change, and diagnosing a failing test. They are terrible at being their own scheduler, lock manager, process supervisor, or sole judge of their own work. Deterministic code should own the loop and its hard checks, while judging intent belongs to a fresh-context independent reviewer—or a human.
This guide teaches the core primitives of a continuous software engine conceptually—no framework lock-in and no giant code dumps. Scan this overview in a minute to grasp the whole machine, then dive into each chapter to learn how to build each primitive, what breaks when you skip it, and how to verify you built it right.
Core Ethos
Every architectural decision in this guide flows from six principles. When you hit a design tradeoff while building your own engine, come back to these six rules.
- The deterministic orchestrator owns the loop.Ordinary software controls state transitions, leases, timeouts, retries, and landing. Language models do bounded creative and analytical work inside that shell.
- Design for failure first.Expect processes to hang, networks to drop, models to oscillate, and merges to conflict. An unattended engine is defined by how cleanly it recovers, not by its happy path.
- Non-blocking over blocking.Waiting for a human decision, an offline network, or a flaky dependency must never freeze unrelated ready work or hold a worker slot hostage.
- Favor focus over features.Keep goals small, single-purpose, and independently verifiable. Small slices land cleanly, isolate blame when something breaks, and stay easy for humans to review.
- Git and files over chat history.Treat every agent context window as disposable RAM. Intent, contracts, landed outcomes, and coordination belong in version-controlled files and Git history.
- Approachable, human-readable evidence.Store raw command output, diffs, review verdicts, and rollback reasons as plain files a tired engineer can open and trust in thirty seconds.
How the Engine Runs
At altitude, the engine is a deterministic pipeline backed by two durable stores. Shared Git holds the source of truth—approved objectives, goal contracts, and landed commits—while a local transactional ledger tracks transient leases, attempt counters, and raw run evidence. Broad intent enters through just-in-time decomposition and tiered admission so bounded slices run autonomously while ambiguous or high-risk boundaries pause cleanly for human judgment.
Why not let one long-lived agent session run the whole loop?
Long-lived chat sessions accumulate stale assumptions, silently drift from edited requirements, and lose track of background processes when a context window compacts or a client disconnects. Worse, the same session that wrote a shortcut is primed to rationalize that shortcut during self-review.
When a deterministic orchestrator fires up short-lived, single-purpose sessions in fresh worktrees, every attempt starts clean, every failure leaves inspectable evidence on disk, and every judgment happens with zero attachment to how hard the builder tried.
The Five Core Primitives
Build these five primitives in order. Each chapter starts with the simplest mental model, highlights the concrete failure modes it prevents, and finishes with a verification checklist.
- Chapter 01State & Contracts Outside the Context Window →Replace ephemeral chat history with content-hashed Markdown goal contracts, isolated Git worktrees, durable commit trailers, raw evidence logs, and a local transactional ledger.
- Chapter 02Independent Verification & Transactional Landing →Separate building from judging using deterministic gates, fresh-context independent review, rebase-then-verify landing checks, and culprit-only rollback that spares innocent commits.
- Chapter 03Never Getting Stuck: Watchdogs, Recovery & Liveness →Treat stuckness as a first-class engineering problem with process-group watchdogs, livelock detection, network parking, oscillation guards, and exhaustive finite-state liveness checks.
- Chapter 04Ambition, Self-Improvement & Human Steering →Unify complicated requirements into one pipeline—Intent → Just-in-Time Decomposition → Tiered Admission (auto vs. human-gated) → Verified Execution—paired with non-blocking approval parking, recurring-failure repairs, and metric-gated experiments.
- Chapter 05Multiplayer & Multi-Machine Coordination →Share an engine across teammates and machines with pluggable admission transports, bidirectional 3-way remote sync, atomic remote Git ref leases, and landing-time trailer deduplication.
Looking for how to turn individual agent misses into better instructions, tools, and repo-level gates? Pair this guide with Build with AI Agents.