Skip to content

Add agent evals directory and happy-path eval for MediaTrackingAgent#137

Open
davidharting wants to merge 6 commits into
mainfrom
claude/add-agent-evals-lalFq
Open

Add agent evals directory and happy-path eval for MediaTrackingAgent#137
davidharting wants to merge 6 commits into
mainfrom
claude/add-agent-evals-lalFq

Conversation

@davidharting
Copy link
Copy Markdown
Owner

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

claude added 6 commits May 16, 2026 12:08
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
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.

2 participants