Autoresearch Self Loop
Let an agent iterate on one measured metric in your Git checkout, and keep a log of every attempt. Each kept run becomes a commit with its result in the message, and a keep is refused when the benchmark or checks failed. A discarded, crashed, or checks-failed run reverts the agent's changes, including new untracked files that Git does not ignore. Needs Git, a committer identity, a clean working tree when a session starts, and a benchmark that prints METRIC name=value lines.
Overview
View sourceWhat you get
- An agent loop on one metric. The agent edits the code, the plugin runs your benchmark and checks, and every run is appended to a session log in
.auto/. The log lets a loop survive restarts and context resets. - Keep rules the plugin enforces. A kept run is committed with a
Result:trailer, and its commit is logged. A keep is refused when the last benchmark or its checks failed, or when nothing outside the session files changed. - Reverts for discarded runs. A discarded, crashed, or checks-failed run reverts every change outside the session files and deletes new untracked files that Git does not ignore. The session files stay.
- A thread panel. It shows the metric, the baseline, the best kept run, and the confidence, with the run table and the Start/Resume, Stop, Finalize, and Export buttons.
- A port of pi-autoresearch. This is a close BB port of pi-autoresearch v1.9.0 (MIT License) by Tobi Lutke and David Cortés. After setup, the loop runs without a sequence of manual approval steps. BB permissions and repository protections still apply.
How it works
- During setup, the agent writes the benchmark script and the session brief into
.auto/. The first run of a segment is the baseline. - Each run executes the benchmark and reads its
METRIC name=valuelines. If the benchmark passes and.auto/checks.shexists, the checks run next. The agent then logs the run as keep, discard, crash, or checks_failed. - The loop stops when you press Stop, or when the
maxIterationslimit in.auto/config.jsonis reached.
Requirements
- BB 0.46 or later.
- A Git checkout with at least one commit. Starting a session needs a clean working tree. The session files do not count as changes.
- A committer identity (
user.nameanduser.email) in the checkout, because each keep makes a commit. - A benchmark that prints
METRIC name=valuelines. The benchmark and checks are your repository's own commands, and the plugin runs them as written. - On a remote environment host, the plugin works through the BB server, so the server must be running. The host needs POSIX with
sh,bash, andgit.
More from Oleg
More in Tasks & Workflows 55
Plan, track, route, schedule, or automate work.


