Skip to content

feat: add per-trial usage to results JSON#277

Merged
github-actions[bot] merged 4 commits into
mainfrom
spboyer/issue-272-per-trial-usage
May 23, 2026
Merged

feat: add per-trial usage to results JSON#277
github-actions[bot] merged 4 commits into
mainfrom
spboyer/issue-272-per-trial-usage

Conversation

@spboyer

@spboyer spboyer commented May 22, 2026

Copy link
Copy Markdown
Member

Closes #272

Summary

  • Add a flat usage field to each tasks[].runs[] entry in results JSON.
  • Preserve the existing aggregated summary.usage block.
  • Reuse the existing post-shutdown session usage data already collected by the engine.

Validation

  • go test ./internal/execution ./internal/orchestration ./cmd/waza
  • go test ./...
  • cd site && npm ci && npm run build

Documentation impact

  • Updated site/src/content/docs/reference/statistical-fields.mdx to document the new run-level usage block.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 22, 2026 20:47
@github-actions github-actions Bot enabled auto-merge (squash) May 22, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds per-run usage information to the evaluation results JSON so token/request usage can be analyzed at the trial level while keeping the existing aggregate usage summary.

Changes:

  • Add usage to each tasks[].runs[] entry in results JSON (models.RunResult).
  • Populate per-run usage during post-shutdown usage finalization and re-aggregate summary.usage from per-run usage.
  • Update docs to mention the new run-level usage block.
Show a summary per file
File Description
site/src/content/docs/reference/statistical-fields.mdx Mentions new per-run usage alongside existing aggregate usage.
internal/models/outcome.go Adds RunResult.Usage field to results JSON model.
internal/execution/usage.go Populates RunResult.Usage from session usage and re-aggregates digest usage totals.
internal/execution/usage_test.go Extends tests to validate per-run usage population and JSON serialization.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 2

Comment thread internal/execution/usage.go
Comment thread site/src/content/docs/reference/statistical-fields.mdx Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 00:43
@spboyer spboyer force-pushed the spboyer/issue-272-per-trial-usage branch from 5d36a81 to 2d6414b Compare May 23, 2026 00:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Comment thread site/src/content/docs/reference/statistical-fields.mdx Outdated
Copilot AI added 2 commits May 22, 2026 20:51
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 01:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new

@github-actions github-actions Bot merged commit bcc6396 into main May 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: per-trial token usage in results JSON (currently only aggregate summary.usage)

3 participants