Repository navigation
Description
Problem
A reply that the model review sends back for repair, and that the checks then refuse, is not kept in the refused-reply file of the item.
_Planner._gated in src/devops_cli/roadmap/stage/stage.py keeps the refused replies of the first two asks in <number>.refused.json (#4204). _Planner._repaired asks the model a third time after a finding of the review, and when the checks refuse that revision it raises _stage_error at once. The revision and its problem go to no file. The failure text is cut in the logs, so the reply that ended the item cannot be read.
Evidence: two live stage runs on item #3599 (2026-11-09, live stage model). One ended in the repair round with "builds_own is true, and existing_tool gives no cost. ... The Feasibility section states that src/devops_cli/ai/task_loader.py:def load_task_prompt was read, but the run did not read it." The refused-reply file of the item held two replies and none of them held that problem.
Expected
- A revision that the checks refuse in
_repairedis added to the refused replies of the item, with its problem, before the item fails, and<number>.refused.jsonholds it.
Acceptance criteria
- A test plans an item whose first reply passes, whose review returns it, and whose revision the checks refuse. The refused-reply file holds the revision and its problem. It fails today.
-
uv run devops roadmap eval stage --replaykeeps its result.
Existing tool considered
_keep_refused and RefusedRecord.of in src/devops_cli/roadmap/stage/stage_plan_record.py already write the file. The change passes the revision to them. Cost: about 15 000 tokens to build, 2 000 to keep, and 45 minutes.
Proposed design
Problem statement
When the checks refuse a revision in the review repair round, _Planner._repaired raises _stage_error at once. The revision and its problem go to no file. The refused-reply file <number>.refused.json holds only the replies of the first two asks, so a person cannot read the reply that ended the item.
Acceptance criteria
Requirement: Keep the refused revision
The planner SHALL add a revision that the checks refuse in _Planner._repaired to the refused replies of the item, with its problem, and write <number>.refused.json before it raises the stage error.
Scenario: Refused revision after a review return
- WHEN The first reply passes the checks, the review returns the plan, and the checks refuse the revision of the repair round.
- THEN The refused-reply file holds the revision and its problem, and the planner raises
RoadmapStageError.
Requirement: Keep earlier refused replies
The planner SHALL keep the refused replies of the first two asks in the file beside the refused revision.
Scenario: Earlier refused reply and refused revision
- WHEN The checks refuse the first reply, accept the second reply, the review returns the plan, and the checks refuse the revision.
- THEN The refused-reply file holds the refused first reply and the refused revision, each with its problem.
Requirement: Replay result stays
The change SHALL keep the result of uv run devops roadmap eval stage --replay.
Scenario: Replay after the change
- WHEN The command
uv run devops roadmap eval stage --replayruns after the change. - THEN The result equals the result before the change.
Existing Tool Considered
No open library covers this need: it is one call inside project code. _keep_refused and RefusedRecord.of in src/devops_cli/roadmap/stage/stage_plan_record.py already write the file, so the change reuses them. Cost: about 15 000 tokens to build, 2 000 to keep, and 45 minutes. No alternatives check has run.
Key questions
- How does
_repairedreach the refused-reply list and the key of the item?:_verifiedreceiveskeyand the list of refused replies fromplan, and passes them to_repaired._repairedappends the refused revision with its problem, calls_keep_refused(target, key, refused), and then raises._gatedreturns the refused list, orplankeeps it on the planner for the item. A plan reply that the checks accepted adds no entry. The list of the first two asks stays in the file. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_plan_record.py]- Chosen: Pass key and refused list from plan through _verified to _repaired. Small change that reuses
_keep_refusedand keeps the earlier refused replies in the same file. - Rejected: Write a second file for the revision. Adds a file and a reader, and splits the replies of one item.
- Rejected: Log the revision only. Logs are cut, which is the problem of the issue.
- Chosen: Pass key and refused list from plan through _verified to _repaired. Small change that reuses
- Does a refused revision need a note in the log as the first two asks have?: Yes.
_repairedcalls_note_refusedwith resultrefusedbefore it keeps the revision, as_gateddoes. This needs thefloorof the toolbox runs, so_verifiedtakesfloorfromplantoo. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py]- Chosen: Call
_note_refusedin_repaired. Same log line as the first two asks, with no new format. - Rejected: No log line. The log would show less for the repair round than for the first two asks.
- Chosen: Call
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.Lost audit data hampers debugging but does not block the pipeline or expose a security risk.The refused revision and its problem text are needed to diagnose why an item failed.The body states about 45 minutes and reuses existing _keep_refused and RefusedRecord.of.Both deal with refused replies in the stage job, but #3599 adds a retry step while the candidate persists the refused revision to the file.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at 699026e (see proposed design in issue body).
dan-petty commentedon Nov 10, 2026
Pull request #4365 delivers this item together with #4348. A revision that the checks refuse in a repair round is now added to the refused replies of the item with its problem, and
<n>.refused.jsonholds it beside the refused replies of the first asks. The pull request closes #4348 only. Close this issue when #4365 is merged.fix(roadmap): return a refused repair revision to the planner (#4365)
dan-petty commentedon Nov 10, 2026
Delivered by PR #4365 (closes #4348): the refused list now lives on the planner for the whole item, and
<n>.refused.jsonholds the refused first replies and the refused revisions of the repair rounds, each with its gate problem. A refused revision also gets one bounded return. Closed as completed.