Skip to content

feat(roadmap): eval verify stores each case when it ends and resumes #4344

Closed

Description

@dan-petty

Problem or Motivation

devops roadmap eval verify runs one agent review for each case, and it writes its report only when the last case ends (roadmap_eval_verify._run). A run of the whole golden set takes two hours under load and costs about 8 USD (48 cases, 128M tokens, 2026-11-10). If the process dies in the middle, the run loses every case that ended before. Five parallel processes were needed to finish in time, and a process that ended early could not be merged with the others except by hand. On 2026-11-10, 6 of 48 cases failed with ModelConnectionError and had to run again, one process for each case.

Proposed Solution & Architectural Design

Write the outcome of each case to the report file as soon as the case ends, and let a later run take --resume <report>: it runs only the cases that the report lacks or that failed. Keep the final render as it is. Add a test with the model fake that stops a run in the middle and checks that the report holds the finished cases, and that a resumed run asks the model only for the rest.

Target Subsystem

src/devops_cli/commands/roadmap_eval_verify.py, src/devops_cli/roadmap/stage/stage_verify_eval.py.

Existing Tool Considered

pydantic_evals runs the cases and returns the report at the end of evaluate_sync. Its Dataset has no resume. This change stores each case in the file with the code that is there now. Cost: one function and its test, in one pull request. Related: #4282, #4326.

Standards Compliance

  • I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
  • I am willing to submit a pull request implementing this feature with accompanying tests.

Proposed design

Problem statement

devops roadmap eval verify writes its report only after the last case ends. A crash, a stop, or a model error loses all finished cases. A run of the 48-case golden set takes two hours and costs about 8 USD. The run needs to store each case when it ends and to resume from a stored report, so that only missing or failed cases run again.

Acceptance criteria

Requirement: Case stored at its end

The run SHALL write the outcome of each case to the report file as soon as the case ends.

Scenario: A run stops after two of three cases

  • WHEN the model fake raises a stop signal during the third case
  • THEN the report file exists and holds the outcomes of the first two cases

Requirement: Report file stays valid

Each write of the report file MUST leave a complete JSON document that the final render reads.

Scenario: A write happens between two cases

  • WHEN a test reads the report file after the first case ends
  • THEN the file parses as JSON and lists that case with its findings

Requirement: Resume runs only the rest

The command SHALL accept --resume <report> and SHALL run only the cases that the report lacks or that the report marks as failed.

Scenario: A resumed run with one missing case and one failed case

  • WHEN the report holds two good cases, one failed case, and the set holds one more case
  • THEN the model fake receives calls for the failed case and the missing case only

Requirement: Resume keeps finished cases in the score

A resumed run MUST merge the stored outcomes with the new outcomes into one score and one report.

Scenario: A resumed run ends

  • WHEN the run finishes the remaining cases
  • THEN the score and the final report cover all cases, with the stored outcomes unchanged

Requirement: Final render stays as it is

The run SHALL keep the final text render and the JSON output of the score as they are for a run with no resume.

Scenario: A normal run ends

  • WHEN all cases end and no --resume option is set
  • THEN the output equals the output of the current render for the same score

Requirement: Rejected credentials stop the run

The run MUST keep the stop on rejected credentials and MUST keep the cases that ended before the stop in the report file.

Scenario: A key is refused on the second case

  • WHEN the model fake raises AICredentialsError on the second case
  • THEN the run stops with an error and the report file holds the first case

Existing Tool Considered

pydantic_evals (open, maintained, locked at 2.59.0) runs the cases and returns the report at the end of evaluate_sync. Its Dataset has no resume and no per-case store, so it covers the run but not this need. The change adds code on top of it: one function that writes each case and one that reads a stored report, with tests, in one pull request. Written cost: about 40 000 tokens and 2 hours to build, and about 10 000 tokens to keep the format in step with verify_json.

Key questions

  • How does the run learn when a case ends, given that evaluate_sync returns only at the end?: Write each case inside the task function in _scored, in a try/finally after review returns or fails. The task already holds the case and its output. A failed case is stored with its error text. A per-case hook in the task is the smallest change and keeps pydantic_evals as the runner. (best practice) [sources: src/devops_cli/roadmap/stage/stage_verify_eval.py]
    • Chosen: Store from inside the task function. The task runs once per case with max_concurrency=1. It needs no change to pydantic_evals and no new dependency.
    • Rejected: Run evaluate_sync once per case. It builds a dataset for each case and gives up the single report object. It changes more code.
    • Rejected: Patch or subclass Dataset to add a callback. It couples the project to library internals and costs more to keep.
  • How does the report file stay valid after each case?: Rewrite the whole report JSON after each case with a write to a temporary file in the same directory and an atomic os.replace. The report path is fixed at the start of the run. A crash in the middle of a write then leaves the last complete file. (best practice) [sources: src/devops_cli/commands/roadmap_eval_verify.py, src/devops_cli/roadmap/stage/stage_verify_eval.py]
    • Chosen: Atomic rewrite of the full JSON after each case. The file stays a valid document, and verify_json stays the one writer of the format.
    • Rejected: Append one JSON line for each case. It adds a second format and needs a merge step to build the final report.
  • What does the stored report need so that a resume can read it?: The existing verify_json already lists each case with name, good, labeled, found, returning, error and findings. A resume reads that list and rebuilds CaseOutcome values, with the findings parsed through the Finding model. A case with a non-empty error counts as failed and runs again. The model name in the report must equal the model of the run, else the command stops with an error, because scores of two models must not mix. [sources: src/devops_cli/roadmap/stage/stage_verify_eval.py, src/devops_cli/roadmap/stage/stage_verify.py]
  • Where does a resumed run write its report?: A resumed run writes to the file that --resume names and updates it in place. A normal run keeps the timestamped file under the store path, and creates it at the start of the run. (best practice) [sources: src/devops_cli/commands/roadmap_eval_verify.py]
    • Chosen: Update the resumed file in place. One file then holds the full run, and a second crash can resume again from the same path.
    • Rejected: Write a new timestamped file that merges the old one. It leaves partial files that a person must tell apart.
  • Can five parallel processes merge their reports?: No. Merge of reports from separate processes is out of scope. --resume covers one report file. The existing --case and --limit options still select cases for a process. (best practice) [sources: src/devops_cli/commands/roadmap_eval_verify.py]
    • Chosen: Keep merge out of this change. The issue asks for store and resume. Merge adds a second feature and a larger pull request.
    • Rejected: Add a merge command. It needs its own rules for duplicate cases and mixed models.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It saves hours and dollars when a long run dies mid-way, but the command still works without it.
    • Value: Medium. A two-hour, 8 USD run that loses all progress on a crash is costly, but the feature is a convenience, not a correctness fix.
    • Effort: Low. The body states one function and its test in one pull request.
    • Related: feat(roadmap): a Jev screen before the verify step #4282, which asks for a different change. Both reduce the cost of the verify step, but #4282 adds a Jev screen before verify while this candidate adds per-case persistence and a --resume flag to the same command.
  3. added
    priority/p2-medium
    on Nov 10, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 699026e (see proposed design in issue body).

  6. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 10, 2026
  7. removed
    status/in-progress
    owner/agent
    on Nov 11, 2026
  8. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 05:46 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/lowpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions