Add agent evals directory and happy-path eval for MediaTrackingAgent#137
Open
davidharting wants to merge 6 commits into
Open
Add agent evals directory and happy-path eval for MediaTrackingAgent#137davidharting wants to merge 6 commits into
davidharting wants to merge 6 commits into
Conversation
Creates tests/Evals/ as a top-level directory outside the Unit and Feature test suites in phpunit.xml, so evals never run with `php artisan test` by default. Run them explicitly with `php artisan test tests/Evals/`. The first eval covers the happy path: the agent receives "I just finished reading Dune by Frank Herbert", requests confirmation after identifying the book and checking the library, then executes the write on the second turn. Asserts both the media record and finished event are created in the database. Evals use the real Anthropic API (ANTHROPIC_API_KEY must be set) and a real database via RefreshDatabase. https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ
Adds a separate evals job to pr.yml that runs only when the ci:eval label is on the PR. The job skips Node/npm setup since evals are PHP-only, and passes ANTHROPIC_API_KEY from repository secrets. Also adds the labeled event type to the pull_request trigger so that applying the label to an existing PR fires the workflow immediately. https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ
Replaces the separate evals job with a single step at the end of the existing ci job, gated on the ci:eval label. All the infra setup (PHP, Composer, Postgres, env config) is already done by that point. https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ
Prints a summary line per turn to eval output showing elapsed time, number of agent steps, tools called in order, and token counts (input, output, cache read, cache write). https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ
Replaces dump() with Log::info('eval.turn', [...]) so metrics are
structured key/value context rather than a formatted string.
https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ
One Log::info('eval') at the end with total elapsed time and summed
tokens across both turns. Dropped per-turn logging and tool sequence —
pass/fail covers correctness, tokens and wall clock track efficiency.
https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ
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.
Creates tests/Evals/ as a top-level directory outside the Unit and Feature
test suites in phpunit.xml, so evals never run with
php artisan testbydefault. Run them explicitly with
php artisan test tests/Evals/.The first eval covers the happy path: the agent receives "I just finished
reading Dune by Frank Herbert", requests confirmation after identifying the
book and checking the library, then executes the write on the second turn.
Asserts both the media record and finished event are created in the database.
Evals use the real Anthropic API (ANTHROPIC_API_KEY must be set) and a real
database via RefreshDatabase.
https://claude.ai/code/session_0159hH1QFFypf4oHkWkgFKDJ