Skip to content

fix(roadmap): refuse a group verify that runs an unrelated test #3427

Not planned

Description

@dan-petty

Problem or Motivation

The stage check accepts a group whose verify command runs a test module that does not read the file the group changes. The command passes on the base, so it proves nothing about the change.

The plan of PR #3408 (for #3405) is an example. Group 2 changes src/devops_cli/ai/tasks/roadmap_stage_verify.md and gives the command uv run devops ci test tests/roadmap/test_roadmap_stage_task_verification.py. That test module parses tasks.md and never reads the verification prompt. form_problems checks only the form of the command and the path of a new test. It does not check that the command names a test the group changes or reads.

The issue is broader than the planner prompts in #3347: a plan can point any changed file at a test module that does not exercise it.

Proposed Solution & Architectural Design

  1. In form_problems in src/devops_cli/roadmap/stage_form.py, read each verify command that runs a test module, such as uv run devops ci test <path>. When the path is not in the group's changes, creates or reads, return a problem that names the group, the command and the test module.
  2. Accept a command that runs no test module, such as uv run devops ci docs or ! git grep -n <name> src/ tests/. The rule judges only a command that names a test.
  3. Add a case to tests/roadmap/test_roadmap_stage_form.py for a group that runs a test it does not name, and one for a group that names the test in reads.

Evidence

The plan of PR #3408 group 2:

  • Changes: src/devops_cli/ai/tasks/roadmap_stage_verify.md, tests/roadmap/test_roadmap_stage_verify.py.
  • Verify: uv run devops ci test tests/roadmap/test_roadmap_stage_task_verification.py.

tests/roadmap/test_roadmap_stage_task_verification.py builds a StageGroup, renders tasks.md, and parses it. It loads no prompt. The check uv run devops ci test tests/roadmap/test_roadmap_stage_task_verification.py passes with no edit to the prompt.

Target Subsystem

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

Existing Tool Considered

No open, maintained tool checks that a test command exercises the file a plan changes. The check extends the existing form_problems rule set, which already parses each verify command.

Estimated cost: about 3,000 tokens to build, about 1,000 tokens per year to keep and fix, and about 2 hours elapsed.

Source: PR #3408

Dependencies

Proposed design

Problem statement

The stage form check accepts a group whose verify command runs a test module that the group does not change, create or read. The command can pass on the base and prove nothing about the change. The check must refuse such a command and accept commands that run no test module.

Acceptance criteria

Requirement: Unnamed test module is refused

form_problems SHALL return a problem when a group's verify command runs a test module that the group does not name in changes, creates or reads.

Scenario: Unnamed test module

  • WHEN Group 1 changes src/devops_cli/ai/tasks/roadmap_stage_verify.md and tests/roadmap/test_roadmap_stage_verify.py, and its verify command runs tests/roadmap/test_roadmap_stage_task_verification.py.
  • THEN form_problems returns one problem that names group 1, the command and tests/roadmap/test_roadmap_stage_task_verification.py.

Requirement: Test module in reads is accepted

form_problems SHALL accept a verify command whose test module is in the group's reads.

Scenario: Read test module

  • WHEN Group 1 reads tests/roadmap/test_roadmap_stage_form.py and its verify command runs that module.
  • THEN form_problems returns no problem.

Requirement: Test module in changes is accepted

form_problems SHALL accept a verify command whose test module is in the group's changes.

Scenario: Changed test module

  • WHEN Group 1 changes tests/roadmap/test_roadmap_stage_form.py and its verify command runs that module.
  • THEN form_problems returns no problem.

Requirement: Test module in creates is accepted

form_problems SHALL accept a verify command whose test module is in the group's creates.

Scenario: Created test module

  • WHEN Group 1 creates tests/roadmap/test_roadmap_stage_form.py and its verify command runs that module.
  • THEN form_problems returns no problem.

Requirement: Command with no test module is accepted

form_problems SHALL not judge a verify command that runs no test module.

Scenario: Documentation and search commands

  • WHEN Group 1 gives uv run devops ci docs or ! git grep -n -w unused_probe src/ tests/ as its verify command.
  • THEN form_problems returns no problem.

Requirement: Each unnamed test module is refused

form_problems SHALL return one problem for each test module in a verify command that the group does not name.

Scenario: Two unnamed test modules

  • WHEN Group 1's verify command runs two test modules that the group does not name.
  • THEN form_problems returns two problems, one for each module.

Requirement: Tests cover the new rule

tests/roadmap/test_roadmap_stage_form.py SHALL cover an unnamed test module and a test module named in reads.

Scenario: Stage form tests

  • WHEN The roadmap stage form tests run.
  • THEN Both cases pass and assert the problem and the no-problem result.

Existing Tool Considered

No alternatives check has run. The body reports that no open, maintained tool checks whether a test command exercises the file a plan changes. The change extends the existing form_problems rule. Written cost: about 3,000 tokens to build, about 1,000 tokens per year to keep and fix, and about 2 hours elapsed.

Key questions

  • Which existing helper should identify a test module in a verify command?: Use _is_test_module on each path argument of the command. It requires a path under tests/ with suffix .py and a name that starts test_. (best practice) [sources: src/devops_cli/roadmap/stage_form.py, tests/roadmap/test_roadmap_stage_form.py]
    • Chosen: Reuse _is_test_module. It is the existing rule for a test module and keeps one definition.
    • Rejected: Match tests/**/test_*.py with a new regular expression. It duplicates the helper and can drift from it.
    • Rejected: Judge every path under tests/. A fixture or helper under tests/ is not a test module.
  • Which fields of the group allow a verify command to run a test module?: The group's own changes, creates and reads. A path in another group does not count. [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_form.py]
  • Where should the new problem text live?: Add a RoadmapMessages entry in src/devops_cli/lang/en/messages.py. Format it in form_problems with the group number, the command and the test module. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage_form.py]
    • Chosen: New RoadmapMessages entry. The stage form problems already use the message catalog.
    • Rejected: Inline text in stage_form.py. It breaks the catalog pattern and makes the text hard to test.
  • Should the check judge a command that runs no test module?: No. Judge only a command that runs uv run devops ci test with at least one test module. A documentation command and a negative search pass. (best practice) [sources: src/devops_cli/roadmap/stage_form.py, tests/roadmap/test_roadmap_stage_form.py]
    • Chosen: Judge only test commands. The issue limits the rule to a command that names a test.
    • Rejected: Judge every verify command. It would refuse valid documentation and search checks.
  • Should the check judge every test-module path in a command?: Yes. Judge each path argument that _is_test_module accepts. Return one problem for each unnamed module. (best practice) [sources: src/devops_cli/roadmap/stage_form.py, tests/roadmap/test_roadmap_stage_form.py]
    • Chosen: Judge each path. A command can run more than one test module, and each must be named.
    • Rejected: Judge only the first path. It misses unnamed modules after the first.
    • Rejected: Judge the whole command as one path. It cannot name the module that is missing.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    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. A validation gap that lets weak plans pass, but manual review can still catch them.
    • Value: Medium. Catches a class of incorrect test references in stage plans.
    • Effort: Low. A path comparison in form_problems plus one test case, estimated at about 2 hours.
    • Related: feat(roadmap): the stage probe routes prompt changes to prompt rule tests #3347, which asks for a different change. Both require a verify command to name a test relevant to the changed file; #3347 limits the rule to prompt files, the candidate generalizes it to any changed file.
  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/3427-refuse-a-group-verify-that-runs, draft pull request #3440. 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 verify command that runs a test the group does not name: 27271 tokens
    2. Keep the staged plans of the samples inside the new rule: 16396 tokens

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

    • other at group 2: The plan says the golden set staged plans keep a verify command that names a module of their own group. Group 2 changes no fixture file, and the task_verification test reads the golden set fixtures through form_problems. A fixture plan that runs an unnamed module would fail under the new rule, and no task fixes it. Evidence: "The staged plans that the golden set and the sample builder give keep a verify command that names a module of their own group."

    The plan run made 2 model request(s), and used 153955 input tokens and 9586 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. 10 remaining items

  10. added
    status/planned
    and removed
    status/blocked
    on Nov 5, 2026
  11. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at group 1 by the rule digest: the runner image changed since the stop, from sha256:66a9160699d0c0b2f00a5118abea1fd606ce11d1ffb6f624ac412f0354abe10e to sha256:3e20abf5974c5e90a219f2770e6d312b0b2c1fa67d920df7822d8be80b86c1d7, and the class provider of the stop is one that a new attempt can fix. The item is Planned again, and the Service takes it in the next round. The Service clears at most 1 for each class and 3 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a comment implement: retry.

  12. added
    owner/service
    status/in-progress
    and removed
    status/planned
    on Nov 5, 2026
  13. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: limit_reached.
    Action taken: none.
    Action left: raise_limit: raise the limit that the run went over.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 8012397/35955 -

    Reason:

    LimitReached: The step spent its budget `roadmap.implement.step_token_budget=8000000`.
    Refused commands: git 2, other 1. Other retries: 1.
    

    Last message of the agent (a claim that no check verified): Now I'll write the failing test first(task 1.1), plus the helper changes the new rule needs.

    The job discarded this work. Read it before you retry:

    diff --git a/src/devops_cli/ai/tasks/roadmap_stage_change.md b/src/devops_cli/ai/tasks/roadmap_stage_change.md
    index 2fc29d0f..d2b8d5d7 100644
    --- a/src/devops_cli/ai/tasks/roadmap_stage_change.md
    +++ b/src/devops_cli/ai/tasks/roadmap_stage_change.md
    @@ -15,7 +15,7 @@ The rules of the project:
     - In `decisions`, record each design decision with its reason. In `rejected`, record each alternative that you rejected with the evidence that rejected it.
     - Write `groups` in the order of the work. Each group holds the work of one step of an implementation, and fits in the `budget` with its files: a step reads the instructions of the group, the `AGENTS.md` of the repository and the sections of the documents that it routes the group to, the issue, the change and the files of the group. Keep each group small. A group has these keys: `title`; `kind`, `behavior` or `other`; `reads`, the repository paths that the step reads, an empty list when it reads none; `changes`, the repository paths that the step changes or creates, with at least one path, because every group changes a file; `creates`, the paths of `changes` that do not exist yet, an empty list when it creates none; `creates_lines`, an object that gives the estimated number of lines of each path in `creates`, such as `{"tests/roadmap/test_sample.py": 40}`; `test`, the failing test to write first, and `null` for an `other` group; `implementation`, the work of the step; `documentation`, the documents that the step changes, or `null` when it changes none; `verify`, one command that checks the group and gives the same answer on each run, such as `uv run devops ci test tests/roadmap/test_feature.py`, or `null`; and `process`, the steps of a manual check, or `null`. Every task has a text: `title` and `implementation` are never blank, and no other key that you give is blank.
     - The stage counts 32 tokens for each estimated line of a path in `creates_lines`, so the estimate of a new file counts toward the `budget` of the step. Give a whole number of lines of at least 1 for each path in `creates`. A path in `creates` with no estimate is refused.
    -- Choose the `kind` of each group by what the group does. A `behavior` group adds or changes what the code does. It changes a path under `src/`, it has a `test`, its `verify` runs that test, and it has no `process`. It is written test first. Write tests only for new behavior. Every other group is `other`: a document, a manifest, a workflow, a deletion or a refactor that keeps behavior, an edit of tests only, or data. An `other` group has no `test`, so set `test` to `null`. It has exactly one of `verify` and `process`. `verify` is one command that can run again, such as `uv run devops ci docs`, `uv run devops openspec check`, `! git grep -n <name> src/ tests/` (a command that exits 0 when it finds nothing), or `uv run devops k8s image-pins`. A `verify` command starts with `uv run devops`, and the `! git grep` form is the one other form. The `! git grep` form is not a shell command: it takes the options `-n -I -F -i -w -l -c -q`, then one literal of letters, digits, spaces and the signs `_ . : / = @ + , # % ~ -`, then relative paths, and a pipe, `;`, `&&`, a redirect or any other option is refused. `uv run pytest` is refused. `process` is the steps of a repeatable manual check, and you write it only when no command exists. A reply that breaks these rules comes back to you with the problem.
    +- Choose the `kind` of each group by what the group does. A `behavior` group adds or changes what the code does. It changes a path under `src/`, it has a `test`, its `verify` runs that test, and it has no `process`. It is written test first. Write tests only for new behavior. Every other group is `other`: a document, a manifest, a workflow, a deletion or a refactor that keeps behavior, an edit of tests only, or data. An `other` group has no `test`, so set `test` to `null`. It has exactly one of `verify` and `process`. `verify` is one command that can run again, such as `uv run devops ci docs`, `uv run devops openspec check`, `! git grep -n <name> src/ tests/` (a command that exits 0 when it finds nothing), or `uv run devops k8s image-pins`. A `verify` command starts with `uv run devops`, and the `! git grep` form is the one other form. The `! git grep` form is not a shell command: it takes the options `-n -I -F -i -w -l -c -q`, then one literal of letters, digits, spaces and the signs `_ . : / = @ + , # % ~ -`, then relative paths, and a pipe, `;`, `&&`, a redirect or any other option is refused. A test module that a `verify` command runs is one of the group's own `reads`, `changes` or `creates`. `uv run pytest` is refused. `process` is the steps of a repeatable manual check, and you write it only when no command exists. A reply that breaks these rules comes back to you with the problem.
     - A group that moves a set of modules by name prefix lists every module of that prefix in `changes`, and not the entry module only. Its `verify` command covers the whole prefix: run the layout test of the plan, or search the dotted prefix with the separator (`devops_cli.roadmap.stage_`), and never one sampled module. Before you give a `! git grep` command, call `search_code` with its literal on the staged commit and quote the hit count in `feasibility`. A literal that the plan creates a module for, such as a bare package prefix or a name that no file holds, is no check: the search then proves nothing before the change or can never pass after it.
     - A new test module in `creates` goes in the folder under `tests/` that mirrors the package of the code it tests, such as `tests/roadmap/test_feature.py` for code in `src/devops_cli/roadmap/`, or in `tests/invariants/`. The check refuses a new test module that sits flat under `tests/` when it tests code of a package.
     - A path is relative to the repository root. It has no `..` and does not start with `/`. A sample file that a test writes at run time, and that no group creates, gets a bare name with no folder, such as `test_sample.py`. Put no folder before such a name: the check reads a name with a folder as a path of the repository.
    diff --git a/src/devops_cli/lang/en/messages.py b/src/devops_cli/lang/en/messages.py
    index 698fcde7..c154a9a7 100644
    --- a/src/devops_cli/lang/en/messages.py
    +++ b/src/devops_cli/lang/en/messages.py
    @@ -3317,6 +3317,12 @@ class RoadmapMessages:
             "Group {group} gives the `verify` command `{command}`, and the step cannot run it: "
             "{reason}. Give `uv run devops <command>` or `! git grep -n <name> src/ tests/`."
         )
    +    stage_problem_verify_test: str = (
    +        "Group {group} gives the `verify` command `{command}`, and it runs `{path}`, which is in "
    +        "none of the group's `changes`, `creates` and `reads`. A `verify` command runs a test that "
    +        "the group changes, creates or reads. List the module in `reads`, or give the command of "
    +        "the group's own test."
    +    )
         stage_problem_task: str = (
             "Group {group} ({title}) has the {part} task `{text}`, and it holds one word. A task "
             "holds a verb and an object, such as `Add a test in tests/roadmap/test_feature.py for "
    diff --git a/src/devops_cli/roadmap/stage_form.py b/src/devops_cli/roadmap/stage_form.py
    index 88008fbf..85bcdd3a 100644
    --- a/src/devops_cli/roadmap/stage_form.py
    +++ b/src/devops_cli/roadmap/stage_form.py
    @@ -18,6 +18,11 @@ A task text holds more than one word, with a code span as one word. A path or a
     nothing to the step: `tests/roadmap/test_stage.py` is no task, and `Add a test in
     tests/roadmap/test_stage.py for a bare task` is one (#3255). The gate counts words and parses no
     grammar, so a sentence with a verb and an object always passes.
    +
    +A test module that a `verify` command runs is one of the group's own `reads`, `changes` and
    +`creates` (#3427). A command that runs a test module of another step passes before the change and
    +proves nothing about this one, so the check refuses it. A command that runs no test module proves
    +its group by another means, and a negative search runs no test at all, so neither is judged.
     """
     
     from __future__ import annotations
    @@ -77,6 +82,37 @@ def _verify_problems(number: int, command: str) -> list[str]:
         return problems
     
     
    +def _verify_words(command: str) -> list[str]:
    +    """The words of `command`: read by `shlex`, or split on white space when `shlex` cannot read
    +    the text, which the form check refuses in its own problem."""
    +    try:
    +        return shlex.split(command)
    +    except ValueError:
    +        return command.split()
    +
    +
    +def _verify_test_problems(number: int, group: StageGroup) -> list[str]:
    +    """One problem for each test module that the `verify` command of group `number` runs and that
    +    the group does not name in `changes`, `creates` or `reads` (#3427). The command then runs a
    +    test of another step, which passes before the change and proves nothing about this one. A
    +    command that runs no test module proves its group by another means, and a negative search
    +    searches a name and runs no test, so neither is judged."""
    +    command = group.verify
    +    if command is None or command.split(maxsplit=1)[:1] == [NEGATIVE_SEARCH_WORD]:
    +        return []
    +    named = {*group.changes, *group.creates, *group.reads}
    +    texts = MESSAGES.roadmap
    +    return [
    +        texts.stage_problem_verify_test.format(
    +            group=number,
    +            command=shown(command, CONST_ROADMAP_IMPLEMENT_VERIFY_CHARS),
    +            path=path,
    +        )
    +        for word in _verify_words(command)
    +        if _is_test_module(path := PurePosixPath(word)) and str(path) not in named
    +    ]
    +
    +
     def _task_problems(number: int, group: StageGroup) -> list[str]:
         """One problem for each task text of group `number` that holds one word or less: the failing
         test, the work and the document task. A code span counts as one word."""
    @@ -216,6 +252,7 @@ def form_problems(groups: Sequence[StageGroup]) -> list[str]:
             problems.extend(_task_problems(number, group))
             if group.verify is not None:
                 problems.extend(_verify_problems(number, group.verify))
    +            problems.extend(_verify_test_problems(number, group))
             for created in group.creates:
                 path = PurePosixPath(created)
                 folder = path.parent
    diff --git a/tests/roadmap/test_roadmap_stage_form.py b/tests/roadmap/test_roadmap_stage_form.py
    index 83a16d73..c1f5a34f 100644
    --- a/tests/roadmap/test_roadmap_stage_form.py
    +++ b/tests/roadmap/test_roadmap_stage_form.py
    @@ -32,11 +32,24 @@ VERIFY_PROBLEM = (
     )
     
     
    -def _plan(*changes: str, creates: tuple[str, ...] = (), verify: str | None = None) -> StageProposal:
    -    """The sample proposal, with one group that changes `changes` and creates `creates`."""
    +def _own_verify(changes: tuple[str, ...]) -> str:
    +    """The command of the case's own test module: the first test module of `changes`, or a
    +    command that runs no test module when the case changes none."""
    +    found = next((path for path in changes if _TEST_PATH.fullmatch(path)), "")
    +    return f"uv run devops ci test {found}" if found else "uv run devops ci"
    +
    +
    +def _plan(
    +    *changes: str,
    +    creates: tuple[str, ...] = (),
    +    verify: str | None = None,
    +    reads: tuple[str, ...] = (),
    +) -> StageProposal:
    +    """The sample proposal, with one group that changes `changes`, creates `creates` and reads
    +    `reads`. The `verify` command defaults to the case's own test module."""
         base = make_stage_proposal().groups[0].model_dump()
         update: dict[str, Any] = {
    -        "reads": [],
    +        "reads": list(reads),
             "changes": list(changes),
             "creates": list(creates),
             "creates_lines": {path: 10 for path in creates},
    @@ -44,8 +57,7 @@ def _plan(*changes: str, creates: tuple[str, ...] = (), verify: str | None = Non
         sourced = any(path.startswith("src/") for path in changes)
         if not sourced:
             update |= {"kind": "other", "test": None}
    -    if verify is not None:
    -        update["verify"] = verify
    +    update["verify"] = _own_verify(changes) if verify is None else verify
         group = StageGroup.model_validate({**base, **update})
         return make_stage_proposal(
             groups=[group],
    @@ -54,10 +66,13 @@ def _plan(*changes: str, creates: tuple[str, ...] = (), verify: str | None = Non
         )
     
     
    -def _problems(proposal: StageProposal) -> list[str]:
    -    """What `check_proposal` finds in a plan whose files all exist or are created by it."""
    +def _problems(proposal: StageProposal, *extra: str) -> list[str]:
    +    """What `check_proposal` finds in a plan whose files all exist or are created by it. `extra`
    +    adds the paths that the tree holds without a group changing them."""
         group = proposal.groups[0]
    -    tree = StagedTree([*group.changes, "src/devops_cli/sample.py", "tests/test_sample.py"])
    +    tree = StagedTree(
    +        [*group.changes, *extra, "src/devops_cli/sample.py", "tests/test_sample.py"]
    +    )
         return check_proposal(proposal, ["comment-thread"], tree)
     
     
    @@ -183,6 +198,71 @@ def test_a_test_that_already_exists_is_not_judged() -> None:
         assert _problems(plan) == []
     
     
    +# ── The test module that a verify command runs (#3427) ───────────────────────
    +
    +VERIFY_PROMPT = "src/devops_cli/ai/tasks/roadmap_stage_verify.md"
    +VERIFY_TEST = "tests/roadmap/test_roadmap_stage_verify.py"
    +UNNAMED_TEST = "tests/roadmap/test_roadmap_stage_task_verification.py"
    +
    +
    +def test_a_verify_command_that_runs_an_unnamed_test_module_is_refused() -> None:
    +    plan = _plan(VERIFY_PROMPT, VERIFY_TEST, verify=f"uv run devops ci test {UNNAMED_TEST}")
    +
    +    (problem,) = _problems(plan, UNNAMED_TEST)
    +    assert problem.startswith(
    +        f"Group 1 gives the `verify` command `uv run devops ci test {UNNAMED_TEST}`"
    +    )
    +    assert f"`{UNNAMED_TEST}`" in problem
    +    assert "List the module in `reads`, or give the command of the group's own test." in problem
    +
    +
    +def test_a_verify_command_that_runs_a_test_module_the_group_reads_is_accepted() -> None:
    +    plan = _plan(VERIFY_PROMPT, verify=f"uv run devops ci test {VERIFY_TEST}", reads=(VERIFY_TEST,))
    +
    +    assert _problems(plan, VERIFY_TEST) == []
    +
    +
    +def test_a_verify_command_that_runs_a_test_module_the_group_changes_is_accepted() -> None:
    +    plan = _plan(VERIFY_PROMPT, VERIFY_TEST, verify=f"uv run devops ci test {VERIFY_TEST}")
    +
    +    assert _problems(plan) == []
    +
    +
    +def test_a_verify_command_that_runs_a_test_module_the_group_creates_is_accepted() -> None:
    +    plan = _plan(
    +        VERIFY_PROMPT,
    +        VERIFY_TEST,
    +        creates=(VERIFY_TEST,),
    +        verify=f"uv run devops ci test {VERIFY_TEST}",
    +    )
    +
    +    assert _problems(plan) == []
    +
    +
    +def test_each_unnamed_test_module_of_a_verify_command_gets_its_own_problem() -> None:
    +    other = "tests/roadmap/test_roadmap_stage_move.py"
    +    plan = _plan(VERIFY_PROMPT, verify=f"uv run devops ci test {UNNAMED_TEST} {other}")
    +
    +    problems = _problems(plan, UNNAMED_TEST, other)
    +    assert len(problems) == 2
    +    assert [f"`{path}`" in problem for problem, path in zip(problems, (UNNAMED_TEST, other), strict=True)] == [
    +        True,
    +        True,
    +    ]
    +
    +
    +def test_a_verify_command_that_runs_no_test_module_is_accepted() -> None:
    +    plan = _plan(VERIFY_PROMPT, verify="uv run devops ci docs")
    +
    +    assert _problems(plan) == []
    +
    +
    +def test_a_negative_search_that_names_a_test_module_is_accepted() -> None:
    +    plan = _plan(VERIFY_PROMPT, verify=f"! git grep -n old_name {UNNAMED_TEST}")
    +
    +    assert _problems(plan, UNNAMED_TEST) == []
    +
    +
     # ── A task holds more than one word (#3255) ───────────────────────────────────
     
     SENTENCE = "Add a test in tests/roadmap/test_roadmap_stage_form.py for a bare filename task"
    diff --git a/tests/roadmap/test_roadmap_stage_prompt_rules.py b/tests/roadmap/test_roadmap_stage_prompt_rules.py
    index 138316c4..f55084fc 100644
    --- a/tests/roadmap/test_roadmap_stage_prompt_rules.py
    +++ b/tests/roadmap/test_roadmap_stage_prompt_rules.py
    @@ -317,11 +317,22 @@ def _command(span: str) -> str:
         return " ".join(word for word in words if not word.startswith("tests/"))
     
     
    -def _group(verify: str) -> StageGroup:
    +# A test module of a `verify` form: the command runs it, so the group reads it (the prompt asks
    +# that a verify command runs a test that the group names).
    +_TEST_MODULE = re.compile(r"tests/[\w/<>-]*test_[\w<>-]*\.py")
    +
    +
    +def _test_modules(command: str) -> tuple[str, ...]:
    +    """The test modules that `command` runs."""
    +    return tuple(word for word in command.split() if _TEST_MODULE.fullmatch(word))
    +
    +
    +def _group(verify: str, *, reads: tuple[str, ...] = ()) -> StageGroup:
         return StageGroup.model_validate(
             {
                 "title": "Check the documents",
                 "kind": "other",
    +            "reads": list(reads),
                 "changes": ["docs/sample.md"],
                 "implementation": "Edit the document",
                 "verify": verify,
    @@ -337,7 +348,9 @@ def test_the_prompt_gives_verify_forms() -> None:
     def test_each_verify_form_of_the_prompt_passes_the_form_check(form: str) -> None:
         """The prompt writes the name of a search as the placeholder `<name>`. The gate refuses the
         placeholder as a literal (#3263), so the check gives it a name."""
    -    assert form_problems([_group(form.replace("<name>", "old_name"))]) == []
    +    command = form.replace("<name>", "old_name")
    +
    +    assert form_problems([_group(command, reads=_test_modules(command))]) == []
     
     
     @pytest.mark.parametrize(
    @@ -354,6 +367,16 @@ def test_the_prompt_says_that_a_pytest_command_is_refused_and_the_check_refuses_
         assert form_problems([_group("uv run pytest tests/roadmap/test_stage.py")])
     
     
    +def test_the_prompt_says_a_verify_command_runs_a_test_the_group_names() -> None:
    +    """A verify command that runs a test of another step passes before the change and proves
    +    nothing about it (#3427), so the prompt states the rule that the check enforces."""
    +    assert (
    +        "A test module that a `verify` command runs is one of the group's own `reads`, `changes` "
    +        "or `creates`."
    +    ) in _PROMPT
    +    assert form_problems([_group("uv run devops ci test tests/roadmap/test_stage.py")])
    +
    +
     @pytest.mark.parametrize("form", sorted(set(_verify_forms())))
     def test_the_testing_guide_holds_each_verify_form_of_the_prompt(form: str) -> None:
         assert _command(form) in _TESTING

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  14. added
    status/blocked
    and removed
    status/in-progress
    on Nov 5, 2026
  15. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261105-045827-d563 ended: succeeded.
    Image digest: sha256:3e20abf5974c5e90a219f2770e6d312b0b2c1fa67d920df7822d8be80b86c1d7

    The last lines of its log:

    Tool call: shell, program other, refused.
    Tool call: shell, started: cat /home/devops/.data/agent/worktrees/w-3427/.pydantic-ai-harness/shell/076112e2fa934cd0a4f975c6ac7e5657/status.json
    Tool call: shell, program cat, ok.
    Tool call: shell, started: cat /home/devops/.data/agent/worktrees/w-3427/.pydantic-ai-harness/shell/076112e2fa934cd0a4f975c6ac7e5657/output.log
    Tool call: shell, program cat, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run mypy --strict src/devops_cli/roadmap/stage_form.py
    Tool call: shell, program uv, ok.
    Tool call: shell, started: cat /home/devops/.data/agent/worktrees/w-3427/.pydantic-ai-harness/shell/3d56163b26df41168eae660fb7eda84a/status.json
    Tool call: shell, program cat, ok.
    Tool call: shell, started: grep -n -A2 <masked> /home/devops/.data/agent/worktrees/w-3427/.pydantic-ai-harness/shell/3d56163b26df41168eae660fb7eda84a/output.log
    Tool call: shell, program grep, ok.
    Tool call: shell, started: tail -30 /home/devops/.data/agent/worktrees/w-3427/.pydantic-ai-harness/shell/3d56163b26df41168eae660fb7eda84a/output.log
    Tool call: shell, program tail, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: git grep -n form_problems -- src
    Tool call: shell, program git, ok.
    Tool call: shell, started: git grep -n -e own_paths -e ...
    Tool call: shell, program git, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: git grep -l test_roadmap_implement_negative_search -- openspec/changes
    Tool call: shell, program git, ok.
    Tool call: shell, started: cat openspec/changes/archive/2026-11-02-3263-negative-search-round3/tasks.md
    Tool call: shell, program cat, ok.
    Tool call: shell, started: git grep -l stage_form.py -- openspec/changes/archive
    Tool call: shell, program git, ok.
    Tool call: shell, started: cat openspec/changes/archive/2026-11-03-3255-the-plan-form-gates-miss-a-bare/tasks.md
    Tool call: shell, program cat, ok.
    Tool call: shell, started: cat openspec/changes/archive/2026-11-04-3410-the-stage-gate-proves-a-negative/tasks.md
    Tool call: shell, program cat, ok.
    Tool call: shell, started: git grep -n -e eval_implement_outside -e ...
    Tool call: shell, program git, ok.
    Tool call: shell, started: git grep -n check_proposal -- tests
    Tool call: shell, program git, ok.
    Tool call: read_file, ok.
    Failure class limit_reached. Action left: raise_limit.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 27m 22s
    
  16. removed
    owner/service
    on Nov 5, 2026
  17. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

  18. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Triage under #6519 (owner instruction of 2026-11-30). This item adds or extends a hand-written gate, refusal, context block or plan-shape rule of the stage or implement job. #6519 found that 263 of about 900 issues in four weeks added gates and none replaced the engine; stage now runs on stock Coder, where the agent reads the repository itself and runs the OpenSpec checks in its loop. The code paths that this item names have also moved (for example src/devops_cli/roadmap/stage/stage_change.py). If the failure class still shows in graded attempts (plan_defect), file a new item from that evidence. Closed as not planned.

  19. removed
    status/blocked
    on Nov 30, 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/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