Skip to content

fix(roadmap): refuse a plan group that only reacts to a possible failure #3433

Closed

Description

@dan-petty

Problem or Motivation

The stage plan accepts a task group whose work happens only if a change breaks a test. The group lists at least one path in changes, so form_problems and path_problems accept it. The implement step stages the checkout and stops with implement_stop_no_change ("The agent changed no file.") when no test breaks.

The plan of PR #3409 (for #3404) is the case. Group 3 is "Keep the roadmap stage tests green after the new problem". Its only task is "Run the whole roadmap suite after the rule lands, and fix a test of tests/roadmap/test_roadmap_stage_plan.py that a new problem of the sample plan now stops". No test in the repository changes src/devops_cli/roadmap/stage_change.py, so the group has no work. src/devops_cli/roadmap/implement_step.py returns _Failure(MESSAGES.roadmap.implement_stop_no_change) when _stage lists no path.

Proposed Solution & Architectural Design

  1. In src/devops_cli/ai/tasks/roadmap_stage_change.md, state the rule: a group gives one exact change. The planner names the failing test that the change updates, or it plans no group. It never writes a group that fixes a test only if it breaks.
  2. In content_problems in src/devops_cli/roadmap/stage_change.py, refuse an other group that changes only test paths and whose implementation names no test function in a code span. The rule gives a deterministic reason for a group that cannot prove its change.
  3. Add a case to tests/roadmap/test_roadmap_stage_content.py for a conditional test-only group and one for a group that names the test function it updates.

Target Subsystem

src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/test_roadmap_stage_content.py

Existing Tool Considered

No open, maintained tool reads a plan task for a conditional. The stage check already reads the task texts, so the change extends content_problems. Estimated cost: about 3,000 tokens to build, about 1,000 tokens to keep and fix, about 2 hours.

Proposed design

Problem statement

The stage plan accepts a task group whose work happens only if a change breaks a test. The implement step then stages the checkout and stops with implement_stop_no_change when no test breaks. The change adds a deterministic content check and a prompt rule so a test-only group must name the test function that it updates.

Acceptance criteria

Requirement: Prompt rule for one exact change

The planner prompt SHALL state that a task group gives one exact change and names the failing test that it updates in a code span.

Scenario: Prompt states the test-only rule

  • WHEN load_task_prompt reads roadmap_stage_change.md.
  • THEN The prompt text holds the rule that a group gives one exact change, names the failing test in a code span, and plans no group that fixes a test only if it breaks.

Requirement: Refuse a test-only other group with no test function

The stage plan SHALL refuse an other task group that changes only paths under tests/ when its implementation names no test function in a code span.

Scenario: Conditional test-only group

  • WHEN content_problems reads a proposal with an other group whose changes lists only tests/roadmap/test_sample.py and whose implementation holds no code span with a test_ function.
  • THEN The returned problems hold the refusal sentence for that group.

Requirement: Accept a test-only other group that names its test function

The stage plan SHALL accept an other task group that changes only paths under tests/ when its implementation names a test function in a code span.

Scenario: Named test function

  • WHEN content_problems reads a proposal with an other group whose changes lists only tests/roadmap/test_sample.py and whose implementation holds a code span with test_conditional_group.
  • THEN The returned problems hold no refusal sentence for that group.

Requirement: Keep groups with non-test paths out of the rule

The stage plan SHALL apply the conditional test rule only when every path in changes starts with tests/.

Scenario: Group with a source path

  • WHEN content_problems reads an other group whose changes lists tests/roadmap/test_sample.py and src/devops_cli/sample.py and whose implementation names no test function.
  • THEN The returned problems hold no refusal sentence for that group.

Requirement: Refusal names the group

The refusal sentence for a conditional test-only group MUST name the title of that group.

Scenario: Refusal names the group

  • WHEN content_problems refuses an other group with the title Keep the roadmap stage tests green.
  • THEN The returned sentence holds Keep the roadmap stage tests green.

Existing Tool Considered

No alternatives check has run. No open, maintained tool reads a plan task for a conditional. The change extends content_problems: about 3,000 tokens to build, about 1,000 tokens to keep and fix, and about 2 hours.

Key questions

  • Where does the conditional test rule belong?: It belongs in content_problems in src/devops_cli/roadmap/stage_change.py. check_proposal and the replay both call this function, so one rule judges the stage job and the replay. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_eval_gates.py]
    • Chosen: Add the rule to content_problems. check_proposal and the replay both call it, so the rule has one home and one test seam.
    • Rejected: Add the rule to StageGroup schema validation. The schema cannot see the plan context, and the stage already sends content faults back to the model for one correction.
    • Rejected: Add the rule to form_problems. form_problems judges the shape of task lines, not the meaning of a test-only group.
  • How does the check recognize a test function in a code span?: It reads each code span in implementation. A span counts when its text is test_, or ends with ::test_, with optional (). A span that holds only a test file path does not count. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/test_roadmap_stage_content.py]
    • Chosen: Accept test_ and path::test_ in a code span. It accepts the two exact forms a planner writes and refuses a file path alone.
    • Rejected: Accept any code span under tests/. A test file path proves no test function, so a conditional group would pass.
    • Rejected: Accept any test_ word in the implementation. A word outside a code span is not the exact reference that the prompt asks for.
  • Which groups does the new rule cover?: It covers an other group whose every path in changes starts with tests/. A group with one path under src/, docs/ or another directory keeps work outside tests and is not covered. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]
    • Chosen: Cover only an other group with all changes under tests/. The rule targets a group that can only fix a test, and one non-test path gives the group real work.
    • Rejected: Cover any group with a path under tests/. A behavior group with a test path has real source work, and the rule would refuse a valid group.
    • Rejected: Cover every other group. A document or manifest group has no test function to name, so the rule would refuse valid work.
  • What does the planner prompt state?: It states that a group gives one exact change. The planner names the failing test that the change updates in a code span, or it plans no group. It never writes a group that fixes a test only if it breaks. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: Add the rule to roadmap_stage_change.md. The stage change prompt is the planner's instruction for a new group.
    • Rejected: Add the rule to roadmap_stage_split.md too. A split divides an existing group and does not plan a new conditional group.
    • Rejected: Add no prompt rule and rely on the check. The model needs the rule before it writes the plan, so the check is not the first signal.
  • Does the refusal need a new message entry?: Yes. Add a MESSAGES.roadmap entry for the refusal sentence and format it with the group title. The other content problems already read their sentences from that table. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/lang/en/messages.py]
  • How does the test suite prove the rule offline?: Add cases to tests/roadmap/test_roadmap_stage_content.py that call content_problems with a test-only other group. One case gives no test function, and one case names the test function in a code span. (best practice) [sources: tests/roadmap/test_roadmap_stage_content.py]
    • Chosen: Test through content_problems. The stage job and the replay both call it, so one test proves the shared rule.
    • Rejected: Test only through check_proposal. The replay calls content_problems directly, so a check_proposal test alone leaves the replay path unproved.
    • Rejected: Test through a live stage run. The rule is deterministic text logic, and a live run adds cost and no new evidence.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The gap lets one class of invalid plans through but does not break a shipped feature.
    • Value: Medium. It closes a hole that lets a no-op group pass every stage gate.
    • Effort: Medium. Three files change and the rule is bounded to one function in content_problems.
    • Related: fix(roadmap): refuse a behavior group that omits a test it changes #3414, which asks for a different change. Both extend content_problems to check test naming, but #3414 targets behavior groups that omit a test while the candidate targets test-only groups that must name the exact function.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Staged: branch fix/3433-refuse-a-plan-group-that-only, draft pull request #3441. 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 test-only other group with no named test: 29276 tokens
    2. State the rule in the planner prompt: 15107 tokens

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

    • criterion_dropped at specs and group 2: The issue lists a requirement that the prompt states the rule, with a scenario read through load_task_prompt. The spec delta omits it. Group 2 has no test, and its verify command runs a prompt test that never checks the new rule. Evidence: "### Requirement: Prompt rule for one exact change"
    • other at decisions, group 1 implementation: The rule says a span counts when it ends with ::test_. A real reference such as tests/x.py::test_foo ends with the function name, so it fails the rule. The stated reason says the path form must pass. The helper would refuse a valid group. Evidence: "the span text starts with test_, or ends with ::test_, with optional parentheses"

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

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

  7. added 2 commits that reference this issue on Nov 4, 2026
  8. removed
    status/ready
    on Nov 4, 2026
  9. 3 remaining items

  10. added
    status/in-progress
    on Nov 8, 2026
  11. removed
    status/in-progress
    on Nov 8, 2026
  12. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor
  13. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-08 17:35 UTC

  14. added a commit that references this issue on Nov 11, 2026
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/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions