循环工程:构建不会在睡着时烧掉你预算的自动化循环技术路线图
This is a technical roadmap for building reliable autonomous loops, arguing that a loop is fundamentally different from a prompt—a prompt requires manual initiation while a loop drives itself: set a goal once, then the system finds work, executes, checks, fixes, and repeats until completion. The author emphasizes that the ceiling is set not by prompting skills but by engineering a loop that converges toward truth rather than becoming an expensive random walk. The piece provides step-by-step guidance (Step 0 through Step 7) with working code (Bash scripts), explaining the mechanics of stateless iteration (fresh context per turn to combat context rot), building a narrow relevant context with a token budget, designing incorruptible checks (external deterministic oracle + reward-hacking defense gates + adversarial judge on a different model), dual-level state persistence (human-readable STATUS.md + machine-parseable JSON), physical isolation (git worktree, container with --network none), brakes with observability (structured JSONL log, circuit breakers for stuck/repeated failures, liveness heartbeats), and nonlinear cost analysis (why stateless keeps per-iteration cost constant while stateful grows quadratically). This is aimed at production engineers building AI agent pipelines who need practical, verifiable techniques.