Repository navigation
Description
Problem or Motivation
The roadmap stage job creates the OpenSpec change proposal folder under openspec/changes/<issue>-<slug>/.
The task groups of the plan describe subsequent implementation steps executed by devops roadmap implement.
The implementation steps modify source code under src/, test suites under tests/, and documentation under docs/.
Implementation steps must never create or edit OpenSpec change proposal documents in openspec/changes/ because the change proposal is already written before implementation starts.
In PR #3225 (issue #3060), the stage model generated a redundant task group titled Write the change documents, listing paths under a hallucinated directory openspec/changes/3060-model-tier-ladder/.
Neither StageGroup in src/devops_cli/roadmap/stage_change.py nor check_proposal in src/devops_cli/roadmap/stage_eval_gates.py caught this defect.
Because the group listed the paths in creates, the path validator in src/devops_cli/roadmap/stage_paths.py allowed nonexistent paths under openspec/changes/.
Proposed Solution & Architectural Design
- Add a validator to
StageGroupinsrc/devops_cli/roadmap/stage_change.pythat rejects any group whosechangesorcreatescontains paths starting withopenspec/changes/. - Add a path check in
src/devops_cli/roadmap/stage_paths.pythat refusescreatesentries underopenspec/changes/. - Update
src/devops_cli/ai/tasks/roadmap_stage_change.mdto instruct the stage planner that an implementation group must never change or create files underopenspec/changes/. - Add a unit test in
tests/roadmap/test_stage_change.pyconfirming thatStageGrouprejects paths underopenspec/changes/.
Target Subsystem
src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/ai/tasks/roadmap_stage_change.md
Existing Tool Considered
_repository_path and StageGroup model validators are the existing validation layer in stage_change.py. Adding the path prefix check prevents invalid change folder tasks without adding external dependencies. Cost to build: about 5,000 tokens and 30 minutes.
Proposed design
Problem statement
The stage planner can write a task group that changes or creates files under openspec/changes/. The current StageGroup and check_proposal checks accept those paths. The fix rejects such groups, adds the rule to the prompt, and covers it with tests.
Acceptance criteria
Requirement: Stage group refuses change-folder paths
A StageGroup SHALL reject a path in changes or creates that is openspec/changes or starts with openspec/changes/.
Scenario: Change path in a task group
- WHEN a
StageGroupsetschangestoopenspec/changes/3060-model-tier-ladder/proposal.md - THEN validation fails and the error names that path
Requirement: Stage group allows change-folder reads
A StageGroup SHALL allow a path under openspec/changes/ in reads.
Scenario: Read a change document
- WHEN a
StageGroupsetsreadstoopenspec/changes/3060-model-tier-ladder/proposal.mdand changessrc/devops_cli/roadmap/stage_change.py - THEN validation succeeds
Requirement: Proposal check reports a change-folder path
check_proposal SHALL return a problem for a group that changes or creates openspec/changes or a path under openspec/changes/.
Scenario: Recorded plan edits a change file
- WHEN
check_proposalruns on a group built without validation that createsopenspec/changes/3060-model-tier-ladder/proposal.md - THEN the problems name the group and the path
Requirement: Stage prompt forbids change-folder edits
The roadmap stage prompt SHALL tell the planner that an implementation group must not change or create a path under openspec/changes/.
Scenario: Prompt states the rule
- WHEN the prompt file is read
- THEN it contains a sentence that names
openspec/changes/and forbids the change or creation
Requirement: Roadmap stage tests cover the rule
The roadmap stage tests SHALL cover the rejection in StageGroup and in check_proposal.
Scenario: Roadmap stage tests run
- WHEN the roadmap stage tests run
- THEN they pass and include a case for
openspec/changes/3060-model-tier-ladder/proposal.md
Existing Tool Considered
No alternatives check has run. The existing validation layer, _repository_path and the StageGroup model validators in src/devops_cli/roadmap/stage_change.py, covers the need. No external library applies. Cost to build, keep and fix: about 5,000 tokens and 30 minutes.
Key questions
- Which functions check a stage plan today?:
StageGroupmodel validators check the reply, andcheck_proposalcallspath_problemsandform_problems. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_eval_gates.py] - Where should the stage job refuse a task group that changes or creates a path under
openspec/changes/?: Refuse it in both theStageGroupmodel validator andpath_problems;check_proposalcallspath_problems. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_eval_gates.py]- Rejected: StageGroup validator only. A recorded plan can build a group with
model_constructand skip the schema. - Rejected: path_problems only. The model gets no correction before the job checks the plan.
- Chosen: Both checks. The validator corrects the reply early, and the path gate also judges recorded plans.
- Rejected: StageGroup validator only. A recorded plan can build a group with
- Which path fields should the rule refuse?: Refuse
changesandcreates; allowreads, task text andverifyunless another check refuses the path. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]- Rejected: All path fields. A task text or a command can name a change document to read, and the check cannot tell a read from a write.
- Rejected: creates only. A group can change an existing change file and create no path.
- Chosen: changes and creates. These fields declare the files that the implementation step writes.
- How should the rule treat the
openspec/changesfolder itself?: Refuseopenspec/changesand every path underopenspec/changes/. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]- Rejected: Prefix only. A group could change the folder itself and avoid the prefix check.
- Chosen: Exact folder and prefix. The constant
_CHANGES_DIRECTORYnames the folder, and a write to it is a change-folder write.
- Where should the tests for the rule live?: Add
StageGroupcases totests/roadmap/test_roadmap_stage_form.py, path cases totests/roadmap/test_roadmap_stage_paths.py, and the prompt case totests/roadmap/test_roadmap_stage_prompt_rules.py. (best practice) [sources: tests/roadmap/test_roadmap_stage_form.py, tests/roadmap/test_roadmap_stage_paths.py, tests/roadmap/test_roadmap_stage_prompt_rules.py]- Rejected: New tests/roadmap/test_stage_change.py. The repository already groups StageGroup and path cases in the existing stage test modules.
- Chosen: Existing stage test modules. They hold the nearest cases and run in the same suite.
- How should the prompt state the rule?: Add one bullet under the path rules that says an implementation group must not change or create a path under
openspec/changes/. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen: Add a separate path-rule bullet. The model reads the path rules as a list, and a separate bullet is easy to test.
- Rejected: Add the sentence to the
changeskey description. The model can miss a rule inside a key description. - Rejected: Add the sentence to the feasibility rule. The rule is not about feasibility.
- What message should the validator and the path check give?: Add one message key
stage_bad_change_paththat names the path and says a task group must not change or create a path underopenspec/changes/. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]- Rejected: Reuse
stage_bad_path. That message says the path is not a repository path, which is false. - Chosen: Add
stage_bad_change_path. The message states the real rule and names the path.
- Rejected: Reuse
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.A real plan (PR #3225) produced an invalid group, but the defect is contained to one generated plan and does not break builds.Prevents a class of invalid stage plans that would mislead the implement step, but affects only plans touching openspec/changes paths.The body estimates about 5,000 tokens and 30 minutes for a prefix check, a model-prompt line, and one unit test.Both add path validation in stage_change.py for task groups, but 3010 rejects nonexistent paths while the candidate rejects a specific forbidden prefix (openspec/changes/).devops-cli-service commentedon Nov 3, 2026
Status set to Ready at 2eede7c (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
fix/3285-stage-allows-task-groups-that-edit, draft pull request #3311. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
The plan run made 3 model request(s), and used 227992 input tokens and 15231 output tokens. The model made no tool call.
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat group 1: The new validator refuseschangesandcreatespaths underopenspec/changes/. The existingREPORTfixture uses such paths and feeds passing tests. The group does not update the fixture, so its own verify command fails. Evidence: ""changes": ["openspec/changes/2162-x/mutation-report.md"],"otherat group 1 and group 2: Both groups need the new message text in the roadmap texts thatMESSAGESserves. No group lists that file inchanges. The step cannot edit an unlisted file, so the message key stays undefined. Evidence: "Add the message text to the roadmap texts thatMESSAGESserves"docs(openspec): plan #3285 Refuse task groups that write change files
docs(openspec): plan #3285 Refuse task groups that write change files (…
devops-cli-service commentedon Nov 4, 2026
Released in v0.53.5: https://github.com/dan-petty/devops-cli/releases/tag/v0.53.5
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 04:25 UTC