Skip to content

fix(pr): Require a replay score in stage-change PRs #3398

Closed

Description

@dan-petty

Problem

docs/ROADMAP_WORKFLOW.md:254 requires a pull request that changes the stage prompt or a check of the stage job to state the score of the same model before and after the change. #3331 adds a rule to the stage job that refuses a plan which misses the eval replay task. Nothing checks the implementation pull request. After the plan passes, the pull request that actually changes src/devops_cli/roadmap/stage_change.py can become ready to merge with no replay command and no score, so the rule still depends on a person.

Proposed change

  1. Add a check beside the readiness checks that devops pr check-readiness runs. It reads the changed paths of the pull request. When a path is src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_form.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_criteria.py or src/devops_cli/roadmap/stage_eval_gates.py, the body must hold uv run devops roadmap eval stage --replay, one model name and the before and after score.
  2. Report the missing text with the path and the command, and make the check fail.
  3. Test the refusal, the missing score and the passing body offline in the module that tests the readiness checks.

Acceptance criteria

  1. A test asserts that a pull request that changes a trigger path and holds no replay score is not ready.
  2. A test asserts that a pull request that changes a trigger path and states the model and the before and after score is ready.

Existing Tool Considered

No open, maintained tool or library covers a project-specific readiness rule. The change extends the readiness checks of this repository, so it builds no new tool. Cost: about 8,000 tokens to build, about 2,000 tokens a year to keep and fix, and about half a day of elapsed time.

Source: #3331

Scope from #3397

A pull request body must give real numbers. Words alone are not enough. These bodies are not ready, for a pull request that changes a trigger path:

  1. A body with the command and the words before and after, but no numbers.
  2. A body with one number, for example a before value and no after value.
  3. A body that names two different models. The clause on one model stays.
  4. A body with a --model flag that names no model.

Word the check for both forms of the evidence. A replay (uv run devops roadmap eval stage --replay) states counts before and after, and it calls no model. A live run states a score before and after, with one model name. A number must stand beside its word, so two numbers that are no scores do not pass.

Add a test for each of the four refused bodies. Add a test where the numbers and one model name pass.

Add src/devops_cli/roadmap/stage_move.py to the path list, because check_proposal calls it (stage_change.py:48). Keep src/devops_cli/roadmap/stage_form.py on the list. The plan of #3331 must name the same paths.

Proposed design

Problem statement

A pull request that changes a stage check can become ready to merge with no replay command and no score. The rule in docs/ROADMAP_WORKFLOW.md:276 then depends on a person. This change adds a readiness check that refuses such a pull request and requires numbers beside before and after.

Acceptance criteria

Requirement: A trigger path requires a replay score

The readiness check SHALL refuse a pull request that changes a trigger path and holds no replay score.

Scenario: A trigger path with no score

  • WHEN A pull request changes src/devops_cli/ai/tasks/roadmap_stage_change.md and its body holds no replay command and no score.
  • THEN The check fails and names the path and uv run devops roadmap eval stage --replay.

Requirement: A replay states counts before and after

The check SHALL accept a body that holds uv run devops roadmap eval stage --replay and a count beside each of before and after.

Scenario: A replay body with two counts

  • WHEN The body holds the replay command and a number beside before and beside after.
  • THEN The check passes.

Requirement: A live run states one model and a score before and after

The check SHALL accept a body that holds one model name and a score beside each of before and after.

Scenario: A live body with one model

  • WHEN The body holds one model name and a number beside before and beside after.
  • THEN The check passes.

Requirement: Words without numbers are refused

The check SHALL refuse a body that holds before and after with no number beside either word.

Scenario: Words alone

  • WHEN The body holds the replay command and the words before and after with no number.
  • THEN The check fails.

Requirement: One number is refused

The check SHALL refuse a body that gives a number for one of before and after only.

Scenario: A single number

  • WHEN The body holds a number beside before and no number beside after.
  • THEN The check fails.

Requirement: Two models are refused

The check SHALL refuse a body that names two different models.

Scenario: Two model names

  • WHEN The body names two different models.
  • THEN The check fails.

Requirement: A model flag with no name is refused

The check SHALL refuse a body whose --model flag names no model.

Scenario: An empty model flag

  • WHEN The body holds --model with no name after it.
  • THEN The check fails.

Requirement: A number stands beside its word

The check SHALL count a number only when it stands beside before or after.

Scenario: Two numbers away from the words

  • WHEN The body holds two numbers that stand beside neither before nor after.
  • THEN The check fails.

Requirement: A change outside the trigger paths passes

The check SHALL pass a pull request that changes no trigger path, whatever its body holds.

Scenario: A document-only pull request

  • WHEN A pull request changes only docs/ROADMAP_WORKFLOW.md and its body holds no score.
  • THEN The check passes.

Requirement: The trigger list holds stage_move.py

The check SHALL treat src/devops_cli/roadmap/stage_move.py as a trigger path.

Scenario: A change to stage_move.py

  • WHEN A pull request changes only src/devops_cli/roadmap/stage_move.py and its body holds no score.
  • THEN The check fails.

Requirement: The trigger list keeps stage_form.py

The check SHALL treat src/devops_cli/roadmap/stage_form.py as a trigger path.

Scenario: A change to stage_form.py

  • WHEN A pull request changes only src/devops_cli/roadmap/stage_form.py and its body holds no score.
  • THEN The check fails.

Requirement: The readiness tests cover each case offline

The change SHALL add offline tests for each refused body and for a passing body.

Scenario: The readiness tests run offline

  • WHEN The readiness test module runs with no network.
  • THEN Each refusal case and the passing case pass.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a project-specific readiness rule of this repository. The change extends the existing readiness checks, so it builds no new tool. Cost: about 8,000 tokens to build, about 2,000 tokens a year to keep and fix, and about half a day of elapsed time.

Key questions

  • Which changed paths trigger the replay-score check?: The check triggers on src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_form.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_criteria.py, src/devops_cli/roadmap/stage_eval_gates.py and src/devops_cli/roadmap/stage_move.py. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:276, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_move.py, src/devops_cli/roadmap/stage_form.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_criteria.py, src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: The seven stage paths. These files hold the stage prompt and the checks that check_proposal calls, so a change to one changes the stage check.
    • Rejected: Only the stage prompt and stage_change.py. A change to a gate module changes the stage check with no change to stage_change.py.
    • Rejected: Every path under src/devops_cli/roadmap/. Most modules hold no stage check, so the rule would refuse unrelated pull requests.
  • Which forms of evidence does the check accept?: The check accepts a replay body with uv run devops roadmap eval stage --replay and a count beside before and after, or a live body with one model name and a score beside before and after. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:276, src/devops_cli/roadmap/stage_eval_gates.py]
    • Chosen: Both replay counts and a live score. The replay calls no model, and a live run is the only way to measure a model.
    • Rejected: The live score only. The replay is the cheap run that calls no model, so a refusal of it would block most pull requests.
    • Rejected: The replay command only. A change to the stage prompt needs a model score, which the replay cannot give.
  • How does the check tie a number to before or after?: A number counts only when it is on the same line as before or after. No other number counts. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:276]
    • Chosen: A number on the same line as the word. A line is the unit that a person writes, and a test can assert it offline.
    • Rejected: A number anywhere in the body. Two numbers that are no scores would then pass.
    • Rejected: A model call that reads the body. The readiness check makes no model call, and a test cannot assert its answer offline.
  • Where does the failure text live?: The failure text is a new entry in src/devops_cli/lang/en/messages.py, and it names the trigger path and uv run devops roadmap eval stage --replay. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage_change.py]
    • Chosen: An entry in the message catalog. The project keeps each user-facing text in src/devops_cli/lang/en/messages.py, as stage_change.py shows with MESSAGES.roadmap.
    • Rejected: A string literal in the check module. It breaks the message catalog rule of the project.
  • Which module holds the readiness check and its tests?: The rule goes beside the existing readiness checks that devops pr check-readiness runs. Its tests go in the mirror test module under tests/ for that module. (best practice) [sources: src/devops_cli/lang/en/messages.py]
    • Chosen: The existing readiness-check module. devops pr check-readiness already calls this module, so the rule needs no new command wiring.
    • Rejected: A new check module. A new module duplicates the readiness wiring and adds a call site.
    • Rejected: The command module. A command module holds request handling, and an offline test is harder there.
  • What does this change require of the plan of feat(roadmap): stage requires an eval replay task when a plan edits the stage prompt or gates #3331?: The plan of feat(roadmap): stage requires an eval replay task when a plan edits the stage prompt or gates #3331 must name the same seven trigger paths. This pull request cannot edit that plan. Its owner must align it. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:276]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-06: partly.
Tool: danger/danger-js (https://github.com/danger/danger-js), MIT, last activity 2026-10-26, maintained.

Activity

  1. added
    type/bug
    scope/pr
    status/new
    value/medium
    effort/low
    on Nov 4, 2026
  2. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    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/pr. The (pr) scope of the title gives the scope.
    • Priority: P2-Medium. It closes a process gap but does not block a release or fix a crash.
    • Value: Medium. It removes a manual step that currently enforces the replay score rule.
    • Effort: Low. The body estimates about half a day of elapsed time for a focused check.
    • Related: feat(roadmap): stage requires an eval replay task when a plan edits the stage prompt or gates #3331, which asks for a different change. Both enforce the replay score rule, but #3331 checks the plan and the candidate checks the implementation PR body.
  3. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 999a4fb until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  4. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at d254410 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

  5. added
    status/ready
    and removed
    status/new
    on Nov 6, 2026
  6. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

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

  7. changed the title [-]fix(pr): a merge-ready pull request that changes a stage check states its replay score[/-] [+]fix(pr): Require a replay score in stage-change PRs[/+] on Nov 6, 2026
  8. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 77 characters, and the limit is 60. The type and the scope stay.

    • Before: fix(pr): a merge-ready pull request that changes a stage check states its replay score
    • After: fix(pr): Require a replay score in stage-change PRs
    • Source of the summary: the background model
  9. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: danger/danger-js (https://github.com/danger/danger-js)

    • License: MIT
    • Last activity: 2026-10-26
    • Maintained: yes

    Covers:

    • Reads a pull request's changed file paths and its body, which are the two inputs the readiness rule needs
    • Lets a project write its own rule that fails a pull request and reports a message when a trigger path requires text in the body
    • Runs on each pull request and can fail the check, so the rule would not depend on a person

    Lacks:

    • No built-in notion of a replay score: it does not require uv run devops roadmap eval stage --replay, a number beside before and after, or one model name
    • No rule for refusing two model names, a single number, or a --model flag with no name
    • It is a JavaScript rule engine outside the repository's Python readiness module, so the rule still has to be written and its refusals tested, and it would add a second runtime to the devops pr check-readiness path
    • The project-specific trigger path list and the failure text would still be new code

    Searches run:

    • open source tool enforce pull request description body requirements based on changed files
    • danger-js rule check PR body contains text when files changed
    • Danger JS pull request rules changed files
    • danger js
    • policy check pull request body with conftest opa
    • pull request body lint tool

    Sources:

    Checked on 2026-11-06. A person decides what this means for the item. The check changes no label and closes no issue.

  10. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  11. removed
    status/in-review
    on Nov 14, 2026
  12. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 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/prtype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions