Repository navigation
Description
Problem or Motivation
The pipeline does not yet give plans that a person accepts without rework: of 23 plan pull requests reviewed on 2026-11-02, every one needed fixes, and four were placeholders. The planner runs on a small, cheap model (deepseek-v4.1-flash-1017, a 65,536-token window in configmap.example.yaml) with tight caps. Cost tuning started before the pipeline worked: budgets (#3066), a cheap-first model ladder (#3060) and caps on tool calls and tokens. When the cheap setup fails, there is no way to tell whether the cause is the model, the prompt, the caps or the gates, because there is no baseline from a model that is likely to succeed.
The deterministic replay shows how little the gates can judge alone. On the golden set (40 cases, 299 labeled defects), the gates catch 60 defects today (paths 36, kind 24). 67 more wait for gates that exist now (see the issue about pending defects). 172 defects have no gate: other 98, false_premise 59, criterion_dropped 12, contrived_test 3. Those 172 can only be measured with a model.
Proposed Solution & Architectural Design
Make the cheapest route to an acceptable outcome an explicit, measured step:
- Define "acceptable" in one place (
docs/ROADMAP_WORKFLOW.md): for the golden set, the recall of the major defects after the gates and the verification pass, and zero findings on the good plans; for live plans, the share of plan pull requests that a person merges without a hold. - Run a cloud baseline with
devops roadmap eval stage(toolbox, then--no-toolbox) anddevops roadmap eval verify, with a cloud model (for exampleclaude-sonnet-5-5through the gateway), and store the JSON report under the data directory. Include the same run with the current model, so the gap is a number. - Set the planner to the cheapest model that meets the threshold. Only after the baseline passes, try cheaper models and lower caps one at a time, with the same eval, and keep a change only if the score holds. Record the score in the pull request, as
docs/ROADMAP_WORKFLOW.mdalready asks for a prompt change. - Park cost work until the baseline passes: feat(roadmap): cost and token budgets per item and per day #3066 (budgets), feat(roadmap): a model ladder for retries, with the tier chosen per attempt #3060 (ladder) and any new cap. A person sets priorities, so this issue only asks that they wait.
- The change of the live model is a setting of the deployed config (
ai.tasks.analysis.model, or a stage-specific task), which only a person can change. The issue records the exact setting and the eval command.
Open questions for the refine step: which model call cost the baseline run has (the eval makes one call per case at least, and the toolbox makes more); whether the stage job should have its own task slot, so the planner can move to a cloud model without moving refine, intake and alternatives; the threshold for "acceptable".
Target Subsystem
docs/ROADMAP_WORKFLOW.md, src/devops_cli/commands/roadmap_eval_stage.py, src/devops_cli/roadmap/stage_eval_run.py, src/devops_cli/config/settings.py (the task slot).
Existing Tool Considered
The eval commands (roadmap eval stage, eval verify) and the golden set already exist, and #3104 plans Harbor trials with N runs. Cost to build the missing parts: about 40k tokens and 2 hours (the definition, the slot, the report format). The run itself costs model calls: at least one per case, 40 cases, plus the toolbox calls (a few dollars at cloud prices, not measured). The cost of not measuring is repeated rework of plans.
Related: #3153, #3104, #3166, #3066, #3060, #3206.
Proposed design
Problem statement
Every plan pull request reviewed on 2026-11-02 needed fixes, and four were placeholders. The planner runs on a cheap model with tight caps. No baseline shows whether the model, the prompt, the caps or the gates cause the failures. This change defines an acceptable score, adds a stage task slot for the planner model, and reports the spend of the eval run. The full cloud baseline and the live model change are deferred.
Acceptance criteria
Requirement: Acceptable stage score definition
docs/ROADMAP_WORKFLOW.md SHALL define an acceptable stage score with a recall threshold for blocker and major defects, a zero-findings rule for the good plans, and a live merge share.
Scenario: The workflow doc states the threshold
- WHEN A reader opens the stage measurement section of
docs/ROADMAP_WORKFLOW.md. - THEN The section states at least 90% recall of blocker and major defects after the gates and the verification pass, zero findings on the 3 good plans, and at least 80% of live plan pull requests merged without a hold.
Requirement: Stage task slot
The setting ai.tasks.stage.model SHALL set the model of the stage planner and of devops roadmap eval stage.
Scenario: The stage task sets a model
- WHEN The config sets
ai.tasks.stage.modelto one model andai.tasks.analysis.modelto another. - THEN The stage planner and the eval use the stage model, and a command of the
analysistask keeps its model.
Requirement: Stage task fallback
The stage task SHALL use the model of ai.tasks.analysis when ai.tasks.stage sets no model.
Scenario: The stage task is unset
- WHEN The config sets
ai.tasks.analysis.modeland no model ofai.tasks.stage. - THEN The stage planner and the eval use the analysis model.
Requirement: Eval report spend
The JSON report of devops roadmap eval stage SHALL hold the token count and the spend in USD of the run.
Scenario: A scored run writes its report
- WHEN
devops roadmap eval stagewrites its report after a run. - THEN The report holds the token count and the spend in USD of the run.
Requirement: Baseline procedure
docs/ROADMAP_WORKFLOW.md SHALL record the eval commands, the config setting and the current-model comparison of the cloud baseline.
Scenario: The baseline procedure is documented
- WHEN A reader opens the stage measurement section.
- THEN It names
devops roadmap eval stagewith and without--no-toolbox,devops roadmap eval verify,ai.tasks.stage.model, and the same stage eval with the current model.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers the need: the eval commands and the golden set are the project's own code. The missing parts cost about 40k tokens and 2 hours to build, keep and fix.
Key questions
- What does an acceptable stage score mean, and what is its threshold?: Acceptable means at least 90% recall of the blocker and major defects on the golden set after the gates and the verification pass. It also means zero findings on the 3 good plans. For live plans it means at least 80% of plan pull requests merged without a hold. A cheaper model or a lower cap must match the baseline score on the same eval. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/stage_eval_score.py]
- Chosen: Fixed threshold in the workflow doc. It gives one number for the cloud model, the current model and each cheaper model.
- Rejected: The current model's score as the bar. The current model fails on every reviewed plan, so its score sets too low a bar.
- Rejected: Report only, with no threshold. The item needs a pass or fail to name the cause of a failure.
- Should the stage job have its own task slot?: Yes. Add
ai.tasks.stageas a task override. It sets the planner model and the eval model. When it sets no model, it uses theanalysistask model, so the current behavior stays. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/commands/roadmap_eval_stage.py, docs/ROADMAP_WORKFLOW.md]- Chosen: A
stagetask slot. It moves the planner model alone; theanalysistask keeps its model for other commands. - Rejected: Reuse
ai.tasks.analysis. It moves every command of theanalysistask with the planner. - Rejected: A top-level
ai.stage_model. It breaks the per-task pattern and the variable scheme ofAITasksConfig.
- Chosen: A
- Which model call cost does the baseline run have?: The eval makes at least one call for each of the 40 cases, plus the toolbox calls and the verify pass. The measured one-case run used 109,476 input tokens and 1,936 output tokens. At
claude-sonnet-5-5prices, 40 cases with the toolbox cost about 9.5 USD. The verify pass cost is not measured. A 4-case sample decides whether a full run is worth its price. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/stage_eval_run.py, src/devops_cli/commands/roadmap_eval_stage.py]- Chosen: Use the measured one-case cost. The measured run gives the real tokens, and the 4-case sample bounds the spend before a full run.
- Rejected: Estimate without a run. The first estimate was about ten times too high.
- Rejected: Run the full set without a sample. The full-set cost and the verify cost are not measured, and a person must approve the spend.
- Should the eval report hold the spend of the run?: Yes. The report holds the token count and the spend in USD of the run, as the implement eval reports the tokens of each fixture. The first cloud run then reports its cost. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py, src/devops_cli/roadmap/implement_eval_run.py, docs/ROADMAP_WORKFLOW.md]
- Chosen: Tokens and spend in the report. The cloud cost is not known, and the report is the one record of the run.
- Rejected: Read the spend from the gateway. The gateway keeps no record for each run, and it may not count the toolbox calls.
- Rejected: No spend in the report. The cost of the cloud run stays unknown.
- Which setting changes the live planner model, and who changes it?: A person sets
ai.tasks.stage.modelin the deployed config after the baseline passes. The recommendation is the cheapest model that matches the baseline score. The pull request records the score. (a person decides) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/config/settings.py] - Should the cost work wait for the baseline?: Yes. A person sets priorities. The recommendation is to park feat(roadmap): cost and token budgets per item and per day #3066, feat(roadmap): a model ladder for retries, with the tier chosen per attempt #3060 and each new cap until the baseline passes. A cap set before the baseline hides the cause of a failure. (a person decides)
- Can the full cloud baseline run in this item?: No. The replies state that only a 4-case sample will run, not the full set. The stage eval with the toolbox costs about 9.5 USD for 40 cases at Sonnet prices, and the verify pass cost is not measured. A person must approve the spend and change the deployed config. The full baseline is deferred. (a person decides) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/stage_eval_run.py]
Open questions
- Which setting changes the live planner model, and who changes it? (a person decides)
- Should the cost work wait for the baseline? (a person decides)
- Can the full cloud baseline run in this item? (a person decides)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(roadmap)scope of the title gives the scope.The baseline unblocks model selection and cost work but does not block a release or fix a defect.A measured baseline lets the team pick the cheapest model that meets a threshold, reducing repeated plan rework.The body estimates about 40k tokens and 2 hours for the definition, task slot, and report format, plus model calls for the run.Both work on the stage eval pipeline; #3028 created the golden set and scoring command, while this candidate runs that command with a cloud model to establish a quality baseline.dan-petty commentedon Nov 2, 2026
Data point from the owner, recorded for the refine step: the DeepSeek spend since it was enabled is $1.42. The owner calls this safe for implementation and testing runs. So the cost of a baseline run with
deepseek-v4.1-flash-1017is small against this figure, and the order of work stays as in the issue: measure first, then lower the cost. The cost of the cloud model run (for exampleclaude-sonnet-5-5) is not known yet, and the first run should report its spend.Generated by Claude Code
devops-cli-service commentedon Nov 2, 2026
Refine cannot set this item to Ready at ff9ad06 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
docs(openspec): plan #3060 plan model tier ladder for retries (#3225)
dan-petty commentedon Nov 5, 2026
Cost of the paid calls for this item, written before the first one.
Rule of the owner (2026-11-02): the cloud comparison uses only
claude-sonnet-5-5anddeepseek-v4.1-flash-1017, and only when the toolbox of #3037 works. #3037 is merged. No live score of the toolbox exists yet: the pull request of #3037 says that the run was too slow on the local model (210 to 345 s for one call).Plan of the paid calls:
deepseek-v4.1-flash-1017and the toolbox. This checks that the toolbox works in a live run. The window rule ends the tools at about 49,000 tokens of messages, so I expect at most 15 requests of about 40,000 input tokens, and two plan runs. That is at most about 1.2 million input tokens. At DeepSeek prices this is under 0.50 USD.claude-sonnet-5-5(3.0 USD for 1,000,000 input and 100,000 output tokens bygenai-prices). My estimate before the measure: 10 to 25 million input tokens with the toolbox, so about 20 to 50 USD for one full run. I will not start a full Sonnet run without the measured number.No other model is called.
dan-petty commentedon Nov 5, 2026
Update of the cost, after the first paid run (1 case,
deepseek-v4.1-flash-1017, toolbox).Measured for one case: 109,476 input tokens and 1,936 output tokens (two plan runs of about 55,000 input tokens each). Each plan run made 2 tool calls in its first request and offered no tool in its second request: the window rule (49,152 tokens of the 65,536 window) allows one round of tools. My first estimate (1.2 million input tokens for one case) was about ten times too high.
At the price of
claude-sonnet-5-5(genai-prices), the same tokens cost 0.24 USD for one case and about 9.5 USD for the 40 cases with the toolbox. The verify eval adds an amount that I did not measure.I will not run the full set. I run a sample of 4 cases (2116, 2130, 2147, 2152) with the toolbox, once with
claude-sonnet-5-5(expected at most 1.2 USD) and once withdeepseek-v4.1-flash-1017(expected under 0.10 USD). That is 8 case runs in total. The sample shows whether a baseline is worth its price. It is no baseline.devops-cli-service commentedon Nov 5, 2026
Refine cannot set this item to Ready at e38c8f3 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.