Skip to content

fix(roadmap): stage returns every open review finding to the planner #5059

Closed

Description

@dan-petty

Problem Description

The stage verification pass keeps a plan pull request in draft with the label plan/needs-fix for an open finding, but it sends only some open findings back to the planner. In src/devops_cli/roadmap/stage/stage_verify.py, OPEN_TYPES = RETURN_TYPES | {SPEC_DELTA_WRONG, CRITERION_DROPPED}. The repair loop in stage.py (_verified) starts a repair round only when returning() gives a finding, and returning() takes only RETURN_TYPES. So a plan whose open findings are all spec_delta_wrong, criterion_dropped or a placeholder gets no repair round: it opens as a draft with plan/needs-fix, and no job revisits it.

Reproduction Steps

  1. Stage an item whose first review gives only a criterion_dropped finding that quotes the issue.
  2. Read the log line stage review round: of the item.
  3. See round=0 ... returned=0 open=1, and no request to the planner after the review.

Expected vs Actual Behavior

Expected: each open finding (a finding that keeps the plan in draft) sends the plan back to the planner while a repair round remains, as missing_path does.

Actual: spec_delta_wrong, criterion_dropped and placeholder findings keep the plan in draft but never go back to the planner.

Environment Diagnostics

Service roadmap-service, release 0.118.0, origin/main at a172563.

Logs, Traces, or Terminal Output

Loki, last 24 hours, lines stage review round: (2026-11-12). Of 7 plan pull requests, 5 ended with returned=0 and open>=1:

The other 2 (#4472, #4945) used all CONST_ROADMAP_STAGE_VERIFY_REPAIR_ROUNDS (2) rounds with findings that return the plan still open; #4851 covers more rounds.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Proposed design

Problem statement

The stage verification pass keeps a plan pull request in draft with plan/needs-fix for an open finding. The repair loop of _verified starts a repair round only for the types of RETURN_TYPES. A plan whose open findings are all spec_delta_wrong, criterion_dropped or a placeholder gets no repair round. It then stays in draft, and no job revisits it. The fix starts a repair round for each open finding while a repair round remains.

Acceptance criteria

Requirement: Open finding starts a repair round

The stage job SHALL start a repair round when the review leaves an open finding and a repair round remains.

Scenario: Only a spec_delta_wrong finding is open

  • WHEN The review returns one spec_delta_wrong finding that quotes the issue, and CONST_ROADMAP_STAGE_VERIFY_REPAIR_ROUNDS rounds remain.
  • THEN The stage job sends one planner request whose problem text names the finding, and it opens no draft in that round.

Requirement: Placeholder finding starts a repair round

The stage job SHALL start a repair round for an open finding that reports a placeholder, whatever its defect type.

Scenario: An other finding reports a placeholder

  • WHEN The review returns one other finding whose quote is a placeholder text of the request, and a repair round remains.
  • THEN The stage job sends one planner request for the plan.

Requirement: Each open finding goes to the planner

The stage job SHALL put each open finding of the round into the problem text that it sends to the planner.

Scenario: Two open findings of different types

  • WHEN The round has one criterion_dropped finding and one missing_path finding that quote the issue.
  • THEN The planner request names both findings.

Requirement: The last round keeps the draft label

The stage job SHALL keep the plan pull request in draft with the label plan/needs-fix when an open finding remains after the last repair round.

Scenario: An open finding after the last round

  • WHEN Each review of the two repair rounds returns an open spec_delta_wrong finding.
  • THEN The pull request stays a draft with the label plan/needs-fix, and the job sends no third planner request.

Requirement: Refine keeps its advice rule

The refine judge SHALL NOT return a proposal for a criterion_dropped finding.

Scenario: The refine review reports a dropped criterion

  • WHEN The refine review of a proposal returns one criterion_dropped finding that quotes the proposal.
  • THEN The refine judge records no return for that finding.

Requirement: The spec and the doc state the rule

The change SHALL state in the spec delta of roadmap-stage/verification and in docs/roadmap/stage.md that each open finding returns the plan while a repair round remains.

Scenario: The spec delta names the open findings

  • WHEN The change is validated with openspec validate and the verification section of docs/roadmap/stage.md is read.
  • THEN The validation passes, and the text names spec_delta_wrong, criterion_dropped and a placeholder finding as open findings that return the plan.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need: the rule lives in the project's own stage job, in src/devops_cli/roadmap/stage/stage_verify.py and src/devops_cli/roadmap/stage/stage.py. The change edits the trigger of the repair loop and reuses open_findings. The cost to build and keep it is about 2,000 tokens and under one hour.

Key questions

  • Which findings start a repair round of the stage job?: Each open finding of the round starts a repair round, while CONST_ROADMAP_STAGE_VERIFY_REPAIR_ROUNDS rounds remain. The stage job uses open_findings for this test, and not returning. (best practice) [sources: src/devops_cli/roadmap/stage/stage_verify.py:61, src/devops_cli/roadmap/stage/stage.py:1485, docs/roadmap/stage.md:81, openspec/changes/archive/2026-11-06-3039-verifier-reads-repo-two-rounds/design.md:26]
    • Chosen: Trigger the round on open_findings. It covers spec_delta_wrong, criterion_dropped and a placeholder finding, and it leaves RETURN_TYPES and returning as they are.
    • Rejected: Add SPEC_DELTA_WRONG and CRITERION_DROPPED to RETURN_TYPES. It changes the type set that other readers of RETURN_TYPES see, and a placeholder finding of type other still gets no round.
    • Rejected: Keep the current behavior. The issue logs show 5 of 7 plan pull requests with returned=0 and open>=1.
  • Does a finding that reports a placeholder start a repair round when its type is not a return type?: Yes. open_findings holds a finding whose quote is a placeholder of the request. The stage job returns the plan for it. (best practice) [sources: src/devops_cli/roadmap/stage/stage_verify.py, src/devops_cli/roadmap/pull_form.py]
    • Chosen: Return the plan for the placeholder finding. The finding keeps the plan in draft, so it needs the same repair as a typed finding.
    • Rejected: Return the plan for typed findings only. The plan then stays in draft with no repair, which is the defect of the issue.
  • Does a criterion_dropped finding return the plan to the planner in the stage job?: Yes. The archived design of fix(roadmap): the stage review blocks a plan that does not deliver an acceptance criterion #3448 chose the opposite, to save one planner call. That choice leaves the plan in draft with no repair. The stage job returns each open finding, as the design of feat(roadmap): an independent verifier refutes a plan before the draft pull request opens #3039 states. (best practice) [sources: docs/roadmap/stage.md:81, openspec/changes/archive/2026-11-06-3039-verifier-reads-repo-two-rounds/design.md:26, openspec/changes/archive/2026-11-06-3448-criterion-dropped-keeps-plan-draft/design.md:7, src/devops_cli/roadmap/stage/stage.py:1485]
  • Where does the stage job hold the repair-round trigger?: In _verified of src/devops_cli/roadmap/stage/stage.py. The exported helper returning and the set RETURN_TYPES stay as they are. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py:1485, src/devops_cli/roadmap/stage/stage_verify.py:61, docs/roadmap/stage.md:81]
    • Chosen: Change _verified only. The issue names the repair loop of _verified, and the change stays in that loop.
    • Rejected: Change the exported returning helper. The fix needs no change to an exported helper, and a wider change reaches callers that the issue does not name.
  • Which documents must the change update?: docs/roadmap/stage.md and a spec delta of roadmap-stage/verification. The requirement "Other findings go into the comment" no longer holds for spec_delta_wrong and criterion_dropped. (best practice) [sources: docs/roadmap/stage.md:81, openspec/specs/roadmap-stage/verification/spec.md, CONTEXT.md]
    • Chosen: Update the doc and the spec delta. The doc states the return types, and the spec holds the rule that the change alters.
    • Rejected: Update the doc only. The living spec then keeps a rule that the code contradicts.
  • Does the change keep the repair-round limit at two?: Yes. CONST_ROADMAP_STAGE_VERIFY_REPAIR_ROUNDS stays 2, and feat(roadmap): extend stage gate returns while the plan improves #4851 covers more rounds. [sources: src/devops_cli/config/constants.py:3371, docs/ROADMAP_WORKFLOW.md:344]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p1-high
    owner/agent
    on Nov 12, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

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

  6. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 12, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
  8. 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/lowpriority/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions