agent-inspect 6.29.5 → 6.30.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -1
  3. package/docs/CLI.md +27 -5
  4. package/docs/TRACE-CONTRACTS.md +10 -7
  5. package/package.json +1 -1
  6. package/packages/cli/dist/{chunk-XWQEHKGB.mjs → chunk-BDRJENLM.mjs} +2334 -102
  7. package/packages/cli/dist/chunk-BDRJENLM.mjs.map +1 -0
  8. package/packages/cli/dist/index.cjs +3122 -168
  9. package/packages/cli/dist/index.cjs.map +1 -1
  10. package/packages/cli/dist/index.mjs +793 -61
  11. package/packages/cli/dist/index.mjs.map +1 -1
  12. package/packages/cli/dist/{src-XNC4EUN3.mjs → src-ZUGAUXY6.mjs} +3 -3
  13. package/packages/cli/dist/{src-XNC4EUN3.mjs.map → src-ZUGAUXY6.mjs.map} +1 -1
  14. package/packages/core/dist/advanced.cjs +19 -1
  15. package/packages/core/dist/advanced.cjs.map +1 -1
  16. package/packages/core/dist/advanced.d.cts +2 -2
  17. package/packages/core/dist/advanced.d.ts +2 -2
  18. package/packages/core/dist/advanced.mjs +2 -2
  19. package/packages/core/dist/checks.cjs +33 -1
  20. package/packages/core/dist/checks.cjs.map +1 -1
  21. package/packages/core/dist/checks.d.cts +2 -2
  22. package/packages/core/dist/checks.d.ts +2 -2
  23. package/packages/core/dist/checks.mjs +1 -1
  24. package/packages/core/dist/{chunk-TU47EKKS.mjs → chunk-OOX25GTH.mjs} +35 -3
  25. package/packages/core/dist/chunk-OOX25GTH.mjs.map +1 -0
  26. package/packages/core/dist/{index-DvSbXNot.d.ts → index-7hG_qggp.d.ts} +5 -0
  27. package/packages/core/dist/{index-DKv7esIo.d.cts → index-CQJUNPPe.d.cts} +5 -0
  28. package/packages/cli/dist/chunk-XWQEHKGB.mjs.map +0 -1
  29. package/packages/core/dist/chunk-TU47EKKS.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 094854f: Strict CLI TraceContract JSON for `agent-inspect check --config`:
8
+
9
+ - Top-level `contract` evaluates through `defineTraceContract` / `evaluateTraceContract`.
10
+ - Strict nested validation for run/tools/llm/observations/scope/alternatives/controls/retry (unknown keys fail closed).
11
+ - Mutually exclusive with an effective top-level `checks` block.
12
+ - `--evidence-on` binds the resolved contract (`contract.resolved.json` + check-results digests).
13
+
14
+ ## 6.29.6
15
+
16
+ ### Patch Changes
17
+
18
+ - 129f45a: Safe sharing and integration clarity for 6.29.6:
19
+
20
+ - Treat fully redacted raw-content fields as share-safe while retaining other safety checks (N-8).
21
+ - Clarify trajectory vs outcome CI gates and TOOL-only `requiredOrder` diagnostics in CLI help/docs.
22
+ - Recipe corrections: pairwise measured stage commitments for comparable-cohort-runs; browser observed-outcome identity/precondition/postcondition matrix.
23
+ - Jest reporter association remains explicit (`associations` / `resolveTrace`); private hotel capture (N-9) stays unverified without application checkouts.
24
+
3
25
  ## 6.29.5
4
26
 
5
27
  ### 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.29.5** · persisted schema `1.0` · Node.js `>=20` · MIT.
215
+ **Current published baseline:** **6.30.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
@@ -58,9 +58,9 @@ No new CLI commands were added for branching paths.
58
58
  | ---- | ------ |
59
59
  | One tool must always run | CLI `--required-tool` / contract `tools.required` |
60
60
  | Tool must never run | CLI `--forbidden-tool` / contract `tools.forbidden` |
61
- | Legitimate alternate paths (OR) | TraceContract `alternatives.anyOf` (not CLI flags) |
62
- | Causal order between tools | TraceContract `requiredOrder` + `requiredOrderMode` |
63
- | Read recovery vs write fail-closed | TraceContract `retry.operations` + `sideEffectClass` |
61
+ | Legitimate alternate paths (OR) | TraceContract `alternatives.anyOf` via `--config` `contract` (or TS API) |
62
+ | Causal order between tools | TraceContract `requiredOrder` + `requiredOrderMode` via `--config` `contract` |
63
+ | Read recovery vs write fail-closed | TraceContract `retry.operations` + `sideEffectClass` via `--config` `contract` |
64
64
  | Sensitive expected literals in Evidence | Contract binding safety (`unavailable` on credential-like expected); never silent complete packaging |
65
65
  | Share-safe offline review package | CLI `bundle` / Evidence CI helpers |
66
66
 
@@ -337,7 +337,7 @@ Options:
337
337
  - `--correlate-group`: when using `--session`, also match synthetic `group:` session keys
338
338
  - `--guardrails <rule>`: optional deterministic guardrail rules (`banned-phrase`, `pii-leak`, `prompt-injection`, …); repeatable
339
339
  - `--circuit <rule>`: optional circuit analyzers (`same-tool-repetition`, `max-retries`, …); repeatable
340
- - `--fail-on-observation <status>`: add `outcome.status` rule; repeatable (`failed`, `passed`, `unknown`, `skipped`; default when flag present without value: `failed`)
340
+ - `--fail-on-observation <status>`: **outcome gate** — adds `outcome.status` with `requireAny=true` (needs ≥1 OUTCOME event). Comma-separated statuses: `failed`, `passed`, `unknown`, `skipped`. Does **not** invent a passed outcome from tool/LLM/run success. For adapter structure without outcomes, use `--preset trajectory` (plus `--required-tool` etc.); a trajectory pass is not share safety (`verify-safe`).
341
341
  - `--preset <trajectory|safety|comprehensive|behavioral-session>`: additive check preset (does not change the default when omitted)
342
342
  - `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
343
343
  - `trajectory`: completion/structure/relationship focus; excludes share-safety findings
@@ -351,7 +351,8 @@ Options:
351
351
 
352
352
  By default, `check` runs `run.status`. Additional built-in rules can be selected with `--rule` or config when their options are available. Prefer `--preset trajectory` in CI, then `verify-safe` before sharing.
353
353
 
354
- Config files use this shape:
354
+ Config files use either `checks` (flat rule options) or top-level `contract`
355
+ (TraceContract vocabulary). Do not combine both in one file.
355
356
 
356
357
  ```json
357
358
  {
@@ -364,6 +365,27 @@ Config files use this shape:
364
365
  }
365
366
  ```
366
367
 
368
+ Rich TraceContract JSON (6.30+):
369
+
370
+ ```json
371
+ {
372
+ "contract": {
373
+ "tools": {
374
+ "required": ["retrieve_policy"],
375
+ "forbidden": ["send_email"],
376
+ "requiredOrder": ["retrieve_policy", "generate_answer"],
377
+ "requiredOrderMode": "first-occurrence"
378
+ },
379
+ "observations": { "failOn": ["failed"] },
380
+ "scope": { "runId": "optional-run-id" }
381
+ }
382
+ }
383
+ ```
384
+
385
+ Supported `contract` fields: `run`, `tools` (including `arguments`, `orderRules`),
386
+ `llm`, `observations` (including `requireProvenance`), `scope`, `alternatives.anyOf`,
387
+ `controls`, and `retry`. Unknown keys fail closed (exit 2). With `--evidence-on`,
388
+ contract mode writes `contract.resolved.json` and binds digests into check-results.
367
389
  YAML is not supported. TypeScript config files (`.ts`, `.mts`, `.cts`) fail clearly unless a future explicit loader strategy is added; use precompiled JavaScript config instead.
368
390
 
369
391
  Examples:
@@ -25,6 +25,8 @@ Contracts compile to deterministic check rules for common cases:
25
25
 
26
26
  ## `tools.requiredOrder` semantics
27
27
 
28
+ `requiredOrder` / `orderRules` match **TOOL** events only (via canonical tool names). LLM / LOGIC / other kinds with the same display name do not satisfy the order and are not relabeled as tools. When a required name exists only under another kind, `tool.usage` reports that kind in the finding message.
29
+
28
30
  `requiredOrder` is expanded into **adjacent pair** ordering rules with unique ids:
29
31
 
30
32
  ```text
@@ -42,15 +44,16 @@ Contracts compile to deterministic check rules for common cases:
42
44
  - `all-occurrences` requires every `before` occurrence to finish before every `after` occurrence starts (`max(before.end) <= min(after.start)`);
43
45
  - causal modes fail when a required interval boundary cannot be resolved instead of falling back to encounter order.
44
46
 
45
- Examples for `requiredOrder: ["retrieve", "generate"]`:
47
+ Examples for `requiredOrder: ["retrieve_policy", "send_email"]` (both TOOL-typed):
46
48
 
47
49
  | Trajectory | Result |
48
50
  | --- | --- |
49
- | `retrieve → generate` | PASS |
50
- | `retrieve → rerank → generate` | PASS |
51
- | `retrieve → generate → retrieve` | PASS under omitted / `first-occurrence`; FAIL under `all-occurrences` |
52
- | `generate → retrieve` | FAIL (order) |
53
- | `cache_lookup → generate` | FAIL (missing `retrieve` via implied presence) |
51
+ | `retrieve_policy → send_email` | PASS |
52
+ | `retrieve_policy → rerank_docs → send_email` | PASS |
53
+ | `retrieve_policy → send_email → retrieve_policy` | PASS under omitted / `first-occurrence`; FAIL under `all-occurrences` |
54
+ | `send_email → retrieve_policy` | FAIL (order) |
55
+ | `cache_lookup → send_email` | FAIL (missing `retrieve_policy` via implied presence) |
56
+ | LLM named `generate` present, no TOOL `generate` | FAIL presence with non-TOOL kind diagnostic; not treated as a tool |
54
57
 
55
58
  Low-level `createToolOrderingRule({ before, after })` alone may still pass when an endpoint is missing (compositional). TraceContract `requiredOrder` does not.
56
59
 
@@ -111,7 +114,7 @@ defineTraceContract({
111
114
  {
112
115
  id: "retrieve",
113
116
  contract: {
114
- tools: { required: ["retrieve"], requiredOrder: ["retrieve", "generate"] },
117
+ tools: { required: ["retrieve_policy"], requiredOrder: ["retrieve_policy", "send_email"] },
115
118
  observations: { required: ["retrieval-context-valid"] },
116
119
  },
117
120
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.29.5",
3
+ "version": "6.30.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",