Skip to content

chore(roadmap): Compare Sonnet and DeepSeek on stage and implement work #4411

Open

Description

@devops-cli-service

Split from #4400.

Problem The Service must know how Sonnet differs from DeepSeek in the stage and implement workflows. Sonnet can then be an escalation tier with a known cost and result. The first trial (2026-11-09) cost about 58 to 75 USD and staged nothing. ## Why deferred The study needs live model runs. The owner must set a spend cap before any run, and the suggested cap is 25 USD for the whole study. No run may start until the owner sets the cap. The comparison harness from the parent item gives the table with no live run. ## Acceptance criteria - A table for at least 10 stage items and 5 implement groups, run with Sonnet and with DeepSeek on the same input: gate refusals by gate, tool calls, requests, input and output tokens, minutes, cost, outcome. - The list of differences: tool calls before the first plan, use of the callers and search_code tools, size of tool results, repeated reads, final reply form, refusals by the trace and citation gates. - Whether prompt caching applies through LiteLLM and what it saves. - Whether effort, thinking or max_tokens change cost and quality. - Whether the prompts, tool descriptions or gates need a form that suits the model. - An escalation rule, for example after two DeepSeek stops on the same item, with the cost cap per item. - One fix issue for each finding. - The whole study stays within the cap that the owner sets. - The runs use the golden stage set and the scratch settings copy, not the live ConfigMap.

Dependencies

Proposed design

Problem statement

Do not start a live model run before the owner sets the spend cap and #6521 closes. The Service cannot choose Sonnet as an escalation tier. It does not know how Sonnet differs from DeepSeek in the stage and implement jobs. The first Sonnet trial on 2026-11-09 cost about 58 to 75 USD and staged nothing. This item measures both models on the same inputs and records the cost, the result and an escalation rule. The study report is a page of the documentation site.

Acceptance criteria

Requirement: Report page in the site nav

The study report docs/roadmap/sonnet-deepseek-study.md SHALL be a page of the documentation site in a nav tab.

Scenario: Site build lists the report

  • WHEN The validator uv run devops docs site build runs on the branch that holds the report.
  • THEN The build passes and the built site lists the report in a nav tab.

Requirement: Comparison table

The study report SHALL hold one comparison table with at least 10 stage rows and 5 implement rows for each model and the eight named measures.

Scenario: Table size and columns

  • WHEN The test tests/docs/test_sonnet_deepseek_study.py parses the table of the report.
  • THEN The table holds at least 10 stage rows and 5 implement rows for Sonnet and for DeepSeek, and one column for each of gate refusals by gate, tool calls, requests, input tokens, output tokens, minutes, cost and outcome.

Requirement: Difference list

The study report SHALL give one Sonnet entry and one DeepSeek entry for each of the seven named differences.

Scenario: Each difference holds both entries

  • WHEN The test parses the difference section of the report.
  • THEN Each of tool calls before the first plan, use of callers and search_code, size of tool results, repeated reads, final reply form, trace gate refusals and citation gate refusals holds one Sonnet entry and one DeepSeek entry.

Requirement: Prompt caching result

The study report SHALL state whether LiteLLM prompt caching applies to Sonnet and the cost that it saves.

Scenario: Caching states apply or no apply

  • WHEN The test parses the caching section of the report.
  • THEN The section states that caching applies or does not apply, and gives a saved cost in USD or states that no saving occurred.

Requirement: Parameter effects

The study report SHALL give one cost result and one quality result for each of effort, thinking and max_tokens.

Scenario: Each parameter holds both results

  • WHEN The test parses the parameter section of the report.
  • THEN Each of the three parameters holds one cost result and one quality result.

Requirement: Form recommendation

The study report SHALL give exactly one recommendation for prompts, one for tool descriptions and one for gates.

Scenario: One recommendation for each form

  • WHEN The test parses the recommendation section of the report.
  • THEN The section holds exactly one recommendation for prompts, exactly one for tool descriptions and exactly one for gates.

Requirement: Escalation rule

The study report SHALL define an escalation rule that moves an item to Sonnet after two DeepSeek stops on the same item, with a cost cap for each item.

Scenario: Rule names the trigger and the cap

  • WHEN The test parses the escalation rule of the report.
  • THEN The rule names two stops on the same item as the trigger and gives a cost cap for each item in USD.

Requirement: Fix issue per finding

The study report SHALL give exactly one fix issue for each finding and a link from that finding to the issue.

Scenario: Each finding maps to one issue

  • WHEN The test parses the findings table of the report.
  • THEN Each finding row holds exactly one issue reference and no two finding rows hold the same reference.

Requirement: Spend within the cap

The study report SHALL state the total cost and the cap that the owner set, and the total MUST be at or below the cap.

Scenario: Total cost at or below the cap

  • WHEN The test adds the cost column of every run and compares the total with the cap that the report states.
  • THEN The total is at or below the stated cap.

Requirement: Scratch settings and golden set

The study report SHALL name the golden stage set and the scratch settings copy that the runs used, and MUST name no live ConfigMap.

Scenario: Settings source named

  • WHEN The test parses the settings section of the report.
  • THEN The section names the golden stage set and the scratch copy, and the report names no live ConfigMap.

Existing Tool Considered

No alternatives check has run on this item. promptfoo is an open, maintained tool that compares models on one input and records cost, tokens, latency and pass rate. It covers the comparison of two models in part. It lacks the roadmap stage and implement harness, the tool trace of callers and search_code, the golden stage set, and the trace and citation gates. The study uses the comparison harness of parent #4400 and builds no new comparison code.

Key questions

  • Which code do the compared runs exercise?: The stage job in src/devops_cli/roadmap/stage/stage.py with its tools in src/devops_cli/roadmap/stage/stage_tools.py, and the implement job in src/devops_cli/roadmap/implement/implement.py. [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_tools.py, src/devops_cli/roadmap/implement/implement.py]
  • Which settings source do the runs use?: Use a scratch settings copy that DEVOPS_CLI_CONFIG names, built from the golden stage set. The runs never read the live ConfigMap. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/config/constants.py]
    • Chosen: Scratch settings copy named by DEVOPS_CLI_CONFIG. It keeps the production settings unchanged and makes each run repeatable.
    • Rejected: Live ConfigMap. It changes the production settings and makes the runs unrepeatable.
  • How does the study measure LiteLLM prompt caching?: Read the cache read and cache write token counts and the cost fields of the LiteLLM usage of each run. Record the saved cost. (best practice) [sources: src/devops_cli/ai/client/base.py, src/devops_cli/ai/run_store.py]
    • Chosen: Read the cache and cost fields of the LiteLLM usage. LiteLLM reports the cache token counts and the cost of each request.
    • Rejected: Infer the cache from the latency. Latency alone cannot show a cache hit or its saving.
  • How does the study test effort, thinking and max_tokens?: Change one parameter at a time against a fixed baseline. Record the cost and the gate outcome of each run. (best practice) [sources: src/devops_cli/config/settings.py:1569, src/devops_cli/roadmap/implement/implement.py:225, src/devops_cli/ai/client/claude.py]
    • Chosen: One parameter at a time. It isolates the effect of each parameter within the cap.
    • Rejected: Full factorial. It multiplies the runs beyond the cap.
    • Rejected: Test no parameter. The item asks for the cost and quality effect of each parameter.
  • What escalation rule should the study define?: Move the item to Sonnet after two DeepSeek stops on the same item. Give a cost cap for each item in USD. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement.py]
    • Chosen: Two stops on the same item. The body gives two stops as the example and it allows one retry first.
    • Rejected: One stop. It escalates before a retry can clear a transient stop.
    • Rejected: Cost threshold only. It ignores repeated stops that show a model mismatch.
  • How does the study keep the total cost at or below the cap?: Estimate the cost before each run and stop when the recorded spend reaches the cap. Record the remaining budget. (best practice) [sources: src/devops_cli/ai/run_store.py]
    • Chosen: Pre-run estimate and hard stop. It stops the study before a run can pass the cap.
    • Rejected: Post-run check only. It can pass the cap before the check runs.
  • How does the study turn a finding into a fix issue?: File one fix issue for each finding with a Conventional Commit title, and link the issue from the finding row. (best practice) [sources: AGENTS.md, CONTEXT.md]
    • Chosen: One issue for each finding. It keeps each fix small and traceable to its finding.
    • Rejected: One issue for each group of findings. It hides separate findings in one large fix.
  • What spend cap does the study use?: The owner sets the cap before any live run. The body suggests 25 USD for the whole study. Use 25 USD unless the owner sets another value. (a person decides)

Open questions

  • What spend cap does the study use? (a person decides)

Fit

Fits in one pull request.

Suspected block

The owner must set the study spend cap before any live model run; the body suggests 25 USD for the whole study.

Dependencies

#6521

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • src/devops_cli/roadmap/implement/implement.py
  • src/devops_cli/roadmap/stage/stage.py

Activity

  1. added
    source/agent
    type/chore
    scope/roadmap
    status/new
    value/medium
    effort/high
    on Nov 10, 2026
  2. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    ContributorAuthor

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

    • Type: type/chore. The chore prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P3-Low. The study is deferred until the owner sets a spend cap, so it is not urgent.
    • Value: Medium. The study informs the escalation tier and cost control, but it delivers no direct user-facing change.
    • Effort: High. It needs live runs of two models on 10 stage items and 5 implement groups, plus analysis of many dimensions.
    • Related: chore(roadmap): investigate how Sonnet differs in stage #4400, which asks for a different change. Both concern how Sonnet differs from DeepSeek in stage; #4400 is the parent investigation and the candidate is its measurement split.
  3. added
    priority/p3-low
    on Nov 10, 2026
  4. changed the title [-]chore(roadmap): measure Sonnet against DeepSeek on the stage and implement sets[/-] [+]chore(roadmap): Compare Sonnet and DeepSeek on stage and implement work[/+] on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    ContributorAuthor

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

    • Before: chore(roadmap): measure Sonnet against DeepSeek on the stage and implement sets
    • After: chore(roadmap): Compare Sonnet and DeepSeek on stage and implement work
    • Source of the summary: the background model
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    ContributorAuthor

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

    • What spend cap applies to the whole study? (a person decides)
  7. dan-petty commented on Nov 20, 2026

    @dan-petty
    Owner

    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.

  8. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  9. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See the first point of Open questions and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  10. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See the first point of Open questions and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

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/highpriority/p3-lowscope/roadmapsource/agentstatus/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions