Repository navigation
Description
Problem or Motivation
The stage job checks a plan only with deterministic gates (paths, kind, spec shape). The evaluation of 2026-11-02 shows that the gates miss most of the defects that a reviewer finds: in 12 golden plans with 82 labeled defects, the gates catch the missing paths (about 12% of the defects), and a model review with the cited files as context finds more: claude-sonnet-5-5 finds 56% of all labeled defects and 68% of the major ones, including 9 of 14 false premises, 7 of 11 cases of code that already exists, and 6 of 8 contrived tests. Every plan that the Service made on 2026-11-01 and that a person reviewed had such defects, and a merged bad plan blocks a later implement Job.
Proposed Solution & Architectural Design
A verification pass after the gates, before the stage job opens the plan pull request:
- Input: the issue, the plan, and the content of the files that the plan cites (the first lines of each, capped), as the evaluation driver builds it.
- Model: the task slot
ai.tasks.verification, set toclaude-sonnet-5-5, withdeepseek-v4.1-flash-1017as the gateway fallback. One call for each plan, about 0.03 USD. - Output: findings of the nine defect types. A finding of type
missing_path,false_premiseorignores_existing_codethat quotes evidence returns the plan to the planner once with the finding; the other findings go into the comment of the pull request. The Service never merges, so the pass is advisory beyond that one return. - Measure:
devops roadmap eval verify(new) scores a model on the golden set by recall of the labeled defects and by findings on the good plans, so a change of model or prompt states its score.
The stage job keeps planning on local models until the toolbox of #3037 is built and the evaluation is run again with it.
Target Subsystem
src/devops_cli/roadmap/stage.py, a new verification module, src/devops_cli/commands/roadmap_eval.py, tests/fixtures/roadmap_eval/stage.
Existing Tool Considered
The verification task slot of the settings already exists (used by the review pipeline). The golden set already labels the defects. Cost to build: about 80k tokens and 5 hours; to keep: one prompt and one eval command. Running cost: about 0.03 USD for each plan with claude-sonnet-5-5.
Proposed design
Problem statement
The stage job checks a plan only with deterministic gates. These gates miss most defects that a reviewer finds. A bad plan can merge and block a later implement Job. Add a model verification pass after the gates and an eval command to measure it.
Acceptance criteria
Requirement: Verification after gates
The stage job SHALL run the verification pass after all deterministic gates pass and before it opens the plan pull request.
Scenario: Plan passes the gates
- WHEN A plan passes
check_proposalandvalidate_change. - THEN The job calls the verification client with the issue, the plan and the cited file contents.
Requirement: Capped cited files
The verification request SHALL include the issue, the plan and the capped content of each file that the plan cites.
Scenario: A cited file is long
- WHEN A plan cites a file with more tokens than the cap.
- THEN The request holds only the first capped tokens of that file.
Requirement: Nine defect types
The verification reply SHALL use the nine defect types of the stage golden set.
Scenario: A reply names an unknown defect type
- WHEN The model returns a finding with a type outside the nine types.
- THEN The job rejects the reply and does not open the pull request.
Requirement: One return for evidence-backed findings
The stage job SHALL return the plan to the planner at most once when a finding of type missing_path, false_premise or ignores_existing_code quotes evidence.
Scenario: An evidence-backed finding
- WHEN Verification returns a
false_premisefinding with quoted evidence. - THEN The planner receives the finding once and the job does not open the pull request until the revised plan passes verification.
Requirement: Advisory findings in the comment
The stage job SHALL put each finding that does not return the plan into the pull request comment.
Scenario: A contrived test finding
- WHEN Verification returns a
contrived_testfinding. - THEN The pull request comment lists the finding and the job opens the draft pull request.
Requirement: Verification eval command
devops roadmap eval verify SHALL score a model on the golden set by recall of labeled defects and by findings on good plans.
Scenario: Run the verification eval
- WHEN A person runs
devops roadmap eval verifywith a model. - THEN The output states the recall and the count of findings on good plans, and the command stores the score under
.data/.
Requirement: Task slot and fallback
The verification pass SHALL use the ai.tasks.verification task slot with claude-sonnet-5-5 and the gateway fallback deepseek-v4.1-flash-1017.
Scenario: Primary model fails
- WHEN The primary model returns an error.
- THEN The gateway sends the call to
deepseek-v4.1-flash-1017.
Requirement: No merge or ready mark
The verification pass SHALL NOT merge the pull request or mark it ready.
Scenario: Verification passes
- WHEN Verification returns no blocking finding.
- THEN The pull request stays draft and the job makes no merge call.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers a model review of a staged plan with the cited files. The body names only the internal verification task slot and the golden set. The change builds its own pass and eval command. Written cost: about 80k tokens and 5 hours to build; one prompt and one eval command to keep; about 0.03 USD for each plan with claude-sonnet-5-5.
Key questions
- Where does the verification pass run in the stage job?: After
check_proposalandvalidate_changepass, and before_stage_oneopens the draft pull request. [sources: src/devops_cli/roadmap/stage.py] - Which defect types does the verification pass report?: The nine types of the stage golden set:
missing_path,false_premise,spec_delta_wrong,verify_form,task_order,criterion_dropped,ignores_existing_code,contrived_testandother. [sources: src/devops_cli/roadmap/stage_eval_cases.py] - How many times may verification return a plan to the planner?: At most once for an evidence-backed finding of type
missing_path,false_premiseorignores_existing_code. (best practice) [sources: src/devops_cli/roadmap/stage.py]- Chosen: One return. The stage job already sends a refused reply back once (
_REPLY_RETURNS), and the issue limits the pass to one return. - Rejected: Loop until clean. It can spend many model calls and delay the item without a person.
- Rejected: No return. It would leave the most serious findings only in a comment.
- Chosen: One return. The stage job already sends a refused reply back once (
- Which model slot does the verification pass use?: The existing
ai.tasks.verificationslot, set toclaude-sonnet-5-5withdeepseek-v4.1-flash-1017as the gateway fallback. (best practice) [sources: src/devops_cli/roadmap/stage.py]- Chosen: Existing verification slot. The slot already exists for the review pipeline, and the stage job uses task slots for model choice.
- Rejected: New verification slot. It duplicates a slot that already exists.
- Rejected: Hard-coded model. It prevents a model change without a code change.
- How does the project measure the verification pass?: Add
devops roadmap eval verifyto theroadmap evalgroup. It scores recall of labeled defects and findings on good plans. (best practice) [sources: src/devops_cli/commands/roadmap_eval.py, openspec/specs/roadmap-stage-eval/spec.md]- Chosen: New verify subcommand. The
roadmap evalgroup already holds one subcommand for each job, and the issue asks for a separate score. - Rejected: Extend
roadmap eval stage. It mixes plan quality with verification quality in one score. - Rejected: No eval command. A model or prompt change would state no score.
- Chosen: New verify subcommand. The
- What does the stage job do with findings that do not return the plan?: It puts them in the pull request comment and opens the draft. The Service never merges. (best practice) [sources: src/devops_cli/roadmap/stage.py]
- Chosen: Comment only. The pass is advisory beyond the one return, and the Service never merges.
- Rejected: Block the pull request. It gives a model finding a merge gate that the project does not give it.
- Rejected: Drop the findings. A reviewer loses the evidence.
- Does this change wait on the toolbox of feat(roadmap): the stage job plans with a read-only investigation toolbox #3037?: No. The verification pass reads a plan that the stage job already made. The note about local models concerns the planner and does not block this pass. [sources: src/devops_cli/roadmap/stage.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 2, 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.Improves plan quality but the system still functions with the existing gates alone.Catches 56% of labeled defects and 68% of major ones that the gates miss.The body states about 5 hours to build one prompt and one eval command.a model-based plan verification pass after the gates that returns the plan to the planner for one bounded repair roundas the change that both ask for.Both ask for a model verification step after the gates with a bounded repair round back to the planner, delivering the same behaviour in the stage job.A person closes one of the two if that is so.docs(k8s): name DeepSeek and Sonnet in the Service config (#3159)
devops-cli-service commentedon Nov 2, 2026
Status set to Ready at ac16675 (see proposed design in issue body).