Skip to content

fix(roadmap): keep a refused revision of the review repair #4312

Closed

Description

@dan-petty

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 _repaired is added to the refused replies of the item, with its problem, before the item fails, and <number>.refused.json holds 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 --replay keeps 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 --replay runs 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 _repaired reach the refused-reply list and the key of the item?: _verified receives key and the list of refused replies from plan, and passes them to _repaired. _repaired appends the refused revision with its problem, calls _keep_refused(target, key, refused), and then raises. _gated returns the refused list, or plan keeps 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_refused and 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.
  • Does a refused revision need a note in the log as the first two asks have?: Yes. _repaired calls _note_refused with result refused before it keeps the revision, as _gated does. This needs the floor of the toolbox runs, so _verified takes floor from plan too. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py]
    • Chosen: Call _note_refused in _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.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 10, 2026
  2. dan-petty commented on Nov 10, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Lost audit data hampers debugging but does not block the pipeline or expose a security risk.
    • Value: Medium. The refused revision and its problem text are needed to diagnose why an item failed.
    • Effort: Low. The body states about 45 minutes and reuses existing _keep_refused and RefusedRecord.of.
    • Related: feat(roadmap): retry a refused pull request text once #3599, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 10, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 699026e (see proposed design in issue body).

  6. dan-petty commented on Nov 10, 2026

    @dan-petty
    OwnerAuthor

    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.json holds it beside the refused replies of the first asks. The pull request closes #4348 only. Close this issue when #4365 is merged.

  7. dan-petty commented on Nov 10, 2026

    @dan-petty
    OwnerAuthor

    Delivered by PR #4365 (closes #4348): the refused list now lives on the planner for the whole item, and <n>.refused.json holds 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.

  8. removed
    status/ready
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions