Repository navigation
Description
Problem
The stage service checks that the paths a plan names exist at the staged commit. It does not check that the plan names an existing test the change will break. A plan can name the test it creates and omit the existing test that pins the behavior it changes, and still pass every stage check.
Evidence
The plan of #3351 is the case. It named the two test files it created and the source file it changes, but not tests/roadmap/test_roadmap_implement_step.py. That file holds the two assertions the change updates, The first group (#1) and Make check Static Analysis pass (#1). A review caught the omission. The implement job would have met that failure with no name for it in the plan.
Suggestion
A behavior group that changes an existing source file SHALL name the existing test it updates, not only the test it creates. The problem SHALL name the group, the source path, and the existing test the group does not name.
Source: #3352
Proposed design
Problem statement
The stage plan validation checks that each path a plan names exists at the staged commit, but it does not require a behavior group that changes an existing source file to name the existing test that pins the behavior it changes. A plan can name only the test it creates and pass every stage check; the implement job then meets the broken existing test with no name for it in the plan. The plan validation SHALL refuse such a group and name the group, the source path and the missing existing test.
Acceptance criteria
Requirement: Refuse a behavior group that omits its existing test
The stage plan validation SHALL refuse a behavior group that changes an existing source file under src/ and names no existing test file that imports that module or follows the repository test naming convention for it.
Scenario: A source change names only a new test
- WHEN A group names
src/devops_cli/roadmap/implement_step.pyand the new filetests/roadmap/test_implement_step_more.py, and the staged tree holdstests/roadmap/test_roadmap_implement_step.py, which imports that module. - THEN The stage plan validation exits nonzero and its message names the group,
src/devops_cli/roadmap/implement_step.pyandtests/roadmap/test_roadmap_implement_step.py.
Requirement: Accept a named existing test that imports the module
The stage plan validation SHALL accept a behavior group that changes an existing source file under src/ and names at least one existing test file that imports that module.
Scenario: The existing test imports the module and its file name differs from the module name
- WHEN A group names
src/devops_cli/roadmap/step_files.pyandtests/roadmap/test_roadmap_implement_step.py, which imports that module. - THEN The stage plan validation exits zero for that group.
Requirement: Exempt a source file with no existing test
The stage plan validation SHALL accept a behavior group that changes an existing source file under src/ when the staged tree holds no test file that imports that module and no test file that follows the repository test naming convention for it.
Scenario: An existing module has no existing test
- WHEN A group names
src/devops_cli/roadmap/untested.pyand a new test file with another name, and the staged tree holds no test file for that module. - THEN The stage plan validation exits zero for that group.
Requirement: Exclude the test files the plan creates
The stage plan validation MUST leave out every test path that the plan lists in creates, so that a test file that the plan creates is no existing test.
Scenario: The plan creates the only test for a module it also changes
- WHEN A group names
src/devops_cli/roadmap/untested.pyand createstests/roadmap/test_roadmap_untested.py, and the staged tree holds no test file for that module. - THEN The stage plan validation exits zero for that group.
Requirement: Report one problem for each offending group
The stage plan validation SHALL report one problem for each behavior group that omits an existing test file that imports the source module it changes.
Scenario: Two groups omit their existing tests
- WHEN Group 1 names
src/devops_cli/roadmap/implement_step.pyand group 2 namessrc/devops_cli/roadmap/step_files.py, and neither group namestests/roadmap/test_roadmap_implement_step.py. - THEN The stage plan validation exits nonzero and reports two problems, one for each group.
Existing Tool Considered
No open, maintained tool or library covers this repository-specific stage validation: the rule reads the src/devops_cli/ layout and the tests/ naming convention of this repository, and it must run inside the stage job with no test suite. The project builds its own check in path_problems of src/devops_cli/roadmap/stage_paths.py. The written cost is about 6,000 tokens to build, keep and fix that check, and about 1 hour of elapsed time.
Key questions
- Which existing test holds the two assertions that the plan of feat(roadmap): the implement job formats step commits with conventional prefixes #3351 updates?:
tests/roadmap/test_roadmap_implement_step.pyholdschore: The first group (#1)andchore: Make check Static Analysis pass (#1); the plan of feat(roadmap): the implement job formats step commits with conventional prefixes #3351 named only the new test filetests/roadmap/test_roadmap_implement_step_commit.pyin its changes. [sources: tests/roadmap/test_roadmap_implement_step.py:282, openspec/changes/archive/2026-11-04-3351-the-implement-job-formats-step-commits/tasks.md:14, openspec/changes/archive/2026-11-04-3351-the-implement-job-formats-step-commits/tasks.md:20] - Does the stage plan validation already require an existing test for a changed source file?: No.
path_problemsonly reports a named path that the tree lacks and that no earlier group creates; it never requires a test path. [sources: src/devops_cli/roadmap/stage_paths.py:202, src/devops_cli/roadmap/stage_change.py:618] - Where shall the stage service refuse a plan that omits an existing test?: In the stage plan validation, as a rule beside
path_problemsinsrc/devops_cli/roadmap/stage_paths.py, called fromcheck_proposal. It reads the staged tree and the groups, like the path check. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:618, src/devops_cli/roadmap/stage_paths.py:202]- Chosen: A rule beside
path_problems, called fromcheck_proposal. It reuses the staged tree and the one rule set of the stage job and the replay. - Rejected: Extend
path_problemsitself. The path check reports a missing path once per path; a missing test is a different problem per group, so a separate rule keeps both clear. - Rejected: Refuse in the inputs of an implement step. It runs after a person merges the plan, so a refusal costs an implement step.
- Rejected: State the rule in the planner instructions only. An instruction is no check, so the plan still passes every stage check.
- Chosen: A rule beside
- How shall the check identify the existing test that a behavior group must name?: Use a static candidate set in the staged tree: test files under
tests/that import the changed module, plus test files that follow the naming conventiontests//test_.py. Require at least one named candidate. Exempt the group when the set is empty. (best practice) [sources: tests/roadmap/test_roadmap_implement_step.py:282, src/devops_cli/roadmap/stage_paths.py:76]- Chosen: Static import and naming scan. It is deterministic, it finds the feat(roadmap): the implement job formats step commits with conventional prefixes #3351 test, and it runs no test suite.
- Rejected: Run the test suite. It is slow, it needs dependencies, and stage validation must not execute tests.
- Rejected: Exact file name convention only. It misses a test file whose name differs from the module name, such as
test_roadmap_implement_step.pyforstep_files.py. - Rejected: Any existing test under
tests/. An unrelated test would satisfy the rule and hide the omission.
- What shall the check do when the staged tree holds no existing test for the module?: Accept the group. A module with no existing test has no test to update. The group must still name a test path, new or existing. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:340]
- Chosen: Exempt the group. It avoids a false refusal for a new module or an untested module.
- Rejected: Refuse every source change. It blocks a new module that has no prior test to update.
- Rejected: Warn only. The issue requires a refusal when an existing test is omitted.
- What shall the refusal message contain?: The group number and title, the source path, and every missing existing test candidate. One problem covers one group. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py:174]
- Chosen: Group, source and every candidate. It gives the implementer the exact omission and the test paths to add.
- Rejected: Group and source only. The implementer must search for the missing test.
- Rejected: The first candidate only. It hides another existing test that the change may break.
- Which named files make a task group a behavior group?: A group is a behavior group when its
kindisbehavior, which already requires a change undersrc/(_SOURCE_DIRECTORY). A group of kindotherand a group that changes no file undersrc/are no behavior groups. [sources: src/devops_cli/roadmap/stage_change.py:105, src/devops_cli/roadmap/stage_change.py:340] - Which tree shall the check read to find the existing tests?: The staged tree that
check_proposalalready receives, leaving out every test path that the plan lists increates. This is the base tree plus the change folder and nothing the plan itself creates, so no test that the plan creates counts as existing. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py:202, src/devops_cli/roadmap/stage_paths.py:191]- Chosen: The staged tree, less the paths the plan creates. It is the tree the other plan checks read, and a created test is no existing test.
- Rejected: The worktree of the plan. Every group would pass, because the plan creates its own test file.
- Rejected: A separate base-commit read. It adds a checkout read for a result the staged tree and the
createslists already give.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: none.
Tool: none found.
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.Prevents a class of plan errors that currently require human review to catch, but does not block shipping.Removes a recurring manual-review burden and prevents implement jobs from failing on unnameable test changes.Requires mapping source-file changes to the existing test files that assert their behavior, which needs coverage analysis.Both ensure a plan names the test file for a changed function, but #3389 provides the correct test module name to the plan while the candidate refuses a plan that omits it.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at c6274f7 (see proposed design in issue body).
devops-cli-service commentedon Nov 4, 2026
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
25 remaining items
devops-cli-service commentedon Nov 10, 2026
The runner Job devops-cli-runner-20261110-122751-3b94 ended: succeeded.
Image digest: sha256:4e4c13460c63a1974b17116e0ca085e2079ee8a31822b89c86b41990fa1659cc
The last lines of its log:
fix(roadmap): Record the existing tests of a changed module (#3414)
fix(roadmap): Refuse the group in the paths gate of the plan check (#…
fix(roadmap): Carry the record through the gate arguments of the job (#…
fix(roadmap): Carry the record through the plan recheck (#3414)
fix(roadmap): State the rule of the existing test in the plan-check d…
docs(openspec): archive the change (#3414)
devops-cli-service commentedon Nov 10, 2026
Released in v0.107.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.107.2
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 14:35 UTC
fix(roadmap): the module-test and caller gates read imports and calls (…