Repository navigation
Description
Problem or Motivation
devops roadmap stage creates OpenSpec change folders under openspec/changes/<issue>-<slug>/.
devops openspec archive modifies living specifications under openspec/specs/.
An implementation step (devops roadmap implement) executes the task groups of a staged plan.
An implementation group must never change or create any file under openspec/.
Currently, path restrictions under openspec/ were discovered and patched piecemeal:
- Issue fix(roadmap): stage allows task groups that edit openspec change folders #3285 addressed task groups editing
openspec/changes/. - Issue fix(roadmap): stage allows task groups that edit living specs #3295 addressed task groups editing
openspec/specs/.
When the stage planner formulated the plan for #3295, it assumed that openspec/changes/ was valid for task groups to edit, creating test scenarios asserting success for openspec/changes/... in changes, which contradicted the rules established in #3285.
Furthermore, the stage probe does not enforce a unified check ensuring that all paths under openspec/ are forbidden in changes and creates.
Proposed Solution & Architectural Design
- In
src/devops_cli/roadmap/stage_change.py, generalizeStageGrouppath validation so that any path equal toopenspecor beginning withopenspec/is rejected inchangesandcreates. - In
src/devops_cli/roadmap/stage_paths.py, ensurepath_problemsreports any path underopenspec/listed inchangesorcreates, so recorded plans evaluated offline without schema validation are consistently rejected. - Update
src/devops_cli/ai/tasks/roadmap_stage_change.mdto instruct the stage planner that an implementation group must never change or create any file underopenspec/, because OpenSpec files are managed bydevops roadmap stageanddevops openspec archive. - Add unit tests asserting that both
StageGroupandpath_problemsreject any write underopenspec/while allowing reads underopenspec/specs/andopenspec/changes/.
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
StageGroup model validators and path_problems in stage_paths.py are the existing validation layer. No external tool applies to repository-specific OpenSpec path governance. Cost to build: about 4,000 output tokens and 30 minutes. The change consolidates path prefix rules and deletes redundant checks.
Standards Compliance
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
- I am willing to submit a pull request implementing this feature with accompanying tests.
Source: #3316
Proposed design
Problem statement
The stage probe does not enforce one rule for paths under openspec/. Earlier fixes covered openspec/changes/ and openspec/specs/ in separate changes. A plan can still list a write under openspec/. This change rejects every write under openspec/ in the model and in the offline path check, and it tells the planner the rule.
Acceptance criteria
Requirement: Reject the openspec folder as a change
StageGroup SHALL reject a changes path that equals openspec.
Scenario: A group changes the openspec folder
- WHEN A stage reply lists
openspecinchanges. - THEN Validation fails with an error that names
openspec.
Requirement: Reject paths under openspec in changes and creates
StageGroup SHALL reject every changes or creates path that begins with openspec/.
Scenario: A group writes a file under openspec
- WHEN A stage reply lists
openspec/changes/3358-guard/specs/roadmap/spec.mdinchangesand increates. - THEN Validation fails with an error that names the path.
Requirement: Allow reads under openspec
StageGroup SHALL allow a reads path under openspec/specs/ or openspec/changes/.
Scenario: A group reads the specs and changes
- WHEN A group lists
openspec/specs/roadmap/spec.mdandopenspec/changes/3358-guard/proposal.mdinreads, and listssrc/devops_cli/roadmap/stage_paths.pyinchanges. - THEN Validation succeeds.
Requirement: Report openspec writes in the offline path check
path_problems SHALL report every changes or creates path that equals openspec or begins with openspec/.
Scenario: A recorded plan writes under openspec
- WHEN A recorded group lists
openspec/specs/roadmap/spec.mdinchangesandcreates, and the staged tree holds that file. - THEN
path_problemsreturns a problem that names the path.
Requirement: Tell the planner to write nothing under openspec
The stage prompt MUST tell the planner that an implementation group never changes or creates a file under openspec/.
Scenario: The stage prompt states the write rule
- WHEN A test reads
src/devops_cli/ai/tasks/roadmap_stage_change.md. - THEN The text states that a group must never change or create any file under
openspec/.
Existing Tool Considered
No alternatives check has run. No open, maintained tool covers repository-specific OpenSpec path governance. The change extends the repository's own validation in src/devops_cli/roadmap/stage_change.py and src/devops_cli/roadmap/stage_paths.py. Written cost: about 4,000 output tokens and 30 minutes to build, keep and fix this code.
Key questions
- Where must the stage layer reject writes under
openspec/?: Reject them in both theStageGroupmodel validator andpath_problems. The model validator corrects a new reply.path_problemsalso judges a recorded plan thatmodel_constructbuilt without schema validation. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, openspec/changes/3285-stage-allows-task-groups-that-edit/design.md:5, openspec/changes/3285-stage-allows-task-groups-that-edit/design.md:15]- Chosen: Both
StageGroupandpath_problems. The model validator corrects new replies.path_problemscovers recorded plans built withmodel_construct. - Rejected:
StageGroupvalidator only. A recorded plan built withStageGroup.model_constructskips the validator. - Rejected:
path_problemsonly. The model gets no early correction and the schema check is weaker.
- Chosen: Both
- Which path fields does the rule cover?: Cover
changesandcreatesonly. Keepreadsallowed, because a group may readopenspec/specs/andopenspec/changes/. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]- Chosen:
changesandcreatesonly. These fields declare writes. The issue asks to reject writes and allow reads. - Rejected: All path fields. It would stop a group from reading the specs and changes that it needs.
- Rejected:
changesonly.createsis a write list and would remain unguarded.
- Chosen:
- How does the code identify a path under
openspec/?: Use one predicate that accepts the pathopenspecor a path that starts withopenspec/. Use it in the model validator and inpath_problems. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]- Chosen: One prefix predicate. It covers the folder and every descendant, and both checks use one rule.
- Rejected: List
openspec/changes/andopenspec/specs/. A future folder underopenspec/would stay open. - Rejected: A regular expression for each path. It adds a second rule that can drift from the model validator.
- Which test modules hold the new cases?: Extend
tests/roadmap/test_roadmap_stage_kind.pyforStageGroupandtests/roadmap/test_roadmap_stage_paths.pyforpath_problems. Add no new test module. (best practice) [sources: tests/roadmap/test_roadmap_stage_kind.py, tests/roadmap/test_roadmap_stage_paths.py, openspec/changes/3285-stage-allows-task-groups-that-edit/design.md:20]- Chosen: Extend the two existing modules. They already test
StageGroupandpath_problems. - Rejected: Create
tests/roadmap/test_stage_change.py. The staging commit holds no such file, and the existing modules cover the same code.
- Chosen: Extend the two existing modules. They already test
- How does the planner learn the rule?: Add one rule to
src/devops_cli/ai/tasks/roadmap_stage_change.md: an implementation group must never change or create any file underopenspec/, becausedevops roadmap stageanddevops openspec archivemanage those files. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, CONTEXT.md]- Chosen: Add the rule to the stage prompt. The planner reads this prompt and must know the rule before it writes groups.
- Rejected: Rely on the validators only. The model would keep producing refused replies and waste a round.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 3, 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 consolidates existing piecemeal fixes and prevents future gaps but does not block a current failure.It prevents future path-restriction gaps and removes redundant checks, but the individual paths are already covered.The body states about 4,000 output tokens and 30 minutes of work.Both restrict task-group writes under openspec/; #3295 covers only openspec/specs/ while the candidate covers every path under openspec/ and also updates the planner prompt and path_problems.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at e5b8191 (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
dan-petty commentedon Nov 4, 2026
This item closes as not planned. Its parts are delivered, and its blanket rule is wrong.
Delivered:
openspec/specs/:_no_living_specatsrc/devops_cli/roadmap/stage_change.py:317.openspec/changes/:_change_folder_problemsatstage_change.py:368andpath_problemsatsrc/devops_cli/roadmap/stage_paths.py:211.src/devops_cli/ai/tasks/roadmap_stage_change.mdtell the planner both rules. Reads under these folders stay allowed.Why the blanket rule is wrong: a task group can validly change
openspec/config.yaml. Group 3 ofopenspec/changes/3320-a-plan-that-deletes-a-guard/tasks.md:25does so.stage_change.py:100also listsopenspec/as a path with no spec delta. So the requirements on the pathopenspecand on every other path underopenspec/are dropped.One case has a limit.
path_problemsreportsopenspec/changes/and does not reportopenspec/specs/. A direct call on a group thatmodel_constructbuilt returned no problem foropenspec/specs/roadmap-stage/spec.md. This does not change a result today. A live reply goes through the validator. The replay adds the schema refusal to the problems of a recorded plan (_group_of,src/devops_cli/roadmap/stage_eval_gates.py:124). If a new caller ofpath_problemsneeds this case, file it with that caller as evidence.The stage comment of 2026-11-03T17:32Z gave the evidence
placeholder, which proves nothing. The code above is the evidence. This item has no change folder and no parent issue, so no cleanup is necessary.