Repository navigation
Description
Split from #6360.
ProblemThe intake job writes result lines with no tokens= field. devops roadmap eval grades shows no efficiency for intake.## Why deferredplan_intake() makes the model calls and returns an IntakePlan. log_job_result(RoadmapJob.INTAKE, ...) runs later in apply_intake(). The shared _embed() batch call also makes per-candidate attribution unclear. A change must carry token counts on IntakeDecision and decide how to attribute the batch tokens. That change is outside #6360.## Acceptance criteria- The intake job SHALL carry the token count of its model calls on each intake result line as tokens=.- A test SHALL run one intake attempt with a fake model call that reports 123 tokens. The result line for that attempt SHALL contain tokens=123.- devops roadmap eval grades SHALL show a non-null efficiency value for intake when its result lines carry tokens=.
Proposed design
Problem statement
The intake job writes result lines with no tokens= field. devops roadmap eval grades then shows no efficiency for intake. The change carries the token count of the model calls on IntakeDecision and writes it on each intake result line. It also shares the tokens of one embedding batch across the candidates that the batch served.
Acceptance criteria
Requirement: Intake decision token count
IntakeDecision SHALL carry the number of tokens that the model calls for its candidate used.
Scenario: One candidate with a fake triage call
- WHEN a test calls
plan_intake()for one candidate and the fake triage call reports 123 tokens - THEN the
tokensfield of the decision for that candidate is 123.
Requirement: Intake result line tokens field
The intake job SHALL write the token count of its model calls on each intake result line as tokens=.
Scenario: One intake attempt with a fake model call
- WHEN a test runs one intake attempt and the fake model call reports 123 tokens
- THEN the result line of that attempt contains
tokens=123.
Requirement: Shared batch token share
The intake job SHALL share the tokens of one embedding batch across the candidates that the batch served, and SHALL keep the sum of the shares equal to the batch total.
Scenario: Two candidates in one embedding batch
- WHEN a test runs one intake attempt for two candidates, the fake embedding call reports 100 tokens and the fake triage calls report 0 tokens
- THEN each of the two result lines contains
tokens=50.
Requirement: Intake efficiency in grades
devops roadmap eval grades MUST show a non-null efficiency value for intake when its result lines carry tokens=.
Scenario: Grade of intake result lines with tokens
- WHEN a test feeds intake result lines that carry
tokens=into the grade function ofdevops roadmap eval grades - THEN the efficiency value that the grade reports for intake is not null.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers the need: the change extends the project's own IntakeDecision and its own result-line schema, and the model client already returns the usage counts. The project builds it. Estimated cost: about 20k tokens to build, about 5k tokens to keep and fix each month, and about one day of elapsed time.
Key questions
- Which token count does each intake result line report?: The result line reports the total tokens of the model calls for the candidate: the prompt and completion tokens of its triage call, plus its share of the shared embedding batch. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:423, src/devops_cli/review/handoff.py:229]
- Chosen: Total tokens of the candidate. The job grade compares the cost of an attempt with the work that the attempt did, and the plan spend covers each model call.
- Rejected: Prompt tokens only. It hides the completion cost of the triage call, so the grade understates the attempt.
- How does the intake job attribute the tokens of a shared embedding batch to each candidate?: Share the batch total in equal parts across the candidates that the batch served, and give the remainder to the first candidate of the batch. The sum of the per-candidate counts then equals the batch total. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:423, src/devops_cli/review/handoff.py:229]
- Chosen: Equal share with the remainder on the first candidate. The share is deterministic, needs no extra model call, and the sum of the shares equals the batch total.
- Rejected: The full batch total on each decision. It counts one batch many times, so the sum exceeds the spend of the plan.
- Rejected: A plan-level count only. A result line is per attempt, so a plan-level count gives no value on the line.
- Where does the token count live between
plan_intake()andapply_intake()?: Put the count onIntakeDecisionas a field.plan_intake()fills it,IntakePlan.decisionscarries it, andapply_intake()reads it for the result line. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:349, src/devops_cli/roadmap/intake/intake.py:437, src/devops_cli/roadmap/run.py]- Chosen: A field on
IntakeDecision. The plan already carries the decisions, so the count needs no second path to the caller. - Rejected: A separate mapping passed to
apply_intake(). It makes a second source of the same fact and breaks each caller of the plan. - Rejected: A new model call in
apply_intake(). It spends tokens to learn a count thatplan_intake()already holds.
- Chosen: A field on
- How does a new
tokensfield onIntakeDecisionkeep the other constructors of that type valid?: Give the field a default of 0.duplicate_eval.pyand the tests then build a decision with no token count, and the code that makes no model call stays as it is. (best practice) [sources: src/devops_cli/roadmap/duplicate_eval.py:30, src/devops_cli/roadmap/intake/intake.py:349]- Chosen: A default of 0. Only the intake path that makes a model call sets a value, so no other caller changes.
- Rejected: A required field with each caller updated. It changes code that makes no model call and adds no value to the result line.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 25, 2026
Both add tokens= to roadmap result lines; #6360 covers five jobs while the candidate covers intake only as a split.devops-cli-service commentedon Nov 25, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
chore(main): release 0.247.0 (#7752)
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC