Skip to content

feat(roadmap): stage requires an eval replay task when a plan edits the stage prompt or gates #3331

Closed

Description

@dan-petty

Problem

docs/ROADMAP_WORKFLOW.md:233 specifies the following SDLC rule:
"A pull request that changes the stage prompt (roadmap_stage_change.md) or a check of the stage job (check_proposal and the gates it calls) states the score of the same model before and after the change."

Plans that modify src/devops_cli/ai/tasks/roadmap_stage_change.md or check_proposal (such as #3252 / PR #3298) frequently miss this requirement in their tasks and workflow follow-up sections.

Because the stage planner and gate do not check for this requirement, implementation pull requests often fail merge readiness or need rework to run uv run devops roadmap eval stage --replay.

Proposed change

  1. In src/devops_cli/roadmap/stage_eval_gates.py, add a rule that inspects whether a plan changes roadmap_stage_change.md or stage_eval_gates.py / stage_change.py gates.
  2. If so, verify that the plan tasks or workflow follow-up includes running the model replay evaluation and reporting the score.
  3. Refuse plans that modify prompt rules or gate checks without specifying the replay evaluation step.
  4. Add unit tests in tests/roadmap/test_roadmap_stage_plan.py or tests/roadmap/test_roadmap_stage_form.py.

Acceptance criteria

  1. A test asserts that a plan editing roadmap_stage_change.md without an evaluation task is refused.
  2. A test asserts that a plan editing roadmap_stage_change.md that includes the model replay evaluation passes.

Source: #3298

Proposed design

Problem statement

The stage job does not refuse a plan that changes the stage prompt or a stage gate without an eval replay task. Such plans reach implementation and break the workflow rule. The change adds a check to check_proposal and tests it.

Acceptance criteria

Requirement: Replay task for prompt change

A plan that changes src/devops_cli/ai/tasks/roadmap_stage_change.md SHALL include a task with uv run devops roadmap eval stage --replay and the before and after score.

Scenario: Prompt change without replay task

  • WHEN A plan changes src/devops_cli/ai/tasks/roadmap_stage_change.md and no group task holds the replay command and the before and after score.
  • THEN check_proposal returns a problem that names the changed path and the replay command.

Requirement: Replay task for gate change

A plan that changes src/devops_cli/roadmap/stage_change.py or src/devops_cli/roadmap/stage_eval_gates.py SHALL include a task with the replay command and the before and after score.

Scenario: Gate change without replay task

  • WHEN A plan changes src/devops_cli/roadmap/stage_eval_gates.py and no group task holds the replay command and the before and after score.
  • THEN check_proposal returns a problem that names the changed path and the replay command.

Requirement: Replay command without score

A plan that changes a trigger path SHALL report the before and after score, not only run the replay command.

Scenario: Replay command without score

  • WHEN A plan changes src/devops_cli/roadmap/stage_change.py and a group task holds the replay command but not the words score, before and after.
  • THEN check_proposal returns a problem that asks for the before and after score.

Requirement: Replay task passes

A plan that changes a trigger path SHALL pass the replay check when one group task holds the replay command and the before and after score.

Scenario: Trigger path with replay task

  • WHEN A plan changes src/devops_cli/roadmap/stage_change.py and one group task holds uv run devops roadmap eval stage --replay, score, before and after.
  • THEN check_proposal returns no problem for the eval replay rule.

Requirement: Unrelated path is not checked

A plan that changes no trigger path SHALL not get the eval replay problem.

Scenario: Unrelated source change

  • WHEN A plan changes only src/devops_cli/roadmap/stage.py.
  • THEN check_proposal returns no problem for the eval replay rule.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a project-specific stage plan gate. The project must build the check. Cost: 12,000 tokens to build, 3,000 tokens per year to keep and fix, and 1 day elapsed.

Key questions

  • What does the workflow rule require of a plan that changes the stage prompt or a stage gate?: The pull request must state the score of the same model before and after the change, and name the model. A change of a gate must also state the replay counts before and after. [sources: docs/ROADMAP_WORKFLOW.md:233, docs/ROADMAP_WORKFLOW.md:232]
  • How does the stage job run the current plan checks?: check_proposal in src/devops_cli/roadmap/stage_change.py runs the path, spec delta and verify form checks. stage_eval_gates.py calls check_proposal from its paths gate for the replay. [sources: src/devops_cli/roadmap/stage_eval_gates.py, openspec/changes/3200-refuse-a-plan-with-placeholder-or/design.md:19]
  • Where should the eval replay rule run?: Run the rule inside check_proposal in src/devops_cli/roadmap/stage_change.py. The stage job and the replay both call this function, so one rule refuses a plan and the replay judges the same rule. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:232, src/devops_cli/roadmap/stage_eval_gates.py, openspec/changes/3200-refuse-a-plan-with-placeholder-or/design.md:19]
    • Chosen: Add the rule to check_proposal. The stage job calls check_proposal, and the replay calls it through the paths gate. One code path gives one result.
    • Rejected: Add a new gate only in stage_eval_gates.py. The stage job does not call run_gates, so a new GATES entry alone would not refuse a plan.
    • Rejected: Add a separate check in stage.py. The replay would not run the same check, so the rule would drift from the replay.
  • Which changed paths trigger the eval replay rule?: The rule triggers on src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_change.py and src/devops_cli/roadmap/stage_eval_gates.py. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:233, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_eval_gates.py]
    • Chosen: The prompt and the two gate modules. These paths hold the prompt and the checks that the workflow rule names.
    • Rejected: The prompt only. The rule also covers check_proposal and the gates it calls.
    • Rejected: Every path under src/devops_cli/roadmap/. Most roadmap code is no stage gate, so this option would refuse unrelated plans.
  • What text must a plan include to show the eval replay step?: One group task must hold the exact command uv run devops roadmap eval stage --replay and the words score, before and after. The check reads the group title, test, implementation, documentation and verify text. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:233, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Exact command and before and after score words. The check is simple, offline and gives a clear problem to the model.
    • Rejected: Any task text that mentions an evaluation. The model can satisfy this option without the replay command or a score.
    • Rejected: A separate task for the command and another for the score. One task keeps the command and its result together, so a reader sees the full step.
  • Which test module holds the new unit tests?: Add the tests to tests/roadmap/test_roadmap_stage_form.py. That module tests check_proposal form rules and needs no model or git. (best practice) [sources: tests/roadmap/test_roadmap_stage_form.py, tests/roadmap/test_roadmap_stage_plan.py]
    • Chosen: tests/roadmap/test_roadmap_stage_form.py. The module tests check_proposal rules with a staged tree, so the new check fits there.
    • Rejected: tests/roadmap/test_roadmap_stage_plan.py. That module tests the full stage job and model calls, which the rule does not need.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 3, 2026
  2. dan-petty commented on Nov 3, 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/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The change reduces rework and merge failures in the plan workflow but does not block release or fix a critical defect.
    • Value: Medium. It prevents a recurring class of merge failures and rework for plans that edit the stage prompt or gates.
    • Effort: Low. The change adds one conditional rule to an existing gates file and two unit tests, which is a small, scoped addition.
    • Related: feat(roadmap): add a plan-check command for a plan pull request #3201, which asks for a different change. Both add checks to plan pull requests, but #3201 builds a general plan-check command while the candidate adds a specific gate rule in stage_eval_gates.py that enforces a replay task.
  3. added
    priority/p2-medium
    on Nov 3, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 3, 2026
  5. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

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

  6. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    Staged: branch feat/3331-stage-requires-an-eval-replay-task, draft pull request #3339. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Refuse a plan that changes a stage trigger path without the eval replay task: 31191 tokens
    2. Name the trigger paths and the replay task in the workflow document: 14426 tokens

    The plan run made 2 model request(s), and used 151605 input tokens and 6986 output tokens. The model made no tool call.

    A model review of the plan found these points. They stop no draft, and a person judges them:

    • other at group 1: Group 1 changes stage_change.py, a trigger path of the new rule, but has no replay command or score task. The new rule would refuse this plan, and the workflow rule needs the score for this change. Evidence: "A plan that changes src/devops_cli/roadmap/stage_change.py or src/devops_cli/roadmap/stage_eval_gates.py SHALL include a task with the replay command and the before and after score."
  7. added 2 commits that reference this issue on Nov 3, 2026
  8. removed
    status/ready
    on Nov 4, 2026
  9. 6 remaining items

  10. added
    status/blocked
    on Nov 4, 2026
  11. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261104-103847-c60e ended: succeeded.
    Image digest: sha256:68ba10ea2a5e3536c67a726812a8aaac645a24539797eb2a7cf907c8762cdf68

    The last lines of its log:

    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_form.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_form.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git checkout HEAD -- src/devops_cli/roadmap/stage_change.py
    Tool call: shell, program git, ok.
    Tool call: shell, started: git checkout HEAD -- src/devops_cli/lang/en/messages.py
    Tool call: shell, program git, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, retry.
    Tool call: shell, started: uv run devops ci docs
    Tool call: shell, program uv, ok.
    Tool call: edit_file, retry.
    Tool call: edit_file, retry.
    Tool call: shell, started: cd /home/devops/.data/agent/worktrees/w-3331 && find . -name ...
    Tool call: shell, program cd, refused.
    Tool call: shell, started: ruff check src/devops_cli/roadmap/stage_change.py
    Tool call: shell, program ruff, ok.
    Tool call: shell, started: ruff check src/devops_cli/lang/en/messages.py
    Tool call: shell, program ruff, ok.
    Tool call: shell, started: ruff check docs/ROADMAP_WORKFLOW.md
    Tool call: shell, program ruff, ok.
    Formatted: src/devops_cli/lang/en/messages.py
    Tool call: edit_file, retry.
    Tool call: edit_file, retry.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_form.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_form.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: ruff check src/devops_cli/roadmap/stage_change.py src/devops_cli/lang/en/messages.py
    Tool call: shell, program ruff, ok.
    Tool call: shell, started: git status
    Tool call: shell, program git, ok.
    Tool call: shell, started: git diff --name-only HEAD
    Tool call: shell, program git, ok.
    Tool call: shell, started: git diff src/devops_cli/lang/en/messages.py
    Tool call: shell, program git, ok.
    Failure class plan_defect. Action left: amend.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 22m 40s
    
  12. added
    status/planned
    and removed
    owner/service
    status/blocked
    on Nov 4, 2026
  13. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at group 1 by the rule digest: the runner image changed since the stop, from sha256:68ba10ea2a5e3536c67a726812a8aaac645a24539797eb2a7cf907c8762cdf68 to sha256:89bb522e53b2cf11cc1aa5746e87351306958e1be75ef01cc0bd1d203c8470f5. The item is Planned again, and the Service takes it in the next round. The Service clears a stop one time for each runner image. A new stop on this image waits for a comment implement: retry.

  14. added
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 6, 2026
  15. removed
    status/in-review
    on Nov 6, 2026
  16. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor
  17. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 02:22 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/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