Repository navigation
Description
Problem Description
The stage job pushes change branches with task groups that pack no files.
In src/devops_cli/roadmap/stage/stage.py, the _settle method measures the task groups with measure_groups. The method checks if any group exceeds roadmap.stage.step_tokens. It does not check if a group packs zero files.
In contrast, devops roadmap plan-check enforces the group-no-files gate in src/devops_cli/roadmap/plan_check.py:392-394. A group that changes existing files without citing them in code spans packs zero files. The stage job creates a draft pull request that immediately fails CI Plan Check. Also, the implement job then starts the step without the files that the task changes.
Reproduction Steps
- Create a plan proposal where a task group changes an existing file without naming that file in a backticked code span in the task text.
- Run
devops roadmap stageon the item. - Observe that
stagecommits and pushes the branch and opens a draft pull request. - Run
devops roadmap plan-check <pr>or observe the CIPlan Checkjob. - See
group-no-fileserror on that group.
Expected vs Actual Behavior
Expected: stage refuses the proposal during gating when a group has zero packed files and changes existing files. The job asks the planner model again to cite the files.
Actual: stage accepts the proposal, pushes the branch, and opens a pull request that fails CI.
Proposed Solution
In src/devops_cli/roadmap/stage/stage.py, add a gate check in _settle (and _fit):
Refuse the proposal when any measured group satisfies item.files == 0 and not set(item.group.changes) <= set(item.group.creates). Return _Refused with texts.plan_check_group_no_files to prompt the model to cite the files in task code spans.
Environment Diagnostics
- DevOps CLI Version: 0.79.0
- Python Version: 3.14.10
- Execution Environment: Roadmap Service / CI
Proposed design
Problem statement
The stage job measures task groups but does not enforce the group-no-files gate. A group can change an existing file without citing it in a code span. Stage then pushes a draft pull request that fails CI Plan Check. The implement job also starts without the files that the task changes. The fix refuses that proposal during stage gating and asks the planner to cite the files.
Acceptance criteria
Requirement: Refuse a group that packs no existing file
The stage job SHALL refuse a measured group when files == 0 and its changes are not a subset of its creates.
Scenario: Existing file not cited
- WHEN a measured group has
files == 0and changes a path that it does not create. - THEN
_settlereturns_RefusedwithMESSAGES.roadmap.plan_check_group_no_files.
Requirement: Accept a group that only creates files
The stage job SHALL accept a measured group when files == 0 and every changed path is also a created path.
Scenario: Pure create group
- WHEN a measured group has
files == 0andset(group.changes) <= set(group.creates). - THEN
_settledoes not return_Refusedfor the no-files rule.
Requirement: Refuse before a split
The stage job SHALL refuse a no-files group in _fit before it asks for a split.
Scenario: No-files group also over budget
- WHEN a measured group has
files == 0, changes an existing file, and exceeds the budget. - THEN
_fitreturns_Refusedbefore it callsask_split.
Requirement: Check the groups that a split returns
The stage job SHALL apply the no-files gate to the final measured groups after a split.
Scenario: Split group changes an existing file
- WHEN
_fitreplaces the groups and a returned group hasfiles == 0and changes a path that it does not create. - THEN
_settlereturns_RefusedwithMESSAGES.roadmap.plan_check_group_no_files.
Requirement: Return the refusal to the planner once
The stage job SHALL send one no-files refusal back to the planner and stop on a second refusal.
Scenario: Second no-files reply
- WHEN the planner returns a second proposal with a group that has
files == 0and changes a path that it does not create. - THEN
_gatedraisesRoadmapStageErrorand writes no branch.
Requirement: Use the plan-check rule and message
The stage job SHALL use the same no-files predicate and message as devops roadmap plan-check.
Scenario: Plan-check and stage agree
- WHEN plan-check and stage judge the same group with
files == 0and changes outside its creates. - THEN both report
MESSAGES.roadmap.plan_check_group_no_files.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need: group-no-files is an internal invariant of this project, already enforced by src/devops_cli/roadmap/plan_check.py:392-394. The change reuses that rule and its message. It builds no new checker, so there is no build cost.
Key questions
- Which existing gate does plan-check enforce for a group that packs no files?: Plan-check enforces
group-no-filesatsrc/devops_cli/roadmap/plan_check.py:392-394and reportsMESSAGES.roadmap.plan_check_group_no_files. [sources: src/devops_cli/roadmap/plan_check.py:392-394] - Where does the stage job measure the final task groups?:
_Planner._settlecalls_fit;_fitcalls_build, which callsmeasure_groups, and it returns the final measured groups after any split. [sources: src/devops_cli/roadmap/stage/stage.py] - Which condition identifies a group that packs no files and changes an existing file?: The condition is
measured.files == 0andnot set(measured.group.changes) <= set(measured.group.creates). [sources: src/devops_cli/roadmap/plan_check.py:392-394, src/devops_cli/roadmap/stage/stage_change.py] - Where should the stage job check the no-files condition?: Check in
_fitafter the first measure and before a split, and check the final measured groups in_settleafter_fit. The first check avoids a split that cannot add a citation, and the second check covers the groups that a split returns. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/plan_check.py:392-394]- Chosen: Before a split in
_fitand after_fitin_settle. The first check avoids a split that cannot fix the citation, and the second check covers split groups. - Rejected: Only after
_fitin_settle. A group that is also over budget gets a split call before the refusal. - Rejected: Only before the split in
_fit. A split can return a zero-file group that would escape the gate.
- Chosen: Before a split in
- Should stage and plan-check share the no-files predicate?: Put the predicate in one helper in
stage_change.pyand call it from both stage and plan-check. UseMESSAGES.roadmap.plan_check_group_no_filesfor both. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/roadmap/plan_check.py:392-394]- Chosen: One shared helper in
stage_change.py. One condition and one message cannot drift between the two gates. - Rejected: Duplicate the predicate in
stage.py. Two copies can diverge when either gate changes. - Rejected: Keep plan-check unchanged and add a separate stage check. It creates a second copy of the same rule.
- Chosen: One shared helper in
- How does a stage refusal reach the planner?:
_gatedsends one_Refusedreply back to the model with the problem, and a second refusal raisesRoadmapStageError. [sources: src/devops_cli/roadmap/stage/stage.py] - Which tests cover the stage measure and the plan-check gate?:
tests/roadmap/stage/test_roadmap_stage_measure.pycoversmeasure_groups, andtests/roadmap/test_roadmap_plan_check.pycovers the plan-check gate. [sources: tests/roadmap/stage/test_roadmap_stage_measure.py, tests/roadmap/test_roadmap_plan_check.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-09: none.
Tool: none found.
Activity
devops-cli-service commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The defect wastes CI runs and breaks the implement step, but it has a workaround and no data loss.The gate stops broken draft pull requests and empty implement steps for one plan defect.The change adds one check and one refusal text in two methods of one file.Both add a stage gate on the files that a task group names, but item 3446 checks the group lists and the candidate checks zero packed files.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 682d206 (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Alternatives check: none
Reason: Searches for an external plan-validation or lint tool that checks whether a plan's task groups cite the files they change returned only unrelated validation and file-API pages. The closest maintained candidate, OpenSpec, is the project's own spec/change-proposal layer and validates proposal structure only, so nothing outside this repository enforces the
group-no-filesrule thatplan_check.pyalready implements and thatstagemust reuse.Tool: none found
Lacks:
group-no-filesrule that a task group changing an existing file must cite it in a code spanplan_check_group_no_filesmessage with this repository'splan_check.py, which is internal codeTools considered:
Searches run:
Sources:
Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.
feat(roadmap): run the plan checks before the stage push (#5416)
dan-petty commentedon Nov 13, 2026
Closed as superseded by #5416 (
feat(roadmap): run the plan checks before the stage push, release v0.129.0, live on the roadmap Service since 2026-11-13 14:23Z).The stage job now runs all the rules of
devops roadmap plan-checkon the files that it writes, before the push (_file_findingsand_plan_checkinsrc/devops_cli/roadmap/stage/stage.py). The rulegroup-no-filesis one of these rules. A plan that a rule refuses goes back to the planner model, as a refusal of any other gate does. So the stage job no longer pushes a plan that CIPlan Checkrefuses forgroup-no-files.If a plan PR from the stage job fails
Plan Checkwithgroup-no-filesafter v0.129.0, file a new bug and link that PR.