Skip to content

feat(roadmap): a fix-plan step repairs a plan PR with open findings #5061

Closed

Description

@dan-petty

Problem or Motivation

The stage job opens a plan pull request as a draft with the label plan/needs-fix when its last verification review has an open finding (#3264). No job revisits such a pull request. The row stage_ready refuses it, a later stage round does not take the item again, and the pull request stays a draft until a person fixes it. On 2026-11-12, 6 plan pull requests are open with plan/needs-fix: #4849, #4917, #4963, #4980, #5032 and #5053. #5059 makes the stage job send every open finding back to the planner during the stage round, but a plan that is still open after the last repair round, and each plan that opened before #5059, needs a later repair.

Proposed Solution & Architectural Design

A step job fix-plan (src/devops_cli/roadmap/steps/fix_plan.py, CLI devops roadmap step fix-plan --pull N) repairs one open plan pull request with plan/needs-fix for each call:

  1. Read the open findings from the marked stage comment of the pull request, and the plan from its branch.
  2. Run the stage planner on the existing branch with the plan as previous and the open findings as problem, as the stage repair round does (StageJob._repaired). Then run the stage gates and the verification review (StageJob._review) on the revision.
  3. Push the revision with the push step, so that the push holds origin/main (feat(git): refuse a push that does not hold origin/main #4879, fix(roadmap): the final push of the implement Job can miss the latest main #4957).
  4. Update the marked stage comment with the findings of the new review.
  5. When the review has no open finding, remove plan/needs-fix, so that stage_ready can mark the draft ready. Otherwise record the attempt and keep the label.

Bounds: bot plan pull requests only; at most 2 attempts for each plan, at least 6 hours apart; no attempt while the Service drains (the drain guard of #4925); stop on an owner/* label or on a head that is not the head that the step read. Record keys fix_plan.attempts, fix_plan.last_at and fix_plan.result.

The step reuses the stage planner, gates and verification code. It does not copy them. A seam in stage.py that runs one repair round for a given plan and findings, which the stage repair loop and this step both call, is the expected shape.

First input: the 6 open pull requests above.

Target Subsystem

Roadmap steps (src/devops_cli/roadmap/steps/) and the stage verification repair (src/devops_cli/roadmap/stage/stage.py, stage_verify.py).

Existing Tool Considered

No open tool repairs an OpenSpec plan from review findings. The step reuses the stage job code, the push step (#4957) and the marked-comment writer (#5025). Cost to build: about 1M tokens and 1 agent-day; at run time at most 2 planner runs and 2 reviews for each plan.

Acceptance Criteria

  • A test: a plan pull request with plan/needs-fix and a quoted criterion_dropped finding gets one planner request with the finding as problem, and a clean review removes the label.
  • A test: a review that still has an open finding records the attempt and keeps the label.
  • A test: a third attempt, an attempt within 6 hours of the last, and an attempt during a drain each make no model request.
  • A test: the push holds origin/main.
  • A dry-run test sees 0 requests.

Dependencies

Source: #5014

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 12, 2026
  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 12, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
  7. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 15:46 UTC

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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions