Skip to content

feat(roadmap): add toolset comparison to stage planner eval #3239

Closed

Description

@dan-petty

Problem

After #3238 the stage planner has named toolsets. Nothing says which set gives the best plans for the cost. The offline golden set (devops roadmap eval stage) judges only the defects that a gate can see (64 of 299 labeled defects, 21%). The rest needs a model run (#3207).

Proposed change

Add --toolset <name> to devops roadmap eval stage and a compare form that runs the same cases for two or more toolsets and prints one table.

Each row of the table holds, for one toolset: defects caught by the gates, defects caught by the verification pass, tool calls, requests, input and output tokens, elapsed time, and the cost of the run. A line states the difference to the first toolset (base).

The run uses the replay inputs of real staged items (the plans reviewed on 2026-11-02 are the first cases), not only the 40 golden cases. Each case runs at least 3 times, because the replies of a model differ, and the table shows the spread.

Acceptance criteria

  1. devops roadmap eval stage --toolset extended runs and names the toolset in its report.
  2. devops roadmap eval stage compare base extended prints one table with the columns above and runs offline with a fake client in the tests.
  3. The report states the number of runs for each case and the spread.
  4. The command is in the MCP exposure list as excluded or exposed, the docs are regenerated, and eval stage --dry-run states what it would run and what it would cost.

Notes

The first real comparison needs a cloud model and spend, so a person approves the run (#3207). Cheapest route: run base and extended on 10 cases that failed review, 3 times each, with deepseek-v4.1-flash-1017, then confirm the winner once with the verification model.

Related: #3238, #3207, #3201.

Alternatives check of 2026-11-05: partly.
Tool: promptfoo/promptfoo (https://github.com/promptfoo/promptfoo), MIT, last activity 2026-11-05, maintained.

Proposed design

Problem statement

The stage planner has named toolsets: base, extended and research. The project has no measurement of which set gives the best plans for its cost. The offline golden set judges only the defects that a gate can see: 64 of 299 labeled defects, 21%. This change adds a --toolset option and a compare form to devops roadmap eval stage. A person can then choose a toolset from measured defects, tokens, time and cost. The first paid comparison run needs #3207 and a person's approval; this issue delivers the offline command and its tests.

Acceptance criteria

Requirement: Toolset option

The devops roadmap eval stage command SHALL accept a --toolset option and SHALL name the selected toolset in its report.

Scenario: Run one toolset

  • WHEN A test runs devops roadmap eval stage --toolset extended with a fake client on the golden fixture set.
  • THEN The command exits 0 and its report contains the toolset name extended.

Requirement: Comparison table

The devops roadmap eval stage compare form SHALL run two or more toolsets on the same cases and SHALL print one table with the required columns.

Scenario: Compare base and extended offline

  • WHEN A test runs devops roadmap eval stage compare base extended with a fake client.
  • THEN The output has one row for base and one for extended, with columns for gate defects, verification defects, tool calls, requests, input tokens, output tokens, elapsed time and cost.

Requirement: Run count and spread

The comparison report SHALL state the number of runs for each case and SHALL show the minimum and maximum of each measured value.

Scenario: Three runs with different replies

  • WHEN A test runs a comparison with --runs 3 and a fake client that returns different token counts.
  • THEN The report states runs=3 for each case and shows the minimum and maximum token counts.

Requirement: Replay inputs

The comparison SHALL load replay cases from the golden set and from staged-item replay cases in the same case format.

Scenario: Mixed replay set

  • WHEN A test runs the comparison with a fixture directory that holds one golden case and one staged-item replay case.
  • THEN The report includes both case names and runs each case at least three times.

Requirement: Dry run

The devops roadmap eval stage compare command SHALL state the cases, runs, toolsets and estimated cost on --dry-run, and SHALL make no model call.

Scenario: Dry run makes no model call

  • WHEN A test runs devops roadmap eval stage compare base extended --dry-run with a fake client that fails on any call.
  • THEN The command exits 0, prints the case count, the run count, both toolset names and an estimated cost, and makes no model call.

Requirement: Cost from spend pricing

Each comparison row SHALL show the run cost calculated from the existing AI spend pricing data.

Scenario: Known token counts

  • WHEN A test uses a fake client with known token counts and a known pricing table.
  • THEN The row shows the expected cost.

Requirement: Delta line

The comparison SHALL print one delta line for each measured column as toolset - base.

Scenario: Delta to base

  • WHEN A test runs a comparison of base and extended with known values.
  • THEN The delta line shows extended - base for each measured column and the table keeps the raw values.

Requirement: Verification column

The comparison SHALL report the defects caught by the stage verification pass, and SHALL report not run when the run configures no verification pass.

Scenario: No verification pass configured

  • WHEN A test runs a comparison with a run configuration that sets no verification pass.
  • THEN The verification column shows not run and the command exits 0.

Requirement: MCP exposure

The roadmap eval stage command SHALL appear in the MCP exposure list as excluded.

Scenario: MCP exposure list check

  • WHEN A test reads the MCP exposure list.
  • THEN The list contains roadmap eval stage with the value excluded.

Requirement: Generated docs

The generated documentation SHALL describe the --toolset option and the compare form of devops roadmap eval stage.

Scenario: Docs regeneration

  • WHEN A test runs the docs generator and compares the output with the committed docs.
  • THEN The generated docs contain --toolset and compare, and no diff remains.

Existing Tool Considered

promptfoo (https://github.com/promptfoo/promptfoo), MIT, maintained, partly covers the need. It runs one eval over the same cases with several configurations, prints a comparison table, repeats each case (repeat: 3), records cost, latency and input and output tokens for each configuration, and runs offline with recorded inputs and custom Python assertions. It lacks the repository's stage planner toolsets, its gate and verification defect counts, its golden and staged-item replay case format, its AI spend pricing and ledger, its delta line against base, and its MCP exposure list and docs regeneration. The project extends devops roadmap eval stage for these repository-specific parts. The written cost is about 25k tokens and 2 engineer-days to build, keep and fix the command and its offline tests.

Key questions

  • Which command surface should select a toolset and compare toolsets?: Extend devops roadmap eval stage with a --toolset option and a compare subcommand. Do not add a new top-level command. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py, tests/roadmap/stage/test_roadmap_stage_tools.py]
    • Chosen: Extend the existing eval stage command. The command already owns the golden set, the stage evaluation and its report.
    • Rejected: Add a new top-level compare command. It duplicates the eval entry point and splits documentation and MCP exposure.
    • Rejected: Add only a --toolset flag. One flag cannot print two toolsets side by side.
  • Which toolset names should the comparison accept?: Read names from the stage toolset setting roadmap.stage.toolset. base, extended and research are the named sets today, and a new named toolset needs no eval change. (best practice) [sources: docs/ENV_VARS.md:145, src/devops_cli/config/settings.py, src/devops_cli/roadmap/stage/stage_tools.py, tests/roadmap/stage/test_roadmap_stage_tools.py]
    • Chosen: Use the stage toolset setting. It keeps eval names aligned with the planner and accepts future toolsets.
    • Rejected: Hard-code base and extended. A new toolset would need a second code change.
    • Rejected: Add eval-only toolset names. It creates names that the planner does not use.
  • How should the comparison handle model non-determinism?: Run each case at least three times. Add --runs with a default of 3. Report the minimum and maximum of each measured value as the spread. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py, tests/ai/test_run_comparison.py]
    • Chosen: At least 3 runs with minimum and maximum. It shows the spread in a simple way and meets the issue requirement.
    • Rejected: One run for each case. One model reply is a sample, not a measurement.
    • Rejected: Five runs with standard deviation. It costs more and standard deviation hides outliers.
  • How should the command calculate the cost of a run?: Reuse the existing AI spend pricing registry and ledger. Do not add a second price table to the eval command. (best practice) [sources: tests/ai/spend/test_ai_spend_pricing.py, tests/ai/spend/test_ai_spend_ledger.py, tests/ai/spend/test_ai_spend_cli.py]
    • Chosen: Reuse AI spend pricing and ledger. One price source stays current and matches the rest of the CLI.
    • Rejected: Hard-code prices in the eval stage command. A second price table drifts from the spend ledger.
    • Rejected: Report tokens only. The table must show cost.
  • How should the table show the difference to the base toolset?: Print one delta line for each measured column as toolset - base. Keep the raw values in the table rows. (best practice) [sources: tests/ai/test_run_comparison.py, src/devops_cli/commands/roadmap_eval_stage.py]
    • Chosen: One delta line per measured column. It gives the comparison that the issue asks for without hiding raw values.
    • Rejected: Only raw rows. The reader must subtract values by hand.
    • Rejected: Percentage difference only. It hides the absolute cost and token differences.
  • What MCP exposure should roadmap eval stage have?: List roadmap eval stage as excluded. It is an offline evaluation that can spend model money and writes local reports; it is not an MCP tool. (best practice) [sources: docs/MCP_TOOLS.md, tests/ai/mcp/test_mcp_exposure_table.py]
    • Chosen: Excluded. The command is a local evaluation with model spend and no MCP client use.
    • Rejected: Exposed. It adds an MCP surface for a long-running eval that no MCP client needs.
  • What should --dry-run print for the comparison?: Print the selected toolsets, the case count, the runs per case and the estimated cost from the pricing table. Make no model call. (best practice) [sources: tests/commands/test_ai_runs_cost_cache_dry_run.py, tests/commands/test_tf_dry_run.py, src/devops_cli/commands/roadmap_eval_stage.py]
    • Chosen: Print the full plan and estimated cost. The operator can approve the spend before the run.
    • Rejected: Print only the case list. It does not state the cost.
    • Rejected: Run a small sample. A dry run must make no model call.
  • Where should the comparison get replay inputs of real staged items?: Load staged-item replay cases as offline fixtures in the existing case format, together with the golden cases. Do not read live GitHub data during the comparison. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py, tests/roadmap/stage/test_roadmap_stage_tools.py]
    • Chosen: Offline fixtures in the existing case format. The acceptance requires offline tests with a fake client.
    • Rejected: Live GitHub reads. They make the test non-deterministic and need a token.
    • Rejected: Golden cases only. The issue requires real staged-item replay inputs.
  • Where do the real staged-item replay fixtures come from?: A separate issue records the plans reviewed on 2026-11-02 as fixtures. This issue ships the case loader and a sample staged-item replay case. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py]
    • Chosen: Record the real plans in a separate issue. The plans live outside the repository and a person must approve their capture.
    • Rejected: Capture the real plans in this issue. The implementer cannot read the 2026-11-02 plans offline.
    • Rejected: Use golden cases only. The issue requires real staged-item replay inputs.
  • What supplies the verification-pass defect count?: Use the stage job's existing verification and repair pass when the run configures it. Report the column as not run when no pass is configured. Do not add a new model verifier. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, docs/CONFIGURATION.md:280, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: Optional verification pass with not run. It keeps the column without reviving the deleted review verifier.
    • Rejected: Require a new model verifier. ADR 0005 deletes the model verifier and its guards.
    • Rejected: Remove the verification column. The issue requires the column.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    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. It improves evaluation decisions but does not fix a broken path or block a release.
    • Value: Medium. It lets a person pick the best toolset by cost and quality, which guides future tuning work.
    • Effort: Medium. It adds a CLI flag, a compare subcommand, a multi-run table, MCP exposure, and docs regeneration.
    • Related: test(roadmap): a golden set of plan cases and a scoring command for the stage job #3028, which asks for a different change. Both extend devops roadmap eval stage, but #3028 created the golden set and basic scoring while the candidate adds toolset selection and a multi-toolset comparison table.
  3. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 7072e35 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.

    • Does the first paid comparison run need a person? (a person decides)
  4. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: promptfoo/promptfoo (https://github.com/promptfoo/promptfoo)

    • License: MIT
    • Last activity: 2026-11-05
    • Maintained: yes

    Covers:

    • Runs one eval over the same test cases with several configurations side by side and prints a comparison table
    • Repeats each test case a set number of times (--repeat / repeat: 3) to sample model non-determinism
    • Records per-configuration cost, latency and input/output token usage in its metrics
    • Supports offline, deterministic test runs with custom Python assertions and recorded test inputs
    • Has command-line and CI integration, so a comparison can run without a cloud UI

    Lacks:

    • Does not know the repository's stage planner toolsets (base, extended) or read them from its toolset registry
    • Does not measure defects caught by the repository's gates or by its verification pass
    • Does not load the golden set or recorded staged-item replay cases in the repository's case format
    • Does not compute cost from the repository's AI spend pricing and ledger
    • Does not print the issue's delta line against the base toolset, nor handle MCP exposure list and docs regeneration

    Searches run:

    • LLM evaluation framework compare multiple configurations cost tokens latency table promptfoo
    • promptfoo repeat runs variance min max cost per eval comparison
    • compare agent tool configurations evaluation open source repeated runs report variance cost tokens

    Sources:

    Checked on 2026-11-05. A person decides what this means for the item. The check changes no label and closes no issue.

  5. changed the title [-]feat(roadmap): compare toolset configurations of the stage planner on the golden set[/-] [+]feat(roadmap): add toolset comparison to stage planner eval[/+] on Nov 6, 2026
  6. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 69 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(roadmap): compare toolset configurations of the stage planner on the golden set
    • After: feat(roadmap): add toolset comparison to stage planner eval
    • Source of the summary: the background model
  7. added
    status/ready
    and removed
    status/new
    on Nov 12, 2026
  8. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

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

    Moved to new items: #5191.

  9. added
    owner/service
    on Nov 13, 2026
  10. 103 remaining items

  11. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Stopped at scoped checks.

    Failure class: ci_infra.
    Action taken: none.
    Action left: retry: run the item again.

    Step Status Attempts Tokens in/out Last failing command
    group 3 done 1 9801544/31321 pytest on base: tests/roadmap/stage/test_roadmap_stage_eval_compare.py
    group 4 done 1 5682543/24257 pytest on base: tests/roadmap/stage/test_roadmap_stage_eval_compare.py
    group 5 done 1 6081326/23505 pytest on base: tests/roadmap/stage/test_roadmap_stage_eval_compare.py
    group 6 done 1 1717933/5926 -
    group 7 done 1 4501002/20470 pytest on base: tests/roadmap/stage/test_roadmap_stage_eval_compare.py
    group 8 done 1 3607004/19133 pytest on base: tests/roadmap/stage/test_roadmap_stage_eval_compare.py
    group 9 done 2 23518378/100980 pytest on base: tests/roadmap/stage/test_roadmap_stage_eval_compare.py
    group 10 done 1 820323/3626 -
    group 11 done 1 4585004/12665 -
    scoped checks stopped 1 0/0 -

    Reason:

    SecurityError: Prohibited dangerous environment variable override: 'PYTEST_ADDOPTS'
    

    Last message of the agent (a claim that no check verified): none.

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

    The job kept the commits that passed on the branch feat/3239-add-toolset-comparison-to-stage-planner on origin. The last is b34b1ded54e96dd54a3e443b1acd9097cf9abf11. The pull request stays a draft. The next run continues from it, runs no group that is ticked, and runs the scoped checks again.

  12. added
    status/blocked
    and removed
    status/in-progress
    on Nov 15, 2026
  13. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-implement-devops-cli-3239-3c6ee4 ended: succeeded.
    Image digest: sha256:222ceedab21f2cbe301701360c0360a9e06e95b432951799f870437a70014f57

    The last lines of its log:

    Tool call: run_command, started: uv run devops ci test tests/docs/test_vale_ste.py ...
    Tool call: run_command, program uv, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: run_command, started: git diff -- docs/ROADMAP_WORKFLOW.md | head ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci docs 2>&1 ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git grep -ln CONST_ -- tests/invariants ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git grep -ln docs/roadmap/stage.md\\|roadmap/stage.md -- tests/roadmap ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git grep -n roadmap/stage.md -- tests/roadmap/stage/test_roadmap_stage_window.py ...
    Tool call: run_command, program git, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: run_command, started: uv run devops ci test tests/invariants/test_change_folders.py ...
    Tool call: run_command, program uv, ok.
    Tool call: edit_file, ok.
    Tool call: run_command, started: git grep -n <masked> -- openspec/changes/3239-add-toolset-comparison-to-stage-planner/tasks.md
    Tool call: run_command, program git, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: run_command, started: git diff --stat
    Tool call: run_command, started: uv run devops ci docs 2>&1 ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git status --short
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git log --oneline -3
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git show --stat --oneline HEAD
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git grep -n <masked> -- docs/roadmap/stage.md
    Tool call: run_command, started: git grep -n <masked> -- openspec/changes/3239-add-toolset-comparison-to-stage-planner/tasks.md
    Tool call: run_command, program git, ok.
    Tool call: run_command, program git, ok.
    Failure class ci_infra. Action left: retry.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    
  14. added
    status/planned
    and removed
    owner/service
    status/blocked
    on Nov 15, 2026
  15. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at scoped checks by the rule digest: the runner image changed since the stop, from sha256:222ceedab21f2cbe301701360c0360a9e06e95b432951799f870437a70014f57 to sha256:8b7cd197b6be84b145b5873d8b404ec79c3c0cfb19c6740ff69353df434c6d02, and the class ci_infra of the stop is one that a new attempt can fix. The item is Planned again, and the Service takes it in the next round. The Service clears at most 1 for each class and 3 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a comment implement: retry.

  16. added
    status/in-review
    and removed
    status/planned
    on Nov 16, 2026
  17. removed
    status/in-review
    on Nov 16, 2026
  18. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 03:02 UTC

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/roadmaptype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions