feat: evaluation framework - score, compare, and regression-test agent sessions (v0.8.0)#16
Merged
Merged
Conversation
…ions (#10) Add `agent-strace eval` subcommand with run, compare, ci, and dataset management. Scorers (zero new dependencies): - no_errors: 1.0 if no ERROR events - regex: pattern match against any event type - cost_under: proportional score against a dollar budget - files_scoped: all file ops within allowed path prefixes - duration_under: session duration within a time budget - custom: any callable returning float in [0, 1] Commands: agent-strace eval run <session-id> [--format table|json] agent-strace eval compare <session-a> <session-b> agent-strace eval ci <session-id> # exits 1 on any failure agent-strace eval dataset add|list|export Config via .agent-evals.yaml (stdlib-only YAML parser, no PyYAML). Dataset storage is local JSONL in .agent-traces/datasets/. 41 new tests covering all scorers, dataset CRUD, runner formatting, compare output, and CI exit codes. Co-authored-by: Ona <no-reply@ona.com>
bce3b4a to
cb157f4
Compare
config.py: remove unused 'import re' and unused 'first_indent' variable in _parse_block (first_content was the only one read). dataset.py: remove unused TraceStore import. Co-authored-by: Ona <no-reply@ona.com>
scorers.py: - score_regex: wrap re.compile in try/except to return a ScoreResult instead of raising on invalid patterns - score_files_scoped: replace asymptotic scoring formula with violations/total_ops ratio so 100% violations scores 0.0 config.py: - ScorerConfig: remove redundant 'weight' field (threshold is the canonical name; weight was never read by the runner) runner.py: - EvalReport: make passed/failed properties derived from results list so they stay in sync if results is mutated after construction - cmd_eval_ci: route table output to stderr for clean CI piping Co-authored-by: Ona <no-reply@ona.com>
- score_regex: invalid pattern returns ScoreResult (not raises) - score_files_scoped: all-violations scores 0.0, partial is proportional - EvalReport.passed/failed: live properties stay in sync after mutation Co-authored-by: Ona <no-reply@ona.com>
Siddhant-K-code
added a commit
that referenced
this pull request
Apr 5, 2026
Co-authored-by: Ona <no-reply@ona.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10
What
Adds
agent-strace eval- a subcommand for scoring sessions, comparing them across runs, and integrating quality checks into CI.Commands
Scorers
All built-in scorers use zero new dependencies:
no_errorsregexcost_underfiles_scopedduration_undercustomExample output
Config (
.agent-evals.yaml)Parsed with a stdlib-only YAML parser - no PyYAML dependency.
Implementation
Dataset entries stored as JSONL in
.agent-traces/datasets/. No database, no external service.41 new tests covering all scorers, dataset CRUD, runner formatting, compare output, and CI exit codes.