Skip to content

fix(roadmap): name the same-name file of a missing test path #4498

Closed

Description

@dan-petty

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

  1. Read <n>.refused.json of 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.
  2. 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.py and the staged tree holds tests/github/test_item_grounding.py.
  • THEN The problem ends with the text of stage_path_same_name for tests/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.py and no file of the staged tree has the name test_absent.py.
  • THEN The problem ends with the text of stage_path_no_same_name and 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.py formats MESSAGES.roadmap.stage_problem_missing_test_file for each test path that the staged commit lacks, at src/devops_cli/roadmap/stage/stage_change.py:2089. The template is at src/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_name returns the files of the tree with the name of a path, sorted and at most SAME_NAME_MAX. _problem formats them with stage_path_same_name, or uses stage_path_no_same_name when 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 reuse stage_path_no_same_name when 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_name and stage_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.
  • How does the test-path template take the hint?: Add a {hint} placeholder to stage_problem_missing_test_file, and always format it with one of the two hint texts, as _problem does. (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.
  • Where does the test-path check read the same-name files?: It calls StagedTree.same_name on the staged tree, as path_problems does. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py, tests/roadmap/stage/test_roadmap_stage_paths.py]
    • Chosen: Call StagedTree.same_name on the staged tree. The check reads one tree, gets a bounded and sorted list, and reuses tested code.
    • Rejected: Run a second git ls-files in the check. A second read costs a git call and can see a tree other than the staged commit.

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 11, 2026
  2. dan-petty commented on Nov 11, 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. Three stored items fail because the message does not name the correct file, but the system still operates.
    • Value: Medium. It reduces planner failures on a known pattern of wrong test paths.
    • Effort: Low. The same-name logic already exists in stage_path_same_name; the fix applies it to the test-file gate.
    • Related: fix(roadmap): the stage probe names the files of a cited bare name #3415, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 11, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

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

  6. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 11, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 11, 2026
  8. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 14:13 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