Repository navigation
Description
Problem
A stage plan can name the test module that a change updates and still omit the existing test case whose assertion the change breaks. The stage path check only confirms that a named path exists, and #3414 requires a named test file, so the plan passes both while its task list leaves out the failing case. The implementer finds the case only when the group's verification command runs the module.
Evidence
The plan of #3415 (PR #3437) names tests/roadmap/test_roadmap_stage_probe.py. It adds git ls-tree to the probe, and test_every_command_reads_and_the_checkout_does_not_change asserts the exact set of command names {"cat-file", "grep", "log"}, so the change fails that case. The plan as staged did not name the case. A reviewer had to prototype the change and run the module to find it. The plan names the case only after review.
The same plan first read the staged tree at the start of every run. That choice also changes two tests that pin the probe command count. The plan avoided the change only when the review chose a lazy tree read, and it did not state that constraint.
Suggestion
A behavior group that changes a source file and names an existing test module SHALL name each test case in that module whose assertion the change invalidates, or state that it updates no existing case. The stage context SHALL list the test cases of a named test module that reference a symbol, message or constant of the changed source file, so the planner reads them before it writes the group.
Related: #3414 requires the existing test file; this item requires the existing test case inside that file. #3389 names the test module for a changed function.
Source: #3437
Source: #3437
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Proposed design
Problem statement
A stage plan names the test module that a change updates. It can still omit the test case whose assertion the change breaks. The path check passes because the path exists. The implementer finds the failing case only when the module runs. The stage context must list the test cases that reference the changed source. The plan must name each invalidated case.
Acceptance criteria
Requirement: Group names the invalidated test case
A behavior group that changes a source file and names an existing test module SHALL name each test case whose assertion the change invalidates.
Scenario: The probe change breaks a pinned command set
- WHEN A group adds
git ls-treeto the stage probe and namestests/roadmap/test_roadmap_stage_probe.py. - THEN The task list of the group names
test_every_command_reads_and_the_checkout_does_not_changeand the command-name set that this case asserts.
Requirement: Group states that it invalidates no case
A group that names an existing test module and invalidates no assertion in it SHALL state that it updates no existing test case.
Scenario: A group only adds a test case
- WHEN A group adds a case to
tests/roadmap/test_roadmap_stage_probe.pyand changes no existing assertion. - THEN The task list of the group states that it updates no existing test case.
Requirement: Context lists the referencing test cases
The stage context SHALL list each test case of a named test module that references a symbol, message or constant of the changed source file.
Scenario: A constant of the changed source file
- WHEN The plan cites
tests/roadmap/test_roadmap_stage_probe.pyand the changed file definesCONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS. - THEN The context lists
test_the_probe_stops_at_the_bound_and_lists_the_items_it_skippedas a case that references the constant.
Requirement: Context reports the cases that the bound cuts off
The stage context SHALL name each referencing test case that the probe command bound leaves unlisted.
Scenario: The command bound is reached
- WHEN The listing of referencing test cases reaches the bound of
CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS. - THEN The context names the unlisted cases in the line that reports the reached bound.
Requirement: The plan snapshot holds the rule
The rendered stage plan instructions SHALL contain the rule that a group names the invalidated test case.
Scenario: The rendered instructions of a group
- WHEN The stage plan renders the instructions for a behavior group.
- THEN The rendered text contains the rule, and
tests/roadmap/__snapshots__/test_roadmap_stage_plan.ambrrecords it.
Existing Tool Considered
No check has run. git grep, which the stage probe already runs, finds a symbol in a test module. The dynamic contexts of coverage.py (--context) map each test case to the lines that it runs. Neither states which assertion a change invalidates, so the plan instructions must require that statement. A custom detector would cost about 80k tokens to build, 20k tokens each month to keep and fix, and 5 days of elapsed time.
Key questions
- Which existing test case does a change to the stage probe invalidate?:
test_every_command_reads_and_the_checkout_does_not_changeintests/roadmap/test_roadmap_stage_probe.pyasserts the exact command-name set{"cat-file", "grep", "log"}, so a new command breaks it. The plan of fix(roadmap): the stage probe names the files of a cited bare name #3415 named this case only after review. [sources: tests/roadmap/test_roadmap_stage_probe.py:117, openspec/changes/3415-the-stage-probe-names-the-files/tasks.md] - What does the stage context pack for a step?: The instructions of the group, the
AGENTS.mdof the repository, the routed sections of its documents, the item, the change folder and the packed files of the group. The context has no test-case listing now. [sources: CONTEXT.md] - How does the stage context find the test cases that reference a symbol, message or constant of the changed source file?: Reuse the
git grepof the stage probe on the named test module, and list the matching cases in the context. (best practice) [sources: CONTEXT.md, tests/roadmap/test_roadmap_stage_probe.py]- Chosen: Reuse the probe's
git grepon the named test module. The probe already runs bounded read-onlygrep, so the listing adds no tool and stays inside the bound. - Rejected: Add a planner tool that lists test cases. CONTEXT.md fixes the planner toolset, and a new tool spends the token budget of the step.
- Rejected: Ask the model to recall the test module. The plan of fix(roadmap): the stage probe names the files of a cited bare name #3415 missed the case until review, so recall is no evidence.
- Chosen: Reuse the probe's
- Where does the rule that a group names the invalidated test case live?: In the stage plan instructions, checked by the stage plan snapshot test. (best practice) [sources: tests/roadmap/snapshots/test_roadmap_stage_plan.ambr, openspec/changes/3415-the-stage-probe-names-the-files/design.md]
- Chosen: The stage plan instructions, checked by the plan snapshot. The plan renders from instructions, and the snapshot test already pins the rendered text.
- Rejected: A validator over the prose of
tasks.md. The plan is free text, so a validator over its prose is brittle.
- How does the context report a referencing test case that the command bound cuts off?: Name the case in the line that reports the reached bound. (best practice) [sources: tests/roadmap/test_roadmap_stage_probe.py, CONTEXT.md]
- Chosen: Name the case in the line that reports the reached bound. The probe already lists skipped items when it reaches the bound, so the planner sees the omission.
- Rejected: Raise the bound. The bound keeps the inputs of a step inside its token budget.
- Rejected: Leave the case out silently. A silent omission repeats the failure of fix(roadmap): the stage probe names the files of a cited bare name #3415.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-07: partly.
Tool: tarpas/pytest-testmon (https://github.com/tarpas/pytest-testmon), MIT, last activity 2026-11-02, maintained.
Activity
dan-petty commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.A real gap in stage plan validation that delayed a review, but it affects planning tooling, not user-facing output.Prevents implementers from discovering failing test cases only at run time and removes a class of review rework.Requires a new validation rule for test-case naming plus a stage-context change that lists cases referencing changed symbols.Both require a stage plan to name an existing test its change breaks, but #3414 stops at the file level while the candidate goes to the individual test case level.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 53cffca (see proposed design in issue body).
[-]fix(roadmap): the stage plan names the existing test case that pins a changed output[/-][+]fix(roadmap): Name the test case that a change invalidates[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 70 characters, and the limit is 60. The type and the scope stay.
fix(roadmap): the stage plan names the existing test case that pins a changed outputfix(roadmap): Name the test case that a change invalidatesdevops-cli-service commentedon Nov 7, 2026
Alternatives check: partly
Reason: The web searches errored out, so the check rests on the package and repository facts: pytest-testmon records which test cases exercise which lines and, after a change, names the cases a source change affects, which is the "list the referencing test cases" half of the need. It does not say which assertion a change invalidates, does not list cases by symbol, message or constant reference in a named module, and does not feed the stage plan's task list, so the plan-instruction rule the issue asks for stays needed.
Tool: tarpas/pytest-testmon (https://github.com/tarpas/pytest-testmon)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 10, 2026
Staged: branch
fix/3443-name-the-test-case-that-a, draft pull request #4352. 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 64000 tokens:
A model review of the plan found these open findings. The stage keeps this pull request a draft with the label
plan/needs-fixuntil a later round clears them:criterion_droppedat group 1: Group 1 lists the cases only of test modules that the issue cites. The plan of fix(roadmap): the stage probe names the files of a cited bare name #3415 namedtests/roadmap/test_roadmap_stage_probe.py, and issue fix(roadmap): the stage probe names the files of a cited bare name #3415 cites no test module, so the probe still omits the case that the change breaks, and no task delivers the criterion for a test module that a group names. Evidence: "The stage context SHALL list each test case of a named test module that references a symbol, message or constant of the changed source file."criterion_droppedat group 1 and specs: The group's second case and the added requirement name only the test module and the source file in the bound line, not each referencing test case that the bound leaves unlisted, so the issue's criterion has no task and the spec delta narrows it. Evidence: "The stage context SHALL name each referencing test case that the probe command bound leaves unlisted."The runs of the planner and the review made 82 model request(s), and used 6083405 input tokens and 132185 output tokens. The tool calls, in order:
list_files({"directory":"src/devops_cli/roadmap/stage"})list_files({"directory":"tests/roadmap/stage"})file_symbols({"path":"src/devops_cli/roadmap/stage/stage_probe.py"})file_symbols({"path":"src/devops_cli/roadmap/stage/stage_context_facts.py"})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":1,"end_line":130})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":230,"end_line":400})file_symbols({"path":"src/devops_cli/roadmap/stage/stage_request.py"})search_code({"text":"probe_premise("})read_file({"path":"src/devops_cli/roadmap/stage/stage.py","start_line":1290,"end_line":1420})search_code({"text":"roadmap_stage_plan"})search_code({"text":"roadmap_stage_"})list_files({"directory":"src/devops_cli/ai/tasks"})read_file({"path":"docs/roadmap/stage.md","start_line":1,"end_line":45})search_code({"text":"test module"})search_code({"text":"existing test"})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":1,"end_line":90})search_code({"text":"behavior group"})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":24,"end_line":120})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":37,"end_line":80})search_code({"text":"def collect_context"})search_code({"text":"CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_probe.py","start_line":1,"end_line":200})search_code({"text":"roadmap_stage_change"})list_files({"directory":"tests/roadmap/stage/__snapshots__"})read_file({"path":"tests/roadmap/stage/__snapshots__/test_roadmap_stage_plan.ambr","start_line":1,"end_line":80})file_symbols({"path":"tests/roadmap/stage/test_roadmap_stage_plan.py"})search_code({"text":"The stage counts 32 tokens"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_prompt_rules.py","start_line":1,"end_line":70})search_code({"text":"load_task_prompt"})read_file({"path":"openspec/changes/3428-the-stage-context-names-the-plan/proposal.md","start_line":1,"end_line":40})search_code({"text":"test module"})search_code({"text":"STAGE_EVAL_TRIGGER_PATHS"})search_code({"text":"roadmap eval stage --replay"})file_symbols({"path":"src/devops_cli/roadmap/stage/stage_form.py"})read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":240,"end_line":300})read_file({"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":40,"end_line":160})read_file({"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":240,"end_line":300})list_files({"directory":"tests/fixtures/roadmap_eval/stage"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_plan.py","start_line":75,"end_line":215})read_file({"path":"openspec/changes/3428-the-stage-context-names-the-plan/tasks.md"})file_symbols({"path":"src/devops_cli/roadmap/stage/stage_probe.py"})search_code({"text":"_Run"})callers({"symbol":"_Run"})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":90,"end_line":200})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_probe.py","start_line":100,"end_line":180})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":280,"end_line":380})search_code({"text":"stage_probe_skipped"})list_files({"directory":"src/devops_cli/ai/tasks"})search_code({"text":"behavior"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_prompt_rules.py","start_line":1,"end_line":80})search_code({"text":"behavior group"})read_spec({"capability":"roadmap-stage","requirement":"A task group names its files"})read_spec({"capability":"roadmap-stage"})search_code({"text":"test case"})search_code({"text":"invalidat"})search_code({"text":"pair that"})read_file({"path":"docs/roadmap/stage.md","start_line":1,"end_line":60})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":1,"end_line":70})read_file({"end_line":120,"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":24})search_code({"text":"tests/"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_probe.py","start_line":1,"end_line":60})search_code({"text":"tests/roadmap"})search_code({"text":"probe.commands"})read_file({"path":"src/devops_cli/config/constants.py","start_line":3270,"end_line":3280})list_files({"directory":"tests/support"})search_code({"text":"MESSAGES_FILE"})file_symbols({"path":"tests/roadmap/stage/test_roadmap_stage_plan.py"})file_symbols({"path":"src/devops_cli/ai/task_loader.py"})search_code({"text":"def git_result"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_plan.py","start_line":182,"end_line":212})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":180,"end_line":460})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_probe.py","start_line":120,"end_line":300})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":342,"end_line":430})read_file({"path":"docs/roadmap/stage.md","start_line":1,"end_line":50})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_plan.py","start_line":180,"end_line":225})search_code({"text":"docs/roadmap/stage.md"})search_code({"text":"A 'behavior' group"})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":30,"end_line":110})search_code({"text":"'kind'"})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":1,"end_line":30})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":58,"end_line":140})read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":23,"end_line":32})search_code({"text":"kind of a group"})read_file({"path":"tests/support/roadmap_stage.py","start_line":190,"end_line":300})read_file({"path":"tests/support/roadmap_stage.py","start_line":100,"end_line":190})read_spec({"capability":"roadmap-stage"})read_spec({"capability":"roadmap-stage","requirement":"The probes are bounded and read-only"})read_spec({"capability":"roadmap-stage","requirement":"The job probes the premise at the staging commit"})read_file({"path":"src/devops_cli/config/constants.py","start_line":3272,"end_line":3280})read_file({"path":"src/devops_cli/lang/en/messages.py","start_line":3590,"end_line":3600})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_plan.py","start_line":90,"end_line":105})file_symbols({"path":"src/devops_cli/roadmap/refine/refine.py"})file_symbols({"path":"src/devops_cli/ai/task_loader.py"})list_files({"directory":"tests/roadmap/stage/__snapshots__"})list_files({"directory":"openspec/changes/archive/2026-11-04-3415-the-stage-probe-names-the-files"})search_code({"text":"class _Run"})read_file({"path":"src/devops_cli/roadmap/stage/stage_probe.py","start_line":100,"end_line":180})read_file({"path":"src/devops_cli/roadmap/refine/refine.py","start_line":685,"end_line":740})read_file({"path":"src/devops_cli/roadmap/refine/refine.py","start_line":770,"end_line":800})search_code({"text":"ast.parse"})read_file({"path":"src/devops_cli/roadmap/stage/stage_context_facts.py","start_line":1,"end_line":170})read_file({"path":"src/devops_cli/roadmap/implement/implement_test_names.py","start_line":1,"end_line":80})search_code({"text":"defined_tests"})search_code({"text":"test cases"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_prompt_rules.py","start_line":200,"end_line":400})search_code({"text":"_DOCUMENTS"})search_code({"text":"test_the_prompt_names_the_test_case_that_a_change_invalidates"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_prompt_rules.py","start_line":400,"end_line":560})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_prompt_rules.py","start_line":560,"end_line":660})git_log({"path":"tests/roadmap/stage/test_roadmap_stage_probe.py"})git_log({"path":"src/devops_cli/roadmap/stage/stage_probe.py"})git_log({"path":"openspec/changes/archive/2026-11-04-3415-the-stage-probe-names-the-files/tasks.md"})read_file({"path":"src/devops_cli/lang/en/messages.py","start_line":3576,"end_line":3592})callers({"symbol":"probe_premise"})search_code({"text":"stage_probe_skipped"})list_files({"directory":"tests/roadmap/stage"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_probe.py","start_line":239,"end_line":400})search_code({"text":"stage-eval"})search_code({"text":"probes"})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py","start_line":1,"end_line":80})search_code({"text":"roadmap/stage/eval"})search_code({"text":"CASES_DIRECTORY"})read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":60,"end_line":200})search_code({"text":"files: Mapping[str, str]"})search_code({"text":"class StagedChange"})read_issue({"number":3415})read_file({"path":"openspec/changes/archive/2026-11-04-3415-the-stage-probe-names-the-files/proposal.md","start_line":1,"end_line":80})read_file({"path":"openspec/changes/archive/2026-11-04-3415-the-stage-probe-names-the-files/tasks.md","start_line":1,"end_line":40})read_file({"path":"src/devops_cli/roadmap/refine/refine.py","start_line":660,"end_line":690})search_code({"text":"scenario names"})search_code({"text":"has no behavior test"})Tool calls: callers=2 (empty=0), file_symbols=10 (empty=0), git_log=3 (empty=0), list_files=10 (empty=0), read_file=55 (empty=0), read_issue=1 (empty=0), read_spec=5 (empty=0), search_code=45 (empty=3)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
1 remaining item
devops-cli-service commentedon Nov 10, 2026
Stopped at group 1.
Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.Reason:
Last message of the agent (a claim that no check verified): Now the pairing in
probe_premise:The job discarded this work. Read it before you retry:
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 ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.devops-cli-service commentedon Nov 10, 2026
The runner Job devops-cli-runner-20261110-105724-b626 ended: succeeded.
Image digest: sha256:4e4c13460c63a1974b17116e0ca085e2079ee8a31822b89c86b41990fa1659cc
The last lines of its log:
docs(openspec): fix the plan of #3443 for module-level names and one …
docs(openspec): plan #3443 Name the test case that a change invalidates
docs(openspec): fix the plan of #3443 for module-level names and one …
docs(openspec): keep the stage eval run as a task of group 2 in the p…
docs(openspec): keep the stage eval run in the implementation task of…
docs(openspec): plan #3443 Name the test case that a change invalidat…
fix(roadmap): implement takes a plan that needs a fix (#4494)
dan-petty commentedon Nov 20, 2026
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.