agent-inspect 6.25.1 → 6.26.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
+ ## 6.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ec2ebbf: Outcome-aware behavioral sessions: `--preset behavioral-session` scores OUTCOME events without collapsing graceful tool errors into run failure, plus a synthetic MCP dual-axis recipe (#362).
8
+
3
9
  ## 6.25.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -212,7 +212,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
212
212
 
213
213
  ## Status and documentation
214
214
 
215
- **Current published baseline:** **6.25.1** · persisted schema `1.0` · Node.js `>=20` · MIT.
215
+ **Current published baseline:** **6.26.0** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
216
 
217
217
  Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
218
218
 
package/docs/CLI.md CHANGED
@@ -320,7 +320,8 @@ Options:
320
320
  - `--guardrails <rule>`: optional deterministic guardrail rules (`banned-phrase`, `pii-leak`, `prompt-injection`, …); repeatable
321
321
  - `--circuit <rule>`: optional circuit analyzers (`same-tool-repetition`, `max-retries`, …); repeatable
322
322
  - `--fail-on-observation <status>`: add `outcome.status` rule; repeatable (`failed`, `passed`, `unknown`, `skipped`; default when flag present without value: `failed`)
323
- - `--preset <trajectory|safety|comprehensive>`: additive check preset (does not change the default when omitted)
323
+ - `--preset <trajectory|safety|comprehensive|behavioral-session>`: additive check preset (does not change the default when omitted)
324
+ - `behavioral-session` (6.26): require harness completion + score OUTCOME events (`--fail-on-observation failed` by default); does **not** treat every TOOL `error` as a failed run
324
325
  - `trajectory`: completion/structure/relationship focus; excludes share-safety findings
325
326
  - `safety`: raw-content / secret / redaction focus
326
327
  - `comprehensive`: union of trajectory and safety
@@ -8,11 +8,26 @@ Useful CLI entry points: `sessions`, `search`, activity views (see [CLI.md](./CL
8
8
 
9
9
  Attempt identity for contracts (6.22+): `operationId`, `attemptId`, `attemptNumber`, `retryOf`, `fallbackOf`, `idempotencyKey`. Retry safety evaluation prefers this identity over “saw a prior ok” (see [TRACE-CONTRACTS.md](./TRACE-CONTRACTS.md), corrected in 6.25.1).
10
10
 
11
- ## Observed outcomes
11
+ ## Observed outcomes (dual-axis)
12
12
 
13
13
  Outcomes record what the agent produced or decided at a high level for later review and gates. They remain local JSONL-derived evidence.
14
14
 
15
- **Dual-axis reminder:** tool/run **execution status** (`ok` / `error`) is independent of behavioral **outcome** (`passed` / `failed` / `unknown`). A graceful tool rejection can be `status: "error"` while the expected behavioral outcome is `passed`. Expanding this for MCP behavioral sessions is the focus of **6.26.0** (#362).
15
+ | Axis | Where | Values | Meaning |
16
+ | --- | --- | --- | --- |
17
+ | Execution | TOOL / RUN `status` | `ok` / `error` / … | What happened at runtime (MCP `isError` stays `error`) |
18
+ | Behavior | OUTCOME `outcomeStatus` | `passed` / `failed` / `unknown` / `skipped` | Whether the result matched the test expectation |
19
+
20
+ A graceful tool rejection can be TOOL `status: "error"` while the expected behavioral OUTCOME is `passed`. Do **not** rewrite tool errors to `ok` to make a gate green.
21
+
22
+ ### CLI (6.26)
23
+
24
+ ```bash
25
+ npx agent-inspect check <run> --preset behavioral-session --json
26
+ ```
27
+
28
+ Preset selects harness completion + `outcome.status` and defaults `--fail-on-observation failed`. Recipe: [examples/recipes/mcp-behavioral-session](../examples/recipes/mcp-behavioral-session/).
29
+
30
+ Issue **#362**: external sanitized fixtures remain `BLOCKED_ON_EXTERNAL_FIXTURE` until reviewed; the synthetic recipe ships first.
16
31
 
17
32
  ## Limitations
18
33
 
@@ -21,4 +36,4 @@ Outcomes record what the agent produced or decided at a high level for later rev
21
36
  - Studio session pages may still be thinner than APIs — Studio is Beta
22
37
  - AgentInspect does not execute retries or mutate source sessions
23
38
 
24
- Related: [WORKSPACE.md](./WORKSPACE.md) · [USE-CASES.md](./USE-CASES.md)
39
+ Related: [WORKSPACE.md](./WORKSPACE.md) · [USE-CASES.md](./USE-CASES.md) · [TRACE-CONTRACTS.md](./TRACE-CONTRACTS.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.25.1",
3
+ "version": "6.26.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local evidence debugger and trajectory-test toolkit for TypeScript AI agents — execution trees, TraceContract checks, Evidence v2, and read-only MCP",
@@ -13063,7 +13063,7 @@ var init_src = __esm({
13063
13063
  });
13064
13064
 
13065
13065
  // package.json
13066
- var version = "6.25.1";
13066
+ var version = "6.26.0";
13067
13067
 
13068
13068
  // packages/cli/src/list.ts
13069
13069
  init_advanced();
@@ -19791,9 +19791,9 @@ function unionCheckSelect(input3) {
19791
19791
  function resolvePreset(preset, context = {}) {
19792
19792
  if (preset === void 0 || preset.trim() === "") return void 0;
19793
19793
  const name = preset.trim().toLowerCase();
19794
- if (name !== "trajectory" && name !== "safety" && name !== "comprehensive") {
19794
+ if (name !== "trajectory" && name !== "safety" && name !== "comprehensive" && name !== "behavioral-session") {
19795
19795
  throw new Error(
19796
- `Unknown --preset "${preset}". Use trajectory, safety, or comprehensive.`
19796
+ `Unknown --preset "${preset}". Use trajectory, safety, comprehensive, or behavioral-session.`
19797
19797
  );
19798
19798
  }
19799
19799
  const trajectorySelect = [
@@ -19828,6 +19828,15 @@ function resolvePreset(preset, context = {}) {
19828
19828
  select: safetySelect
19829
19829
  };
19830
19830
  }
19831
+ if (name === "behavioral-session") {
19832
+ return {
19833
+ requireCompleted: true,
19834
+ enableSafetyRedaction: false,
19835
+ enableStructureRelationshipDefaults: false,
19836
+ select: ["run.requireCompleted", "outcome.status", "structure.orphan"],
19837
+ failOnObservation: "failed"
19838
+ };
19839
+ }
19831
19840
  const select = [.../* @__PURE__ */ new Set([...trajectorySelect, ...safetySelect])];
19832
19841
  return {
19833
19842
  requireCompleted: true,
@@ -20261,7 +20270,8 @@ function applyResolvedPreset(config, options, resolved) {
20261
20270
  config: { checks: checks2 },
20262
20271
  options: {
20263
20272
  ...options,
20264
- ...resolved.requireCompleted ? { requireCompleted: true } : {}
20273
+ ...resolved.requireCompleted ? { requireCompleted: true } : {},
20274
+ ...resolved.failOnObservation !== void 0 && (options.failOnObservation === void 0 || options.failOnObservation.trim() === "") ? { failOnObservation: resolved.failOnObservation } : {}
20265
20275
  }
20266
20276
  };
20267
20277
  }
@@ -20407,7 +20417,13 @@ function isSafetyFinding(ruleId) {
20407
20417
  }
20408
20418
  function printPresetClassSummary(result, preset) {
20409
20419
  const name = preset?.trim().toLowerCase();
20410
- if (name !== "trajectory" && name !== "safety" && name !== "comprehensive") {
20420
+ if (name !== "trajectory" && name !== "safety" && name !== "comprehensive" && name !== "behavioral-session") {
20421
+ return;
20422
+ }
20423
+ if (name === "behavioral-session") {
20424
+ console.log(
20425
+ `Behavioral session: ${result.status === "pass" ? "PASS" : "FAIL"} (outcomes scored; tool errors may be expected)`
20426
+ );
20411
20427
  return;
20412
20428
  }
20413
20429
  const hasSafetyFindings = result.findings.some(
@@ -26176,7 +26192,7 @@ function createCliProgram() {
26176
26192
  "run optional circuit rules (repeatable): same-tool-repetition, max-retries, ...",
26177
26193
  (value, previous = []) => [...previous, value]
26178
26194
  ).addOption(
26179
- new commander.Option("--preset <name>", "additive check preset").choices(["trajectory", "safety", "comprehensive"])
26195
+ new commander.Option("--preset <name>", "additive check preset").choices(["trajectory", "safety", "comprehensive", "behavioral-session"])
26180
26196
  ).addOption(
26181
26197
  new commander.Option(
26182
26198
  "--evidence-on <mode>",