Skip to content

feat(roadmap): hold a refine judge approval by a stage plan that builds #7166

Backlog

Description

@devops-cli-service

Split from #5905.

Problem: The refine judge grade must mark an approved verdict held when a later stage result shows a plan that builds. Why deferred: the stage result line records result, plan_calls, gate_returns, verify_rounds, tokens and seconds, and no plan-check result (src/devops_cli/roadmap/stage/stage.py:4731-4738). Issue #5603 adds the stage plan grade and is open. Acceptance criteria: The stage result line SHALL record the plan-check result of the plan that it staged. The job grade report SHALL mark an approved refine_judge verdict held when a later stage result line of the same item records a passing plan check. A test SHALL assert both outcomes with a fake stage result line.

Proposed design

Problem statement

Record the plan-check result in the stage result line, and make the job grade report hold an approved refine_judge verdict when a later stage result line of the same item records a passing plan check. The item waits on #5603, which adds the stage plan grade to the stage result line. The stage result line holds no plan-check result now, so the grade report cannot hold an earlier approval.

Acceptance criteria

Requirement: Stage result plan check

The stage job SHALL write the result of its plan check into the stage result line as the field plan_check, with the value pass, fail or none.

Scenario: Plan check outcome

  • WHEN A unit test builds the stage result line for a passing plan check, a failing plan check and a missing plan check
  • THEN The stage result line holds plan_check with the value pass for the passing check, fail for the failing check and none for the missing check.

Requirement: Grade holds the approved verdict

The job grade report MUST mark an approved refine_judge verdict held when a later stage result line of the same item records plan_check pass.

Scenario: Later stage line with a passing plan check

  • WHEN A unit test gives the grade report an approved refine_judge result line and a later stage result line of the same item with plan_check pass
  • THEN The grade report shows the refine_judge verdict as held.

Requirement: Grade keeps the approved verdict on a failing plan check

The job grade report MUST keep an approved refine_judge verdict not held when the later stage result line of the same item records plan_check fail.

Scenario: Later stage line with a failing plan check

  • WHEN A unit test gives the grade report an approved refine_judge result line and a later stage result line of the same item with plan_check fail
  • THEN The grade report keeps the refine_judge verdict approved and not held.

Requirement: Grade keeps the approved verdict with no plan check

The job grade report MUST keep an approved refine_judge verdict not held when the later stage result line of the same item records plan_check none.

Scenario: Later stage line with no plan check

  • WHEN A unit test gives the grade report an approved refine_judge result line and a later stage result line of the same item with plan_check none
  • THEN The grade report keeps the refine_judge verdict approved and not held.

Requirement: Grade keeps the approved verdict for a line without the field

The job grade report MUST keep an approved refine_judge verdict not held when the later stage result line of the same item holds no plan_check field.

Scenario: Older stage result line

  • WHEN A unit test gives the grade report an approved refine_judge result line and a later stage result line of the same item with no plan_check field
  • THEN The grade report keeps the refine_judge verdict approved and not held.

Existing Tool Considered

No alternatives check has run. No open tool or library covers this need: the change is internal to the stage result line and the job grade report of devops-cli. The written cost to build, keep and fix this code is about 4,000 tokens and 2 hours.

Key questions

  • Which field records the plan-check result in the stage result line?: Add a string field plan_check to the stage result line, with the closed values pass, fail and none. Keep the existing result field for the job outcome. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, CONTEXT.md]
    • Chosen: Add string field plan_check. It records the plan check beside the job result and gives the grade report a closed set of values.
    • Rejected: Add boolean field plan_ok. It cannot show that no plan check ran.
    • Rejected: Reuse the existing result field. It conflates the job outcome with the plan-check outcome.
  • Where does the job grade report apply the hold?: In the job grade report, when it reads the result lines of one item. A later stage result line with plan_check pass marks an earlier approved refine_judge verdict held. The stored result lines stay unchanged. (best practice) [sources: CONTEXT.md, src/devops_cli/commands/roadmap_eval.py]
    • Chosen: Apply the hold in the grade report. The item asks the job grade report to mark the verdict held, and the recorded result lines stay unchanged.
    • Rejected: Rewrite the refine_judge result line. It changes recorded history and needs a second write.
    • Rejected: Hold the verdict at refine time. The stage result line does not exist when refine runs.
  • What value shows that no plan check ran?: Record plan_check with the value none when the stage job staged no plan or ran no plan check. The grade report then keeps the approved refine_judge verdict not held. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, CONTEXT.md]
    • Chosen: Record plan_check as none. It makes the absence of a plan check explicit and keeps pass and fail unambiguous.
    • Rejected: Omit the plan_check field. The grade report cannot tell an old result line from a new line with no plan check.
    • Rejected: Record plan_check as fail. It reports a plan failure when no plan check ran.
  • Where does the stage job take the plan-check result that it records?: From the outcome of the plan check that the stage job already runs on the plan before it opens the draft. A plan that passes the check gives pass, a plan that fails gives fail, and a run with no plan check gives none. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, CONTEXT.md]
    • Chosen: Reuse the outcome of the stage plan check. The stage job already refuses a plan that fails the check, so the outcome costs no second check.
    • Rejected: Run a second plan check after the result line is built. It costs a second check and can disagree with the check that staged the plan.
    • Rejected: Record none for every run. It hides a real plan check from the grade report.
  • Which module holds the job grade report that reads the result lines?: The devops roadmap eval command group is registered from src/devops_cli/commands/roadmap_eval.py. The command devops roadmap eval grades prints the job grade from the result lines of each attempt in Loki. [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/commands/roadmap_eval.py, CONTEXT.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5603

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 25, 2026
  2. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  4. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  5. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions