Skip to content

feat(roadmap): enforce that tasks name every changed file in code spans #4025

Not planned

Description

@dan-petty

Problem or Motivation

The stage planner can create task groups that pack no files. When the model writes an implementation task that omits the changed file paths in backtick code spans, step_files.py finds no files to pack.

The check _size_problems then fails with group-no-files. This blocks the plan pull request.

Proposed Solution & Architectural Design

  • Stage Prompt: Update src/devops_cli/ai/tasks/roadmap_stage_change.md to state that implementation must name every path in changes in a code span.
  • Validation: In StageGroup validation or render_change, ensure the task implementation references the paths of changes.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

Built-in roadmap stage prompt and validation in src/devops_cli/roadmap/.

Dependencies

Proposed design

Problem statement

The stage planner can write an implementation task that omits changed file paths from backtick code spans. step_files.py then finds no files to pack. _size_problems fails the plan pull request with group-no-files. The change makes the prompt and StageGroup validation require every path in changes in a code span.

Acceptance criteria

Requirement: Prompt requires changed paths

The roadmap stage prompt MUST tell the planner to name every path in changes in a backtick code span in the task implementation.

Scenario: Prompt states the code span rule

  • WHEN The roadmap stage prompt is read.
  • THEN It states that implementation names every path in changes in a backtick code span.

Requirement: Missing changed path is rejected

The StageGroup model MUST reject a group whose implementation omits any path in changes from a backtick code span.

Scenario: A group omits one changed path

  • WHEN A StageGroup has two paths in changes and its implementation names only one in a backtick code span.
  • THEN Validation fails and the error names the missing path.

Requirement: Validation lists every missing path

The StageGroup validation error MUST name every path in changes that the implementation does not contain in a backtick code span.

Scenario: A group omits two changed paths

  • WHEN A StageGroup has three paths in changes and its implementation names only one in a backtick code span.
  • THEN The validation error names both omitted paths.

Requirement: Complete group passes

The StageGroup model SHALL accept a group whose implementation contains every path in changes in a backtick code span.

Scenario: A group names every changed path

  • WHEN A StageGroup has each path in changes as a backtick code span in its implementation.
  • THEN Validation returns no error for the changed paths.

Existing Tool Considered

No check has run. The body names only the internal roadmap prompt and validation. No open, maintained tool or library covers this need. The change builds its own check in StageGroup. Estimated cost: 15k tokens and 3 hours to build, keep and fix the check.

Key questions

  • Which check produces group-no-files for a task group with no packed files?: _size_problems in plan_check.py produces group-no-files when a task group packs no files. [sources: src/devops_cli/roadmap/plan_check.py:409, src/devops_cli/roadmap/plan_check.py:529]
  • Where must the changed-path code span rule live?: Add a StageGroup model validator that runs before render_change and returns a content fault to the model. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md]
    • Chosen: StageGroup model validator. It rejects a bad group before rendering, and the stage retry can correct the reply.
    • Rejected: render_change. It runs after the model reply and cannot return a structured correction.
    • Rejected: plan_check._size_problems. It detects the fault only after the plan files exist and blocks the plan pull request.
  • What must the stage prompt say about changed paths?: Tell the planner that implementation must name every path in changes in a backtick code span. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]
    • Chosen: State the rule in the stage prompt. The model reads the rule before it writes a task group.
    • Rejected: Rely on validation only. The model gets no instruction and needs more correction retries.
    • Rejected: Rely on the prompt only. A model can still omit a path and block the plan pull request.
  • What counts as naming a path in a code span?: A path counts when a backtick code span contains exactly that path. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage/stage_change.py]
    • Chosen: Exact code span content. It is unambiguous and matches the prompt rule to write every path in a code span.
    • Rejected: Substring match. A longer path can satisfy a shorter path and hide the omission.
    • Rejected: Path with optional line number. It adds a form that the prompt does not state and tests must cover.
  • Should _size_problems keep the group-no-files check?: Keep it as a final guard. Do not remove it. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:409]
    • Chosen: Keep group-no-files. It protects against any packing defect that the schema does not catch.
    • Rejected: Remove it. It would hide a real failure and weaken the plan check.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Prevents a recurring group-no-files failure but does not block all stage work.
    • Value: Medium. Reduces failed plan pull requests and improves stage reliability for users.
    • Effort: Medium. Requires a prompt edit plus a validation rule in StageGroup or render_change.
    • Related: feat(roadmap): stage prompt instructs model to name read files #3978, which asks for a different change. Both target the same prompt file and the same goal of requiring file paths in code spans, but the candidate adds a validation check and focuses on changes paths while 3978 is prompt-only and broader.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. dan-petty commented on Nov 8, 2026

    @dan-petty
    OwnerAuthor

    Pull request #4112 reproduces this problem. The stage planner generated two groups for issue #3296. Group 1 changed src/devops_cli/roadmap/stage/stage_change.py and src/devops_cli/lang/en/messages.py. The task text omitted both paths from backtick code spans. step_files.py packed zero files for Group 1. devops roadmap plan-check 4112 failed with group-no-files.

    Adding both file paths in backtick code spans to task 1.1 resolved the check error. This confirms that the stage prompt and schema must enforce file paths in backtick code spans for implementation tasks.

  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 bfe0192 (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Two searches found no open tool that checks a generated task's text for every changed path in a backtick code span. The need is specific to this project: the StageGroup model, its changes field and the stage prompt. A generic Markdown parser could extract code spans, but the check is a small validator that the project's own model has to hold.

    Tool: none found

    Lacks:

    • A check that every path in changes appears in a code span of implementation
    • A change to the stage prompt in roadmap_stage_change.md
    • A validation error that names each missing path

    Searches run:

    • validate markdown text references file paths in backtick code spans pydantic validator, results: 5
    • markdown-it-py extract inline code spans python library, results: 5

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

  8. added
    owner/service
    on Nov 18, 2026
  9. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Plan state: branch feat/4025-enforce-that-tasks-name-every-changed, draft pull request #6280. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.

    The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:

    1. Refuse a plan whose group omits a changed path: 49280 tokens
    2. Name both changed paths in the shared plan builder: 14917 tokens
    3. State the changed-path rule in the stage prompt: 32728 tokens
    4. Name the changed paths in the first three good stage plans: 18466 tokens
    5. Name the changed paths in the other three good stage plans: 31245 tokens
    6. Name the changed paths in the staged compare case: 21728 tokens
  10. 13 remaining items

  11. added
    status/planned
    owner/service
    status/in-progress
    and removed
    status/ready
    status/planned
    on Nov 18, 2026
  12. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Owner question: The step "group 1" stopped with a plan defect: the plan does not hold. Amend the plan or split the item?

    Options

    1. Amend the plan: A person amends the plan and runs the item again.
    2. Split the item: A person splits the item and plans each part again.

    Recommendation: Amend the plan: the step follows the plan, so a step that cannot follow it names a defect of the plan.

    Evidence

  13. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: plan_defect.
    Action taken: none.
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 7128141/53147 -

    Reason:

    The agent asked for a scope change: Task 2.1's census `uv run devops ci test tests/roadmap` cannot pass. The content rule of group 1 refuses every task group whose `implementation` names a path of `changes` in no code span, and about 150 tests in some 40 modules of `tests/roadmap/stage` build their own `StageProposal` whose group omits a changed path. No group of the plan changes those modules, and the 5-path cap of a group means the plan needs new groups for them.. Evidence: With the helper of task 1.2 and the builder edit of task 2.1 applied, `uv run devops ci test tests/roadmap/stage` gives 150 failed and 2925 passed, and 171 lines name the new message; without the builder edit the same run gives 547 failed. The failing modules include `tests/roadmap/stage/test_roadmap_stage_content.py` (an exact problem count of 1), `test_roadmap_stage_plan.py`, `test_roadmap_stage_self_acceptance.py` (the #3972 plan names 2 of its 3 changed paths), `test_roadmap_stage_manifest.py`, `test_roadmap_stage_class_claim.py`, `test_roadmap_stage_security.py`, `test_roadmap_stage_apply.py`, `test_roadmap_stage_split_gates.py` and `test_roadmap_stage_eval_gates.py` (the seven recorded good plans).
    

    Last message of the agent (a claim that no check verified): I reverted the work because the plan cannot pass its own census. Here is what I found. What I did (then reverted, as a plan-request keeps no file): - Wrote tests/roadmap/stage/test_roadmap_stage_group_paths.py with test_one_omitted_path, test_two_omitted_paths, test_every_changed_path_named and test_the_plan_of_this_change_passes_the_content_rule. On the base the first two failed for the right reason (content_problems gave no problem for the omitted path); the plan-of-this-change literal was clean. - Added _changed_path_span_problems to src/devops_cli/roadmap/stage/stage_change.py, the message stage_implementation_missing_paths to src/devops_cli/lang/en/messages.py, and the call in content_problems. uv run devops ci test tests/roadmap/stage/test_roadmap_stage_group_paths.py then passed (4 passed). - Applied the builder edit of group 2 to measure the census. uv run devops ci test tests/roadmap/stage gave 547 failed without it and 150 failed with it; 171 lines name the new message. The failures span about 40 modules that no group of the plan changes (for example tests/roadmap/stage/test_roadmap_stage_content.py asserts an exact problem count, test_roadmap_stage_self_acceptance.py replays the #3972 plan that names 2 of its 3 changed paths, and test_roadmap_stage_eval_gates.py replays the seven recorded good plans). So task 2.1's verification (uv run devops ci test tests/roadmap passes) cannot hold, and the plan has no group that may

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  14. added
    status/blocked
    and removed
    status/in-progress
    owner/service
    on Nov 18, 2026
  15. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

  16. dan-petty commented on Nov 24, 2026

    @dan-petty
    OwnerAuthor

    Amend the plan.

  17. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Triage under #6519 (owner instruction of 2026-11-30). A prompt rule and a validation for the stage job are incremental plan-shape work; the check group-no-files now lives in src/devops_cli/roadmap/plan_check.py and the stage runs on stock Coder. If the failure still shows in graded attempts, file a new item from that evidence. Closed as not planned.

  18. removed
    status/blocked
    on Nov 30, 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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions