Uh oh!
There was an error while loading. Please reload this page.
feat(eval): ondemand simulate — replay a dataset, evaluate synchronously - #2071
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## refactor #2071 +/- ##
============================================
+ Coverage 97.14% 97.16% +0.02%
============================================
Files 494 495 +1 Lines 32550 32676 +126 ============================================
+ Hits 31622 31751 +129 + Misses 928 925 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
634f6f9 to
94a16acCompare94a16ac to
623bbfcCompareClaude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
ec6636c to
f6776ccCompareClaude Security Review: no high-confidence findings. (run) |
f6776cc to
c29ad31CompareClaude Security Review: no high-confidence findings. (run) |
… expectedResponse as a reference input Addresses review on #2071: swap the hand-rolled SIGINT/AbortController for the shared withUserCancellation helper, and include per-turn expectedResponse in the Evaluate reference inputs so an expected-response-only dataset still contributes ground truth.
1b0ca37 to
2c20882CompareClaude Security Review: no high-confidence findings. (run) |
…ms, failures/sessions)
… expectedResponse as a reference input Addresses review on #2071: swap the hand-rolled SIGINT/AbortController for the shared withUserCancellation helper, and include per-turn expectedResponse in the Evaluate reference inputs so an expected-response-only dataset still contributes ground truth.
…late turn→traceId) Bug bash against a live agent showed the Evaluate API rejects expectedResponse under a session-only context. Correlate each turn's expectedResponse to its trace id instead, and extend the fixture golden dataset with an expected_response turn graded by Builtin.Correctness so the real Evaluate call validates the mapping at record time.
…fix stale-trace pollution)
2c20882 to
0cfacfeCompareClaude Security Review: no high-confidence findings. (run) |
Uh oh!
There was an error while loading. Please reload this page.
| ), | ||
| flag("header", "an ordered application header (repeatable)", z.array(z.string()).optional()), | ||
| flag( | ||
| "bearer-token", |
There was a problem hiding this comment.
this and --header should be marked sensitive
Follow-up to #2071. These flags carry secrets (CUSTOM_JWT bearer token, auth headers) but were logged in cleartext by the withLogging debug middleware. The canonical 'runtime invoke' handler already marks both sensitive; apply the same to the on-demand and batch-evaluation simulate handlers.
What
eval ondemand simulate— replay a dataset against a runtime, then evaluate the sessions synchronously, client-side (scores print inline). The on-demand twin ofbatch-evaluation simulate.Pipeline:
invokeDataset(replay) →getTracesForAgent(CloudWatch) →evaluate(Evaluate API).Follows the batch-evaluation simulate pattern
--ingestion-wait-ms(default 180000; 0 to skip)invokeDatasetcompositionfailures[0])sessions[](exampleId ↔ sessionId) +failures[]Differs by design: no
--name/--kms-key-arn(no async job); output is inline scores, not a job id.Output
{ "sessionsEvaluated": 1, "results": [ { "evaluatorId": "Builtin.Helpfulness", "value": 0.83, "label": "Very Helpful", "explanation": "…", "tokenUsage": {…} } ], "examplesInvoked": 1, "examplesFailed": 0, "sessions": [ { "exampleId": "greet", "sessionId": "…" } ], "failures": [] }Tests (batch pattern)
ondemand.test.tsx(TestCoreClient): required-flag validation, refuse-when-nothing-invoked,--ingestion-wait-mspassthrough.ondemand.fixture.test.tsx: real invoke → CloudWatch traces → Evaluate, recorded against a live agent, replayed offline viamatchGolden. Deterministic via the injectednewSessionIdseam plus anow()clock seam — on-demand's trace-query window is otherwiseDate.now()-based, so itsStartQueryfixture key would drift between record and replay (batch has no client query;evaluatepins an explicit--start-time/--end-time).Notes
ignoredReferenceInputFields); the handler still forwards them (adapter exercised).refactor(was stacked on the pre-merge batch-simulate work).