Repository navigation
Description
Problem or Motivation
The plan in PR #3278 (for #2441) held three defects that no gate refused, and a reviewer found them by reading:
- Its group 3 is the task "Write the proposal, design, tasks and spec delta of the change in
openspec/changes/2441-loki-monolithic-mode-and-no-memcached-service-account/". The plan is that folder, and it already existed under another name,2441-loki-values-name-the-monolithic-deployment. TheImpactsection also listed the files of the plan as theCodeandDocumentsthat the change touches. - A spec scenario says that
_loki_modecallspytest.failonSingleBinary, and no task adds a test for that. The rules ofopenspec/config.yamlsay that a scenario is one that a test undertests/can assert. - A comment in
tests/commands/k8s/test_k8s.pythat namesSingleBinarywas left out of the tasks, although the plan's own search (references SingleBinary, 4 files) listed it.
The premise of the plan was right (helm template of chart 20.0.2 gives the same render for SingleBinary and Monolithic, and memcached.enabled: false drops only loki-memcached).
Proposed Solution & Architectural Design
- Refuse a task or an
Impactentry whose path is underopenspec/changes/<own change>/: the plan folder is written by the stage job, not by a task of the plan. - For each spec scenario that names a function or a file, require that a task in a
behaviorgroup names a test for it, or that the scenario says it holds by a command (helm template,git grep). Name the scenario that has neither. - When the plan quotes a search that lists files (
references X answered files N), require each listed file outsideopenspec/changes/archive/to appear in aChangeslist or in the design as left unchanged.
Target Subsystem
src/devops_cli/roadmap/stage_change.py (check_proposal), src/devops_cli/roadmap/stage_paths.py.
Source: #3278
Proposed design
Problem statement
The stage plan check accepts three defects. A task or an Impact entry can write the plan folder. A spec scenario can name code and have no behavior test. A quoted search can list a file that no task or design covers. A reviewer finds these by reading. The plan check must refuse them before the draft pull request opens.
Acceptance criteria
Requirement: Own change folder in a group path
The plan check SHALL return a problem when a group lists a path under openspec/changes// in changes.
Scenario: A group lists the plan proposal
- WHEN A behavior group lists
openspec/changes/3321-plan-check/proposal.mdinchangesandcheck_proposalreceiveschange='3321-plan-check'. - THEN
check_proposalreturns one problem that names the path and the own change folder.
Requirement: Own change folder in a task code span
The plan check SHALL return a problem when a task code span names a path under openspec/changes//.
Scenario: A task names the plan tasks file
- WHEN A behavior group's
implementationnamesopenspec/changes/3321-plan-check/tasks.mdin a code span. - THEN
check_proposalreturns one problem that names the group and the path.
Requirement: Scenario with code needs a behavior test
The plan check SHALL return a problem for a spec scenario that names a function or a file and has no behavior test or command exception.
Scenario: A scenario names _loki_mode and no task tests it
- WHEN A spec scenario's
thennames_loki_modein a code span and no behavior group'stestorverifynames any function or file span of that scenario. - THEN
check_proposalreturns one problem that names the scenario and_loki_mode.
Requirement: Scenario command exception
The plan check SHALL accept a spec scenario that names a function or a file when the scenario names a command such as helm template or git grep.
Scenario: A scenario cites helm template
- WHEN A spec scenario's
thennames_loki_modeandhelm templatein code spans. - THEN
check_proposalreturns no problem for that scenario.
Requirement: Quoted search file needs a change or design decision
The plan check SHALL return a problem for each file that a quoted references ... answered files N search lists outside openspec/changes/archive/ and that no group changes or design decision names.
Scenario: A quoted search lists an untouched test file
- WHEN
feasibilityholdsreferences SingleBinary answered files 1andtests/commands/k8s/test_k8s.py, and no groupchangesorStageDecisionnames that path. - THEN
check_proposalreturns one problem that namestests/commands/k8s/test_k8s.py.
Requirement: Archived plan is skipped
The plan check SHALL skip a file under openspec/changes/archive/ that a quoted search lists.
Scenario: A quoted search lists an archived plan
- WHEN
feasibilityholdsreferences SingleBinary answered files 1andopenspec/changes/archive/2441-loki-values-name-the-monolithic-deployment/proposal.md. - THEN
check_proposalreturns no problem for that archived path.
Requirement: Design decision leaves a file unchanged
The plan check SHALL accept a file that a quoted search lists when a design decision names it as left unchanged.
Scenario: A design decision leaves the test unchanged
- WHEN
feasibilityliststests/commands/k8s/test_k8s.pyand aStageDecisionnames that path and says it is left unchanged. - THEN
check_proposalreturns no problem for that path.
Existing Tool Considered
No alternatives check has run. No open, maintained tool covers this repository's internal OpenSpec plan validation. The change builds the check in check_proposal: about 5,000 tokens to implement, about 2,000 tokens per year to keep and fix, and half a working day of elapsed time.
Key questions
- How does
check_proposallearn the own change folder?: Add a requiredchangekeyword tocheck_proposaland pass the folder name from the stage job. Compare each path withopenspec/changes//. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: Add a
changekeyword tocheck_proposal. The stage job knows the folder, andcheck_proposalhas no other reliable source. - Rejected: Derive the folder from the issue number and slug. The proposal does not hold the slug.
- Rejected: Treat every
openspec/changes/path as the own folder. This refuses paths of other changes and the archive.
- Chosen: Add a
- Which plan text fields count as a task or an Impact entry for the own-change check?: Check
group.changes, the code spans oftest,implementation,documentationandprocess, and the paths ofverify.group.changesrenders the Impact section. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]- Chosen: Check
changes, task code spans andverifypaths. This covers the Impact section and the tasks in one pass. - Rejected: Check only
changes. A task can name the plan folder and still pass. - Rejected: Check only the rendered Impact section. A task can name the plan folder and still pass.
- Chosen: Check
- How does the plan check identify a function or a file in a spec scenario?: Use
code_spansonwhenandthen. A span is a file whenStagedTree.as_pathreturns it. A span is a function when it matches an identifier with a dot or an underscore. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/step_files.py]- Chosen: Classify code spans by path and identifier pattern. This finds
_loki_mode,pytest.failandtests/...with no network. - Rejected: Treat every word in the scenario as a name. This reports prose words.
- Rejected: Treat only file paths as names. This misses
_loki_mode.
- Chosen: Classify code spans by path and identifier pattern. This finds
- What satisfies a spec scenario that names a function or a file?: A behavior group's
testmust name one code span of the scenario, or itsverifymust name one path of the scenario. A code span with a space and a first word inhelm,git,kubectl,uv,devopsorghalso satisfies the scenario. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, openspec/config.yaml]- Chosen: One behavior group test or verify names one scenario span. This matches the issue example and keeps the check narrow.
- Rejected: Every behavior group must name every span. This is too strict for a scenario with several names.
- Rejected: The scenario name must appear in a test. Tests do not name scenarios.
- How does the plan check read a quoted search and accept a listed file?: Scan
feasibility,whyandwhat_changesforreferences answered files. Collect paths from the same text withStagedTree.paths_in. Skipopenspec/changes/archive/. Accept a path in anygroup.changesorStageDecisiontext. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]- Chosen: Scan the plan text and accept
changesor design decisions. The existing fields hold the search and the design, so no schema change is needed. - Rejected: Add a
left_unchangedfield toStageProposal. A design decision already states that a file is left unchanged. - Rejected: Scan only
feasibility. The plan can quote the search inwhy.
- Chosen: Scan the plan text and accept
- Where do the new checks and messages live?: Put the path helpers in
stage_paths.pyand call them fromcheck_proposal. Add one message for each problem tosrc/devops_cli/lang/en/messages.py. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/lang/en/messages.py]- Chosen: Helpers in
stage_paths.py, calls incheck_proposal, messages inmessages.py. Path logic already lives instage_paths.pyand the project keeps messages in one module. - Rejected: Put all checks in
stage_change.py. This duplicates path logic thatstage_paths.pyowns. - Rejected: Write inline problem strings. The project uses
MESSAGESfor every problem.
- Chosen: Helpers in
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.The checks prevent recurring plan defects found in review, but they are additive guards rather than a blocking failure.Each check catches a class of defect that a human reviewer found by reading, reducing rework on affected plans.Three rules must parse plan structure, cross-reference scenarios with tasks, and match quoted search output to a Changes list in two existing modules.Both refuse tasks whose paths sit under openspec/changes/, but 3285 covers any change folder while the candidate targets the plan's own folder and adds two further validation rules.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at b46b6bd (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
feat/3321-the-plan-check-refuses-a-self, draft pull request #3335. 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 2 model request(s), and used 151773 input tokens and 1127 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:
criterion_droppedat groups: The plan has one placeholder group. It has no task for the own-change path refusal, the scenario test rule or the quoted search rule. It also leaves out stage_paths.py and messages.py, andcriteriais empty. Evidence: "Refuse a task or anImpactentry whose path is underopenspec/changes//"spec_delta_wrongat specs (roadmap-stage, added): The added requirement and its scenario hold only the text "x". No test can assert the scenario, and none of the seven requirements of the issue appears. Evidence: "x SHALL x"verify_format group 1: The command checks the OpenSpec files, not the newcheck_proposalbehavior. It runs no test of the work in the group. Evidence: "uv run devops openspec check"otherat plan: The summary, the feasibility, the decisions and the group text are placeholders. The group has kindotherand no test, so a reviewer cannot judge it against the issue. Evidence: ""implementation": "x""docs(openspec): fix the plan of #3321
docs(openspec): plan #3321 refuse a self-named or untested plan (#3335)
[-]feat(roadmap): the plan check refuses a self-referential task and a scenario with no test[/-][+]feat(roadmap): refuse a self-named or untested plan[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 74 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): the plan check refuses a self-referential task and a scenario with no testfeat(roadmap): refuse a self-named or untested planfeat(roadmap): refuse a self-named or untested plan (#4157)
devops-cli-service commentedon Nov 8, 2026
Released in v0.90.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.90.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 15:26 UTC
feat(roadmap): pair each new spec scenario with a task (#5683)