Skip to content

fix(roadmap): plan-check counts files from earlier plan groups #3973

Closed

Description

@dan-petty

Problem

In src/devops_cli/roadmap/plan_check.py, _size_problems flags a task group with group-no-files when item.files == 0 and not set(item.group.changes) <= set(item.group.creates).

When an earlier group in a plan creates a new file, later groups in the same plan that edit that new file do not list it in their own creates. Because the new file does not exist yet in the head commit, named_files cannot find it in the repository tree, and item.files is 0.

As a result, _size_problems reports group-no-files on valid subsequent groups unless they name an unrelated existing repository file in a task code span.

Expected

_size_problems accumulates the paths created by all prior groups in the proposal. When all changed paths of a group exist in prior created paths, _size_problems does not report group-no-files.

Acceptance criteria

  • _size_problems collects created files from previous task groups in the proposal.
  • A group that edits a file created by an earlier group in the same change does not fail group-no-files.
  • Tests cover a multi-group proposal where a later group edits a file created by the first group.

Existing tool considered

Internal plan check logic in src/devops_cli/roadmap/plan_check.py. No new library is needed.

Related

Related: #3499, #3669, #3928.

Proposed design

Problem statement

The plan check reports group-no-files on a valid task group when the group changes a file that an earlier group of the same change creates. named_files keeps only paths that exist in the head commit, so the later group packs no file and item.files is 0. The check must accumulate the paths that earlier groups create before it judges each group, as the stage job's own path check already does.

Acceptance criteria

Requirement: plan-check-accumulates-earlier-creates

The plan check SHALL accumulate the paths that each task group creates and SHALL count a path created by an earlier group of the same change as a file that exists for every later group.

Scenario: A later group changes a file that an earlier group creates

  • WHEN A task group packs no file and changes only paths that earlier groups of the same change create
  • THEN The plan check reports no group-no-files problem for the group.

Requirement: plan-check-own-creates-still-pass

The plan check MUST keep a group that creates every path it changes free of the group-no-files problem.

Scenario: A group creates the file that it changes

  • WHEN A task group packs no file and lists every path it changes in its own creates
  • THEN The plan check reports no group-no-files problem for the group.

Requirement: plan-check-unknown-path-still-fails

The plan check MUST report group-no-files for a group that changes a path that neither the head commit nor an earlier group creates.

Scenario: A group changes a path that no group creates

  • WHEN A task group packs no file and changes a path that the head commit and the creates of earlier groups do not hold
  • THEN The plan check reports one group-no-files problem for the group.

Requirement: plan-check-later-creates-do-not-count

The plan check MUST NOT count a path that only a later task group creates as a file that exists for an earlier group.

Scenario: An earlier group changes a file that only a later group creates

  • WHEN The first task group packs no file and changes a path that only the second group lists in its creates
  • THEN The plan check reports one group-no-files problem for the first group.

Requirement: plan-check-created-path-test

The tests MUST cover a change whose later task group edits a file that its first group creates.

Scenario: Two task groups with one created file

  • WHEN The test runs the plan check on a change folder whose first group creates a file and whose second group changes it
  • THEN The result holds no problem with the rule group-no-files.

Requirement: plan-check-spec-delta-updates-the-rule

The change MUST hold a MODIFIED requirement for group-no-files that counts the creates of earlier groups as existing paths.

Scenario: The change folder validates

  • WHEN openspec validate --strict runs on the change folder
  • THEN Validation passes and the spec delta modifies the group-no-files requirement to name the creates of earlier groups.

Requirement: plan-check-docs-state-earlier-creates

docs/roadmap/plan-check.md SHALL state that a path created by an earlier group counts as a file that exists.

Scenario: The plan-check documentation is read

  • WHEN A test reads the group-no-files paragraph of docs/roadmap/plan-check.md
  • THEN The paragraph names the creates of earlier groups as files that exist.

Existing Tool Considered

No open, maintained tool or library covers the need: the defect is in the project's own _size_problems rule in src/devops_cli/roadmap/plan_check.py, and the matching stage rule is project code in src/devops_cli/roadmap/stage/stage_paths.py:280. The change builds its own code: about 6 lines in _size_problems, one test, a MODIFIED spec-delta requirement and one docs paragraph. The written cost is about 15,000 tokens to build, about 4,000 tokens each year to keep and fix, and about 2 hours of elapsed time.

Key questions

  • Where does the plan check report group-no-files?: _size_problems in src/devops_cli/roadmap/plan_check.py reports it. It loops over the measured groups and appends the problem when item.files == 0 and the group's changes are not all in its own creates. [sources: src/devops_cli/roadmap/plan_check.py:409, src/devops_cli/roadmap/plan_check.py:445, src/devops_cli/roadmap/plan_check.py:446]
  • Why does a group that changes a file created by an earlier group pack no file?: named_files keeps a code span only when the path is an existing file inside the checkout at the head commit. A file that the change creates is not in the head commit, so named_files leaves it out, _reads counts zero files, and item.files is 0. [sources: src/devops_cli/roadmap/step_files.py:198, src/devops_cli/roadmap/step_files.py:204, src/devops_cli/roadmap/stage/stage_change.py:1686, src/devops_cli/roadmap/stage/stage_change.py:1690]
  • How does the check treat a group that changes a file created by an earlier group?: The check keeps a set of paths that earlier groups create. Before it judges a group, it accepts the group's changes when they are all in the union of its own creates and that set. After it judges the group, it adds the group's creates to the set. Only earlier groups count: a path that only a later group creates is not on the branch when the earlier step runs, and the stage job's path_problems already applies that order. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:445, src/devops_cli/roadmap/stage/stage_paths.py:280, src/devops_cli/roadmap/stage/stage_paths.py:285, src/devops_cli/roadmap/stage/stage_paths.py:290, openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/specs/roadmap-stage/spec.md:4, src/devops_cli/ai/tasks/roadmap_stage_split.md:7]
    • Chosen: Accumulate the creates of earlier groups. The branch holds the file when the later step runs, and the stage job's own path check already accepts a path that the same or an earlier group creates.
    • Rejected: Keep the current rule and require an existing file. This is the defect: a valid later group fails unless it names an unrelated file that exists.
    • Rejected: Read the created file from the change folder to measure it. The plan holds no content for a created file, so the check has nothing to read.
    • Rejected: Count the creates of every group, including later groups. A later group's file is not on the branch when an earlier step runs, and the stage path check reports a path that only a later group creates as missing.
  • Does the fix change the token budget of a group?: No. The fix changes only the group-no-files condition. measure_groups still measures the tokens of the shared text, the group's text, the files it reads and the creates_lines estimate, and the budget roadmap.stage.step_tokens stays as it is. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:445, src/devops_cli/roadmap/stage/stage_change.py:1703, src/devops_cli/roadmap/stage/stage_change.py:1722]
    • Chosen: Change only the group-no-files rule. The issue asks for the false failure to go, and the budget keeps its measure of the head tree.
    • Rejected: Also add the lines of the files that earlier groups create. The plan holds no estimate of the lines of a created file beyond creates_lines, and the issue does not ask for a budget change.
  • Where does the test of the new rule go?: Extend tests/roadmap/test_roadmap_plan_check.py, next to test_a_group_that_packs_no_file_is_reported. Build a change with two groups: the first creates tests/test_sample.py, and the second is an other group that changes it and lists it in no creates. Push the change and assert that no problem has the rule group-no-files. (best practice) [sources: tests/roadmap/test_roadmap_plan_check.py:599, tests/roadmap/test_roadmap_plan_check.py:612, tests/support/builders.py:137, tests/support/roadmap_stage.py:36]
    • Chosen: Extend the module that tests plan_check. The rule belongs to the plan check, and the module already runs the check and holds the group-no-files case.
    • Rejected: Add a new test module. It repeats the fixtures of the plan check for one case.
  • Must the change update the spec and the documentation?: Yes. The change's spec delta holds a MODIFIED requirement for 'Plan-check reports a group that packs no file' that counts the creates of earlier groups, and docs/roadmap/plan-check.md states the new rule. The change does not edit the living spec at openspec/specs/roadmap-plan-check/spec.md:188 directly: only openspec archive writes it. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md:86, CONTEXT.md:20, openspec/specs/roadmap-plan-check/spec.md:188, docs/roadmap/plan-check.md:34]
    • Chosen: A MODIFIED spec delta and a docs paragraph. The living spec states the old rule, and ADR 0010 requires a MODIFIED requirement in the change; the docs describe the rule and would otherwise be wrong.
    • Rejected: Edit openspec/specs/roadmap-plan-check/spec.md directly. CONTEXT.md and ADR 0010 reserve the living spec for openspec archive.
    • Rejected: Change no spec or docs. The archived spec and the docs would keep the false rule that a file created by an earlier group does not exist.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-09: none.
Tool: none found.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 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. Valid plans fail CI with a false group-no-files error, blocking legitimate work but with a known workaround.
    • Value: Medium. It removes a false failure that blocks valid multi-group plans from passing plan-check.
    • Effort: Low. The fix is scoped to one function that must accumulate created paths from prior groups.
    • Related: fix(roadmap): stage must check packed files before opening a draft plan #3970, which asks for a different change. Both concern the group-no-files check, but #3970 adds the check to the stage job while the candidate fixes a false positive in plan_check._size_problems.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. dan-petty commented on Nov 8, 2026

    @dan-petty
    OwnerAuthor

    This defect occurred on pull request #4104 for issue #3075.

    Group 1 created tests/roadmap/test_roadmap_faults.py (new).
    Group 4 changed tests/roadmap/test_roadmap_faults.py.
    The command devops roadmap plan-check rejected Group 4 with group-no-files.
    The check failed because the file was not in the head commit and not in Group 4 creates.

    Accumulating created paths across earlier groups in the proposal will prevent this false failure.

  5. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  6. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

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

  7. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The defect is in the project's own _size_problems rule in plan_check.py, which doesn't accumulate paths created by earlier groups. I ran one search for an existing tool and found only unrelated pages. No open library checks a project-specific plan format like this, and the issue itself says none is needed.

    Tool: none found

    Lacks:

    • No external tool understands the project's plan-check task groups, creates and changes fields
    • The fix is a small change to internal code

    Searches run:

    • validate task plan that later steps edit files created by earlier steps, tool or library, results: 5

    Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.

  8. added
    status/in-progress
    and removed
    status/ready
    on Nov 14, 2026
  9. added
    status/in-review
    and removed
    status/in-progress
    on Nov 14, 2026
  10. removed
    status/in-review
    on Nov 14, 2026
  11. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

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