Repository navigation
Record an eval baseline for every skill #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0fb5a1d
2e23e2e
054753a
2651773
7b57597
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Print every eval case whose score dropped between two baselines. | ||
| # | ||
| # Usage: | ||
| # bin/eval-compare evals/baselines/opus-5-5-high.json evals/baselines/new.json | ||
| # | ||
| # Exits 1 if any case dropped by more than 0.34, about one run of three. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [ $# -ne 2 ]; then | ||
| echo "Usage: bin/eval-compare <baseline.json> <new.json>" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v jq &> /dev/null; then | ||
| echo "Error: jq is required but not installed. Install it with: brew install jq" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| max_drop=0.34 | ||
|
|
||
| rows=$(jq -r --slurpfile new "$2" ' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Risk: We'll compare any 2 baselines, but a plugin-only run counts The Sonnet scores were graded on a slightly different checklist from Claude Opus 5.5 (claude-opus-5-5) |
||
| ($new[0].cases | map({(.name): .score}) | add // {}) as $scores | ||
| | .cases[] | ||
| | select($scores[.name] == null or $scores[.name] < .score) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Risk: A case missing from the new run prints as When we rerun just the 47 tests Opus passed every time, the report also Claude Opus 5.5 (claude-opus-5-5) |
||
| | [.name, .score, ($scores[.name] // "missing"), | ||
| (if $scores[.name] == null then "" else ($scores[.name] - .score) end)] | ||
| | @tsv | ||
| ' "$1") | ||
|
|
||
| if [ -z "$rows" ]; then | ||
| echo "No case dropped." | ||
| exit 0 | ||
| fi | ||
|
|
||
| { | ||
| printf "CASE\tBASE\tNEW\tCHANGE\n" | ||
| echo "$rows" | awk -F'\t' -v OFS='\t' '{ | ||
| if ($4 == "") print $1, sprintf("%.2f", $2), $3, "" | ||
| else print $1, sprintf("%.2f", $2), sprintf("%.2f", $3), sprintf("%+.2f", $4) | ||
| }' | ||
| } | column -t -s $'\t' | ||
|
|
||
| if echo "$rows" | awk -F'\t' -v max="$max_drop" '$4 != "" && -$4 > max { found = 1 } END { exit !found }'; then | ||
| echo | ||
| echo "At least one case dropped by more than $max_drop." | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Shrink a `claude plugin eval --json` result to a committable baseline. | ||
| # | ||
| # Usage: | ||
| # bin/eval-summary evals/results/opus-5-5-high.json | ||
| # | ||
| # Writes evals/baselines/opus-5-5-high.json, named after the input file. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [ $# -ne 1 ]; then | ||
| echo "Usage: bin/eval-summary <results.json>" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v jq &> /dev/null; then | ||
| echo "Error: jq is required but not installed. Install it with: brew install jq" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| results="$1" | ||
| label=$(basename "$results" .json) | ||
| out="evals/baselines/$label.json" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Risk: We name the baseline after the results file and overwrite If we save a new run under an old run's name, the old scores are gone. Claude Opus 5.5 (claude-opus-5-5) |
||
|
|
||
| if [ "$(jq -r '.partial' "$results")" = "true" ]; then | ||
| echo "Error: $results is partial ($(jq -r '.partialReason' "$results")). Not summarizing it." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| mkdir -p evals/baselines | ||
|
|
||
| jq --arg label "$label" ' | ||
| def round(places): (. * pow(10; places) | round) / pow(10; places); | ||
| { | ||
| label: $label, | ||
| claudeVersion, | ||
| startedAt, | ||
| costUsd: (.costUsd | round(2)), | ||
| cases: [ | ||
| .cases[] | { | ||
| name, | ||
| skill: (.dir | split("/")[1]), | ||
| score: (.aggregates.score | round(4)), | ||
| delta: (.aggregates.delta | if . == null then null else round(4) end), | ||
| costUsd: ([.arms[][] | .costUsd] | add | round(2)) | ||
| } | ||
| ] | ||
| } | ||
| ' "$results" > "$out" | ||
|
|
||
| echo "Wrote $out" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tradeoff: We fail only on a drop over 0.34, so losing exactly 1
run of 3 (a 0.33 drop) prints but passes. A skill that really got
worse in 1 run of 3 slips through, so we might want to rerun any case
that prints before trusting it.
Each test gets 3 tries. If it goes from passing all 3 to passing 2,
the check still says OK. It's a smoke alarm set to go off only when
there's a lot of smoke: fewer false alarms, but a small fire can
smolder.
Claude Opus 5.5 (claude-opus-5-5)