agent-inspect 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 44e9684: Add cohort analysis v2: baseline/candidate comparison, grouping, metrics, and `agent-inspect cohort` CLI with JSON/Markdown/HTML reports.
8
+
3
9
  ## 5.0.0
4
10
 
5
11
  ### Minor Changes
package/docs/CLI.md CHANGED
@@ -930,6 +930,39 @@ npx agent-inspect suite run --config fixtures/configs/outcome-suite.suite.json -
930
930
 
931
931
  Recipe: [trace-suite-basic](../examples/recipes/trace-suite-basic/README.md).
932
932
 
933
+ ### 6.26 `cohort`
934
+
935
+ Compare **baseline vs candidate** trace cohorts for regressions (v5.1+). Reads local traces only — no agent replay, no model calls, no upload.
936
+
937
+ ```bash
938
+ agent-inspect cohort --dir <path> --baseline <label> --candidate <label> [options]
939
+ ```
940
+
941
+ Options:
942
+
943
+ - `--dir <path>` — trace directory (default: `.agent-inspect/traces`)
944
+ - `--baseline <label>` / `--candidate <label>` — cohort labels from `run_started.metadata`
945
+ - `--cohort-key <key>` — metadata key for labels (default: `cohort`)
946
+ - `--group-by <spec>` — `model`, `session`, `group`, or `metadata.<key>` (default: `model`)
947
+ - `--metric <list>` — comma-separated metrics (`errorRate`, `duration`, `toolChoice`, `observationFailure`, …)
948
+ - `--format <format>` — `markdown`, `json`, or `html` (default: `markdown`)
949
+ - `-o, --output <dir>` — write `cohort-results.json`, `cohort-summary.md`, `cohort-report.html`
950
+ - `--json` — print deterministic JSON result
951
+
952
+ Exit code **1** when any comparison flags a regression.
953
+
954
+ Example:
955
+
956
+ ```bash
957
+ npx agent-inspect cohort \
958
+ --dir fixtures/cohorts/before-after \
959
+ --baseline before \
960
+ --candidate after \
961
+ --group-by model
962
+ ```
963
+
964
+ Recipe: [cohort-baseline-candidate](../examples/recipes/cohort-baseline-candidate/README.md).
965
+
933
966
  ## 7. Optional TUI behavior
934
967
 
935
968
  `view --tui` delegates to `@agent-inspect/tui` and requires an interactive terminal. If the package is not installed, the CLI prints a short install hint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Trace, check, and safely share TypeScript AI-agent runs locally — no account, no upload, metadata-only by default",