feat(eval): add batch-evaluation simulate (dataset simulations) - #2000
Closed
jariy17 wants to merge 13 commits into
Closed
feat(eval): add batch-evaluation simulate (dataset simulations)#2000jariy17 wants to merge 13 commits into
jariy17 wants to merge 13 commits into
Conversation
added 5 commits
August 13, 2026 18:58
…d-evaluate-clean # Conflicts: # src/core/eval.tsx # src/handlers/eval/index.tsx # src/handlers/eval/types.tsx # src/testing/TestCoreClient.tsx
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #2000 +/- ##
============================================
- Coverage 96.96% 96.12% -0.84%
============================================
Files 364 370 +6
Lines 20758 21393 +635
============================================
+ Hits 20127 20563 +436
- Misses 631 830 +199 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
added 4 commits
August 14, 2026 19:46
…es + ingestion wait)
…ype example classes
Split the monolithic core.eval.simulate into two composable EvalClient calls the
handler orchestrates — invokeDataset (replay) then startBatchEvaluation (grade) —
and model each dataset type as a class that owns its parse + run + ground truth.
- src/core/eval/dataset/: types (Example interface, RunContext), predefined +
simulated example classes, DatasetLoader (shape-classify → switch → new), and a
generic runExamples pool. Replaces src/core/eval/simulate.ts.
- core.eval.invokeDataset returns { sessions, invoked, failed } with neutral inline
ground truth; the batch-evaluation simulate handler wraps it as sessionMetadata and
submits startBatchEvaluation. No Core method calls a sibling.
- readDatasetText reuses readLocalDatasetFile + downloadDatasetToTemp (drops the
combined loadDatasetFile); dispatch is a build() switch whose non-exhaustiveness on a
new DatasetSchemaType fails the build (no map, no assertNever).
- Carries the simulate fixes: sparse multi-turn ground truth keeps turn position
(input.prompt per turn), both-row refusal, NotImplementedError for simulated,
per-example failure isolation, 180s ingestion wait, AbortSignal, JSON-only.
- Tests: dataset unit tests + a golden snapshot of the inline ground-truth shape;
handler test asserts the invokeDataset→startBatchEvaluation composition.
… crashing A JSONL line that is valid JSON but not an object (e.g. bare `null`) threw a raw TypeError (`null is not an object`) when DatasetLoader dereferenced `row.example_id`; the same happened in PredefinedExample for a non-object turn entry (`turns: [null]`). Both now surface a clear InputValidationError at the parse boundary. Adds guard tests plus behavior locks for CRLF endings, unicode ids, empty assertions/trajectory omission, and `expected_response: ""`.
…data golden
runExamples: lock per-example failure isolation (one worker throws, the rest run
and are returned; firstError captured and non-Error throws wrapped), exactly-once
processing, the concurrency bound, and the empty-input case. Adds a golden
snapshot of the sessionMetadata the simulate handler builds, pinning the
`{ inline: gt }` wrapping and the omitted-member case for a session with no GT.
refactor(eval): invokeDataset + per-type example classes
Contributor
Author
|
Superseded by #2032, which folds this replay path into the |
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.
Summary
simulatereplays a dataset through a runtime — one client-sideinvokeper scenario — then submits aStartBatchEvaluationover the sessions it created.The service has no dataset data source, so the CLI creates the sessions and the service grades them.
CLI command structure
Flags (mirror
runtime invoke):--runtime-id--qualifierDEFAULT)--payload-template '{"prompt":"{input}"}'{input}= scenario input--header--bearer-token--user-id--dataset <path|id>--dataset-version--evaluator--name--description--kms-key-arncontent-type/acceptare hardcodedapplication/json.How it works
StartBatchEvaluation—cloudWatchLogsscoped to thosesessionIds+evaluationMetadata.sessionMetadata.agentcore eval batch-evaluation get.Design decisions
EvalClient—simulateis a method, no new class.invokeRuntimefree fns tosrc/core/invokeRuntime.ts— no siblingcore.runtime.*calls, star graph preserved;RuntimeClient.invokeRuntimebecomes a 1-line delegate.SimulateInput/SimulateResultare public; private helpers use local types (no handler-interface leaks inward).renderJsonTemplateinsrc/io— JSON-safe{key}substitution, not eval-specific.randomUUID()= 36), needed for microVM stickiness + multi-turn threading; matches the publicbedrock_agentcoreSDK rather than reading a response header.AbortSignalthreaded through handler → core → invoke/sleep; aborts in-flight invokes, the dataset download, and the ingestion wait.Testing
Live-verified in account
685197708687/us-west-2, agentasdf_MyAgent-3s5axvBC6Q, evaluatorBuiltin.Helpfulness:sim_live_1f9e-cbcc074b38→ COMPLETED, 2/2 sessions graded.sim_mt_2755-7517683065(2-turn "remember 7 → recall it") → COMPLETED, 2/2 graded, 2 sessions scoped.Automated:
bun test src/→ 1383 pass; typecheck + oxlint clean.src/io/template.test.ts,src/handlers/eval/batch-evaluation/simulate/simulate.test.tsx.--help(captured via tui-harness):Required-flag validation (captured via tui-harness,
--nameomitted):