Repository navigation
Description
Problem
A reply whose MODIFIED requirement leaves out a scenario of the living spec fails the OpenSpec validation, and the model does not repair it in the one return that it gets.
The stage job checks a plan with openspec validate <change> --strict --json (validate_change in src/devops_cli/roadmap/stage/stage_validate.py). OpenSpec refuses a MODIFIED block that omits a scenario of the base requirement, because a MODIFIED requirement replaces the whole block. The model reads the requirement with read_spec and still writes a block with fewer scenarios.
Evidence: a live stage run on item #3599 with the live stage model (deepseek-v4.1-flash-1017), 2026-11-09. The second reply was refused, word for word: "roadmap-implement-job/spec.md: MODIFIED "The job rewrites the pull request after the push" omits scenario(s) the current spec still has: "A refused body stops the item". The modified block has 6 scenarios; the current spec has 5 scenarios. It adds 2 scenarios not in the current spec: "A refused body is rebuilt once", "A second refused body". Copy the omitted scenarios into the MODIFIED block (a MODIFIED requirement replaces the whole block, so archive refuses to drop them)." The item failed there. The stage job logs show the same problem for #3488 and #3478 on 2026-11-04.
Expected
- The job repairs the mechanical part itself: for a
MODIFIEDrequirement that omits scenarios of the base requirement, it adds each omitted scenario of the living spec to the block, with the text thatopenspec show <capability> --type spec --jsongives, before it validates the change. Or the problem that goes back to the model holds the text of each omitted scenario. - A scenario that the reply drops on purpose is not possible: archive refuses it, so the repair loses nothing.
Acceptance criteria
- A test builds a plan with a
MODIFIEDrequirement that omits one base scenario, and shows that the change that the job writes holds all base scenarios. It fails today. -
uv run devops roadmap eval stage --replaykeeps its result.
Existing tool considered
openspec show <capability> --type spec --json (used by read_spec in src/devops_cli/roadmap/stage/stage_tools.py) already gives the name and the raw text of each scenario. No new parser is needed if the repair copies the raw text. Cost: about 40 000 tokens to build, 5 000 to keep, and 2 hours.
Proposed design
Problem statement
A MODIFIED requirement in a plan can leave out a scenario of the living spec. OpenSpec refuses that block, because a MODIFIED requirement replaces the whole block. The model gets one return to fix the block and often fails, so the item fails at the stage job (seen on #3599, #3488 and #3478). The omitted text is known, so the job can restore it with no model call.
Acceptance criteria
Requirement: Omitted scenario is restored
The stage job MUST add each scenario of the base requirement that a MODIFIED block omits to that block, with the raw text that openspec show <capability> --type spec --json gives, before it validates the change.
Scenario: One base scenario omitted
- WHEN A plan holds a MODIFIED requirement that omits one scenario of the base requirement, and the base spec holds that scenario
- THEN The change files that the job writes hold all base scenarios in the block, and
validate_changereturns None for them
Requirement: Scenarios of the reply stay
The repair SHALL keep every scenario that the reply holds in its own text and order, and SHALL append only the omitted scenarios after them.
Scenario: Reply adds and changes scenarios
- WHEN A MODIFIED block has a changed scenario of the base and a new scenario, and omits a third base scenario
- THEN The repaired block keeps the changed text and the new scenario, and ends with the omitted base scenario
Requirement: Complete block is unchanged
The repair MUST NOT change a file when each MODIFIED block holds every scenario of its base requirement.
Scenario: No scenario omitted
- WHEN A plan holds MODIFIED blocks that name every base scenario
- THEN The repaired files equal the input files byte for byte
Requirement: Other sections are left alone
The repair SHALL touch only requirements in the MODIFIED section of a delta, and SHALL NOT change an ADDED, REMOVED or RENAMED requirement.
Scenario: ADDED requirement with few scenarios
- WHEN A delta holds an ADDED requirement and a base requirement of the same name has more scenarios
- THEN The ADDED block is unchanged
Requirement: Missing base is left to OpenSpec
The repair SHALL NOT change a delta when the base spec or the base requirement does not exist, so OpenSpec reports that problem as before.
Scenario: MODIFIED of an unknown requirement
- WHEN A MODIFIED block names a requirement that the base spec does not hold
- THEN The files are unchanged and the validation problem still reaches the model
Requirement: Replay result is kept
The change MUST keep the result of uv run devops roadmap eval stage --replay.
Scenario: Replay after the change
- WHEN The replay runs on the recorded cases
- THEN The result equals the result before the change
Existing Tool Considered
OpenSpec already gives the raw text of each base scenario through openspec show <capability> --type spec --json, which read_spec in src/devops_cli/roadmap/stage/stage_tools.py uses. It has no command that repairs a MODIFIED block, and openspec validate only reports the problem. So the change builds a small repair that reads headings of the delta and copies the raw text from OpenSpec. Cost: about 40 000 tokens to build, 5 000 to keep, and 2 hours.
Key questions
- Does the job repair the block itself, or does the problem that goes back to the model hold the omitted text?: The job repairs the block itself before it validates. A scenario cannot be dropped on purpose, because archive refuses it, so the repair loses nothing. It also saves the one return that the model gets. (best practice) [sources: src/devops_cli/roadmap/stage/stage_validate.py]
- Chosen: Repair in the job. It is deterministic, needs no model call, and fixes the failure on feat(roadmap): retry a refused pull request text once #3599, fix(roadmap): the job owns the ticks and the strays of a step #3488 and fix(roadmap): a placeholder reply of a model moves no item #3478.
- Rejected: Put the omitted text in the problem for the model. The model can still copy the text wrongly, and it has only one return.
- Where does the repair run?: A new function in
stage_validate.pytakes the tool, the checkout and the files of the change, and returns the repaired files. The planner uses the repaired files for both the validation and the files that it writes, so the two never differ. (best practice) [sources: src/devops_cli/roadmap/stage/stage_validate.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: A function beside
validate_change, which the planner calls first. The module already copies base specs and holds the OpenSpec tool, and the callers ofvalidate_changestay unchanged. - Rejected: Repair inside
validate_change. The function returns only a problem text, so it cannot hand back the repaired files that the job writes.
- Chosen: A function beside
- How does the repair match a base scenario to a scenario of the reply?: It matches by scenario name, after it strips the white space at each end. It reads the
### Requirement:and#### Scenario:headings of the MODIFIED section. It takes the raw text of each omitted scenario fromopenspec showand renders it in the form of_requirement_lines. (best practice) [sources: src/devops_cli/roadmap/stage/stage_tools.py]- Chosen: Match by name. OpenSpec compares scenarios by name, as its error message shows.
- Rejected: Match by text. The reply may reword a scenario on purpose, and the repair would then add a duplicate.
- Which base specs does the job have at the repair?: The job reads the base spec from the checkout, as
_copy_base_specsdoes. A capability that the checkout does not hold is left alone. [sources: src/devops_cli/roadmap/stage/stage_validate.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 10, 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.Recurring failure blocks items #3599, #3488, and #3478 from completing.Every affected item fails and wastes model calls; fixing it unblocks recurring work.The body estimates 2 hours and about 40 000 tokens, a focused change to one repair step.Both touch OpenSpec validation in the roadmap stage flow, but #3429 adds validation to a gate that lacks it, while the candidate repairs a specific validation failure before it occurs.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at c70d673 (see proposed design in issue body).
fix(roadmap): a MODIFIED block gets the base scenarios it omits
fix(roadmap): a MODIFIED block gets the base scenarios it omits
fix(roadmap): a MODIFIED block gets the base scenarios it omits (#4333)
devops-cli-service commentedon Nov 10, 2026
Released in v0.106.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.106.1
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 06:39 UTC