Skip to content

feat(roadmap): the stage job verifies its plan with a model after the gates #3153

Closed

Description

@dan-petty

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:

  1. 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.
  2. Model: the task slot ai.tasks.verification, set to claude-sonnet-5-5, with deepseek-v4.1-flash-1017 as the gateway fallback. One call for each plan, about 0.03 USD.
  3. Output: findings of the nine defect types. A finding of type missing_path, false_premise or ignores_existing_code that 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.
  4. 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_proposal and validate_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_premise finding 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_test finding.
  • 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 verify with 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_proposal and validate_change pass, and before _stage_one opens 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_test and other. [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_premise or ignores_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.
  • Which model slot does the verification pass use?: The existing ai.tasks.verification slot, set to claude-sonnet-5-5 with deepseek-v4.1-flash-1017 as 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 verify to the roadmap eval group. 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 eval group 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.
  • 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

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 2, 2026
  2. dan-petty commented on Nov 2, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Improves plan quality but the system still functions with the existing gates alone.
    • Value: High. Catches 56% of labeled defects and 68% of major ones that the gates miss.
    • Effort: Medium. The body states about 5 hours to build one prompt and one eval command.
    • Possible duplicate: feat(roadmap): an independent verifier refutes a plan before the draft pull request opens #3039, which may ask for the same change. The model names a model-based plan verification pass after the gates that returns the plan to the planner for one bounded repair round as 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.
  3. added
    priority/p2-medium
    on Nov 2, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 2, 2026
  5. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at ac16675 (see proposed design in issue body).

  6. removed
    status/ready
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions