Skip to content

fix(roadmap): refuse a behavior group verify that runs no test #3463

Closed

Description

@dan-petty

Problem or Motivation

The stage form check accepts a behavior group whose verify command runs no test. _behavior_problems requires a test and a verify, but it does not check that the command runs the test. The rule of #3427 judges only a command that names a test module, and it accepts a command that names none, as the issue requires. A behavior group with verify of uv run devops ci docs or uv run devops ci test tests/roadmap/ therefore passes, and the step proves nothing about the behavior that the group changes.

Evidence

At main 1efa0578, a script on the sample behavior group of tests/support/builders.py:

  • form_problems([group with verify="uv run devops ci docs"]) returns [].
  • form_problems([group with verify="uv run devops ci test tests/roadmap/"]) returns [].

The staging prompt src/devops_cli/ai/tasks/roadmap_stage_change.md line 18 says a behavior group's verify runs its test, and no check enforces the sentence. PR #3440 adds the membership rule of #3427, and it leaves this gap by design.

Proposed Solution & Architectural Design

  1. In form_problems in src/devops_cli/roadmap/stage_form.py, add a rule for a behavior group: its verify command must name the test module of the group's test task, or a test module in changes, creates or reads. A command that shlex.split and str.split give no test module for gets one problem that names the group, the command and the test module that the group should run.
  2. Add the problem text to RoadmapMessages in src/devops_cli/lang/en/messages.py.
  3. Add cases to tests/roadmap/test_roadmap_stage_form.py: a behavior group with uv run devops ci docs is refused, a behavior group with its own test module is accepted, and an other group with uv run devops ci docs is accepted.
  4. The staging prompt already states the rule, so no prompt change is needed.

Target Subsystem

src/devops_cli/roadmap/stage_form.py, src/devops_cli/lang/en/messages.py, tests/roadmap/test_roadmap_stage_form.py.

Existing Tool Considered

No open, maintained tool checks that a behavior plan's verify runs its test. The rule extends form_problems, which already parses each verify command. Written cost: about 2,000 tokens to build, about 500 tokens per year to keep and fix, and about 1 hour elapsed.

Source: #3440

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

Proposed design

Problem statement

The stage form check accepts a behavior group whose verify command runs no test. A behavior group can pass with uv run devops ci docs or with a test directory, so the step proves nothing about the behavior. The change adds a rule that requires the verify command to name a test module of the group.

Acceptance criteria

Requirement: A behavior group runs a test

A behavior group SHALL give a verify command that names a test module of the group.

Scenario: A command that names no test module

  • WHEN a behavior group has the verify uv run devops ci docs and the test module tests/test_sample.py
  • THEN form_problems returns one problem that names the group, the command and tests/test_sample.py

Requirement: A test directory is no test module

The check MUST treat a directory path as no test module.

Scenario: The verify names a test directory

  • WHEN a behavior group has the verify uv run devops ci test tests/roadmap/ and the test module tests/roadmap/test_roadmap_stage_form.py
  • THEN form_problems returns one problem for that group

Requirement: The group's own test module counts

The check MUST accept a behavior group whose verify names a test module from its test text.

Scenario: The group runs the test that it writes

  • WHEN a behavior group names tests/test_sample.py in its test task and its verify runs uv run devops ci test tests/test_sample.py
  • THEN form_problems returns no problem for that group

Requirement: A created test module counts

The check MUST accept a behavior group whose verify names a test module that the group creates.

Scenario: The group runs the test that it creates

  • WHEN a behavior group creates tests/test_sample.py and its verify runs uv run devops ci test tests/test_sample.py
  • THEN form_problems returns no problem for that group

Requirement: A changed test module counts

The check MUST accept a behavior group whose verify names a test module that the group changes.

Scenario: The group runs the test module that it changes

  • WHEN a behavior group changes tests/test_sample.py and its verify runs uv run devops ci test tests/test_sample.py
  • THEN form_problems returns no problem for that group

Requirement: A read test module counts

The check MUST accept a behavior group whose verify names a test module that the group reads.

Scenario: The group runs a test module that it reads

  • WHEN a behavior group reads tests/roadmap/test_roadmap_stage_form.py and its verify runs uv run devops ci test tests/roadmap/test_roadmap_stage_form.py
  • THEN form_problems returns no problem for that group

Requirement: An other group keeps its command

The check MUST NOT apply the test module rule to a group whose kind is other.

Scenario: A documentation group

  • WHEN an other group has the verify uv run devops ci docs
  • THEN form_problems returns no problem for that group

Requirement: A negative search is refused

The check MUST refuse a behavior group whose verify is a negative search.

Scenario: The verify searches for a name

  • WHEN a behavior group has the verify ! git grep -n sample src/ and the test module tests/test_sample.py
  • THEN form_problems returns one problem for that group

Requirement: A quoted test path parses

The check SHALL split the command with shlex.split, and with str.split when that raises ValueError.

Scenario: A quoted test path

  • WHEN a behavior group has the verify uv run devops ci test 'tests/test_sample.py'
  • THEN form_problems returns no problem for that group

Requirement: The problem comes from the catalog

The check SHALL take the text of the new problem from MESSAGES.roadmap.stage_problem_verify_no_test.

Scenario: The catalog holds the text

  • WHEN a behavior group fails the rule
  • THEN the problem is the catalog text formatted with the group number, the command and the expected test module

Existing Tool Considered

The alternatives check of 2026-11-10 found no open, maintained tool that checks whether a behavior group's verify command names its own test module. CI-config linters, commit and check verifiers, and OpenSpec validation do not read a plan step's command. The change builds the rule into form_problems. Written cost: about 2,000 tokens to build, about 500 tokens per year to keep and fix, and about 1 hour elapsed.

Key questions

  • Which test modules may a behavior group's verify command name?: Only the test modules of that group: the module paths in its test text and in changes, creates and reads. A command that names no such module is refused. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: The group's own test modules. A group proves its own behavior, and the issue limits the rule to the group.
    • Rejected: Every test module of the plan. A group could run another group's test and prove nothing about its own change.
    • Rejected: No test module at all. The issue reports that such a command passes and proves nothing.
  • How does the check find a test module in the command?: Split the command into words with shlex.split, and with str.split when shlex.split raises ValueError. Keep the words that _is_test_module accepts, and compare them with the group's test module paths. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py]
    • Chosen: Compare the split words. The check reuses the parser and the test-module test that the module already holds.
    • Rejected: Search the module path as a substring. A path inside a longer word, such as a comment, would pass with no test run.
    • Rejected: Match a regular expression on the whole command. It hides the path rules in a pattern and handles no ./ prefix.
  • How does the check tell a test module from a test function name?: Only a code span of the test text that _is_test_module accepts counts. A test function name adds nothing. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py]
    • Chosen: Reuse _is_test_module. The check and the new-file rule agree on what a test module is.
    • Rejected: Accept every code span of the test text. A test function name would count as a module, and any command could pass.
  • Which function holds the new rule?: Extend _verify_test_problems, the helper that judges a verify command against the group's test modules, and call it from form_problems. When the helper finds no test module, it returns one problem. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py]
    • Chosen: Extend _verify_test_problems. The helper already reads the group and its test modules, so the new rule needs no second parser.
    • Rejected: Extend _verify_problems. Its arguments hold the command only, so each caller would change.
    • Rejected: Add a second helper. It would repeat the group paths and the parser that the existing helper uses.
  • Which groups does the rule judge?: Only a behavior group with a verify. An other group keeps its command, and a missing verify gets the existing kind problem. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: Behavior groups only. The staging prompt gives the test-run rule to a behavior group, and an other group has no test.
    • Rejected: Every group. A documentation or manifest group may run a command that names no test.
  • Does a negative search count as a test run?: No. A behavior group with a ! git grep verify gets the new problem, because a search runs no test. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: Refuse it. The staging prompt says that a behavior group's verify runs its test.
    • Rejected: Accept it. The group would pass the check and prove nothing about its behavior.
  • Where does the new problem text live?: In RoadmapMessages in src/devops_cli/lang/en/messages.py, as stage_problem_verify_no_test. The text names the group, the command and the expected test module. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage/stage_form.py]
    • Chosen: The message catalog. The other stage problems live there, and the check reads them through MESSAGES.roadmap.
    • Rejected: A literal in stage_form.py. It splits the texts of the stage problems across two files.
  • What does the problem name when the group names no test module at all?: The expected part of the message reads a test module of the group. One template serves both cases. (best practice) [sources: src/devops_cli/lang/en/messages.py]
    • Chosen: One template. The case is rare, and a second template adds a text to keep.
    • Rejected: A second message. It doubles the texts for one rare fault.
  • Does the sample behavior group of make_stage_proposal pass the new rule?: Yes. Its verify runs tests/test_sample.py, which the group creates and changes. [sources: tests/support/builders.py]
  • What does the staging prompt say about a behavior group's verify?: It says that a behavior group's verify runs its test. No check enforces that sentence today. [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md]
  • Does a behavior group with no verify get the new problem?: No. The kind rule reports the missing verify, and the new rule judges only a command that exists. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage/stage_form.py]
    • Chosen: Judge only a given command. The plan gets one problem for one fault.
    • Rejected: Report both problems. The model gets two texts for one fault and one retry.

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/low
    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.
    • Value: Medium.
    • Effort: Low.
  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 7cf8335 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 4, 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:

    placeholder

  7. added
    status/new
    and removed
    status/ready
    on Nov 4, 2026
  8. 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.

    • What evidence shows that the premise of the issue does not hold at the staging commit? (a person decides)
  9. 2 remaining items

  10. added
    status/ready
    on Nov 13, 2026
  11. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 4ef7c6f (see proposed design in issue body).

  12. added
    owner/service
    on Nov 14, 2026
  13. added
    status/in-progress
    and removed
    status/ready
    on Nov 14, 2026
  14. added
    status/in-review
    and removed
    status/in-progress
    on Nov 14, 2026
  15. removed
    status/in-review
    owner/service
    on Nov 14, 2026
  16. 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/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions