From ce2996ad198eb0255b0857d8aa506dbffdced77c Mon Sep 17 00:00:00 2001 From: Mathieu Ripert Date: Fri, 13 Nov 2026 14:41:36 +0100 Subject: [PATCH 1/3] Add read-only experiment and evaluator commands Add `experiments list|show|results` and `evaluators list|show|summary|scores` over the organization's customer API. These are reads only: they never create, activate, stop, or change experiments or evaluators. - Browser OAuth only; organization keys are refused before any request. - `experiments results` joins the experiment to its workload's evaluator summary over the experiment's life (bounded to 90 days) and reports each arm's sample size, pass rate with interval, cost per trace, and the candidate-minus-control difference. Missing evaluators, drafts, and arms below 30 rated traces are reported, never filled in. - `evaluators scores` omits judge reasons unless --include-reasons, since they can quote the organization's traces. - Inputs are validated locally; responses are checked for repeated ids and for belonging to the requested experiment or evaluator. Tests use invented fixtures and mocked HTTP responses only. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 + docs/resource-commands.md | 41 +++ src/cli.ts | 4 + src/commands/evaluators.ts | 115 +++++++ src/commands/experiments.ts | 109 ++++++ src/evaluators/contracts.ts | 218 ++++++++++++ src/evaluators/service.ts | 207 ++++++++++++ src/experiments/service.ts | 211 ++++++++++++ src/output.ts | 6 + tests/experiments-evaluators-command.test.mjs | 144 ++++++++ tests/experiments-evaluators-service.test.mjs | 314 ++++++++++++++++++ 11 files changed, 1371 insertions(+) create mode 100644 src/commands/evaluators.ts create mode 100644 src/commands/experiments.ts create mode 100644 src/evaluators/contracts.ts create mode 100644 src/evaluators/service.ts create mode 100644 src/experiments/service.ts create mode 100644 tests/experiments-evaluators-command.test.mjs create mode 100644 tests/experiments-evaluators-service.test.mjs diff --git a/README.md b/README.md index 254b6dc..b032abc 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,8 @@ arguments and filters, for example `understudy workloads route --help`. | `workloads` | `list`, `show`, `create`, `update`, `route` | Model tasks, capture settings, and explicit model traffic routes. | | `models` | `list`, `show` | Models in your organization's catalog. | | `benchmarks` | `list`, `show` | Read published workload benchmarks and model recommendations. | +| `experiments` | `list`, `show`, `results` | Read online model experiments and compare control and candidate through the workload's evaluator. Browser OAuth only. | +| `evaluators` | `list`, `show`, `summary`, `scores` | Read workload evaluators, their rubrics, and judged results. Browser OAuth only; `scores` requires an organization admin. | | `keys` | `list`, `create`, `exec`, `revoke` | API key metadata, private key storage, and credential delivery to a child process. | New workloads have capture disabled by default. Setting a model route enables diff --git a/docs/resource-commands.md b/docs/resource-commands.md index 30bdd44..7f2b731 100644 --- a/docs/resource-commands.md +++ b/docs/resource-commands.md @@ -25,6 +25,13 @@ accept an id. A selector that matches multiple resources is an error. | `benchmarks list` | List workloads and their current published benchmark, if any. | | `benchmarks show --project --workload ` | Summarize the current benchmark and its recommendation without printing the full report. | | `benchmarks show --project --workload --include-report --json` | Return the full published benchmark manifest, including any recommendation report and prompt diff. | +| `experiments list [--project [--workload ]] [--status ]` | List experiments visible to the organization, newest first. | +| `experiments show ` | Show one experiment's models, share, audience, and status. | +| `experiments results [--from