Repository navigation
Description
Split from #3569.
The problem: a repair round sends the same group again. When the failure names a group, or the inputs of the step exceed the step budget, another attempt with the same group repeats the failure. A step whose inputs exceed the window refuses before the first request, so no round can react to it today. This part is split from #3569, which changes the strategy of each round but keeps the group as it is. It is deferred because a repair round may change only the files that the failure names, and the job owns tasks.md and writes it back from its text before the run. A smaller group changes the plan, so this part needs plan-change machinery that #3569 does not build. Acceptance criteria: (1) when the reason of a failed attempt names a group, the repair round SHALL ask for a smaller group; (2) the step MUST write the smaller group into tasks.md and keep the other groups as they were; (3) a test with a stub model MUST show the smaller group in the message of the round and in tasks.md.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Proposed design
Problem statement
A repair round of an implement step re-sends the same task group after a failure. When the reason of the failure names a group, as the no-change stop of a group does, the step takes no repair round at all, so the next run tries the same group again and the failure repeats. The bounded group plan-request already writes a smaller group into tasks.md and keeps the other groups, and the no-change stop already asks for a smaller replacement, but no repair round carries that ask to the model. This change makes the repair round ask for a smaller group when the reason names one, and the job writes the smaller group into tasks.md.
Acceptance criteria
Requirement: Smaller group in the repair-round message
When the reason of a failed attempt names a task group, the repair round SHALL build a message that asks for a smaller group of that group.
Scenario: Reason names group 2
- WHEN A test gives the repair-round message builder the no-change failure reason of group 2 and one repair round is left
- THEN The message holds the request for a smaller group 2, and the turn allows only the
tasks.mdof the change to change
Requirement: Repair round for a group-naming failure
The step MUST run a repair round for a failure whose reason names a task group, even when the failure names no repair path.
Scenario: No change in group 2
- WHEN A test runs the step with a stub model,
roadmap.implement.repair_roundsset to 1, and a first turn that changes no file - THEN The second model request holds the request for a smaller group 2, and the step records one repair round
Requirement: Only the named group written to tasks.md
The job MUST write a smaller group from a repair round into tasks.md and MUST keep the text of every other group unchanged.
Scenario: Only group 2 changes
- WHEN A test writes the
groupplan-request for group 2 from the last message of a stopped repair round into atasks.mdthat holds task groups 1, 2 and 3 - THEN The written
tasks.mdholds the smaller group 2 and the text of task groups 1 and 3 is unchanged
Requirement: Stub model shows the smaller group
The repair round MUST show the smaller group in its message and in tasks.md when a stub model returns it.
Scenario: Stub model returns a smaller group 2
- WHEN A test runs the repair round with a stub model that answers the smaller-group request with a
groupplan-request for group 2 - THEN The message of the round names group 2 and the written
tasks.mdholds the smaller group 2
Existing Tool Considered
No alternatives check has run on this item. No open, maintained tool or library covers this need: the change asks a model for a smaller task group and writes that group into the tasks.md of one change, inside this repository's own implement job, and no general tool does that. The change builds its own code, and the plan-change machinery it needs already exists (the group kind of implement_amend.py and the split of an over-window group), so the written cost is small: about 3k tokens to build it, about 1k tokens a month to keep and fix it, and about half a day of elapsed time.
Key questions
- Does the implement step already accept a bounded change of its plan, so that this item needs no new plan-change machinery?: Yes.
_judge_groupaccepts agrouprequest that replaces one unticked group with one of the same number, fewer tasks and no path that the group does not name, andjudgewrites that replacement over the group's text intasks.mdand records the amendment. The change extends that path and builds no new subsystem. [sources: src/devops_cli/roadmap/implement/implement_amend.py:281, src/devops_cli/roadmap/implement/implement_amend.py:375, openspec/specs/roadmap-plan-amendment/spec.md:96] - Does a repair round see a failure whose reason names a group today?: No.
_extra_askreturns no turn for a failure that names no repair path, and the no-change failure of a group, which names the group and asks for a smaller replacement, is aplan_defectwith no repair path. The step stops, and the next run starts the same group with no smaller-group ask. [sources: src/devops_cli/roadmap/implement/implement_step.py:1993, src/devops_cli/roadmap/implement/implement_step.py:1832, src/devops_cli/lang/en/messages.py:3674] - Does the repair-round message already ask for a smaller group?: No. The message of a repair round is
implement_repair_turn(or the verification, tests-lost or hook turn), which says to fix what the check reports and to change only the files the step changed; no turn message names a smaller group. [sources: src/devops_cli/roadmap/implement/implement_step.py:2004, src/devops_cli/lang/en/messages.py:3625] - How does a smaller group reach
tasks.mdwhen the job owns the file?: The repair round ends with agroupplan-request that names the group and its smaller tasks. The job reads the request from the last message of the stopped step withparse_request, judges it withjudge, writes the replacement over that group's text intasks.mdand commits the amendment before the group runs again. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py:1129, src/devops_cli/roadmap/implement/implement_amend.py:375, docs/ROADMAP_WORKFLOW.md:257]- Chosen: Structured
groupplan-request written by the job. The job ownstasks.mdand writes it from the text of the round, and thegroupkind already bounds the change to one group of the same number with fewer tasks and no new path. - Rejected: The model edits
tasks.mddirectly. The job writes the file back from the text of the round before the run, so a direct edit is lost. - Rejected: A new plan-change subsystem. It repeats the bounded
groupamendment that the implement step already supports and adds code to keep.
- Chosen: Structured
- Does a smaller group come before a split when the inputs of a step exceed the limit?: No. When the packed inputs of a group exceed the window, the job catches
OverWindowErrorinside the run, asks the split prompt for new groups under the limit, renumbers the later groups and records asplitamendment before the first request. The smaller group answers a reason that names a group, and the split answers a group over the window. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:259, CONTEXT.md:146, src/devops_cli/roadmap/implement/implement_run.py:960]- Chosen: Split on an over-window refusal, as the project records. The split happens before the first request and is the recorded behaviour for a group over the limit, so the smaller group must not repeat it.
- Rejected: Smaller group first, then split. It repeats the split that the run already makes and leaves a group over the window to a model turn that may not shrink it.
- Rejected: Record the refusal as a failed-attempt reason and let the round react. The refusal happens before the first request, so no round exists yet, and the split already settles it in the same run.
- How does the round learn about a refusal that happens before the first request?: It does not:
_handle_over_windowcatches the refusal inside the run, asks the split prompt and writestasks.mdbefore any step runs, so the refusal never becomes a failed attempt. [sources: src/devops_cli/roadmap/implement/implement_run.py:960, src/devops_cli/roadmap/implement/implement_run.py:1001, docs/ROADMAP_WORKFLOW.md:259] - Which part of the plan may the repair round change?: Only the group that the reason names, bounded by the existing
groupkind: the same number, fewer tasks, and no path that the group does not already name. The job needs no second refusal, because_judge_grouprefuses every replacement outside those bounds. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:255, src/devops_cli/roadmap/implement/implement_amend.py:294, src/devops_cli/roadmap/implement/implement_amend.py:302]- Chosen: Only the named group, bounded by the kind
group. The failure names one group, and the existing kind already bounds the replacement to that group with fewer tasks and no new path. - Rejected: Any group of the change. It makes the round a planner, and the plan of the change changes with no review.
- Rejected: A new refusal when the request names another group. It duplicates the bound of the kind
groupand needs the group of the failure passed into the judge.
- Chosen: Only the named group, bounded by the kind
- Should the smaller-group ask go in the repair-round message or in the stop that the next run reads?: The repair-round message. The
plan_defectstop already asks for a smaller replacement, but it waits for a person'simplement: retry, and the next run's# The stop of the earlier Jobsection carries only a check log and conflict files, so the model never sees that ask. The round asks before the step gives up, so the group is smaller in the same job. (best practice) [sources: openspec/specs/roadmap-implement-step/exit-checks/spec.md:300, docs/roadmap/implement.md:93, openspec/changes/archive/2026-11-15-3569-each-repair-round-changes-the-strategy/design.md:13]- Chosen: Ask in the repair-round message. It reaches the model in the same job, before the step stops, and the job can apply the
grouprequest at once. - Rejected: Keep the ask in the stop only, as feat(roadmap): each repair round changes the strategy of a step #3569 recorded. The stop waits for a person's retry, and the next run's hand-off carries a check log and conflict files, not the stop reason.
- Rejected: Add the stop reason to the next run's hand-off. It still needs a stop and a retry, and it changes the hand-off that holds a check log and conflict files.
- Chosen: Ask in the repair-round message. It reaches the model in the same job, before the step stops, and the job can apply the
- Which items must be delivered before this one?: Only chore(roadmap): hold incremental stage and implement work #6521. It is the hold issue that keeps the incremental work on the stage, implement and fix-checks jobs from starting until the re-architecture of refactor(roadmap): re-architect stage and implement on Coder #6519 lands, and it holds this item back. feat(roadmap): each repair round changes the strategy of a step #3569 is delivered: its strategy module is on the default branch, and a closed dependency holds nothing back. [sources: docs/roadmap/refine.md:24, docs/roadmap/refine.md:22, src/devops_cli/roadmap/implement/implement_strategy.py:1, openspec/changes/archive/2026-11-15-3569-each-repair-round-changes-the-strategy/proposal.md:5]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/roadmap/dependencies.py
Activity
devops-cli-service commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It refines the repair loop but is deferred until plan-change machinery exists, so it is not urgent.A smaller group reduces repeated failures, but the benefit is one part of the broader repair strategy in #3569.It needs plan-change machinery to write a smaller group into tasks.md while preserving other groups, plus a stub-model test.Both items improve repair rounds of an implement step; #3569 changes the strategy per round, while the candidate adds a smaller-group request that writes to tasks.md.devops-cli-service commentedon Nov 7, 2026
Refine cannot set this item to Ready at 72c52c6 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 16, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 20, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 25, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.