agent-inspect 6.26.0 → 6.28.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 (60) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/BUNDLES.md +4 -1
  4. package/docs/LIMITATIONS.md +1 -1
  5. package/docs/SAFE-TRACE-SHARING.md +2 -0
  6. package/docs/TRACE-CONTRACTS.md +21 -3
  7. package/package.json +1 -1
  8. package/packages/cli/dist/{chunk-HPR2OJPU.mjs → chunk-JVQ4LTHR.mjs} +4317 -3803
  9. package/packages/cli/dist/chunk-JVQ4LTHR.mjs.map +1 -0
  10. package/packages/cli/dist/index.cjs +4541 -4005
  11. package/packages/cli/dist/index.cjs.map +1 -1
  12. package/packages/cli/dist/index.mjs +4 -4
  13. package/packages/cli/dist/index.mjs.map +1 -1
  14. package/packages/cli/dist/{src-J43ECFHC.mjs → src-M5J5YC5E.mjs} +3 -3
  15. package/packages/cli/dist/{src-J43ECFHC.mjs.map → src-M5J5YC5E.mjs.map} +1 -1
  16. package/packages/core/dist/advanced.cjs +3026 -2501
  17. package/packages/core/dist/advanced.cjs.map +1 -1
  18. package/packages/core/dist/advanced.d.cts +172 -16
  19. package/packages/core/dist/advanced.d.ts +172 -16
  20. package/packages/core/dist/advanced.mjs +362 -32
  21. package/packages/core/dist/advanced.mjs.map +1 -1
  22. package/packages/core/dist/checks.cjs +537 -152
  23. package/packages/core/dist/checks.cjs.map +1 -1
  24. package/packages/core/dist/checks.d.cts +9 -414
  25. package/packages/core/dist/checks.d.ts +9 -414
  26. package/packages/core/dist/checks.mjs +1 -1
  27. package/packages/core/dist/{chunk-LHSXRIYU.mjs → chunk-ME4WXYY3.mjs} +3609 -3224
  28. package/packages/core/dist/chunk-ME4WXYY3.mjs.map +1 -0
  29. package/packages/core/dist/{context-DOOT9GZ-.d.cts → context-DGMqxFpz.d.cts} +4 -4
  30. package/packages/core/dist/{context-DOX2-RjH.d.ts → context-DgcvkJ9t.d.ts} +4 -4
  31. package/packages/core/dist/diff.d.cts +3 -3
  32. package/packages/core/dist/diff.d.ts +3 -3
  33. package/packages/core/dist/exporters.d.cts +3 -3
  34. package/packages/core/dist/exporters.d.ts +3 -3
  35. package/packages/core/dist/{index-CtK_p-ps.d.ts → index-BOA1AeEU.d.ts} +473 -6
  36. package/packages/core/dist/{index-D72DPqAF.d.ts → index-BzyNPfLm.d.ts} +2 -2
  37. package/packages/core/dist/{index-DLLz9sce.d.cts → index-C6bCIbFO.d.cts} +2 -2
  38. package/packages/core/dist/{index-CR4CCRqP.d.cts → index-DVetZwGG.d.cts} +473 -6
  39. package/packages/core/dist/index.d.cts +7 -7
  40. package/packages/core/dist/index.d.ts +7 -7
  41. package/packages/core/dist/{inspect-event-DRthdZlf.d.cts → inspect-event-CDqjcrG_.d.cts} +1 -1
  42. package/packages/core/dist/{inspect-event-DRthdZlf.d.ts → inspect-event-CDqjcrG_.d.ts} +1 -1
  43. package/packages/core/dist/{log-config-CFlIJHTf.d.cts → log-config-DcjV8ZjF.d.cts} +1 -1
  44. package/packages/core/dist/{log-config-OZRfpHED.d.ts → log-config-N_c5AE09.d.ts} +1 -1
  45. package/packages/core/dist/logs.d.cts +3 -3
  46. package/packages/core/dist/logs.d.ts +3 -3
  47. package/packages/core/dist/{persisted-inspect-event-BVucFVrP.d.ts → persisted-inspect-event-CbaRYpbw.d.ts} +1 -1
  48. package/packages/core/dist/{persisted-inspect-event-CVZWZldL.d.cts → persisted-inspect-event-DiJ0I_vi.d.cts} +1 -1
  49. package/packages/core/dist/persisted.d.cts +5 -5
  50. package/packages/core/dist/persisted.d.ts +5 -5
  51. package/packages/core/dist/readers.d.cts +3 -3
  52. package/packages/core/dist/readers.d.ts +3 -3
  53. package/packages/core/dist/{types-B562HgN_.d.cts → types-BA_IOdg4.d.cts} +1 -1
  54. package/packages/core/dist/{types-B562HgN_.d.ts → types-BA_IOdg4.d.ts} +1 -1
  55. package/packages/core/dist/{types-VzKihKQo.d.cts → types-wXuxMUop.d.cts} +2 -2
  56. package/packages/core/dist/{types-Bx3mEZ04.d.ts → types-xv9bSgOK.d.ts} +2 -2
  57. package/packages/core/dist/writers.d.cts +2 -2
  58. package/packages/core/dist/writers.d.ts +2 -2
  59. package/packages/cli/dist/chunk-HPR2OJPU.mjs.map +0 -1
  60. package/packages/core/dist/chunk-LHSXRIYU.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 228b4df: Package resolved TraceContract / check-preset snapshots into Evidence v2 (`contract.resolved.json`) with digest binding to check results, honest partial/unavailable status for custom rules, and verify support — no signing or trusted-time claims (schema stays 1.0).
8
+
9
+ ## 6.27.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 0f7c2e1: Bounded safe recovery contracts: additive TraceContract `retry.operations[]` oracles (read-first `retrieve_policy`), ADR-0011, and flagship recipe. Schema remains 1.0; AgentInspect still does not execute retries.
14
+
3
15
  ## 6.26.0
4
16
 
5
17
  ### Minor 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.26.0** · persisted schema `1.0` · Node.js `>=20` · MIT.
215
+ **Current published baseline:** **6.28.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/BUNDLES.md CHANGED
@@ -37,7 +37,8 @@ trace.html # offline HTML (index for multi-run)
37
37
  trace.jsonl # redacted JSONL copy
38
38
  summary.md # human overview
39
39
  metadata.json # legacy manifest (version, profile, safe status)
40
- check-results.json # verify-safe results per run
40
+ check-results.json # verify-safe / check results per run (may include contract digest binding)
41
+ contract.resolved.json # optional resolved TraceContract / preset snapshot (6.28+)
41
42
  redaction-report.json # detector summary (no secret values)
42
43
  eval-results.json # placeholder unless eval artifacts are added later
43
44
  performance-summary.json # placeholder unless perf artifacts are added later
@@ -73,6 +74,8 @@ Profiles:
73
74
 
74
75
  Bundles are **derived copies**, not compliance certification. Always review `evidence.html` / `summary.md`, `check-results.json`, and run `bundle verify` before attaching to tickets or PRs.
75
76
 
77
+ When `contract.resolved.json` is present (6.28+), reviewers can inspect the resolved TraceContract or check preset that was evaluated and confirm digests via `bundle verify`. Custom/programmatic rules are marked `partial` and are not fully replayable from JSON. Contract binding is **not** a signature or trusted-time claim — see [EVIDENCE-FORMAT.md](./EVIDENCE-FORMAT.md#contract-binding-628).
78
+
76
79
  See also [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md) and [CLI.md §6.24](./CLI.md#624-bundle).
77
80
 
78
81
  ## Review workflow
@@ -8,7 +8,7 @@ This document states what AgentInspect **does not** provide today. It complement
8
8
  - **No production APM replacement**: no sampling agents, no fleet-wide aggregation, no uptime SLAs.
9
9
  - **No vendor upload pipeline**: no built-in Langfuse/Braintrust/New Relic/Datadog direct exporters as live sinks.
10
10
  - **No automatic universal instrumentation** of every framework: integration is explicit (manual traces, log ingest, optional adapters).
11
- - **No retry execution engine:** TraceContract `retry` rules evaluate attempt identity and evidence only. AgentInspect does not retry tools, remediates nothing, and does not treat a client `idempotencyKey` as proof of exactly-once writes.
11
+ - **No retry execution engine:** TraceContract `retry` rules (including additive `retry.operations[]` recovery oracles in 6.27) evaluate attempt identity and evidence only. AgentInspect does not retry tools, remediates nothing, and does not treat a client `idempotencyKey` as proof of exactly-once writes. Write-tool timeout/unknown completion is unevaluable without authoritative idempotency evidence; write-retry is not safe by default.
12
12
  - **Omitted-payload digests** (`createOmittedPayloadCommitment`) are bounded (1 MiB preflight). Digests prove omitted bytes existed; they are not redaction or authorization.
13
13
 
14
14
  ## Correlation metadata (v1.3.0)
@@ -34,6 +34,8 @@ Manual traces redact common sensitive keys **before disk** by default. Pass `red
34
34
 
35
35
  When a maintainer or support responder needs reproducible evidence, follow the [safe support reproduction workflow](./SUPPORT-REPRODUCTION.md) to create and review a minimized Evidence bundle. Do not attach a raw trace directory.
36
36
 
37
+ For reviewer-reproducible trajectory checks (6.28+), prefer Evidence that includes `contract.resolved.json` and a matching `contract` digest in `evidence.json` / `check-results.json`. That lets a reviewer see the resolved TraceContract or check preset that was evaluated. Custom/programmatic rules remain `partial` — JSON cannot replay executable rule functions. Contract binding verifies packaged digests only; it does **not** prove producer identity, trusted time, or that the artifact is safe to publish. See [EVIDENCE-FORMAT.md](./EVIDENCE-FORMAT.md#contract-binding-628).
38
+
37
39
  - Use **`--redaction-profile share`** for PR/issue attachments; use **`strict`** when sharing outside your team.
38
40
  - **Review** the exported file — profiles do not detect all sensitive data.
39
41
  - Treat traces written with `redact: false` as sensitive. Review every event before sharing them outside your team.
@@ -14,7 +14,7 @@ Contracts compile to deterministic check rules for common cases:
14
14
  - additive `tools.orderRules` with per-rule occurrence modes
15
15
  - bounded `tools.arguments` JSON Pointer checks (`exists` | `type` | `equals` | `oneOf`)
16
16
  - `controls` declared-versus-enforced invariants
17
- - `retry` / side-effect safety using explicit attempt identity
17
+ - `retry` / side-effect safety using explicit attempt identity (additive `retry.operations[]` recovery oracles in 6.27)
18
18
  - `alternatives.anyOf` for one level of legitimate alternate paths
19
19
  - actor `scope` selectors (`runId`, `subAgentId`, `groupId`, `workflowStep`, `rootEventId`)
20
20
  - observation `requireProvenance` (structural method / evidence / same-run event references)
@@ -169,9 +169,9 @@ defineTraceContract({
169
169
 
170
170
  Bounded evidence shapes: string event id, `{ eventId }`, or `{ eventIds }` (max 16). Method must be in the `ObservedOutcomeMethod` vocabulary. Omitting `requireProvenance` leaves prior observation behavior unchanged.
171
171
 
172
- ### `tools.arguments` / `tools.orderRules` / `controls` / `retry` (shipped — experimental, 6.23; retry chronology corrected in 6.25.1)
172
+ ### `tools.arguments` / `tools.orderRules` / `controls` / `retry` (shipped — experimental, 6.23; retry chronology corrected in 6.25.1; `retry.operations` in 6.27)
173
173
 
174
- See [ADR-0010](./decisions/ADR-0010-structured-control-contracts.md).
174
+ See [ADR-0010](./decisions/ADR-0010-structured-control-contracts.md) and [ADR-0011](./decisions/ADR-0011-bounded-safe-recovery.md).
175
175
 
176
176
  ```ts
177
177
  defineTraceContract({
@@ -203,12 +203,30 @@ defineTraceContract({
203
203
  requireIdempotencyEvidenceForRetry: true,
204
204
  requireRecoveredFailureVisible: true,
205
205
  fallbackOnlyAfterFailure: true,
206
+ operations: [
207
+ {
208
+ tool: "retrieve_policy",
209
+ sideEffectClass: "read",
210
+ maxAttempts: 2,
211
+ retryableErrors: { codes: ["TRANSIENT"] },
212
+ requireFailureBeforeRetry: true,
213
+ requireSameArguments: "structured-or-digest",
214
+ requireTerminalSuccess: true,
215
+ requireRecoveredFailureVisible: true,
216
+ successfulResultDependency: {
217
+ consumerKind: "LLM",
218
+ requireExplicitReference: true,
219
+ },
220
+ },
221
+ ],
206
222
  },
207
223
  });
208
224
  ```
209
225
 
210
226
  **Retry classification (6.25.1):** a genuine retry is detected from explicit identity preference — `attemptNumber > 1`, valid `retryOf` (target exists and precedes), distinct later `attemptId` under the same `operationId`, or a later finished attempt in an explicitly grouped operation — **not** only from a prior `ok`. `error → success` without `idempotencyKey` / `noSideEffect` evidence fails when `requireIdempotencyEvidenceForRetry` is set. `fallbackOnlyAfterFailure` and `requireRecoveredFailureVisible` require chronological earlier failure in the related chain. A client `idempotencyKey` is evidence of intent, not proof of exactly-once mutation. AgentInspect evaluates traces; it does not execute retries.
211
227
 
228
+ **Bounded recovery operations (6.27):** `retry.operations[]` adds per-tool oracles for safe **read** recovery first (`retrieve_policy` recipe). Same-arguments checks accept structured payloads or matching digests and fail closed when both are missing. Write `sideEffectClass` treats timeout/`unknown`/`running` completion as unevaluable unless authoritative idempotency evidence is present. Write-retry is not safe by default.
229
+
212
230
  Missing structured argument evidence fails closed (`AI_CHECK_TOOL_ARGUMENT_EVIDENCE_UNAVAILABLE`). Findings never include full actual inputs.
213
231
 
214
232
  ### Capture capability matrix (tool-argument evidence)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.26.0",
3
+ "version": "6.28.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",