feat(batch-evaluation): add --output-config, rename --qualifier to --endpoint, require timestamp timezones - #2265
Conversation
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice, well-scoped PR. The three changes are cleanly separated, the tests cover each layer where it can fail (handler, SessionSource timestamp parsing, and — deliberately — the Core→SDK seam that the TestCoreClient and fixture suites can't cover), and the "resolve --output-config before any Runtime invocation" ordering in simulate is exactly the right call for a command that bills per example. The BatchOutputConfig module and long-form parameter help follow existing conventions and are appropriately API-shaped.
No blocking issues. A couple of small notes, take or leave:
eval ondemand simulatestill uses--qualifier(src/handlers/eval/ondemand/simulate/index.tsx:19,69,92). The PR body justifies the rename by aligningsimulatewith its own command family (eval), but this sibling command in the same family is left inconsistent. If it's intentionally deferred, a follow-up TODO/issue reference would help; otherwise consider renaming it in the same breaking change so users only see one flag flip.- Timestamp regex accepts
HH:MMwith no seconds (sessionSource.tsx:171) — that's fine and matches ISO-8601, but the error message example (2026-09-01T00:00:00Z) and all tests use the seconds form; worth confirming2026-09-01T00:00Zis intentionally allowed (looks like it is, and it's a superset of what customers will type).
Live verification, mutation-testing notes, and the explanation for the new src/core/eval.test.ts file (the gap between handler-level TestCoreClient assertions and re-record-only fixture assertions) are all appreciated.
73e7c29 to
2a11a5b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/eval-cli-router-groups #2265 +/- ##
============================================================
Coverage 97.06% 97.06%
============================================================
Files 568 569 +1
Lines 39343 39374 +31
============================================================
+ Hits 38188 38219 +31
Misses 1155 1155 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2a11a5b to
ccd369d
Compare
| import { createSilentLogger } from "../testing"; | ||
| import type { OutputConfig } from "@aws-sdk/client-bedrock-agentcore"; | ||
|
|
||
| // The TestCoreClient suites assert what a handler hands to Core; the fixture |
… --endpoint --output-config lets a customer say where results and metrics are written instead of taking the service-managed default. An API-shaped passthrough: BatchOutputConfig resolves inline JSON, file://, or stdin and hands the parsed object to StartBatchEvaluation with field names and nested values untouched. Field documentation goes in the flag's `help:` block, rendered under "Parameter details". `simulate --qualifier` becomes `--endpoint`, matching SessionSource, which has always called the same concept --endpoint. The InvokeDatasetInput field stays `qualifier` — that is the Runtime API's name, not ours. simulate resolves --output-config before invoking the Runtime, since the replay bills the customer per dataset example and malformed JSON must not surface only after the whole run. Dependencies move to @aws-sdk/client-bedrock-agentcore 3.1129.0, the first release exposing request-side outputConfig on StartBatchEvaluationRequest. The generated type is used directly; no cast papers over an older model. src/core/eval.test.ts covers the seam the other suites miss: the TestCoreClient suites assert what a handler hands to Core, and the fixture suites need an account to re-record. Deleting Core's outputConfig forwarding passed every test until this one existed. Timestamp handling is unchanged. An earlier revision required an explicit timezone on --start-time/--end-time; that is a breaking change and has been dropped.
ccd369d to
290780f
Compare
Third of four PRs. Stacked on #2262 (grouped help + examples) — GitHub retargets this to
refactoras the stack merges.Three changes to
eval batch-evaluation evaluateandsimulate, plus the SDK release that makes the first possible. Two are breaking, listed below.--output-config(new)Lets a customer say where evaluation results and metrics are written instead of taking the service-managed default. An API-shaped passthrough:
BatchOutputConfigresolves inline JSON,file://<path>, or-(stdin) and hands the parsed object toStartBatchEvaluationwith field names and nested values untouched.The CLI adds no defaults and validates no field combinations — the service is the only thing that knows which are legal (e.g.
logGroupNameis illegal withSOURCE_LOG_GROUP, and can't sit under the reserved/aws/bedrock-agentcore/evaluations/namespace). What the CLI does guarantee is that malformed JSON is rejected before any side effect.Long-form documentation lives in the flag's
help:block, rendered inParameter details:, following the existingharness/parameterHelp.tsxconvention rather than being crammed into the one-line description.--data-source-configgets the same treatment — it was previously documented only by a 70-character description.simulate --qualifier→--endpointSessionSourcehas always called this concept--endpoint;simulatewas the one eval command spelling it--qualifier. No alias — the refactor CLI hasn't shipped GA.Worth a reviewer's attention:
harness endpoint *andruntime *still use--qualifier. This movessimulateto match its own command family (eval) rather than those. TheInvokeDatasetInputfield staysqualifier, since that's the Runtime API's name and not ours.Timestamps are unchanged
An earlier revision of this PR required an explicit timezone on
--start-time/--end-time, rejecting2026-09-01T00:00:00. That is a breaking change and has been dropped — parsing stays exactly as it is onrefactor.Dependency
@aws-sdk/client-bedrock-agentcoreand-control→ 3.1129.0, the first release exposing request-sideoutputConfigonStartBatchEvaluationRequest. The generated type is used directly — no cast papering over an older model.simulateresolves output config before invokingThe replay bills the customer's Runtime once per dataset example. A malformed
--output-configmust surface before the first invocation, not after the whole run — so it's resolved up front, and there's a test assertinginvokeDatasetis never reached.Live verification — account 725476964917 (EXPLORE_PROFILE), us-west-2
All three input forms submitted real jobs; the service echoed back exactly what was passed.
Inline JSON, custom dedicated group — job
pr3_outputconfig_verify_1788996491-5011fdbc56,COMPLETED:The service created
/company/pr3-verify-evaluationsand a stream named after the job. It held 0 bytes because the target Runtime had no in-scope sessions — the destination wiring is what this proves, not result content.file://,SOURCE_LOG_GROUP— jobpr3_sourcegroup_verify_1788996663-8f6486e573, HTTP 202. NologGroupNameechoed back, correct for that destination.stdin (
-) — jobpr3_stdin_verify_1788996665-07d97ca802, HTTP 202.metricsNamespacehonored; the service filled in its own default dedicated group.Rejected locally, before any AWS call: malformed
--output-configJSON, and--qualifier(now an unknown option).Cleanup: the
/company/pr3-verify-evaluationslog group was deleted (confirmed 0 remaining). The three batch-evaluation job records remain — there is no delete API for them, the same limitation the existing fixture suite notes.Tests
src/core/eval.test.ts(new, 2 tests) — this file exists because the other layers left a real gap. TheTestCoreClientsuites assert what a handler hands to Core; the fixture suites assert whole recorded requests but need an account to re-record. Deleting Core'soutputConfig: input.outputConfigline passed every existing test. It stubs only the data client and asserts the constructedStartBatchEvaluationCommand.batch-evaluation.test.tsx(+7) — output config from inline / file / stdin reaching the request unchanged; omitted stayingundefined; malformed JSON rejected with an empty Core call log;--endpointdriving both the invocation qualifier and the graded session source; malformed output config aborting beforeinvokeDataset.Mutation-checked: dropping Core's
outputConfigforwarding fails the new Core test.Verification
bun test— 3201 pass, 0 failbun run typecheck,bun run lint:check,bun run format:check— cleanFollow-up
Fourth PR covers online-eval:
--output-config(control-plane shape, deliberately not sharing this PR's data-plane type),--tagson create,--descriptionon update, and widening the CLI-managed execution role so a custom destination is actually writable.