Skip to content

fix(roadmap): the stage probe names the files of a cited bare name #3415

Closed

Description

@dan-petty

Problem

The stage job probes each path that an issue cites at the staging commit (stage_probe, #3011). A citation can be a bare file name with no folder, such as stage_specs.py. The probe checks that name literally at the repository root (git cat-file -e <sha>:stage_specs.py), finds no file there, and reports that the path is no file of the staging commit.

The report is true for the root, but it misleads the planner: a file with that name can exist under a folder. The plan of #3328 (PR #3336) shows the cost. Issue #3328 says "In src/devops_cli/roadmap/stage_eval_gates.py or stage_specs.py". The probe reported stage_specs.py missing at the root, and the plan concluded that "stage_specs.py ... is no file of the commit". But src/devops_cli/roadmap/stage_specs.py exists and reads the base specs, so the plan dismissed a file that exists.

The path check already lists the files of the same name when a path is missing (StagedTree.same_name and path_problems of src/devops_cli/roadmap/stage_paths.py), and the prompt tells the model to use one of them. The probe does not resolve a bare name this way.

Proposed change

When a cited path is no file of the staging commit and its name has files under a folder, the probe names those files, as the path check does. Then the planner reads a file that exists and does not dismiss it. Add a test of the probe for a cited bare name with a file under a folder.

Acceptance criteria

  1. A cited bare name with a file under a folder makes the probe name that file, and the probe gives the file as the candidate.
  2. A test asserts that the probe names the file of a cited bare name that has no root file.

Source: #3336

Proposed design

Problem statement

The stage probe checks each cited path at the repository root only. A bare file name such as stage_specs.py fails even when a file with that name exists under src/devops_cli/roadmap/. The planner then dismisses a file that exists. The fix makes the probe name files of the same name under a folder, as the path check already does.

Acceptance criteria

Requirement: Probe names a same-name file under a folder

When a cited path is no file at the staging commit root and the staged tree holds files with the same name under a folder, the stage probe SHALL name those files and give the existing file as the candidate.

Scenario: Cited bare name with a file under a folder

  • WHEN The issue cites stage_specs.py, the staging commit has no root stage_specs.py, and src/devops_cli/roadmap/stage_specs.py exists.
  • THEN The probe output names src/devops_cli/roadmap/stage_specs.py as the candidate and does not report the bare name as a missing file of the commit.

Requirement: Probe test covers a cited bare name

The probe test suite MUST assert that a cited bare name with no root file gets the matching file under a folder as its candidate.

Scenario: Test of a cited bare name

  • WHEN The test runs the probe on a body that cites stage_specs.py against a staging commit with src/devops_cli/roadmap/stage_specs.py and no root stage_specs.py.
  • THEN The test asserts that the probe output names src/devops_cli/roadmap/stage_specs.py.

Requirement: Probe keeps a root file result

When a cited path exists at the staging commit root, the stage probe MUST keep its current result and MUST NOT list same-name files.

Scenario: Cited root file still passes

  • WHEN The issue cites README.md and the staging commit holds README.md at the root.
  • THEN The probe reports README.md as a file of the staging commit and lists no other file.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need. The change extends the repository's own stage_probe path check. Estimated written cost: 400 to 800 tokens to change src/devops_cli/roadmap/stage_probe.py and add one test, and under one hour of elapsed time to implement and review. The project keeps this code.

Key questions

  • How should the stage probe find a cited bare name that is no root file?: Use the existing StagedTree.same_name method to list files of the same name under a folder, as path_problems does. Do not add a second name search. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_probe.py]
    • Chosen: Call StagedTree.same_name. The path check and the probe then use one rule for same-name files.
    • Rejected: Add a name search inside stage_probe.py. It duplicates the rule and can drift from the path check.
    • Rejected: Read git ls-files again in the probe. It repeats the tree read and ignores the existing limit.
  • How many same-name files should the probe name?: Name at most SAME_NAME_MAX files, which is five, in sorted order. This matches StagedTree.same_name and path_problems. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py]
    • Chosen: Use SAME_NAME_MAX from stage_paths.py. The probe keeps the same bound as the path check.
    • Rejected: Name every same-name file. A large tree can flood the probe output and the planner context.
    • Rejected: Name one file only. The planner can miss the correct file when several files have the same name.
  • What should the probe output when a cited bare name has a matching file under a folder?: The probe must name the matching path and give it as the candidate. The planner then reads a file that exists. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage_paths.py]
    • Chosen: Name the matching path as the candidate. It follows the path check and removes the false missing-file report.
    • Rejected: Report the bare name as missing at the root. The report is true for the root but misleads the planner.
    • Rejected: Report the bare name with no candidate. The planner cannot resolve the file and may dismiss a file that exists.
  • Which test module should hold the new probe test?: tests/roadmap/test_roadmap_stage_probe.py holds the tests of stage_probe, so the new case joins it. [sources: tests/roadmap/test_roadmap_stage_probe.py, src/devops_cli/roadmap/stage_probe.py]
  • Does the change need a new dependency or a new module?: No. The change uses StagedTree.same_name in the existing stage_probe module and adds one test. [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_probe.py, tests/roadmap/test_roadmap_stage_probe.py]

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 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. The probe misleads the planner into dismissing existing files, but the project still stages plans.
    • Value: Medium. Preventing false dismissals of existing files improves plan accuracy for every issue that cites a bare name.
    • Effort: Low. The same_name lookup already exists in path_problems; the fix wires it into the probe and adds one test.
    • Related: fix(roadmap): the premise probe reports a file as absent that exists at the plan base #3301, which asks for a different change. Both fix the probe reporting a file as missing when it exists, but #3301 fixes a wrong commit reference while the candidate fixes bare-name resolution to a subfolder path.
  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 c6274f7 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Staged: branch fix/3415-the-stage-probe-names-the-files, draft pull request #3437. 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. Name the same-name files of a cited bare path in the probe: 27113 tokens

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

    • other at group 1, tests: The plan adds an ls-tree command to the probe. An existing test asserts that the probe runs only cat-file, grep and log, and the plan does not update it. The tree read also takes one command from the budget, so the bound tests that assert exact command counts and skipped items would change. Evidence: "assert {args[0] for args in ran} == {"cat-file", "grep", "log"}"
    • other at group 1, implementation: The implementation adds a message text under src/devops_cli/lang/, but the group lists no file there in changes or reads. The step that edits files will not know the file to change. Evidence: "add a candidate text to the roadmap messages of src/devops_cli/lang/"

    The plan run made 2 model request(s), and used 149161 input tokens and 5462 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. added
    status/planned
    and removed
    status/ready
    on Nov 4, 2026
  9. added
    status/in-review
    and removed
    status/planned
    on Nov 4, 2026
  10. removed
    status/in-review
    on Nov 4, 2026
  11. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-04 14:17 UTC

  12. added a commit that references this issue on Nov 10, 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