Skip to content

fix(roadmap): The stage eval report names why each case ended #6324

Done

Description

@dan-petty

Problem

devops roadmap eval stage (live) keeps the reason of each case in CaseRun.reason, but neither the text report nor the --json report shows it, and the stored report under .data/roadmap_eval/stage/ does not hold it. For a failed case the reason is only the type name of the error (_ended in src/devops_cli/roadmap/stage/stage_eval_run.py), and the message is dropped.

On 2026-11-18 the base and head runs for #6214 ended with 2 and 3 of 3 cases failed, and the score counts a failed case as not avoided. The runs cost 0.43 and 0.30 USD, and no report said why a case failed, so the base and head scores could not be compared.

Expected behavior

  • The text and --json reports list each case with its end (staged, refused, degenerate, over_budget, failed) and its reason, with secrets masked.
  • A failed case keeps the error message, not only its type, and names an infrastructure end (gateway 429, provider error, timeout) apart from a reply that the schema refused.
  • The stored report holds the same.

Related

Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Three searches for per-case outcome and failure-reason reporting in eval runs returned only unrelated web API documentation pages, no tool. The need is the internal text, JSON and stored report of devops roadmap eval stage, so no external library covers it.

Lacks:

  • No tool renders this repository's stage eval report
  • No tool classifies gateway 429, provider, timeout apart from schema refusal
  • No tool masks secrets at the CaseRun reason boundary

Proposed design

Problem statement

The stage eval run keeps the reason of each case in CaseRun.reason, but the text report, the --json report and the stored report drop it. A failed case shows only the error type, so a gateway 429, a provider error, a timeout and a schema refusal look the same. The change shows the end and the masked reason in all three reports.

Acceptance criteria

Requirement: Failed case keeps masked message

A case run that ends failed SHALL keep the masked message of its error in CaseRun.reason.

Scenario: Provider error keeps its message

  • WHEN The test patches mask_secrets in stage_eval_run to return [MASKED] and calls _ended with an AIClientError whose message is provider failed and whose status is 500.
  • THEN The returned reason holds [MASKED] and does not hold provider failed.

Requirement: Infrastructure ends are named

The reason of a case that ends failed SHALL name gateway_429, provider or timeout for the matching AIClientError and MUST NOT name schema_refusal.

Scenario: Infrastructure classes are named

  • WHEN The test calls _ended with an AIClientError with status 429, one with status 500, and one with timed_out set to true.
  • THEN The returned reasons name gateway_429, provider and timeout, and none names schema_refusal.

Requirement: Schema refusal is not an infrastructure end

The reason of a case that ends failed from StructuredOutputValidationError SHALL name schema_refusal and MUST NOT name gateway_429, provider or timeout.

Scenario: Schema refusal is named apart

  • WHEN The test calls _ended with a StructuredOutputValidationError whose error_types is ('missing',).
  • THEN The returned reason names schema_refusal and does not name gateway_429, provider or timeout.

Requirement: Text report lists each case

The text report of devops roadmap eval stage SHALL list each case with its end and its masked reason.

Scenario: Text report shows a failed case

  • WHEN The test calls render_score with a StageScore whose case_runs holds one CaseRun with outcome failed and reason provider: boom.
  • THEN The text output holds a line with failed and provider: boom.

Requirement: JSON report holds each case

The --json report SHALL hold the outcome and reason of each case.

Scenario: JSON report carries both fields

  • WHEN The test calls score_json with a StageScore whose case_runs holds one CaseRun with outcome failed and reason provider: boom.
  • THEN The parsed JSON has case_runs[0].outcome equal to failed and case_runs[0].reason equal to provider: boom.

Requirement: Stored report matches the JSON report

The stored report under .data/roadmap_eval/stage/ SHALL hold the same case records as the --json report.

Scenario: Stored report matches the JSON

  • WHEN The test runs devops roadmap eval stage with a temporary data directory and a mocked run_cases that returns one failed CaseRun.
  • THEN The stored file under the temporary data directory parses to the same case_runs list as the --json output.

Requirement: Reports mask secrets

The text report and the --json report SHALL mask secrets in CaseRun.reason with mask_secrets before they write it.

Scenario: Secret is masked in both reports

  • WHEN The test patches mask_secrets in stage_eval_render to return [MASKED] and renders a CaseRun whose reason is token=secret.
  • THEN The text output and the parsed JSON both hold [MASKED] and neither holds secret.

Existing Tool Considered

The alternatives check in the issue body (2026-11-21) records verdict none and no tool. The change extends project code in src/devops_cli/roadmap/stage/stage_eval_run.py, src/devops_cli/roadmap/stage/stage_eval_score.py, src/devops_cli/roadmap/stage/stage_eval_render.py and src/devops_cli/commands/roadmap_eval_stage.py. The written cost is about 15k to 25k tokens to build, about 3k tokens for each later fix, and under one day of elapsed work.

Key questions

  • How does the report name why a case ended?: Keep CaseRun.reason for every end. For a failed case, prefix the masked message with a class. Use gateway_429 for AIClientError with status 429, timeout when timed_out is true or the status is 408 or 504, provider for another AIClientError, and schema_refusal for StructuredOutputValidationError. Use the error type name for another exception. Do not add a new Outcome member. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_run.py:150, src/devops_cli/ai/client/models.py:72, src/devops_cli/ai/client/models.py, src/devops_cli/security/sanitizer.py]
    • Rejected: Keep the error type name only. The message is dropped, so a gateway 429 and a schema refusal look the same.
    • Rejected: Add infra to Outcome. The closed set changes, and every reader of the five ends must change too.
    • Chosen: Prefix the masked message with a failure class in reason. The reason keeps the evidence and names the infrastructure end. The five ends stay stable.
  • Where does each report read the end and the reason?: StageScore in stage_eval_score.py keeps a case_runs tuple of CaseRun. render_score in stage_eval_render.py prints one line for each run with its outcome and masked reason. score_json writes a case_runs list with name, outcome and reason. The command commands/roadmap_eval_stage.py writes the score_json text to stdout and to the stored file. One record shape serves all three outputs. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_score.py, src/devops_cli/roadmap/stage/stage_eval_render.py, src/devops_cli/commands/roadmap_eval_stage.py]
    • Rejected: Separate shape for each output. The three outputs drift, and a fix in one leaves the others wrong.
    • Chosen: One shared case record. One change fixes the text, the JSON and the stored report.
  • Does the change add a new Outcome member for infrastructure ends?: No. Keep the five members staged, refused, degenerate, over_budget and failed. Name the infrastructure class in reason. stage_eval_compare.py and the counters keep working. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_run.py:64, src/devops_cli/roadmap/stage/stage_eval_compare.py, src/devops_cli/roadmap/stage/stage_eval_score.py]
    • Rejected: Add infra to Outcome. The closed set changes, and every reader of the five ends must change too.
    • Chosen: Classify inside reason. The five ends stay stable and the reason carries the new detail.
  • Must the reason be masked before the stored report?: Yes. Call mask_secrets at the _ended boundary and again in render_score and score_json before they write a reason. The stored file never keeps a secret, even if a CaseRun is built elsewhere. (best practice) [sources: src/devops_cli/security/sanitizer.py, src/devops_cli/roadmap/stage/stage_eval_run.py:150, src/devops_cli/roadmap/stage/stage_eval_render.py]
    • Rejected: Mask at render time only. The stored report could keep a secret.
    • Rejected: Mask at the _ended boundary only. A CaseRun built by another path could reach a report unmasked.
    • Chosen: Mask at the _ended boundary and at each output. Every output reads a masked reason and masks it again before it writes.
  • Does CaseRun already hold the reason?: Yes. CaseRun.reason exists at src/devops_cli/roadmap/stage/stage_eval_run.py:77; only the reports drop it. [sources: src/devops_cli/roadmap/stage/stage_eval_run.py:77]
  • Which module holds the stage eval report record?: stage_eval_record.py records constants for the facts of a case. It does not hold the report record. stage_eval_score.py builds the score and stage_eval_render.py renders the text and the JSON. [sources: src/devops_cli/roadmap/stage/stage_eval_record.py, src/devops_cli/roadmap/stage/stage_eval_score.py, src/devops_cli/roadmap/stage/stage_eval_render.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    on Nov 18, 2026
  2. dan-petty commented on Nov 18, 2026

    @dan-petty
    OwnerAuthor
  3. added
    scope/roadmap
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 18, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

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

  5. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

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

    Searches (3)

    Searches run:

    • Python library classify exception reason mask secrets report per case run, results: 5
    • LLM eval framework per-case outcome and failure reason in JSON and text report, results: 5
    • promptfoo eval results output per test failure reason JSON, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  8. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  10. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 17:09 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