Repository navigation
Description
Problem
A repair round of the stage job gets no return when the checks refuse its revision. _repaired in src/devops_cli/roadmap/stage/stage.py raises _stage_error at the first refused revision, while _gated returns a refused first reply to the model once with the problem. After the model review found defects, the planner runs again with the findings; that run costs 33 to 49 tool calls and 6 to 10 minutes, and one gate problem in its reply (a form fault that the model fixes at once when told) throws all of it away.
Evidence: a live run of devops roadmap stage --plan --item 3387 on 2026-11-10 with deepseek-v4.1-flash-1017. The plan run, the gate return and the review (63 calls) all passed. The repair run (22 requests, 33 tool calls, 348 seconds) gave a revision that the check refused: "Scenario 'The plan is on the default branch and the branch is gone' names stage.pr with no behavior test". The item failed after 21 minutes. The run before the change of #4346 did stage the same item in 62 minutes, with a repair that passed the check.
Expected
- A refused revision of a repair round goes back to the planner once with the problem, as a refused first reply does. The return needs few calls (a gate return took 0 to 4 calls in the same runs).
Acceptance criteria
- A test of
_repairedshows that a revision with a gate problem goes back once, and that a second refusal stops the item. It fails today. -
devops roadmap eval stage --replaykeeps its result (81 of 317 defects caught, 0 missed, 5 of 5 good plans accepted).
Existing tool considered
None: it is control flow of the job. Cost: about 20,000 tokens to build, 2,000 to keep, 1.5 hours.
Proposed design
Problem statement
In a repair round of the stage job, _repaired in src/devops_cli/roadmap/stage/stage.py raises _stage_error at the first revision that the checks refuse. _gated returns a refused first reply to the planner once with the problem. A repair run costs 33 to 49 tool calls and 6 to 10 minutes. One form fault in its revision, which the model fixes at once when told, throws all of that work away. The item then fails.
Acceptance criteria
Requirement: A refused revision returns once
The planner SHALL send a revision of a repair round that the checks refuse back to the model once, with the problem and the refused revision, as _gated does for a refused first reply.
Scenario: First revision refused, second revision passes
- WHEN the checks refuse the first revision of a repair round and accept the second revision
- THEN
_repairedasks the model a second time withpreviousset to the refused revision andproblemset to the gate problem, and it returns the accepted change
Requirement: A second refusal stops the item
The planner SHALL stop the item with RoadmapStageError when the checks refuse the returned revision of a repair round.
Scenario: Both revisions refused
- WHEN the checks refuse the first revision and the second revision of a repair round
- THEN
_repairedraisesRoadmapStageErrorthat names the problem of the second refusal, and it makes no third model call
Requirement: The return is bounded
The planner SHALL make at most one return for each repair round, and a revision that the checks accept SHALL cause no extra model call.
Scenario: Accepted revision makes no return
- WHEN the checks accept the first revision of a repair round
- THEN
_repairedmakes exactly one model call
Requirement: The replay result stays
The replay of the stage evaluation SHALL keep its result after the change.
Scenario: Replay keeps its result
- WHEN
devops roadmap eval stage --replayruns offline - THEN it reports 81 of 317 defects caught, 0 missed and 5 of 5 good plans accepted
Existing Tool Considered
None: the change is control flow of the stage job, and no library covers it. Cost: about 20,000 tokens to build, 2,000 to keep and fix, and about 1.5 hours. The change reuses the return logic that _gated already has.
Key questions
- Does a gate return of a repair round need its own return limit?: No. One return for each repair round matches the return of
_gated, which uses one return, and the issue asks for one. The number of repair rounds staysCONST_ROADMAP_STAGE_VERIFY_REPAIR_ROUNDS. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, CONTEXT.md]- Chosen: One return for each repair round. It matches
_gatedand the Expected section of the issue, and it bounds the extra cost to a few calls. - Rejected: Several returns for each repair round. It adds cost and delay, and the issue does not ask for it.
- Rejected: No return, as today. It throws away 33 to 49 tool calls for one form fault.
- Chosen: One return for each repair round. It matches
- How should the code share the return logic between
_gatedand_repaired?: Extract a helper that asks the planner, settles the reply, and sends one return withpreviousandproblemwhen the checks refuse it._repairedand the return step of_gatedcall it. Keep the refused-reply log, the file of refused replies and the degenerate-reply stop in the_gatedpath, so its behavior does not change. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py]- Chosen: Shared helper. It keeps one rule for the return and avoids copied code.
- Rejected: Copy the return code into
_repaired. It duplicates the logic and the two paths can then differ.
- Does the change alter the result of the replay of the stage evaluation?: No. The replay reads recorded replies and the change only adds a return after a refused repair revision. A test checks the numbers 81 of 317 defects caught, 0 missed and 5 of 5 good plans accepted. [sources: src/devops_cli/roadmap/stage/stage_eval_run.py, src/devops_cli/roadmap/stage/stage.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 10, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.A single gate refusal discards 21 minutes of work, but the item still completes its run; it is a correctness bug, not a blocker.It prevents a full item failure from a form fault the model can fix in 0 to 4 calls, saving 6 to 10 minutes per affected run.It mirrors the existing _gated return path in the same file; the body estimates 1.5 hours.Both target a refused revision in _repaired, but #4312 asks to persist it to a file while the candidate asks to return it to the planner for one retry.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at f8bd761 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Released in v0.107.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.107.1
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 13:56 UTC