Repository navigation
feat: loops — repair runs verified by the daemon's own checks - #426
Merged
Merged
Conversation
…red as one commit A loop pursues one objective until the daemon's own checks pass, then hands the result over as a commit on its own branch. The worker agent never decides it is done: its loop_report tool only asks for verification; the daemon snapshots the candidate, runs every check itself, records the evidence, and commits exactly the tree it verified. - LoopService: a controller with compare-and-set transitions, attempts scheduled only through the dispatcher, pause/resume/steer/cancel, restart reconciliation, time and attempt budgets (downtime and approval waits uncharged), and a takeover prompt for replacement workers. - Verification: the candidate is the run's base with the worktree laid over it (secret-looking files withheld, setup files excluded); it is written out from hash-verified objects into a daemon-made check directory, prepared once by the trusted setup recipe on the base and sealed, and every check runs in a fresh copy of it at the same path; what a check or setup leaves running is reaped. - Hardening: every daemon git runs pinned to the run's repository, with hooks, filters, fsmonitor, replace refs and network off and never the daemon's credentials; no session but the run's worker can get a working directory in its worktree. - Surfaces: codeoid loop start|ls|show|cancel|pause|resume|steer, web loops panel and run detail, TUI /loop and /loops, protocol loop.* messages, docs/loops.md. Audited over 16 security and correctness rounds; each finding has a regression test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
abhisheksoamj
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A loop pursues one objective until the daemon's own checks pass, then delivers the result as one commit on its own branch.
The worker agent never decides it is done:
loop_reportonly asks for verification; the daemon snapshots the candidate, runs every check itself, records the evidence, and commits exactly the tree it verified.User guide:
docs/loops.md. Design:docs/loop-engineering-design.md.How
src/daemon/loops/service.ts): compare-and-set transitions, attempts scheduled only through the dispatcher, pause / resume / steer / cancel, restart reconciliation, attempt and time budgets (daemon downtime and approval waits are not charged), a takeover prompt for replacement workers.host.ts,materialize.ts):GIT_DIR/GIT_COMMON_DIR/GIT_WORK_TREE), with hooks, filter drivers, fsmonitor, replace refs and network off, and gets an agent's environment, never the daemon's credentials (git-env.ts, also adopted by forks, setup, fleet and packs). No session but the run's worker can get a working directory in its worktree (create, fork, import, dispatch, routines, pipelines, skill grants).codeoid loop …CLI, web loops panel and run detail, TUI/loopand/loops, protocolloop.*messages with schemas.Known limits (documented)
eol,working-tree-encoding) aren't applied in the check directory.cannot_satisfyverification are the next milestone.Review
Audited over 16 rounds by independent security and correctness reviewers until neither found anything significant; every finding has a regression test (
src/daemon/loops/*.test.ts,src/tests/loops-e2e.test.ts,src/tests/git-env.test.ts,src/tests/kill-marked.test.ts).Full suite: 4161 pass / 0 fail; web 732 pass.
Follow-up stacked on this: loop watches (CI-failure and review-comment triggers).
🤖 Generated with Claude Code