Repository navigation
Description
Problem
A stage revision run that breaks the reply schema ends the item, also when an earlier reply of the same attempt was a valid plan.
- A plan run allows one output retry:
_REPLY_RETURNS = 1atsrc/devops_cli/roadmap/stage/stage.py:991andsrc/devops_cli/roadmap/stage/stage_verify.py:83. _ask_plan(stage.py:2010-2017) logs the violations and re-raisesStructuredOutputValidationError. The item then ends with the classparser, and the last schema-valid plan is lost.- The class
parsercaused 8 of 11 stage failures over 24 h and 4 of 5 over 6 h (grades, 2026-11-19). Loki:{container="stage"} |~ "^- #[0-9]+ ". - Of 9 parser failures since 2026-11-18 00:00, 4 had an earlier valid reply: feat(research): resolve a pinned action commit to its release #4012 at 09:39 (4 gate returns), feat(roadmap): halt implement step when all group tasks are verified #4075 at 12:44 (3 gate returns), feat(research): resolve a pinned action commit to its release #4012 at 23:12 (5 gate returns, 4 review rounds, 15.6 M tokens, 6106 s) and fix(roadmap): Name the failed refine form check to the model #6327 (1 gate return).
- fix(roadmap): A schema limit of the plan reply never fails a stage item #6319 removes the schema limits of
pull_request_bodyandsecurity. fix(roadmap): Tell the stage planner what counts as source code #6335 (merged) fixes the kind rule of fix(roadmap): Tell the stage planner what counts as source code #6214. After both, about 3 parser failures in 26 h remain, and all 3 had an earlier valid reply. Examples:dependences (extra_forbidden)for feat(research): resolve a pinned action commit to its release #4012, and 13 violations ofgroups.N.kind (enum)for fix(roadmap): Name the failed refine form check to the model #6327.
This item does not widen #6319. #6319 changes the schema. This item changes what the stage does after any schema failure of a revision.
Expected
- When a revision run breaks the schema after its output retry, the stage keeps the last schema-valid reply. It sends the violations back to the planner as a gate return, and that return counts against
roadmap.stage.gate_returns. The item does not end on the first schema failure of a revision. - A first reply that breaks the schema has no earlier plan. It keeps today's behavior, or it gets its own measure (for example a second output retry). The design names the choice.
- Test first: a fake planner gives a valid first reply, then a revision that breaks the schema twice, then a valid reply. The item stages, and the gate return count is 1 higher. A second test: when
gate_returnsis used up, the schema failure ends the item with the classparseras today.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches for a structured-output retry or schema-error handling library returned only generic documentation pages, no open tool. The need is stage-internal control flow: keep the last valid StageProposal and turn the violations into a gate return.
Lacks:
- No library keeps the last schema-valid plan across a failed revision
- No library maps schema violations onto the gate return budget
- No library decides the first-reply case with no earlier plan
Proposed design
Problem statement
A stage revision run that breaks the reply schema ends the item and loses the last schema-valid plan. The stage must keep that plan, send the schema violations back as a gate return, and count the return against roadmap.stage.gate_returns. A first reply with no earlier plan keeps the current one-retry behavior.
Acceptance criteria
Requirement: Revision schema failure keeps the last valid plan
When a revision reply fails the reply schema after its output retry, the stage SHALL keep the last schema-valid plan and send the schema violations to the planner as one gate return.
Scenario: A revision schema failure returns the last valid plan
- WHEN A fake planner gives a valid first reply, a revision that fails the schema twice, and then a valid reply
- THEN The stage stages the item, and the gate return count is one higher than before the revision
Requirement: An exhausted gate return ends with the parser class
When a revision schema failure uses the last roadmap.stage.gate_returns return, the stage MUST end the item with the failure class parser.
Scenario: The last gate return leaves the parser class
- WHEN A fake planner gives a valid first reply and revisions that fail the schema until
roadmap.stage.gate_returnsis used up - THEN The stage ends the item with the failure class
parserand opens no pull request
Requirement: A first reply with no plan keeps one output retry
A first plan reply that fails the reply schema MUST keep the single output retry and then end the item with the class parser when no valid plan exists.
Scenario: A first reply with no earlier plan ends as parser
- WHEN A fake planner returns a schema-invalid first reply twice and no valid plan
- THEN The stage ends the item with the failure class
parserand makes no gate return
Requirement: The gate return names the schema violations
The gate return after a revision schema failure SHALL include the schema violations of the failed revision.
Scenario: The planner sees the revision schema violations
- WHEN A fake planner returns a revision with the violation
dependences (extra_forbidden) - THEN The next planner request contains
dependences (extra_forbidden)
Existing Tool Considered
The alternatives check of 2026-11-19 records verdict none and names no tool. The alternatives block in the issue body gives its searches and lacks. No open, maintained tool or library covers the stage's internal schema-retry policy. The project builds the change in its own code. The proposal catches StructuredOutputValidationError at the revision call, keeps the last valid StageProposal, and sends the violations as one gate return. The estimated cost is about 30,000 tokens to build, keep and fix, and one working day.
Key questions
- What should a first plan reply that breaks the schema do when no earlier plan exists?: Keep the current behavior: one output retry, then end the item with the class
parser. Do not add a second output retry. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py:991, src/devops_cli/roadmap/stage/stage_verify.py:83, openspec/specs/roadmap-stage/replies/spec.md:9, openspec/specs/roadmap-failure-taxonomy/spec.md:121]- Chosen: Keep one output retry and end as parser. The replies spec sets one retry, and no earlier plan exists to return.
- Rejected: Add a second output retry. It hides schema defects and adds token cost without a plan to preserve.
- Rejected: Treat it as a gate return with no plan. A gate return needs a plan to revise, and no plan exists.
- How should a revision schema failure use the gate return budget?: Catch
StructuredOutputValidationErrorfrom the revision call, keep the lastStageProposalthat_ask_planreturned, and send the violations as one gate return. Reuseroadmap.stage.gate_returns; add no new setting. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py:1994, src/devops_cli/roadmap/stage/stage.py:2010, src/devops_cli/config/settings.py:1347, src/devops_cli/roadmap/stage/stage.py:1078, src/devops_cli/roadmap/stage/stage.py:1392]- Chosen: Reuse
roadmap.stage.gate_returns. The setting already counts planner returns, and the issue requires the same count. - Rejected: Add a separate schema-return setting. It adds a second budget for the same planner loop and changes configuration.
- Rejected: End the item at once. It loses the last valid plan, which is the defect.
- Chosen: Reuse
- Where does the stage keep the last schema-valid plan?: In the caller's
proposalvalue._ask_planreturns only a schema-validStageProposal; a failed revision raises before it returns. Catch the error at the revision call and keepproposal. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py:1994, src/devops_cli/roadmap/stage/stage.py:2010]- Chosen: Keep the caller's
proposalvalue. It already holds the last reply that passed the schema, and a failed revision raises before it changes. - Rejected: Add a module-level cache. It adds shared state to a job that runs one item at a time and has no need for it.
- Rejected: Reread the last plan from disk. It adds file I/O and a second source of truth for a value that the caller holds.
- Chosen: Keep the caller's
- What ends the item when a revision schema failure has no gate return left?: The item ends with the failure class
parser, becauseStructuredOutputValidationErrormaps toparser. [sources: openspec/specs/roadmap-failure-taxonomy/spec.md:121] - What text does the gate return carry after a revision schema failure?: It carries the schema violations of the failed revision, such as
dependences (extra_forbidden), so the planner can correct the same reply. [sources: src/devops_cli/roadmap/stage/stage.py:2010, openspec/specs/roadmap-stage/replies/spec.md:9]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
The parser class caused 8 of 11 stage failures over 24 h, which is a high error rate on the stage service.Both address schema validation failures in the stage, but #6319 removes the schema constraints while this item keeps the last valid reply and sends violations as a gate return.devops-cli-service commentedon Nov 19, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (6)
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
19 remaining items
devops-cli-service commentedon Nov 20, 2026
Pull request #6484 is ready for review. The checks passed.
Spend: 68 model requests, 5695051 input tokens, 19300 output tokens.
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
docs(openspec): plan #6357 keep the last valid plan on a schema error
fix(roadmap): Return a revision schema failure to the planner with th…
fix(roadmap): State the revision schema return in the stage item of t…
docs(openspec): archive the change (#6357)
fix(roadmap): Return a gate return schema failure too (#6357)
devops-cli-service commentedon Nov 20, 2026
Released in v0.183.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.183.1
devops-cli-service commentedon Nov 20, 2026
Live since 2026-11-20 17:44 UTC