Skip to content

feat(roadmap): eval grades shows success and context size per model #5176

Open

Description

@dan-petty

Part of #5164 (child 11).

Problem or Motivation

The owner wrote on 2026-11-12, word for word:

one more consideration to make with agentic workflows is the model tier, so jobs that frequently succeed at a small context window would be good candidates to test running with a local model and tasks that are failing could be good candidates to run with a frontier model

No measure joins the grade of a workflow with its model and its context size:

  • The result line has no model field. The stage reply log names the model that answered (answered=deepseek-v4.1-flash-1017), but the result line does not.
  • The writer (roadmap/job_result.py) changes a name with a character other than a letter, a digit, _, - or . to other, so a local model name such as qwen3.8:27b becomes other.
  • Mean input tokens per request in 7 days (devops_cli_ai_tokens_total{type="prompt"} / devops_cli_ai_requests_total, model deepseek-v4.1-flash-1017): retitle 1,812; intake 3,219; alternatives 17,108; refine 51,292; stage 70,630; implement 4,488,151 (the runner records a Job as one request, so this value is not a context size).
  • Intake without the measure defect of fix(roadmap): leave out changed intake candidates and count plan calls #5166 is 37 of 37 attempts (grade 100) at about 3.2K input tokens for each request. That is the profile that the owner names for a local model, and no report shows it.

Proposed Solution & Architectural Design

  • Line. Through the attempt context of feat(roadmap): result lines state first-pass, model calls and cost #5168, add model= (the model that answered the most requests of the attempt; the gateway route name when the model name holds : or /), models (the number of different models that answered), and the counts input_tokens_p50 and input_tokens_max (input tokens for each request of the attempt). The runner of implement reports each model request, not one total for the Job.
  • Report. devops roadmap eval grades --by-model gives, for each workflow and model: n, p, the Wilson interval, the first-pass ratio, the median and p90 of input_tokens_max, seconds and cost for each success.
  • Tier recommendation, with its evidence (n, interval, top classes, context size), in the report, in --format json and in the issue of the grade-check step (feat(roadmap): a daily grade-check step keeps one issue per workflow #5173):
    • Local candidate: held grade 90 or better (or 100), 30 or more attempts, the current model is hosted, and the p90 of input_tokens_max is at most half of the context window of a local tier (the gateway routes, devops ai gateway routes).
    • Frontier candidate: grade under 80 (first at under 60), 30 or more attempts, and model-capability classes are half or more of the failures with infra=false. Capability classes: plan_defect, test, lint, types, no_change_in_fix, tests_lost, outside_plan, parser. Not capability: gate classes (refused_tool, read_only_path, output_cap), infrastructure classes, and premise_false, conflict, head_moved, timeout.
    • The frontier candidates come from the owner comparison set (Claude Sonnet 5.5 and DeepSeek V4.1 Flash). A Sonnet trial waits until the owner lifts the hold of 2026-11-11 ("hold off on sonnet for now"). The report shows "frontier candidate, held by the owner" in that case.
  • The gauge row of feat(roadmap): a dashboard and alerts for the pipeline #3655 shows the current model, the context size and the recommendation for each workflow.

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/job_result.py, src/devops_cli/commands/roadmap_eval*.py) and AI & Agentic Review Pipeline (src/devops_cli/ai/spend/ledger.py).

Existing Tool Considered

LiteLLM spend logs and devops_cli_ai_tokens_total hold the model and the tokens of each request, but not the attempt or its result, so they cannot give success for each model. The report reuses the Loki queries of #5165 and statsmodels. #4284 asks Jev for a tier for each stage item; this item gives the measure that can check such a choice. Cost: about 300,000 tokens, 7 hours elapsed.

Acceptance Criteria

  • A line with model qwen3.8:27b keeps a usable model name, not other.
  • A fixture of 37 intake attempts, all first-pass, at 3,200 input tokens, with a local tier of 32K context, gives "local candidate" with n, the interval and the context size.
  • A fixture of 40 stage attempts at 0.55 with 70% plan_defect gives "frontier candidate". The same at 70% ci_infra gives none.
  • An implement attempt gives input_tokens_p50 and input_tokens_max for each model request.

Dependencies

#5165 (the report), #5168 (the attempt context).

Alternatives check of 2026-11-22: partly.
Tool: langfuse/langfuse (https://github.com/langfuse/langfuse), NOASSERTION, last activity 2026-11-21, maintained.
Reason: Searches found no tool that joins a roadmap attempt's grade with its model and context window; Langfuse does record model, input tokens, cost and an outcome score per generation, but gives no Wilson interval or tier rule.

Covers:

  • Model name, input tokens and cost recorded per generation
  • Outcome score attached to the trace of a run
  • Dashboard and API filter and group by model and score

Lacks:

  • No attempt result line or grade per workflow
  • No Wilson interval per workflow and model row
  • No local or frontier tier rule, no owner hold text
  • No median or p90 of input tokens for each attempt

Proposed design

Problem statement

The result line of a roadmap job holds no model, so no report joins the grade of a workflow with the model and the context size that it ran on. The line writer turns a model name that holds : or / into other, and every configured group holds one of those characters (local/qwen3.8:27b, openrouter/deepseek/deepseek-v4.1-flash-1017). Intake succeeds at about 3,200 input tokens for each request, which is a profile for a local model, and no report shows it. This item adds the model, the route and the input-token counts to the line. It adds a per-model report with a tier recommendation.

Acceptance criteria

Requirement: Model name on the result line

The result line SHALL write the served model name and the gateway route name when they hold : or /.

Scenario: A served model name with a colon

  • WHEN an attempt records the served model qwen3.8:27b on the gateway route local/qwen3.8:27b
  • THEN the line holds model=qwen3.8:27b and route=local/qwen3.8:27b, not model=other

Requirement: Model and input-token counts of an attempt

The attempt context SHALL record the input tokens of each model request and the number of different models that answered.

Scenario: Three requests from two models

  • WHEN an implement attempt makes three model requests with 1,000, 3,000 and 8,000 input tokens from two models
  • THEN the result line holds models=2, input_tokens_p50=3000 and input_tokens_max=8000

Requirement: The per-model grade row

The report SHALL give one row for each workflow and model with the count, the success ratio, the Wilson interval and the first-pass ratio.

Scenario: A report with two models

  • WHEN devops roadmap eval grades --by-model reads lines of one workflow that name two models
  • THEN the report holds one row for each model with its count, ratio, interval and first-pass ratio

Requirement: The token and cost columns of a row

The report SHALL give the median and p90 of input_tokens_max, and the seconds and cost of each success, for each row.

Scenario: A row with five attempts

  • WHEN a workflow and model has five attempts with input-token maxima of 2,000, 2,000, 4,000, 6,000 and 8,000
  • THEN the row holds a median of 4,000, a p90 of 8,000, and the seconds and cost of each success

Requirement: The hosted flag and the context window

The report SHALL take the hosted flag from the route name and the context window from the context_window of the workflow's task.

Scenario: A local route with a task window

  • WHEN a line holds route=local/qwen3.8:27b and the task of the workflow sets context_window 32768
  • THEN the row is local and its window is 32768 tokens

Requirement: The local candidate rule

A row SHALL be a local candidate when the grade is 90 or better, the count is 30 or more, the route is hosted, and the p90 of input_tokens_max is at most half of the context_window of the workflow's task.

Scenario: Intake at grade 100 with a 32K task window

  • WHEN 37 intake attempts are all first pass at 3,200 input tokens, the route is hosted, and the task sets context_window 32768
  • THEN the row is a local candidate with n=37, the Wilson interval and the 32768-token window

Requirement: The frontier candidate rule

A row SHALL be a frontier candidate when the grade is under 80, the count is 30 or more, and half or more of its failures with infra=false are capability classes.

Scenario: Stage failures from the plan

  • WHEN 40 stage attempts at 0.55 have 70% plan_defect failures and 30% ci_infra failures
  • THEN the row is a frontier candidate

Requirement: No frontier candidate from the infrastructure

A row MUST NOT be a frontier candidate when its failures with infra=false are not capability classes.

Scenario: Stage failures from the infrastructure

  • WHEN 40 stage attempts at 0.55 have 70% ci_infra failures
  • THEN the row has no recommendation

Requirement: The recommendation in the JSON output

The report SHALL write each recommendation and its evidence in its --format json output.

Scenario: The JSON output

  • WHEN devops roadmap eval grades --by-model --format json runs
  • THEN each row holds its recommendation with n, the Wilson interval, the top classes and the context size

Requirement: The owner hold on Sonnet

The report SHALL show frontier candidate, held by the owner for a held model and start no trial.

Scenario: A frontier candidate on a held model

  • WHEN a frontier candidate names the route or model claude-sonnet-5-5
  • THEN the report shows frontier candidate, held by the owner and starts no trial

Existing Tool Considered

The alternatives check of 2026-11-16 gave the verdict none and named no tool, and a further web search found no open, maintained tool that covers the need. LiteLLM spend logs and devops_cli_ai_tokens_total hold the model and the tokens of each request, but not the attempt or its result, so they give no success for each model. No open tool joins a per-model token context with the outcome of an attempt, gives a Wilson interval, and gives a tier rule. The change builds its own report in roadmap/job_grade_report.py, at a written cost of about 300,000 tokens and 7 hours elapsed.

Key questions

  • How does the result line keep a model name that holds : or /?: The line gets a model-name pattern that admits : and /, the two characters of every configured group (local/qwen3.8:27b, openrouter/deepseek/deepseek-v4.1-flash-1017, anthropic/claude-sonnet-5-5). It writes the served model name in model= and the route in route=, so model=qwen3.8:27b and route=local/qwen3.8:27b. A name over 128 characters or with a space or = is other. The route name alone is no fix: local/qwen3.8:27b holds : and / too. (best practice) [sources: src/devops_cli/roadmap/job_result.py:54, k8s/llm/gateway/config.yaml:317, k8s/devops/configmap.example.yaml:135]
    • Chosen: Model-name pattern with : and /. It writes the name as served and the route as configured, so the report groups and joins exactly, and the two characters are bounded with no space or =.
    • Rejected: Gateway route name only. The route name local/qwen3.8:27b holds the same : and /, so it becomes other too.
    • Rejected: Replace : and / with -. It collides two names that differ only in those characters and loses the exact join to the task setting.
    • Rejected: Write other. The model is lost, and the report cannot group the attempts by model.
  • Where do the input tokens of each model request come from?: track_request_spend in ai/spend/ledger.py holds the requested model, served_model and prompt_tokens of each request, and it calls record_attempt_ai (ledger.py:1090-1092). The attempt context today adds those tokens to one tokens count (job_result.py:221-236). This change passes the served model, the route and prompt_tokens to record_attempt_ai, and the context keeps one entry for each request, so the line writes models, input_tokens_p50 and input_tokens_max. The implement runner reports each model request, not one total for the Job. [sources: src/devops_cli/ai/spend/ledger.py:1090, src/devops_cli/roadmap/job_result.py:221]
  • Which model does model= name when several models answer one attempt?: The served model that answered the most requests, with its route in route=. On a tie, the name that sorts first, so the line is the same on each run. models counts the different served models. (best practice) [sources: src/devops_cli/roadmap/job_result.py:293]
    • Chosen: Most requests, then the first name. It names the model that did the most work and gives the same line on each run.
    • Rejected: The last model that answered. A retry or a fallback would hide the model that did most of the work.
    • Rejected: One field for each model. The line has no fixed set of model fields, so a query cannot group them.
  • Which library gives the Wilson interval?: statsmodels.stats.proportion.proportion_confint with method="wilson", as wilson_interval already does (job_grade.py:194-201). statsmodels==0.15.0 is a locked dependency (pyproject.toml:73), and the agentic-jobs guideline names it for the Wilson interval. The project writes no interval code of its own. (best practice) [sources: pyproject.toml:73, src/devops_cli/roadmap/job_grade.py:194, docs/guidelines/agentic-jobs.md:277, openspec/specs/roadmap-job-grades/spec.md:24]
    • Chosen: statsmodels proportion_confint. An open, maintained library that the project already locks gives the Wilson interval, so the project keeps no formula of its own.
    • Rejected: Own Wilson formula. It adds code that the project must keep and test, for a formula that a locked dependency gives.
  • Where do the tier thresholds live?: As module constants in roadmap/job_grade_report.py, next to MIN_ATTEMPTS and _ALPHA of job_grade.py, with the owner rule and its date in a comment. The local threshold is 90, a margin above the recorded owner rule that a job moves to local/qwen3.8:27b only after its grade reaches 80% (owner decisions of 2026-11-07, feat(k8s): the Service uses one model for every chat slot #3874, and 2026-11-16). They are no settings, because they are one measured rule and not an operational key. (best practice) [sources: src/devops_cli/roadmap/job_grade.py:80, docs/CLUSTER.md:51, src/devops_cli/roadmap/job_grade_report.py]
    • Chosen: Module constants. The modules hold their fixed rules as constants with the owner rule and its date, as MIN_ATTEMPTS and _ALPHA do.
    • Rejected: Settings under roadmap.*. The config holds operational keys, and a threshold that a deployment changes makes two grades incomparable.
  • Does this item write the recommendation into the gauge row of feat(roadmap): a dashboard and alerts for the pipeline #3655 and the issue of feat(roadmap): a daily grade-check step keeps one issue per workflow #5173?: No. The report and its --format json output hold the recommendation and its evidence, and the job-success page already gives --format json the same report to an agent. The gauge row of feat(roadmap): a dashboard and alerts for the pipeline #3655 and the grade-check issue of feat(roadmap): a daily grade-check step keeps one issue per workflow #5173 read that output. This item adds no second writer. (best practice) [sources: docs/roadmap/job-success.md:72, src/devops_cli/roadmap/job_grade_report.py]
  • Does the owner hold on Sonnet still apply, and how does the report show it?: The hold of 2026-11-11 applies: SECURITY.md rule 13 says the owner holds claude-sonnet-5-5 since 2026-11-11, and no trial, eval or comparison runs with it until the owner lifts the hold. A frontier candidate whose route or model is claude-sonnet-5-5 gets the text frontier candidate, held by the owner, and the report starts no trial. The hold is one constant with its date. (best practice) [sources: SECURITY.md:40]
    • Chosen: One constant with the date and the held text. The report shows the hold and starts no trial, and one constant is easy to remove when the owner lifts it.
    • Rejected: Read the hold from the owner's comments. The report reads no issue comment, and a comment is no fixed input.
    • Rejected: Run the Sonnet trial with no hold. SECURITY.md records the hold, and the owner has not lifted it.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5165, #5168

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches (all 8 attempts) returned no relevant open-source tool. The need is a project-specific join of workflow success grades with per-model token context size and a tier recommendation rule, which no general LLM-observability or eval library provides. The issue itself confirms that LiteLLM spend logs and the existing devops_cli_ai_tokens_total metric hold model and tokens but not the attempt outcome, so they cannot supply success per model.

    Tool: none found

    Lacks:

    • No tool joins LLM model metadata (name, tokens) with workflow success/failure outcome per attempt.
    • No tool provides per-model grade with Wilson confidence interval and p50/p90 input-token context size.
    • No tool emits a tier recommendation (local vs frontier) from the grade-and-context-size combination.

    Searches run:

    • open source LLM observability tool track per-model success rate job outcomes confidence interval, results: 5
    • Langfuse Arize Phoenix LLM observability per-model metrics success rate report, results: 5
    • Langfuse LLM observability track model token usage success failure per model dashboard, results: 5
    • LLM evaluation tool per-model grade confidence interval Wilson success rate open source, results: 5
    • "Langfuse" OR "Arize Phoenix" OR "Helicone" LLM tracking model success rate per model report, results: 5
    • LLM observability platform track model usage tokens success failure dashboard open source, results: 5
    • Langfuse github open source LLM engineering platform, results: 5
    • LLM eval tool per-model success rate grade Wilson interval model tier recommendation local model frontier model, results: 5
    • Helicone LLM gateway token tracking per model analytics, results: 5
    • statsmodels Wilson confidence interval LLM model evaluation success rate report tool, results: 5

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

  5. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  6. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

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

  7. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: none, no tool. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • open source LLM router model routing cost token analytics per request outcome feedback, results: 5
    • LLM observability tool join per-model token usage with workflow outcome success rate, results: 5
    • LiteLLM spend logs per model success rate analytics, results: 5
    • Langfuse group traces by model token usage success score dashboard, results: 5
    • LLM model tier recommendation benchmark success rate context window tool, results: 5
    • Langfuse open source LLM observability, results: 5
    • LiteLLM proxy model spend tracking documentation, results: 5
    • "langfuse" github, results: 5
    • Arize Phoenix OpenTelemetry LLM tracing evaluations documentation, results: 5
    • Wilson score interval per model success rate report LLM agent evaluation tool, results: 5

    Sources:

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/p2-mediumscope/roadmapsource/agentstatus/readytype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions