Skip to content

fix(roadmap): a move plan leaves out files of a tool #4291

Closed

Description

@dan-petty

Problem

The move-reference gate of the stage job treats a plan as a move of a module when it is no move, and it asks a plan to edit files that nobody edits.

moved_modules in src/devops_cli/roadmap/stage/stage_change.py calls a Python module "moved" when a task group lists it in changes and the group creates any file (#3373). A group that changes stage_change.py and creates a test file is then a move. The job greps the whole staged commit for the path and the dotted name of each such module (_probe_references in src/devops_cli/roadmap/stage/stage.py). _move_reference_problems then refuses the plan for each hit that no group changes, with no regard for the kind of file.

Two kinds of hit can never be edited by a task group:

  • CHANGELOG.md is written by release-please only (AGENTS.md; class tool-owned in CONST_DOCS_INVENTORY).
  • openspec/changes/**/*.md are records of other changes (class record in the same inventory), and the plan rule says that no group edits a file of a change folder.

Evidence: the Service logs of the stage job (Loki, 7 days). Four items failed with this gate in 24 hours, with 2248 sentences of one shape. Items #3599, #3398, #3443 and #3592. Word for word, from #3599: "The move plan leaves out CHANGELOG.md. Add a task group that changes it or mark it unchanged with a reason. The move plan leaves out openspec/changes/3253-map-all-issue-requirements-to-a/proposal.md. Add a task group that changes it or mark it unchanged with a reason." The failure text of #3599 is 88 000 characters long. The model cannot answer 500 such sentences, so the item fails.

The paths gate counted 11.8 refusals in the last 6 hours.

Expected

  • A group moves a module only when it creates the same module in another place: a created module of the same name, or a created module under the sub-package that the name prefix gives (stage_probe.py to stage/probe.py). A group that changes a module and creates a test, a document or a module of another name moves nothing.
  • A hit in a file of class tool-owned or record in CONST_DOCS_INVENTORY needs no task group and no unchanged entry.
  • Any other hit (a caller, a test, a hand-written document) still needs a task group or an unchanged entry with a reason.

Acceptance criteria

  • uv run devops ci test tests/roadmap/stage/test_roadmap_stage_move_references.py passes. It fails on the base.
  • uv run devops roadmap eval stage --replay keeps its result: every gate refuses what it must refuse, and 5 of 5 good plans pass. The case 3412-a-move-plan-leaves-a-test-reference still refuses.

Existing tool considered

explicit_classes of src/devops_cli/docs/inventory.py already classes the files, and PurePosixPath.full_match reads the globs. The change adds no parser. Cost: about 25 000 tokens to build, 3 000 to keep, and 1 hour.

Proposed design

Problem statement

The move-reference gate of the stage job treats a plan as a move of a module when it is no move. It then asks a plan to edit files that no task group can edit: CHANGELOG.md and files in openspec/changes. This makes the failure text very long, and the item fails.

Acceptance criteria

Requirement: A move needs a created module of the same place

The function moved_modules SHALL report a module as moved only when the same group creates a module of the same name, or a module under the sub-package that the name prefix gives.

Scenario: A group changes a module and creates a test

  • WHEN A group lists src/devops_cli/roadmap/stage/stage_change.py in changes and creates tests/roadmap/stage/test_roadmap_stage_move_references.py
  • THEN moved_modules returns an empty list for that group.

Requirement: A real move is still found

The function moved_modules SHALL report a module as moved when a group creates the module under the sub-package that its name prefix gives.

Scenario: A prefix move

  • WHEN A group changes src/devops_cli/roadmap/stage_probe.py and creates src/devops_cli/roadmap/stage/probe.py
  • THEN moved_modules returns the old path and the dotted name of stage_probe.

Requirement: A same-name move is found

The function moved_modules SHALL report a module as moved when the group creates a module of the same name in another folder.

Scenario: Same name in another folder

  • WHEN A group changes src/devops_cli/a/foo.py and creates src/devops_cli/b/foo.py
  • THEN moved_modules returns the old path of foo.py.

Requirement: Tool-owned and record files need no group

The function _move_reference_problems SHALL NOT refuse a reference hit in a file of class tool-owned or record in CONST_DOCS_INVENTORY.

Scenario: Hits in CHANGELOG.md and a change folder

  • WHEN The references list CHANGELOG.md and openspec/changes/3253-map-all-issue-requirements-to-a/proposal.md and no group changes them
  • THEN _move_reference_problems returns no problem.

Requirement: Other hits still need a group or an unchanged entry

The function _move_reference_problems MUST refuse a reference hit in any other file that no group changes and no unchanged entry covers.

Scenario: A caller is left out

  • WHEN The references list a caller module and a test that no group changes
  • THEN _move_reference_problems returns one problem for each of these paths.

Requirement: The replay keeps its result

The replay of the stage eval SHALL keep every gate refusal and pass 5 of 5 good plans, and the case 3412-a-move-plan-leaves-a-test-reference MUST still refuse.

Scenario: Replay of the golden set

  • WHEN uv run devops roadmap eval stage --replay runs after the change
  • THEN The result equals the result before the change and the case 3412 still refuses.

Existing Tool Considered

The inventory function explicit_classes in src/devops_cli/docs/inventory.py already classes the files, and PurePosixPath.full_match reads the globs. The change adds no parser and no new dependency. It builds a small filter in stage_change.py. Cost of this own code: about 25000 tokens to build, 3000 tokens to keep, and 1 hour of elapsed time.

Key questions

  • Which files may a move plan skip without a task group or an unchanged entry?: Files of class tool-owned or record in CONST_DOCS_INVENTORY: CHANGELOG.md and openspec/changes/**/*.md. The gate reads the class from the existing inventory and does not keep its own list. (best practice) [sources: src/devops_cli/docs/inventory.py, src/devops_cli/config/constants.py]
    • Chosen: Reuse the class of CONST_DOCS_INVENTORY through explicit_classes. The body names this inventory as the single source and it adds no second list.
    • Rejected: Hard-code CHANGELOG.md and openspec/changes in the gate. A second list can drift from the inventory.
  • Where does the gate learn that a file is tool-owned or record?: The function _move_reference_problems in stage_change.py filters the hits with the inventory class before it builds problems. The probe in stage.py stays as it is. [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/roadmap/stage/stage.py, src/devops_cli/docs/inventory.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/high
    effort/low
    on Nov 9, 2026
  2. dan-petty commented on Nov 9, 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: P1-High. Four items failed in 24 hours with 2248 sentences of refusal text, blocking active work.
    • Value: High. The gate blocks valid plans from passing CI, stalling multiple items.
    • Effort: Low. The body states about 25 000 tokens to build and 1 hour of work.
    • Related: feat(roadmap): Require a move plan to cover each reference #3373, which asks for a different change. Both work on the move-reference gate in stage_change.py and stage.py; #3373 adds the gate, this candidate fixes its false move detection and skips tool-owned and record files.
  3. added
    priority/p1-high
    on Nov 9, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

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

  6. added
    status/in-progress
    and removed
    status/ready
    on Nov 10, 2026
  7. added 3 commits that reference this issue on Nov 10, 2026
    792ac59
    f1f5451
    5d9eea3
  8. removed
    status/in-progress
    on Nov 10, 2026
  9. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor
  10. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-10 01:54 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/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions