Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LOOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ issue ──bruce-lee──▶ PR [turn:spec-review] ──robocop──▶ [tur

1. **Spec** (bruce-lee): picks the oldest `turn:spec` issue nothing blocks, creates branch `feat/<issue>-<name>`, commits the OpenSpec change (`docs(<change>): add proposal …`), opens a **draft** PR with `Closes #<issue>`, moves the label: issue loses `turn:spec`, PR gets `turn:spec-review`.
2. **Spec review** (robocop): checks the change against issue #1 and the existing specs: in scope, testable scenarios, nothing contradicts. Every round reads the whole change against the existing specs, not only the `range-diff`: a spec change is short, and a contradiction can sit in a line no one touched. Approve → `turn:build`; reject → `turn:spec` with the reasons.
3. **Build** (chuck-norris): takes the oldest `turn:build` PR whose issue nothing blocks. Writes failing tests named after the scenarios and makes them pass, running only the specs the change touches; archives the change, folds fixup commits, rebases onto the latest `origin/main` checking that every commit passes on its own (`git rebase --exec 'uv run pytest -q tests/unit <the change's integration specs>' origin/main`), fills in the **Proof** section, pushes (the hook runs `scripts/ci --fast`) and marks the PR ready (`gh pr ready`), which starts the full check on GitHub. Waits for it (`gh pr checks <n> --watch --required`); red → read the log, fix, push, wait again. Green → labels it `turn:review`.
3. **Build** (chuck-norris): takes the oldest `turn:build` PR whose issue nothing blocks. Writes failing tests named after the scenarios and makes them pass, running only the specs the change touches; then breaks the code once for each scenario and each case a ticked task names (delete or invert the line that serves it, one at a time) and sees a test fail; a case no test catches gets one before review; archives the change, folds fixup commits, rebases onto the latest `origin/main` checking that every commit passes on its own (`git rebase --exec 'uv run pytest -q tests/unit <the change's integration specs>' origin/main`), fills in the **Proof** section, pushes (the hook runs `scripts/ci --fast`) and marks the PR ready (`gh pr ready`), which starts the full check on GitHub. Waits for it (`gh pr checks <n> --watch --required`); red → read the log, fix, push, wait again. Green → labels it `turn:review`.
4. **Review** (robocop): first checks that the PR merges (`gh pr view <n> --json mergeable`); a conflict goes straight back to `turn:build` with one line naming the conflicting files: nothing was reviewed, so it is not a verdict and counts no strike. Then checks that the required checks passed on the head commit (`gh pr checks <n> --required`; GitHub ran them, not the builder, so this is not trusting a claim) and checks out that commit (on later rounds, `git range-diff` against the last reviewed head), reproduces the proof, runs any spec it doubts, checks every scenario has a test, scope is limited to the change, and no test was weakened. Approve → `turn:attack`, nudge terminator; a pull request that changes no code of the tool (docs, specs, this harness) skips the attack: the pair check (step 5), then auto-merge on (rebase), `turn:human`, notify the human. Reject → `turn:build` with the reasons.
5. **Attack** (terminator): installs the head commit the way users will and tries to break the change, time-boxed (stop after 30 minutes): reads the diff and the spec, writes 5 to 8 hypotheses about states a user could be in that the change might not survive (existing hooks, worktrees, odd paths, interrupted runs, concurrent pushes, …), builds each state in a fresh throwaway repository and checks the result. Every break comes with a script that reproduces it from an empty directory, and is checked against `main` (a break that `main` already has is an issue, not a reason to hold this pull request). Anything else that fails on the head and not on `main` is a break, however small (a traceback where the spec names a message counts): a passing verdict files no issue about this pull request's code. Verdict as one comment (`## Attack: PASS | BREAK`, the head SHA, a table of hypotheses and results, the scripts in a collapsed block). Break → `turn:build`; chuck-norris fixes it in this pull request like a review finding, folding the fix into the commit it corrects, and after the fix robocop reviews again. A gap in the spec this pull request brings (a state it leaves unspecified, a question its spec answers wrongly) is a break as well, never an issue: it goes to `turn:spec`, bruce-lee amends the change in this pull request, and it goes through spec review and build again. Pass → the **pair check**: test the pull request against every other `turn:human` one (`git merge-tree --write-tree --name-only <head> <other head>`). If they conflict, it goes to `turn:build` instead, its issue blocked by the other's issue, with one line naming that pull request and the files: not a verdict, no strike; once the other merges, chuck-norris rebases it and it continues as in step 6. Otherwise auto-merge on (rebase), `turn:human`, notify the human.
6. **Merge** (human): reads the proof and approves. Terminator turned on auto-merge (rebase) when it passed, so GitHub merges as soon as the human's approval and the required checks are in. The issue closes. A push after the approval dismisses it, so nothing unapproved lands. When a merge makes a `turn:human` PR conflict with `main`, robocop moves it back to `turn:build` with one line naming the conflicting files: not a verdict, no strike, and no message to the human. After chuck-norris rebases, robocop reviews the `git range-diff` against the approved or held head and, after the pair check (step 5), returns it to `turn:human`. Conflicts never reach the human, nor do pairs that would conflict: the human approves each pull request once.
Expand Down
Loading