Repository navigation
Description
What happened
About 14 of 37 plans carry a spec delta on a change that needs none (2977, 2979, 2980, 2983, 2985, 2986, 2987, 2994: tests, CI and document changes with skip_specs false) or put it in the wrong capability or ADD a requirement that the base spec already has (2976, 2981, 2987, 2993, 2997, 3002). check_proposal only checks that skip_specs agrees with the specs list. It does not look at the changes paths, and the model gets only the capability names.
What should happen
check_proposalrefusesskip_specs: falsewhen everychangespath is undertests/,.github/workflows/,docs/oropenspec/.- It refuses an ADDED requirement whose name exists in the base spec of that capability.
- The input holds the purpose and the requirement names of each capability.
Acceptance criteria
- Both refusals have unit tests and the model gets the problem text.
- A replay of the plan of docs(openspec): plan #2116 use PATH stand-ins for scanner tests #2977 is refused.
Source
An evaluation on 2026-11-01 of the 37 docs(openspec): plan #N pull requests (35 merged, 2 open) found 34 that need fixes and 1 to reject. The per-PR reviews are in the comments of tracker #3005's thread and in .data/agent/scratch/plan-review.json of the owner's workstation. Related: #3005 (the kind of a task group: test for behavior, a repeatable check for other changes).
Proposed design
Problem statement
The stage job's check_proposal function does not check whether a spec delta is needed based on the changed file paths. It also does not check for duplicate requirement names against the base spec. About 14 of 37 recent plans carry an unnecessary or incorrect spec delta. The model input lacks the capability purpose and requirement names, so the model cannot choose correctly.
Acceptance criteria
Requirement: Refuse unnecessary spec delta
check_proposal SHALL refuse skip_specs: false when every changes path is under tests/, .github/workflows/, docs/, or openspec/.
Scenario: All paths are non-spec paths
- WHEN A proposal has skip_specs: false and all changes paths start with tests/, .github/workflows/, docs/, or openspec/
- THEN check_proposal returns a problem stating that no spec delta is needed
Requirement: Refuse duplicate requirement
check_proposal SHALL refuse an ADDED requirement whose name exists in the base spec of that capability.
Scenario: Added requirement name matches base spec
- WHEN A spec delta ADDs a requirement whose name already appears in openspec/specs//spec.md
- THEN check_proposal returns a problem naming the duplicate requirement
Requirement: Model input includes capability details
The model input SHALL include the purpose and the requirement names of each capability.
Scenario: Input contains capability names and purposes
- WHEN The stage job builds the model input for a proposal
- THEN The input contains the purpose text and the list of requirement names for each capability
Requirement: Unit tests for both refusals
Both refusal checks SHALL have unit tests that assert the problem text.
Scenario: Unit tests pass
- WHEN The test suite runs the unit tests for the path-prefix refusal and the duplicate-requirement refusal
- THEN Both tests pass and assert the expected problem text
Requirement: Model receives problem text
The model SHALL receive the problem text when check_proposal refuses a proposal.
Scenario: Problem text is sent back to the model
- WHEN check_proposal returns a problem for a proposal
- THEN The existing retry mechanism sends the problem text to the model
Requirement: Replay of #2977 is refused
A replay of the plan of #2977 SHALL be refused by check_proposal.
Scenario: Replay test
- WHEN The plan of docs(openspec): plan #2116 use PATH stand-ins for scanner tests #2977 is replayed through check_proposal
- THEN check_proposal returns a problem
Existing Tool Considered
No check has run. No open, maintained tool or library covers the need to validate whether a spec delta is needed based on changed file paths and to check for duplicate requirement names against a base spec. The project builds this validation in check_proposal.
Key questions
- What path prefixes indicate that no spec delta is needed?: tests/, .github/workflows/, docs/, openspec/ (best practice) [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md]
- Chosen: tests/, .github/workflows/, docs/, openspec/. The body states these four prefixes. They cover all non-spec-change paths in this repository.
- Rejected: Only tests/ and docs/. Too narrow. .github/workflows/ and openspec/ changes also do not need a spec delta.
- How does check_proposal detect a duplicate requirement name?: It reads the base spec file openspec/specs//spec.md, extracts the requirement names (the heading text of each requirement), and compares them against the names in the ADDED section of the spec delta. A match is a problem. (best practice) [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md, CONTEXT.md]
- Chosen: Compare requirement heading names against the base spec. The base spec is the living specification. A requirement with the same name already exists there, so ADDing it is a no-op or an error.
- Rejected: Compare the full requirement text. Too strict. A requirement can be modified (MODIFIED) with the same name but different text. Only the name matters for the duplicate check.
- Where is check_proposal implemented?: It is a pure function in the stage job module, called by plan_stage. The archived change fix(roadmap): the stage job refuses a plan that names a path that does not exist #3010 shows it takes the reply and the tree, and appends problems to its list. The exact source file path needs investigation. [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md, openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md]
- How does the model receive the problem text on refusal?: The existing retry mechanism handles it. check_proposal appends the problem to its list, and the planner sends the violation back to the model for one correction (max_retries=1). A second failure stops the item through the existing stage_invalid error. [sources: openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md, openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md]
- What does the model input need to include for each capability?: The purpose text and the list of requirement names. This lets the model choose the correct capability and avoid ADDing a requirement that already exists. (best practice) [sources: CONTEXT.md]
- Chosen: Purpose and requirement names. The body states this. The purpose tells the model what the capability is for. The requirement names let it avoid duplicates.
- Rejected: Capability names only (current behavior). Insufficient. The model cannot judge whether a spec delta is needed or whether a requirement name is a duplicate.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 1, 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.Twelve plans carry wrong spec deltas, but the plans still open and a person can fix them; no blocker is named.It stops 14 of 37 plans from shipping an incorrect spec delta, reducing review waste.Two new refusals, an input-context change for capability names, and unit tests are needed.Both fix the stage job refusal logic, but 3010 checks that named paths exist while the candidate checks that a spec delta is needed and does not duplicate a base-spec requirement.devops-cli-service commentedon Nov 1, 2026
Status set to Ready at bf69f39 (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
Staged: branch
fix/3013-the-stage-job-refuses-a-spec, draft pull request #3177. 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 16 model request(s), and used 491991 input tokens and 8071 output tokens. The tool calls, in order:
search_code({"text":"check_proposal"})search_code({"text":"skip_specs"})repo_map({"directory":"src"})search_code({"text":"def check_proposal"})search_code({"text":"stage_invalid"})read_file({"path":"src/devops_cli/roadmap/stage_change.py"})read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":80,"end_line":420})read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":183,"end_line":420})read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":268,"end_line":400})search_code({"text":"check_proposal("})search_code({"text":"capabilities"})list_files({"directory":"src/devops_cli/ai/tasks"})list_files({"directory":"tests/roadmap"})read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":200,"end_line":400})search_code({"text":"check_proposal"})read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":286,"end_line":360})search_code({"text":"capabilit"})file_symbols({"path":"src/devops_cli/roadmap/stage.py"})file_symbols({"path":"src/devops_cli/roadmap/stage_eval_gates.py"})read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":640,"end_line":770})read_file({"path":"src/devops_cli/roadmap/stage_eval_gates.py","start_line":1,"end_line":145})file_symbols({"path":"src/devops_cli/roadmap/stage_eval_cases.py"})read_file({"path":"tests/roadmap/test_roadmap_stage_eval_cases.py","start_line":1,"end_line":60})docs(openspec): archive the change of #3013
test(roadmap): replay the defects whose gates exist now (#3214)