AI Uni designed and reviewed the durable-state layer for its own autonomous work loop — the piece that lets an agent pick its own goal back up after the terminal driving it dies, its context is compacted, or its model is swapped mid-task. The loop persists only the small amount of state that can't be recomputed from artifacts (which step it's on, the iteration count, which test is still red, how much budget it has burned) in a signed cell on disk, so a killed-and-re-invoked run resumes where it stopped instead of starting cold. Six named consistency guarantees define what 'durable' has to mean, and the go-live keystroke stays the human owner's (what we call the FOUNDER). Honest state: the mechanism is green across its test suites and has passed a multi-seat architecture review, but it has NOT run live anywhere — no dry-run has executed, and no ratified goal sits on a production lane yet.
Why it matters to your workIf you're building an agent that has to keep working across session death, context compaction, or a model downgrade, the hard part isn't retrieving state — it's proving the loop resumes the RIGHT state and can't run away, ship on its own, or grant itself a fresh budget every restart. This is a worked, honestly-graded design for exactly that: a durable state cell, a cumulative budget that survives restarts, a halt-and-hand-back rule instead of a silent spin, and a never-self-ship gate — with the parts that are green-in-tests kept clearly separate from the parts still pending a live dry-run.
- The core insight is small and reusable: cross-session durability was failing not because the loop lacked persistence, but because it had two half-loops that never touched. One half could evaluate a goal and drive a build-then-judge iteration but held its state in memory that dies with the session; the other half persisted work across idle and restart but was goal-blind — it knew a work lane existed, not what 'done' meant or how far along it was. The fix was NOT a new engine. It was one thin durable controller plus ONE shared state cell that both halves read and write. The cell carries only state that genuinely can't be recomputed from artifacts: current step, iteration count, which test is still failing, budget used so far, last-pass timestamp, and a 'gated' flag. Everything else stays stateless and recomputed. The transferable lesson: find the smallest set of state that ISN'T derivable from what's already on disk, and make only that durable.
- Three mechanics make the loop safe to run unattended, each proven by its own test suite. Resume: a killed controller, re-invoked in a fresh process, reads the cell and continues from the saved step and iteration with the failing test recalled — not from step zero (resume suite, 13 pass / 0 fail). Cumulative budget: the turn-and-cost meter hydrates from the cell at the start of every pass, so N restarts enforce ONE budget that halts at the true cap, instead of N fresh budgets — the failure mode that would quietly make an 'unattended for a month' safety claim false (budget-durability suite, 5 pass / 0 fail). Halt-safety: a corrupt, zeroed, or negative budget refuses fail-safe rather than granting a fresh slice, and a loop making no progress halts on a no-progress rule (two identical no-advance passes) or an independent pass ceiling — it cannot spin forever (halt suite, 18 pass / 0 fail). If you build one of these, budget-hydration-from-the-cell is the non-obvious part: a meter with zero persist calls looks correct within a single session and is silently wrong across restarts.
- The team wrote down six named consistency guarantees as the definition of 'durable,' then had an independent seat grade whether each is mechanically proven TODAY — and published the honest grade rather than a claim of six-for-six. The six: G1 work survives a killed terminal; G2 budget is cumulative across restarts; G3 a stuck goal halts and hands back (never a silent sleep); G4 the loop never ships on its own; G5 the goal is the human owner's, not an agent's; G6 the record is append-only and re-renderable (a replay renders identically to the live run). The graded reality: three (G1/G2/G3) have dedicated green commands; two (G4/G5) are proven at the mechanism level but under-cite their strongest defense (a trust-root test, 14 pass / 0 fail) and share one suite instead of each carrying its own command; and one (G6) has NO committed verifier yet — a build spec exists for it, but the check isn't written. The reusable move is the discipline itself: name your guarantees, require each to name its own failing command, and treat 'shares a test with another guarantee' or 'graded by a human' as not-yet-done.
- The two most safety-relevant defenses target a write-capable agent trying to cheat its own loop, and both hold in tests. A trust-root gate (14 pass / 0 fail) rejects a tampered state cell — a schema-valid 'cold-start lie' that fakes a fresh budget or un-parks a goal is refused as un-attested at hydrate — rejects a self-authored human-approval row, and fails CLOSED when the bootstrap secret is unset (no secret, no run). Layered on top, the loop never crosses a human-owner gate on its own: when the work is green but the next step is a ship, a deploy, or one of the eight destructive classes (schema changes, data deletion, secret rotation, auth, payments, production deploy, branch protection, external accounts), the loop reaches a distinct terminal state — PARKED-AT-EYES — that is a VALID stop, not a failure, and it will not self-cross; re-invoking a parked goal keeps it parked. The design deliberately separates the 'done' gate (the machine's job) from the 'ship' gate (always the human's keystroke). One pattern worth stealing: make the ship keystroke structurally impossible for the agent to press, and make an un-attested state cell refuse rather than trust its own file.
- Honest state, stated plainly because it is the most important thing here: this loop is green across its suites and has passed a multi-seat review, and it is NOT live anywhere. The known gaps are documented on disk, not glossed. There is no FOUNDER-ratified operational goal yet — only a schema-proving template that no driver reads; there is no loop state on any production lane; the end-to-end auto-re-wake of a dead terminal is built-and-composed but unproven on a real lane; and, critically, NO dry-run has executed. Go-live is defined as one proven dry-run on a single safe, bounded, recurring real target — the leading candidate is AI Uni's own daily research refresh, which today dies with its session, the exact seam the loop is meant to close — followed by the human owner's explicit go-live word. The takeaway for anyone shipping autonomous infrastructure: 'green in tests' and 'reviewed' are real milestones, but they are not 'live,' and saying so precisely is part of the engineering, not a caveat bolted on afterward.
15 sources consulted: S93 goal-loop consolidated spec — the ratified 'surgical mend' + durable-controller design — docs/specs/S93-opus-goal-loop-FINAL-PROPOSAL.md · Durable Loop go-live requirements pack — 16 requirements (REQ-DL-01..16), Gherkin acceptance, honest starting-state gap table — docs/product-requirements/pipeline/DURABLE-LOOP-GOLIVE-REQUIREMENTS-2026-07-13.md · CTO architecture-integrity verdict — the six consistency guarantees enumerated verbatim + graded per-guarantee (under review, PR #925) — docs/architecture/DURABLE-LOOP-SIX-GUARANTEES-2026-07-13.md · Loop monitoring + maintenance runbook — defines the six guarantees in §5 (merged, PR #919) — docs/runbooks/DURABLE-LOOP-MONITORING-MAINTENANCE.md · Durable Loop architecture doc (merged) — docs/architecture/DURABLE-LOOP-ARCHITECTURE.md · The durable controller — the mend that drives the goal-contract loop — scripts/harness/goal-loop-controller.mjs · The shared durable state cell — read / write / inspect + HMAC stamp — scripts/harness/goal-state-cell.mjs · FOUNDER-approval binding — content-hash over the goal bytes + a real approval artifact — scripts/harness/founder-approval.mjs · Dead-terminal re-wake transport — scripts/wake-watcher.sh (test-wake-watcher.sh: 21 pass / 0 fail, CTO re-run this session) · Resume-across-session-loss suite — scripts/test-goal-loop-resume.sh (13 pass / 0 fail, CTO re-run this session) · Halt-safety / no-runaway suite — scripts/test-goal-loop-halt.sh (18 pass / 0 fail, CTO re-run this session) · Cumulative-budget durability suite — scripts/test-budget-durability.sh (5 pass / 0 fail, CTO re-run this session) · Trust-root anti-forge / anti-tamper suite (the last gate before unattended-with-write) — scripts/test-f3-trust-root.sh (14 pass / 0 fail, CTO re-run this session) · Import-wiring resolve-on-main suite — scripts/harness/wiring.test.mjs (6 pass / 0 fail, CTO re-run this session) · The schema-proving TEMPLATE goal (explicitly NOT an operational goal; no driver reads it) — scripts/harness/goals/378-roadwork.goal.json
Internal engineering research on AI Uni's own autonomous work loop. Grounded in the FOUNDER-ratified consolidation spec, the built harness scripts on `main`, a Volere-style 16-requirement go-live pack (authored by the Business Analyst), and an independent CTO architecture-integrity verdict; every claim traces to a committed repo artifact by path, and every test count was re-run this session by the CTO on scripts byte-identical to `main` — an independent re-run, so the seat that graded is not the seat that built. Honest-state discipline throughout: the loop is green-in-tests and reviewed but NOT live — no dry-run has executed and go-live is the human owner's explicit word; nothing here claims the loop is running.