Repository navigation
Description
Problem Description
The stage gate stage_problem_missing_test_file says "The test path X names no file of the staged commit. Correct the path or add the test file." It does not name the file that the plan most likely means. The planner then repeats the same wrong path in its second reply, and the item fails.
The stored refused records of the Service (2026-11-11) hold 3 items with this problem. In each one, the second reply repeats the wrong path of the first reply (3 of 3). In each one, the staged tree holds exactly one file with the same name in another folder:
| Item | Path in the plan | File in the tree |
|---|---|---|
| #3398 | tests/test_item_grounding.py |
tests/github/test_item_grounding.py |
| #3532 | tests/keyring_isolation.py |
tests/support/keyring_isolation.py |
| #4401 | tests/test_k8s_monitoring_alerting.py |
tests/prometheus/test_k8s_monitoring_alerting.py |
The path gate already names files with the same name for other paths (stage_path_same_name in src/devops_cli/roadmap/stage/stage_paths.py).
This issue is out of scope of #4463.
Reproduction Steps
- Read
<n>.refused.jsonof fix(pr): Require a replay score in stage-change PRs #3398, fix(tests): a logfire console span leaks into stdout of a later test #3532 or fix(security): 52 Trivy-config alerts stay open, none judged #4401 in the stage data folder of the Service. - Compare the problem of reply 0 and reply 1.
Expected vs Actual Behavior
Expected: the problem names the file of the same name, for example "Did you mean tests/github/test_item_grounding.py?", so the second reply can correct the path.
Actual: the problem names only the wrong path, and the second reply repeats it.
Environment Diagnostics
- DevOps CLI: main at c653bde
- Execution environment: the roadmap Service (stage job)
Logs, Traces, or Terminal Output
The test path `tests/test_item_grounding.py` names no file of the staged commit. Correct the path or add the test file.Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Proposed design
Problem statement
The stage gate for a missing test path names only the wrong path. The planner repeats the same wrong path in its second reply, and the item fails. Three refused items of the Service show this. The path gate already names the files with the same name. This change gives the test-path gate the same hint.
Acceptance criteria
Requirement: The test-path problem names the same-name file
The stage job SHALL end the problem of a missing test path with the text of stage_path_same_name for each file of the staged tree with that name.
Scenario: One file has the same name
- WHEN A plan names the test path
tests/test_item_grounding.pyand the staged tree holdstests/github/test_item_grounding.py. - THEN The problem ends with the text of
stage_path_same_namefortests/github/test_item_grounding.py.
Requirement: A missing test path with no same-name file
The stage job SHALL end the problem with the text of stage_path_no_same_name when no file of the staged tree has that name.
Scenario: No file has the same name
- WHEN A plan names the test path
tests/test_absent.pyand no file of the staged tree has the nametest_absent.py. - THEN The problem ends with the text of
stage_path_no_same_nameand names no file.
Requirement: The same-name list is bounded and sorted
The stage job SHALL list the files of the staged tree with that name in sorted order, at most SAME_NAME_MAX files.
Scenario: More same-name files than the limit
- WHEN Six files of the staged tree have the name of the missing test path.
- THEN The problem names the first five files in sorted order.
Requirement: One hint wording for each missing path
The stage job SHALL use the same hint text for a missing test path and for a missing path of changes.
Scenario: The same file name is missing in two places
- WHEN A plan names a missing test path and a missing path of
changes, and the staged tree holds one file with that name. - THEN Both problems end with the same text of
stage_path_same_name.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need. The text is a diagnostic of the stage validator, and the same-name lookup already exists in StagedTree.same_name. The change reuses that lookup in the test-path gate and builds no code that a library could replace. The cost is one message template, one call site and two test cases: about 20 lines, roughly 2,000 tokens, and under one hour.
Key questions
- Where does the stage job build the problem of a missing test path?:
stage_change.pyformatsMESSAGES.roadmap.stage_problem_missing_test_filefor each test path that the staged commit lacks, atsrc/devops_cli/roadmap/stage/stage_change.py:2089. The template is atsrc/devops_cli/lang/en/messages.py:4122. [sources: src/devops_cli/roadmap/stage/stage_change.py:2089, src/devops_cli/lang/en/messages.py:4122] - Does the staged tree already give the files with the same name?: Yes.
StagedTree.same_namereturns the files of the tree with the name of a path, sorted and at mostSAME_NAME_MAX._problemformats them withstage_path_same_name, or usesstage_path_no_same_namewhen the list is empty. [sources: src/devops_cli/roadmap/stage/stage_paths.py, tests/roadmap/stage/test_roadmap_stage_paths.py] - Which text does the test-path problem add for a same-name file?: Reuse
stage_path_same_name, and reusestage_path_no_same_namewhen no file has that name. The issue's "Did you mean" is an example, not a new wording. (best practice) [sources: src/devops_cli/lang/en/messages.py:4150, src/devops_cli/roadmap/stage/stage_paths.py, openspec/specs/roadmap-stage/spec.md]- Chosen: Reuse
stage_path_same_nameandstage_path_no_same_name. The path gate already names the same fact, and the spec pins these texts, so the planner reads one wording. - Rejected: Add a "Did you mean" message. A second wording for the same fact makes the planner read two forms, and the spec pins neither.
- Chosen: Reuse
- How does the test-path template take the hint?: Add a
{hint}placeholder tostage_problem_missing_test_file, and always format it with one of the two hint texts, as_problemdoes. (best practice) [sources: src/devops_cli/lang/en/messages.py:4122, src/devops_cli/roadmap/stage/stage_paths.py]- Chosen: Add a
{hint}placeholder to the existing key. One key and one formatting path serve both cases, and the problem always ends with a hint. - Rejected: Add a second key for the same-name case. Two keys for one problem let a caller pick the wrong one, and the two texts can drift apart.
- Chosen: Add a
- Where does the test-path check read the same-name files?: It calls
StagedTree.same_nameon the staged tree, aspath_problemsdoes. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py, tests/roadmap/stage/test_roadmap_stage_paths.py]- Chosen: Call
StagedTree.same_nameon the staged tree. The check reads one tree, gets a bounded and sorted list, and reuses tested code. - Rejected: Run a second
git ls-filesin the check. A second read costs a git call and can see a tree other than the staged commit.
- Chosen: Call
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 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.Three stored items fail because the message does not name the correct file, but the system still operates.It reduces planner failures on a known pattern of wrong test paths.The same-name logic already exists in stage_path_same_name; the fix applies it to the test-file gate.Both name a file with the same name to help the planner, but #3415 handles bare names in the stage probe while the candidate handles full paths in the test-file gate.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at c3f62a9 (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Released in v0.112.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 14:13 UTC