Repository navigation
Description
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
modelfield. 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.toother, so a local model name such asqwen3.8:27bbecomesother. - Mean input tokens per request in 7 days (
devops_cli_ai_tokens_total{type="prompt"}/devops_cli_ai_requests_total, modeldeepseek-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 countsinput_tokens_p50andinput_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-modelgives, for each workflow and model: n,p, the Wilson interval, the first-pass ratio, the median and p90 ofinput_tokens_max, seconds and cost for each success. - Tier recommendation, with its evidence (n, interval, top classes, context size), in the report, in
--format jsonand 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 ofinput_tokens_maxis 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, andpremise_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.
- Local candidate: held grade 90 or better (or
- 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:27bkeeps a usable model name, notother. - 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_defectgives "frontier candidate". The same at 70%ci_infragives none. - An implement attempt gives
input_tokens_p50andinput_tokens_maxfor 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:27bon the gateway routelocal/qwen3.8:27b - THEN the line holds
model=qwen3.8:27bandroute=local/qwen3.8:27b, notmodel=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=3000andinput_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-modelreads 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:27band the task of the workflow setscontext_window32768 - 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_window32768 - 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_defectfailures and 30%ci_infrafailures - 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_infrafailures - 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 jsonruns - 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 ownerand 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 inmodel=and the route inroute=, somodel=qwen3.8:27bandroute=local/qwen3.8:27b. A name over 128 characters or with a space or=isother. The route name alone is no fix:local/qwen3.8:27bholds: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:27bholds the same:and/, so it becomesothertoo. - 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.
- Chosen: Model-name pattern with
- Where do the input tokens of each model request come from?:
track_request_spendinai/spend/ledger.pyholds the requested model,served_modelandprompt_tokensof each request, and it callsrecord_attempt_ai(ledger.py:1090-1092). The attempt context today adds those tokens to onetokenscount (job_result.py:221-236). This change passes the served model, the route andprompt_tokenstorecord_attempt_ai, and the context keeps one entry for each request, so the line writesmodels,input_tokens_p50andinput_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 inroute=. On a tie, the name that sorts first, so the line is the same on each run.modelscounts 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_confintwithmethod="wilson", aswilson_intervalalready does (job_grade.py:194-201).statsmodels==0.15.0is 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.
- Chosen: statsmodels
- Where do the tier thresholds live?: As module constants in
roadmap/job_grade_report.py, next toMIN_ATTEMPTSand_ALPHAofjob_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 tolocal/qwen3.8:27bonly 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_ATTEMPTSand_ALPHAdo. - Rejected: Settings under
roadmap.*. The config holds operational keys, and a threshold that a deployment changes makes two grades incomparable.
- Chosen: Module constants. The modules hold their fixed rules as constants with the owner rule and its date, as
- 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 jsonoutput hold the recommendation and its evidence, and the job-success page already gives--format jsonthe 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]- Chosen: The report and its JSON hold it. One writer keeps the rule in one place, and each reader takes the same value.
- Rejected: Write the gauge row and the feat(roadmap): a daily grade-check step keeps one issue per workflow #5173 issue here. It adds a second writer and a dependency on two other items for one number.
- 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-5since 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 isclaude-sonnet-5-5gets the textfrontier 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.
Activity
dan-petty commentedon Nov 12, 2026
Both extend the devops roadmap eval grades command; #5165 adds the base per-workflow grade, while this candidate adds the --by-model flag, token stats, and tier recommendation.devops-cli-service commentedon Nov 16, 2026
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_totalmetric hold model and tokens but not the attempt outcome, so they cannot supply success per model.Tool: none found
Lacks:
Searches run:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 8ccd95a (see proposed design in issue body).
devops-cli-service commentedon Nov 22, 2026
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:
Sources: