Skip to content

fix(roadmap): log tokens on fix-checks result lines #7151

Done

Description

@devops-cli-service

Split from #6360.

ProblemThe fix_checks job writes result lines with no tokens= field. devops roadmap eval grades shows no efficiency for fix_checks.## Why deferredThe model repair runs in the agent container of a Kubernetes Job. log_job_result(RoadmapJob.FIX_CHECKS, ...) runs later in _report in the service container. _report makes no model call. The token count must cross containers and pods into FixChecksReport or the item job record. Then it must reach fix_checks_row._report. That change is outside #6360.## Acceptance criteria- The fix_checks job SHALL carry the token count of its model repair on each fix_checks result line as tokens=.- A test SHALL run one fix_checks report with a fake token count of 123. The result line SHALL contain tokens=123.- devops roadmap eval grades SHALL show a non-null efficiency value for fix_checks when its result lines carry tokens=.

Proposed design

Problem statement

fix_checks result lines have no tokens= field. devops roadmap eval grades shows no efficiency for fix_checks. The model repair runs in the agent container. _report runs in the service container and makes no model call. The token count must cross the container boundary into FixChecksReport and reach fix_checks_row._report.

Acceptance criteria

Requirement: Fix-checks result line carries the repair token count

The fix_checks job SHALL write the token count of its model repair on each fix_checks result line as tokens=<n>.

Scenario: Report with a repair token count

  • WHEN A test runs fix_checks_row._report with a repair result that has tokens=123.
  • THEN The result line that log_job_result receives contains tokens=123.

Requirement: Report serializes tokens

FixChecksReport.to_json SHALL write tokens=<n> when the report has a token count.

Scenario: Report with tokens

  • WHEN A test builds a FixChecksReport with tokens=123 and calls to_json().
  • THEN The JSON string contains tokens=123.

Requirement: Report omits absent tokens

FixChecksReport.to_json SHALL omit the tokens= field when the report has no token count.

Scenario: Report with no tokens

  • WHEN A test builds a FixChecksReport with no tokens value and calls to_json().
  • THEN The JSON string contains no tokens= field.

Requirement: Eval grades shows fix_checks efficiency

devops roadmap eval grades SHALL show a non-null efficiency value for fix_checks when its result lines carry tokens=.

Scenario: Grades from a result line with tokens

  • WHEN A test feeds the grades parser a fix_checks result line with tokens=123.
  • THEN The efficiency value for fix_checks is not null.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a tokens= field on this repository's own roadmap result line. The change is internal code. Written cost: about 12,000 tokens to build, 3,000 tokens to keep, 5,000 tokens to fix, and about 4 hours of elapsed time.

Key questions

  • Where does the token count cross from the agent container to the service container?: The agent container writes the token count into the repair result on the shared pod volume. _report reads that result and sets the count on FixChecksReport. A shared file needs no Valkey credentials and is testable offline. (best practice) [sources: src/devops_cli/roadmap/steps/fix_checks.py, src/devops_cli/roadmap/fix_checks_row.py, src/devops_cli/roadmap/steps/fix_checks_phases.py, openspec/specs/roadmap-implement-job/record/spec.md]
    • Chosen: Repair result on the shared pod volume. The agent container and the service container share the pod volume, and a file needs no Valkey credentials.
    • Rejected: Valkey item job record. A runner Job may lack Valkey credentials, as the record spec notes.
    • Rejected: Agent container log. Log parsing is fragile and needs the Kubernetes API in the test.
  • Which object carries the token count into the result line?: FixChecksReport gets a tokens field. to_json writes tokens=<n> when the field is set. The result line then carries the count to every caller. (best practice) [sources: src/devops_cli/roadmap/steps/fix_checks.py:120, src/devops_cli/roadmap/fix_checks_row.py:131]
    • Chosen: Add tokens to FixChecksReport. The result line is built from FixChecksReport.to_json, so one field reaches every writer.
    • Rejected: Append the text in _report. A second writer would duplicate the format and miss other callers.
  • What does _report do when the repair result has no token count?: _report writes no tokens= field when the repair result has no token count. FixChecksReport.to_json omits the field. A missing count is not zero. (best practice) [sources: src/devops_cli/roadmap/steps/fix_checks.py:120, src/devops_cli/roadmap/fix_checks_row.py:131]
    • Chosen: Omit the field. A missing count is not zero, and the eval grades must not read a false value.
    • Rejected: Write tokens=0. A zero would hide a missing count and distort the efficiency.
  • Which result-line field does devops roadmap eval grades need for a non-null efficiency for fix_checks?: The fix_checks result line carries tokens=. The grades parser reads that field. The test feeds a fix_checks result line with tokens=123 and asserts a non-null efficiency. [sources: docs/roadmap/job-success.md, src/devops_cli/roadmap/fix_checks_row.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  4. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 29, 2026
  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 29, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  7. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Live since 2026-11-29 16:17 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/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions