feat(eval): ondemand simulate — replay a dataset, evaluate synchronously - #2071
Draft
jariy17 wants to merge 2 commits into
Draft
feat(eval): ondemand simulate — replay a dataset, evaluate synchronously#2071jariy17 wants to merge 2 commits into
jariy17 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/eval-invoke-dataset-pr #2071 +/- ##
===============================================================
+ Coverage 97.10% 97.11% +0.01%
===============================================================
Files 388 389 +1
Lines 23171 23271 +100
===============================================================
+ Hits 22500 22600 +100
Misses 671 671 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
added 2 commits
August 22, 2026 16:23
…hronously On-demand twin of batch-evaluation simulate. Handler composes three existing core calls — invokeDataset (replay) -> getTracesForAgent (gather) -> evaluate (sync grade) — and adapts each session's neutral InlineGroundTruth into EvaluationReferenceInput[] (assertions + expectedTrajectory map 1:1, correlated by sessionId). No new core method. v1 = session-level ground truth only; per-turn expectedResponse is trace-level and needs a turn->trace id we don't have client-side, so it is omitted (batch simulate still covers it).
…time-handler pattern) Switch the golden assertions from bun toMatchSnapshot to matchGolden + committed __fixtures__/*.golden.json, matching the runtime handlers' golden style. Driven by TestCoreClient: fixtureFactories record/replay can't key this command because its inputs carry random per-session UUIDs + now-based CloudWatch windows (fixturePath hashes the input), so replay never matches — the same reason batch simulate uses TestCoreClient.
jariy17
force-pushed
the
feat/eval-ondemand-simulate
branch
from
August 22, 2026 16:23
634f6f9 to
94a16ac
Compare
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.
What
Adds
eval ondemand simulate— the synchronous twin ofbatch-evaluation simulate. Replay a dataset against a runtime, then grade the resulting sessions client-side via the Evaluate API and print scores inline (no async job to poll).No new core method
The command is a pure handler composition of three existing
CoreEvalClientmethods:Composing them in core would break "a core method never calls a sibling client," so the chain lives in the handler. The only new logic is a small ground-truth adapter.
The ground-truth adapter
invokeDatasetreturns neutralInlineGroundTruthper session;evaluatewantsEvaluationReferenceInput[]correlated bycontext.spanContext.sessionId. Session-level fields map 1:1:evaluate'sgroupRefsBySessionre-groups the flat array by session, so this just works.Command
Same replay flags as batch; drops
--name/--description/--kms-key-arn(no job). Returns{ results[], sessionsRequested, sessionsEvaluated, examplesInvoked, examplesFailed }.Deliberately deferred
v1 = session-level ground truth only (assertions + trajectory, which are exact). Per-turn
expectedResponseis trace-level on the Evaluate API and would require correlating each turn to itstraceIdby order — the same alignment hazard as the batch sparse-turn bug. Left to a follow-up;batch-evaluation simulatestill covers turn-level expectations.Testing
bun run typecheck: 0 errors.bun test: 1552 pass, 0 fail.TestCoreClient): composition (invoke → traces → evaluate), sessionId passthrough, required-flag rejection, refuse-when-nothing-invoked, inline output shape, and a golden locking the adaptedEvaluationReferenceInput[](session-level 1:1, no-GT dropped, turn-level dropped).Stacking
Draft, based on
feat/eval-invoke-dataset-pr(#2032) since it reusesinvokeDataset. Rebase ontorefactoronce #2032 lands. A real-account bug-bash (Strands deploy + on-demand simulate, adversarial) runs next; findings will be appended.