Repository navigation
Description
Problem or Motivation
devops roadmap stage measures task group token consumption from the files that a group reads (Reads:) and estimated created lines. It sets no limit on the number of files that a group changes (Changes:). When one task group changes many files across different subsystems, an implementation step can exhaust its token budget. For example, issue #3654 group 3 changed 7 files across CLI commands, configuration constants, language catalogs, Kubernetes controller modules, tests, and user documentation. The implement runner hit its 8,000,000 token budget limit and stopped as blocked.
Proposed Solution & Architectural Design
Add a check in src/devops_cli/roadmap/stage/stage_change.py that bounds the number of changed files in one task group:
- A task group allows at most 4 files in
Changes:. - When a task group has more than 4 files in
Changes:,stageasks the model to split the group into smaller task groups. - Alternatively, documentation files (such as
k8s/README.mdordocs/) that follow a new command must live in a separate follow-up group.
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
No open tool manages OpenSpec task group file sizing. This change adds a small bound check in stage_change.py: 1,000 tokens to build, 100 each quarter to keep, and 15 minutes.
Alternatives check of 2026-11-09: none.
Tool: none found.
Proposed design
Problem statement
The stage job bounds the tokens that a task group reads and the lines that it creates. It sets no bound on the number of files that the group changes. A group with 7 files exhausted the implement token budget. The change adds a group-files gate that refuses a group over 5 changed files, except a prefix move, and it states the rule in the staging prompt and the roadmap workflow document.
Acceptance criteria
Requirement: Group file limit
The plan check SHALL refuse a task group that lists more than 5 paths in its changes, unless the group is a prefix move.
Scenario: A group over the limit
- WHEN
check_gatesjudges a plan whose second group lists 6 paths inchangesand is no prefix move. - THEN The
group-filesgate holds one sentence for that group.
Requirement: Group at the limit
The plan check SHALL accept a task group that lists 5 paths in its changes.
Scenario: A group at the limit
- WHEN
check_gatesjudges a plan whose every group lists 5 paths inchanges. - THEN The
group-filesgate holds no sentence.
Requirement: Prefix move exemption
The plan check SHALL accept a task group whose changes holds only the old modules of one prefix move and the modules that the group creates.
Scenario: A prefix move over the limit
- WHEN
check_gatesjudges a plan whose group moves 5 modules and lists those 5 old paths and 5 new paths inchanges. - THEN The
group-filesgate holds no sentence.
Requirement: Prefix move with an extra file
The plan check SHALL refuse a group that moves a prefix and also changes a path outside the move when the group lists more than 5 paths.
Scenario: A prefix move with an extra document
- WHEN
check_gatesjudges a plan whose group moves 5 modules and also changesdocs/ROADMAP_WORKFLOW.md. - THEN The
group-filesgate holds one sentence for that group.
Requirement: Refusal text
The refusal SHALL name the number of the group, its title and the number of paths that it changes.
Scenario: The refusal names the group
- WHEN A group titled
Wire the checklists 6 paths inchangesand is no prefix move. - THEN The sentence holds
2,Wire the checkand6.
Requirement: Split reply
A split reply SHALL obey the same file limit as the first reply.
Scenario: A split that keeps a large group
- WHEN The model's split reply holds a group that lists 6 paths in
changesand is no prefix move. - THEN The check returns one
group-filessentence for that group.
Requirement: Staging prompt
The staging prompt SHALL state the limit of 5 files in Changes:, the prefix-move exemption and the instruction to split a larger group.
Scenario: The prompt states the limit
- WHEN The prompt-rule test reads
src/devops_cli/ai/tasks/roadmap_stage_change.md. - THEN The prompt holds the limit of 5 files, the prefix-move exemption and the split instruction.
Requirement: Workflow document
The roadmap workflow document SHALL state the limit of 5 files in Changes:, the prefix-move exemption and the split of a larger group.
Scenario: The stage section states the limit
- WHEN
git grepreads the stage section ofdocs/ROADMAP_WORKFLOW.md. - THEN It finds the limit of 5 files, the prefix-move exemption and the split instruction.
Existing Tool Considered
The alternatives check found no open, maintained tool or library that bounds the files in a task group of an OpenSpec plan. The change builds its own code: about 1,000 tokens to build, 100 tokens each quarter to keep and fix, and 15 minutes.
Key questions
- How many files may one task group change?: At most 5 files in
Changes:, unless the group is a prefix move. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/roadmap/stage/stage_eval_gates.py]- Rejected: 4 files. It refuses two accepted plans with a 5-path
othergroup and one accepted prefix move with 10 paths. - Chosen: 5 files. It accepts the 5-path accepted plans and refuses the reported 7-file behavior group.
- Rejected: 10 files. It accepts the reported 7-file group, so the token failure stays possible.
- Rejected: 4 files. It refuses two accepted plans with a 5-path
- How does the gate treat a prefix move?: It exempts a group whose
changesholds only the old modules of one prefix move and the modules that the group creates. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]- Rejected: Count every path. It refuses the accepted 10-path prefix move.
- Rejected: Exempt any group that moves a module. A move with extra files escapes the limit.
- Chosen: Exempt only a group that holds the old and new modules of one move. It keeps the accepted move and bounds extra work.
- Which gate reports the limit?: A new
ProposalGate.GROUP_FILESgate, with the namegroup-files. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/roadmap/stage/stage_eval_gates.py]- Rejected: Extend the
pathsgate. Thepathsgate judges the files of the commit, not the size of a group. - Chosen: A new
group-filesgate. The name tells a person which rule refused a plan, and the replay reports it.
- Rejected: Extend the
- Is the limit a setting or a module constant?: A module constant,
MAX_GROUP_CHANGES = 5, instage_change.py. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Module constant. The plan-check rules are constants today.
- Rejected: Setting
roadmap.stage.group_files. A setting needs a live ConfigMap change and a restart.
- Must the staging prompt and the roadmap workflow document state the limit?: Yes. The prompt and the stage section of
docs/ROADMAP_WORKFLOW.mdstate the limit of 5, the prefix-move exemption and the split instruction. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py, docs/ROADMAP_WORKFLOW.md]- Chosen: State the limit in both. The model avoids the refusal, and a person reads the rule.
- Rejected: Let the refusal teach the rule. The refusal costs a model call and a second reply for each item.
- Does a split reply obey the same file limit?: Yes. The check applies the same
group-filesrule to each group of a split reply. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen: Apply the limit to split replies. A split cannot keep a group over the limit.
- Rejected: Apply the limit only to the first reply. The split can return the same large group.
- Does a separate follow-up group for documentation replace the file limit?: No. The count bound covers every kind of file, and the prefix-move exemption covers a move. A separate rule would forbid a group that documents its own change. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]
- Chosen: Count bound. One rule bounds every kind of file.
- Rejected: Move documents to a follow-up group. It forbids a group that documents its own change in one file, and it bounds no code file.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It prevents a known token-budget failure but does not block a release or fix a crash.It stops a class of blocked implement runs caused by oversized task groups.The body states a 15-minute bound check in one file.Both add a stage gate on task-group file properties, but #3965 rejects zero-file groups while this candidate caps groups at four changed files.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 1f03ee3 (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Alternatives check: none
Reason: Two searches found no open tool that bounds the number of files a task group changes in an OpenSpec plan; the results were unrelated web-API pages. The need is a project-specific gate in
stage_change.pythat fits the repo's own plan format and its refusal-and-split loop, so no external tool covers it.Tool: none found
Lacks:
Searches run:
Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 14, 2026
The item cannot be built as specified. A hard limit of 4 paths in
Changes:refuses a plan that the stage job must accept.Changes:of one group:src/devops_cli/ai/tasks/roadmap_stage_change.md:31anddocs/ROADMAP_WORKFLOW.md:99.tests/fixtures/roadmap_eval/stage/3372-the-stage-plan-of-a-module/plan.jsonhas one group with 10 changed paths. WithMAX_GROUP_CHANGES = 4, the gategroup-filesrefuses it, sotests/roadmap/stage/test_roadmap_stage_negative_search.py::test_a_negative_search_whose_recorded_hit_survives_is_acceptedand 12 other stage tests fail.good-3264-the-stage-marks-a-plan-readyandgood-3410-the-stage-gate-proves-a-negativeeach hold a 5-pathothergroup.Local result with the gate added:
uv run pytest tests/roadmap/stage -qgave 13 failed, 2816 passed.Amendment for refinement: exempt a group whose paths are the modules of one prefix move, or bound only the source files that are not moved, or raise the limit to 10. The count of changed paths alone cannot separate the reported 7-file behavior group from a legitimate prefix move.
devops-cli-service commentedon Nov 14, 2026
Status set to Ready at 7eda155 (see proposed design in issue body).
feat(roadmap): stage limits changed files per task group (#3995)
devops-cli-service commentedon Nov 16, 2026
Released in v0.162.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.162.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 11:49 UTC