Skip to content

feat(eval): read-only ab-test commands + TUI - #2102

Merged
jariy17 merged 5 commits into
refactorfrom
feat/eval-ab-test-readonly
Aug 26, 2026
Merged

feat(eval): read-only ab-test commands + TUI#2102
jariy17 merged 5 commits into
refactorfrom
feat/eval-ab-test-readonly

Conversation

@jariy17

@jariy17 jariy17 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Adds the full read-only + write agentcore eval ab-test command family, plus the interactive TUI. Five commits.

Command + TUI structure

agentcore eval ab-test                      TUI menu shows get + list only
├── get     --id                            read  · JSON to stdout
├── list    --next-token --max-results      read  · JSON page to stdout
├── pause   --id                            write · executionStatus → PAUSED
├── resume  --id                            write · executionStatus → RUNNING
├── stop    --id                            write · executionStatus → STOPPED
└── delete  --id                            write · DeleteABTestCommand

How it works

A/B tests are imperative jobs (like batch-evaluation), not project resources. All commands are one-liners through the data-plane SDK client @aws-sdk/client-bedrock-agentcore:

  • get/listGetABTestCommand / ListABTestsCommand. get returns per-evaluator metrics inline (no CloudWatch).
  • pause/resume/stopUpdateABTestCommand({ abTestId, executionStatus }) — the same shape online-eval pause/resume uses.
  • deleteDeleteABTestCommand.
  • TUI: menu → picker → detail hub + JSON, modeled on runtime. Write commands are CLI-only and kept out of the interactive menu via .supportedTuiCommands("get","list") (matches online-eval).

Known / deferred

  1. stop gateway-rule suggestion — after stopping, the doc calls for printing a suggested (never executed) update-gateway-rule to promote the winner. Left as a // TODO this PR; tracked as a follow-up.
  2. --json error path — failures print plain-text Error: … to stderr, not a JSON error object. Shared-renderer issue, not ab-test-specific; follow-up.
  3. Transition validity (pause-on-RUNNING, delete-on-RUNNING, etc.) is enforced server-side; the CLI forwards and surfaces the service error. No client-side state machine, matching online-eval.

Files

Area Files
CLI handlers handlers/eval/ab-test/{get,list,pause,resume,stop,delete}/index.tsx, index.tsx
TUI screens handlers/eval/ab-test/{screen,list/screen,get/screen}.tsx, components/AbTestPicker.tsx, 5 routes in Root.tsx
Core core/eval.tsx (getABTest/listABTests/setABTestExecutionStatus/deleteABTest), handlers/eval/types.tsx, testing/TestCoreClient.tsx

Tests

  • Golden fixture (ab-test.fixture.test.tsx, like harness): real router → CoreClient → recorded SDK → matchGolden. get / list / not-found.
  • Screen (ab-test.screen.test.tsx, like runtime): menu (read-only), picker, hub, json, retry.
  • Command-flow (ab-test.write.test.tsx, like batch-evaluation): hierarchy = get/list/pause/resume/stop/delete; each transition's executionStatus; delete; required --id.

Bug bash — all green

  • bun test src/handlers/eval src/components → 338+ pass / 0 fail; bun run typecheck → 0 errors; oxlint → clean.
  • 4-agent /review-pr + a live non-destructive bug-bash on the exploratory account (us-west-2): all 6 commands dispatch correctly; write verbs return a clean not-found on a bogus id (no mutation); --id guard fires pre-network. One real bug found & fixed in this PR: the TUI menu listed write commands (dead-end) — now .supportedTuiCommands.

Follow-ups (separate PRs)

  • stop's gateway-rule promotion suggestion
  • structured --json error output (shared renderer)
  • remove stale projectSchemas/ab-test.ts (contradicts the job model)

@github-actions github-actions Bot added the size/m PR size: M label Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.61279% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.30%. Comparing base (343d213) to head (ba2e9cc).
⚠️ Report is 5 commits behind head on refactor.

Files with missing lines Patch % Lines
src/core/eval.tsx 38.46% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2102      +/-   ##
============================================
- Coverage     97.33%   97.30%   -0.04%     
============================================
  Files           417      428      +11     
  Lines         25250    25546     +296     
============================================
+ Hits          24578    24858     +280     
- Misses          672      688      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add `agentcore eval ab-test get` and `list`, modeled on batch-evaluation.
A/B tests are imperative jobs on the data-plane client, so this wires the
existing @aws-sdk/client-bedrock-agentcore GetABTestCommand / ListABTestsCommand
through EvalClient — no SigV4, no new module.

- get: --id only; GetABTest returns per-evaluator metrics inline (no CloudWatch)
- list: --next-token / --max-results passthrough (service supports no filters)
- TestCoreClient: getABTest/listABTests mocks + setters
- command-flow tests

TUI screens and mutating commands deferred to later phases.
@jariy17
jariy17 force-pushed the feat/eval-ab-test-readonly branch from 6228f89 to 520f0be Compare August 25, 2026 20:04
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@jariy17
jariy17 marked this pull request as ready for review August 25, 2026 20:06
Interactive screens for `agentcore eval ab-test`, modeled on the runtime TUI:
- AbTestScreen menu (RouterScreen)
- AbTestListScreen → AbTestPicker (wraps PaginatedTablePicker, listABTests)
- AbTestGetScreen detail hub (ResourceDetailScreen) + AbTestGetJsonScreen
- 5 routes wired in Root.tsx

Screen tests via renderScreen mirror runtime.screen.test.tsx. No CLI/core
changes; reuses the getABTest/listABTests methods + mocks from the read-only
commit.
@github-actions github-actions Bot added size/l PR size: L and removed size/m PR size: M labels Aug 25, 2026
@jariy17 jariy17 changed the title feat(eval): read-only ab-test get/list commands feat(eval): read-only ab-test commands + TUI Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
notgitika
notgitika previously approved these changes Aug 25, 2026
Comment on lines +29 to +30
status: summary.status ?? "-",
executionStatus: summary.executionStatus ?? "-",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline and we see that this is the output from the API. i would imagine as customer would be confused seeing these 2 fields in the data table in TUI. we can try to unify it in the future maybe

],
},
...overrides,
} as GetABTestResponse;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the reason we are not using satisfies that we have treatmentname and not variantname? I see that in the fixture

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — switched to satisfies GetABTestResponse in c2e0c18. It immediately surfaced that the stub had treatmentName (the real metric field is variantName, matching the recorded fixture) and was missing Variant.variantConfiguration. Both fixed; the cast was hiding them.

Comment thread src/core/eval.tsx
Comment on lines +397 to +398
nextToken: string | undefined,
maxResults: number | undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice that we have these as just passthroughs :)

Addresses review: swap the `as GetABTestResponse` cast for `satisfies`,
which surfaced two wrong fields in the stub — the metric field is
variantName (not treatmentName) and Variant requires variantConfiguration.
Fill the required response fields so the stub type-checks.
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
notgitika
notgitika previously approved these changes Aug 25, 2026
pause/resume/stop set executionStatus via UpdateABTestCommand (same shape as
online-eval pause/resume, on the data-plane client); delete uses
DeleteABTestCommand. All four are --id-only leaf handlers registered on the
ab-test router. stop carries a TODO for the (never-executed) gateway-rule
promotion suggestion. Command-flow tests cover the hierarchy, each transition's
executionStatus, delete, and the required --id.
@github-actions github-actions Bot added size/xl PR size: XL and removed size/l PR size: L labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@jariy17
jariy17 marked this pull request as draft August 25, 2026 23:24
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
Add .supportedTuiCommands("get", "list") to the ab-test router, matching
online-eval. Without it the interactive menu listed pause/resume/stop/delete,
which have no screen routes and dead-ended on the help screen. Add a menu
screen test that fails without the fix.
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@jariy17
jariy17 marked this pull request as ready for review August 26, 2026 14:21
@jariy17
jariy17 merged commit f924f12 into refactor Aug 26, 2026
29 checks passed
@jariy17
jariy17 deleted the feat/eval-ab-test-readonly branch August 26, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants