Repository navigation
feat: the autopilot's cap has no way on but a claim, and lost runs count - #857
Conversation
The draft pull request opens before any code: the Spec as its checklist.
|
The pull request's board
🤖 AI-generated · Claude Opus 5.5 (Anthropic) |
When apply-and-end refuses the agent's commits because they do not build on the branch as GitHub has it, the step now says so in its refused output and the end rule passes it as REFUSED. autopilot.py end rewrites the run's entry on the pull request's board as free, as it does for a lost runner or a held-back make pre-pr, so the engine's own race no longer spends the run. The verdict still stops the run. The rule lives in the pure helper free_end, and the rewrite in freed_runs. Assisted-by: Claude Opus 5.5 (Anthropic)
A comment on an issue whose first line is /autopilot more, from someone who-decides allows, gives the issue's autopilot pull request at its cap one extension: an entry on its board, needs-human off it, and dilux-bot's autopilot:continue on the issue, with no answered flag so the run counts. issue-claim.yml's new more job reads it with its own token, and the claim job leaves the command out. The cap is read per pull request (runs_cap: the policy's autopilot-runs once more per extension) by may-continue, end and next_step. answers() restarts at a cap end and gives the rest of the comment as the next run's hint. Assisted-by: Claude Opus 5.5 (Anthropic)
The same comment from someone who-decides does not allow gives no run: no label moves and the pull request's board is unchanged. dilux-bot answers once on the issue, under the hidden dx-autopilot-more-refused marker, that a maintainer decides, with the issue's link and the AI line; a repeat gets no second reply. When who decides cannot be read, it is never taken for a yes. Assisted-by: Claude Opus 5.5 (Anthropic)
A pull request that already had its two extensions gets no third: the board and the labels stay as they are, and dilux-bot's reply names both ways forward, anyone's /claim of the issue or a maintainer closing the pull request. A pull request below its cap, or whose board was edited by hand, gets a reply that says why and nothing else. Assisted-by: Claude Opus 5.5 (Anthropic)
autopilot-runs stays 5 in policy/autonomy.yml; its comment now says that one pull request goes past it only on /autopilot more by someone who-decides allows, at most twice. The runs cap's comment on the pull request and the OPEN_TO_CLAIM comment on the issue say how a maintainer gives more runs, the former only while an extension is left. docs/agents.md, CONTRIBUTING.md and docs/workflows.md describe the command and the free run on a "do not build on" refusal. Assisted-by: Claude Opus 5.5 (Anthropic)
GitHub's startsWith also matches a comment such as "/autopilot moreover", which the more job then read as the command. autopilot.py more now checks the comment with more_hint first and does nothing, and says nothing, when it is not the command. Assisted-by: Claude Opus 5.5 (Anthropic)
|
The autopilot has a question before it goes on. Every criterion is done and pushed (C1 to C5, the full pytest suite and the scripts' self-tests pass). One choice the Spec left to a maintainer: what one /autopilot more adds to a pull request's cap. With the organisation's autopilot-runs: 5, all three give 10 after the first. (1) Recommended, and what the branch does now (runs_cap in scripts/autopilot.py): each extension adds the policy's autopilot-runs, so the cap is runs x (1 + extensions), 10 then 15 here. A repository that lowered autopilot-runs to 3 gets 6, then 9, so its own lower limit keeps scaling and nothing it chose is widened. (2) Each extension adds a fixed 5: 10 then 15 here, 8 then 13 where autopilot-runs is 3. (3) A fixed 10 whatever the count, so a second extension adds nothing, which goes against C4's limit of 2. Answer 1, 2 or 3. With 1, the next run only marks the pull request ready. With 2 or 3, it changes runs_cap and its tests first. Answer here in your own words; the autopilot goes on with your answer. 🤖 AI-generated · Claude Opus 5.5 (Anthropic) |
|
@soydiloreto: answer the autopilot's question #857 🤖 AI-generated · Claude Opus 5.5 (Anthropic) |
|
1: each extension adds the policy's autopilot-runs, as the branch does now, so a repository's lower limit keeps scaling and nothing it chose is widened. Say it in the Decisions and in docs/agents.md where the command is described (10 then 15 with the organisation's 5), and make C2's wording in the description match (its cap becomes autopilot-runs × 2, 10 here). 🤖 AI-assisted · Claude Opus 5.5 (Anthropic) |
The maintainer chose that each extension adds the policy's autopilot-runs, so a repository's lower limit keeps scaling: docs/agents.md and CONTRIBUTING.md now say the cap becomes autopilot-runs × 2, then × 3 (10, then 15, with the organisation's 5). Assisted-by: Claude Opus 5.5 (Anthropic)
Claude review · risk high · complexity high · type featNothing that must be fixed · 4 minor Incremental review: the new commits make
Policy floor: high (touches high-risk paths: .github/workflows/autopilot.yml, .github/workflows/issue-claim.yml, CONTRIBUTING.md, docs/agents.md, policy/autonomy.yml …). Reviewed 0499cca (whole pull request; review 6 of 5 automatic). Author trusted for auto-merge: false. 🤖 AI review · claude-sonnet-5-5 (Anthropic) · $0.42, 22 turns |
At the runs cap, the issue's comment now comes from autopilot.py cap-comment --issue (open_to_claim), from the same words as the pull request's (cap_way): it offers /autopilot more while an extension is left, and past the second names only /claim and a maintainer closing the pull request. OPEN_TO_CLAIM, for the rounds cap and scripts older than it, no longer offers /autopilot more, which gives nothing there. The sweep's pr_board plumbing goes: autopilot-sweep.yml never fed it, and next_step's callers pass no runs, so the cap there is may-continue's. The reply when who decides cannot be read carries its own marker, dx-autopilot-more-unread, and is said once, until another answer follows it. answers() no longer restarts at a cap end, so a decider's hint written before the cap comment and the rest of a /autopilot more both reach the next run. Assisted-by: Claude Opus 5.5 (Anthropic)
…-s-cap-has # Conflicts: # docs/workflows.md
When autopilot:continue cannot be added to the issue, the extension comes off the pull request's board and needs-human goes back on it, so the same /autopilot more again extends it instead of reading it as below its cap. An exit of deciders.py other than 0 or 1 now reads as could not tell, never as a no whose marker silences later replies. Both with a test. Assisted-by: Claude Opus 5.5 (Anthropic)
📝 What changes
C1, the free run on a "do not build on" refusal. In
autopilot.yml'sapplyjob, the stepappliedwritesrefused=divergedto$GITHUB_OUTPUTjust before it exits 1 with "The agent's commits do not build on $BRANCH as GitHub has it". The end rule gets it asREFUSED: ${{ steps.applied.outputs.refused }}.autopilot.py endtreats it the way it treats a lost runner or a held-backmake pre-pr(lost/held_back): the run's entry on the pull request's board is rewritten asrun_entry(runs, True), so it stays out ofrun_numbers()'s count. The verdict still stops the run as it does today: it is free, but it does not continue. The rule for which runs are free moves into one pure helper,free_end(mode, stopped, asked, lost, held_back, refused), so the test can call it directly.C2–C4,
/autopilot more. Its first line is/autopilot more, and whatever follows is the hint. It is read on an issue (not a pull request) by a new job,more, in.github/workflows/issue-claim.yml, the reusable workflow that already reads/claim. Theclaimjob'sif:leaves out comments that start with/autopilot more, so that "still on it" inside a hint never extends a claim. Like theclaimjob, themorejob runs no repository code, uses a fresh runner and its own dilux-bot token (issues and pull requests write, contents read for CODEOWNERS), and clones.dx-central. It does three things:autopilotpull request that closes the issue.deciders.py may continue "$LOGIN", the same check as for addingautopilot:continue(who-decides, read live).autopilot.py more, which applies a pure planner,more_plan(allowed, state, intact, policy_cap, at_cap, said_before):dx-autopilot-more-refusedmarker so a repeat gets no second reply. The comment says a maintainer decides whether the autopilot gets more runs, gives the issue's full URL, and ends with the AI line./claimthe issue and finish it, or a maintainer closes the pull request.extensionson the pull request's board gets one more entry,{"by": login, "at": iso, "comment": url}.needs-humancomes off the pull request,autopilot:continueis added to the issue, and the issue's board gets noanswered, so the run counts against the new cap.The cap, read per pull request. A new pure helper,
runs_cap(policy_cap, state), gives the cap with that pull request's extensions counted.may-continueandenduse it. The sweep counts no runs of its own (sweep_stepis called with none), and a continue it gives still goes throughmay-continue. A board edited by hand still reads as the cap reached.The hint.
answers()does not restart from a cap end (CAPis not among the bot's comments it restarts from): a cap end is no new start, so a hint a decider wrote before it, which no run read, also reaches the run/autopilot moregives. A/autopilot morecomment from a decider becomes just the rest of its text, and is dropped if the rest is empty. So the next run's prompt (ANSWERS, which already reads the issue's comments and the pull request's) gets the rest of the comment as its hint.run_endandreacceptedare unchanged.The cap message.
cap_comment()(on the pull request, and with--issueon the issue) adds that a maintainer may give this pull request 5 more runs with/autopilot more <hint>on the issue, at most twice.policy/autonomy.ymlgets a comment only (autopilot-runsstays 5).docs/agents.md,CONTRIBUTING.md,docs/workflows.md(theautopilot.ymlandissue-claim.ymlrows) and the header comment inissue-claim.ymldescribe the command.What one extension adds (option a, the maintainer's answer). Each extension adds the policy's
autopilot-runs: cap =autopilot-runs× (1 + extensions), counting at most 2 extensions. Here that is 10, then 15; a repository that loweredautopilot-runsto 3 gets 6, then 9, so nothing it chose is widened past its own scale.When something fails.
deciders.pyexit 0 is a yes and 1 a no; 2, or any other exit, is "could not tell": no run is given, and dilux-bot replies under its own marker,dx-autopilot-more-unread, to try again in a while, said once until another/autopilot moreanswer follows it. The board is written first, so a failed write changes nothing else. If addingautopilot:continueto the issue then fails, nothing would start the run: the extension is taken back off the board,needs-humangoes back on the pull request, and the job fails, so the same/autopilot moreagain extends it instead of finding it below its cap.The issue at the cap. At the runs cap the issue also gets the way past it (
cap-comment --issue, the same text as the pull request'scap_comment, unmarked sorun_endandreacceptedread what they read before).OPEN_TO_CLAIMstays for the rounds cap, with no/autopilot more.What this widens, for whoever merges it. A pull request may now spend up to 3 ×
autopilot-runscounted runs, and only on a comment from someonewho-decidesallows. A run that the "do not build on" refusal ends no longer counts. The newmorejob holds dilux-bot's key with permissions theclaimjob of the same workflow already holds (issues and pull requests write, contents read). No new secret is added, and no caller grants anything new.💡 Why
Closes #856. The autopilot works it here in the open: one commit per criterion, each box ticked once its commit is pushed.
🎯 Acceptance criteria
Test: tests/workflows/test_autopilot_refused_free.py
who-decidesallows comments/autopilot moreon its issue, then its board records the extension, its cap becomes 10, and the next run starts with the rest of the comment as its hint.Test: tests/workflows/test_autopilot_more.py
who-decidesdoes not allow (a contributor from a fork, say), when it is read, then no run is given, dilux-bot answers once that a maintainer decides, with the issue's link, and the board is unchanged.Test: tests/workflows/test_autopilot_more.py
/autopilot moreis commented again, then it is refused with a reply that names/claimand closing.Test: tests/workflows/test_autopilot_more.py
autopilot-runsis still 5.Test: tests/workflows/test_autopilot_more.py (checks that
autopilot-runsis still 5 and that its comment names/autopilot moreas the way one pull request goes past it. The comment check is what makes the test fail at the base.)🧭 Decisions
🙌 Credits
🧪 How I tested it
python3 -m pytest -q tests: 598 passed, 1 skipped. tests/workflows/test_autopilot_refused_free.py (C1) and tests/workflows/test_autopilot_more.py (C2–C5) were each seen failing at the base when written; the four review minors each got a test there that failed before its fix (the issue's cap text past the second extension, nopr_boardplumbing left, the unread reply said once, a hint before the cap reaching the next run).python3 scripts/autopilot.py --test: all pass, with checks forcap_way/open_to_claim,unread_saidand the hint before a cap end.scripts/*.py --test: all pass butapi-commit.py(this sandbox cannot write git objects) anddesign-lint.py(stylelint not installed); this branch touches neither.local-review.sh --no-claude: conventions OK; the diff read against the general profile.make pre-pr, so the checks above stand in for it.🤖 AI-generated · Claude Opus 5.5 (Anthropic)