Skip to content

feat(roadmap): the stage probe routes prompt changes to prompt rule tests #3347

Closed

Description

@dan-petty

A task group that updates planner prompts (roadmap_stage_change.md or roadmap_stage_split.md) or their corresponding schema field descriptions should reference and run prompt-rule verification tests in tests/roadmap/test_roadmap_stage_prompt_rules.py.

In pull request #3306 (planning #3265), the staged change cited tests/roadmap/test_roadmap_stage_plan.py for verifying prompt wording rules rather than tests/roadmap/test_roadmap_stage_prompt_rules.py (which explicitly tests that prompt text and schema fields agree with system rules and thresholds).

Add a verification rule or check to devops roadmap stage that ensures changes targeting src/devops_cli/ai/tasks/roadmap_stage_*.md include tests/roadmap/test_roadmap_stage_prompt_rules.py in their task reads/changes and verification commands.

Proposed design

Problem statement

devops roadmap stage accepts a plan that edits a planner prompt and cites only tests/roadmap/test_roadmap_stage_plan.py. That plan reads and runs no prompt-rule test, so a prompt change can break the agreement between the prompt and the rules with no notice. The change adds one check to check_proposal and states the rule in the two planner prompts.

Acceptance criteria

Requirement: A prompt change reads the prompt-rule test

A task group that changes a src/devops_cli/ai/tasks/roadmap_stage_*.md prompt SHALL list tests/roadmap/test_roadmap_stage_prompt_rules.py in its reads or its changes.

Scenario: Prompt change omits the prompt-rule test

  • WHEN A group changes src/devops_cli/ai/tasks/roadmap_stage_change.md and lists the prompt-rule test in neither reads nor changes.
  • THEN check_proposal returns one problem that names the prompt path and tests/roadmap/test_roadmap_stage_prompt_rules.py.

Requirement: A prompt change verifies the prompt-rule test

A task group that changes a src/devops_cli/ai/tasks/roadmap_stage_*.md prompt SHALL give a verify command that names tests/roadmap/test_roadmap_stage_prompt_rules.py.

Scenario: Prompt change verifies another command

  • WHEN A group changes src/devops_cli/ai/tasks/roadmap_stage_split.md, lists the prompt-rule test in reads, and gives uv run devops ci docs as verify.
  • THEN check_proposal returns one problem that names the prompt path and tests/roadmap/test_roadmap_stage_prompt_rules.py.

Requirement: A prompt change gives no manual check

A task group that changes a src/devops_cli/ai/tasks/roadmap_stage_*.md prompt MUST NOT give process in place of verify.

Scenario: Prompt change gives a process

  • WHEN A group changes src/devops_cli/ai/tasks/roadmap_stage_change.md, lists the prompt-rule test in changes, and gives process with verify as null.
  • THEN check_proposal returns one problem that names the prompt path and the prompt-rule test path.

Requirement: A compliant prompt change passes

A task group that changes a prompt, lists the prompt-rule test and verifies it SHALL pass the prompt-rule check.

Scenario: Prompt change reads and verifies the prompt-rule test

  • WHEN A group changes src/devops_cli/ai/tasks/roadmap_stage_change.md, lists tests/roadmap/test_roadmap_stage_prompt_rules.py in reads, and gives uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py as verify.
  • THEN check_proposal returns no problem about the prompt-rule test.

Requirement: A change of another file is not refused

A proposal whose groups change no src/devops_cli/ai/tasks/roadmap_stage_*.md prompt MUST NOT get a prompt-rule problem.

Scenario: A change of the plan checker

  • WHEN A group changes src/devops_cli/roadmap/stage_change.py and no group changes a roadmap_stage_*.md prompt.
  • THEN check_proposal returns no problem about the prompt-rule test.

Requirement: The stage prompts state the prompt-rule rule

Each src/devops_cli/ai/tasks/roadmap_stage_*.md prompt SHALL state that a group which changes a prompt lists and verifies tests/roadmap/test_roadmap_stage_prompt_rules.py.

Scenario: The prompt-rule test pins the sentence

  • WHEN tests/roadmap/test_roadmap_stage_prompt_rules.py reads roadmap_stage_change.md and roadmap_stage_split.md.
  • THEN Each prompt holds the sentence that names tests/roadmap/test_roadmap_stage_prompt_rules.py.

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers this need, because the check reads the groups of this repository's own StageProposal. The change builds its own code: about 60 lines in src/devops_cli/roadmap/stage_change.py, one message in src/devops_cli/lang/en/messages.py, one sentence in each of the two prompts, and about 90 lines of tests. The cost is about 35k tokens to build, about 6k tokens to keep and fix at each later change, and about 3 hours of elapsed time. The change deletes no internal code.

Key questions

  • Where does the prompt-rule check run?: Add the check to check_proposal in src/devops_cli/roadmap/stage_change.py, beside the path and form checks, so the planner gets its problem in the one retry. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage.py, tests/roadmap/test_roadmap_stage_plan.py]
    • Chosen: Extend check_proposal. It already collects every problem of a reply, and the stage job sends them back to the model.
    • Rejected: Add a separate linter command. It adds a second path, and the planner never sees its result.
    • Rejected: Rely on the prompt sentence alone. A prompt cannot refuse a reply that leaves the test out.
  • Which paths make a group a prompt change?: A changes path in the folder src/devops_cli/ai/tasks/ whose file name matches roadmap_stage_*.md. The repository holds two such prompts, roadmap_stage_change.md and roadmap_stage_split.md. [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/ai/tasks/roadmap_stage_split.md]
  • Which group must list and verify the prompt-rule test?: The group that changes the prompt itself, because that group runs the check and the plan measures it in one step. (best practice) [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py, src/devops_cli/roadmap/stage_change.py]
    • Chosen: The group that changes the prompt. The group that edits the prompt is the unit that runs the check, and the plan measures it in one step.
    • Rejected: Any group of the proposal. A separate group can pass the check while the prompt edit has no verification.
    • Rejected: Only the first group. A proposal can change both prompt files in different groups.
  • Where does the problem text of the new check live?: In the roadmap messages of src/devops_cli/lang/en/messages.py. The group that writes the check lists that file in changes, because content_problems refuses a task text that names a MESSAGES.roadmap entry without it. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/lang/en/messages.py]
  • Which test module holds the tests of the new check?: tests/roadmap/test_roadmap_stage_prompt_rules.py, which already imports check_proposal, StageGroup, StagedTree and make_stage_proposal and holds the rules about the prompts. (best practice) [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py, tests/roadmap/test_roadmap_stage_plan.py]
    • Chosen: tests/roadmap/test_roadmap_stage_prompt_rules.py. It already holds the agreement of the prompt and the rules, and it imports the check.
    • Rejected: tests/roadmap/test_roadmap_stage_plan.py. It holds the plan run and its model, and the prompt rule is no part of that run.
    • Rejected: A new test module. The folder already has the module for this subject, so a new one splits one subject in two.
  • Do the planner prompts state the new rule?: Yes. Each prompt states that a group which changes a prompt lists and verifies tests/roadmap/test_roadmap_stage_prompt_rules.py, and the prompt-rule test pins the sentence. (best practice) [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py, src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/ai/tasks/roadmap_stage_split.md]
    • Chosen: State the rule in both prompts and pin it in the prompt-rule test. The model can follow the rule before the retry, and the pin fails when one side drifts.
    • Rejected: State the rule in no prompt. The model learns the rule only from a refused reply.
    • Rejected: State the rule in roadmap_stage_change.md only. A split reply gives task groups too, and the split prompt holds their rules.
  • Which verify command does the prompt show for a prompt change?: uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py. The form check accepts it, docs/TESTING.md holds the command devops ci test, and the prompt-rule test asserts that each uv run devops form of the prompt is a command of devops and a form of the guide. [sources: docs/TESTING.md, tests/roadmap/test_roadmap_stage_prompt_rules.py, src/devops_cli/roadmap/stage_form.py]
  • Why did the stage job return the item to New?: The return comment holds only the text x, which is a filler with no reason, so it names no false premise. The project records this defect class in fix(roadmap): a placeholder reply of a model moves no item #3478. This proposal claims nothing about the stage job and keeps only checks that a test asserts offline. [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/roadmap/stage.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-06: none.
Tool: none found.

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. It prevents a recurring error of citing the wrong test file but does not block a release or fix a crash.
    • Value: Medium. It removes a class of verification misses that cause PR rework in the roadmap stage workflow.
    • Effort: Low. It adds one rule to the existing stage probe, similar in shape to #3331 and #3328.
    • 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 add a verification rule to the stage probe for prompt file changes, but #3331 requires an eval replay task while the candidate requires the prompt-rule test file in the 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 e80ae3d (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    x

  7. added
    status/new
    and removed
    status/ready
    status/new
    on Nov 3, 2026
  8. 9 remaining items

  9. added
    status/blocked
    and removed
    status/in-progress
    on Nov 7, 2026
  10. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261107-140758-ce58 ended: succeeded.
    Image digest: sha256:ff3526a65853e025ecb4c2c4ca2f78c6e582c29342b762db525e35b57ab5443c

    The last lines of its log:

    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_content.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops roadmap eval stage ...
    Tool call: shell, program uv, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: grep -n prompt_rules tests/fixtures/roadmap_eval/stage/good-3410-the-stage-gate-proves-a-negative/plan.json tests/fixtures/roadmap_eval/stage/good-3410-the-stag ...
    Tool call: edit_file, ok.
    Tool call: shell, program grep, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: grep -rn tests/roadmap/test_roadmap_stage_prompt_rules tests/fixtures/roadmap_eval/stage/
    Tool call: edit_file, ok.
    Tool call: shell, program grep, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run devops roadmap eval stage ...
    Tool call: edit_file, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_criterion_dropped.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run ruff check src/devops_cli/roadmap/stage/stage_change.py src/devops_cli/lang/en/messages.py ...
    Tool call: shell, started: uv run mypy --strict src/devops_cli/roadmap/stage/stage_change.py 2>&1 ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci --help 2>&1 ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git status --short
    Tool call: shell, started: git diff --stat
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Tool call: shell, started: git diff src/devops_cli/roadmap/stage/stage_change.py src/devops_cli/lang/en/messages.py
    Tool call: shell, program git, ok.
    Failure class limit_reached. Action left: raise_limit.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 12m 7s
    
  11. removed
    owner/service
    on Nov 7, 2026
  12. added
    status/in-review
    and removed
    status/blocked
    on Nov 7, 2026
  13. added 2 commits that reference this issue on Nov 7, 2026
  14. removed
    status/in-review
    on Nov 7, 2026
  15. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 22:00 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