agent-inspect 6.25.1 → 6.27.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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+
9
+ ## 6.26.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 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).
14
+
3
15
  ## 6.25.1
4
16
 
5
17
  ### 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.27.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,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)
@@ -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)
@@ -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.25.1",
3
+ "version": "6.27.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",
@@ -11823,5 +11823,5 @@ function renderGateReport(result, options = {}) {
11823
11823
  }
11824
11824
 
11825
11825
  export { COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, Redactor, TraceDirectory, TraceReadError, TreeBuilder, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceHtmlShell, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunDiff, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, serializeEvidenceManifest, sha256Hex, stableJson, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
11826
- //# sourceMappingURL=chunk-HPR2OJPU.mjs.map
11827
- //# sourceMappingURL=chunk-HPR2OJPU.mjs.map
11826
+ //# sourceMappingURL=chunk-WQITHDXH.mjs.map
11827
+ //# sourceMappingURL=chunk-WQITHDXH.mjs.map