agent-inspect 6.31.17 → 6.31.18

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.31.18
4
+
5
+ ### Patch Changes
6
+
7
+ - c65817e: Fix recovery result-availability ordering and mixed attemptId counting; emit bounded OTLP operation/attempt identity without broad attribute dump; add real MCP SDK packed e2e and Fix-Owes recipe corpus (variable paths, timeout ledger, access disclosure, browser observed outcomes, NestJS tenant, causal failure, headsign, Keniel B8).
8
+
3
9
  ## 6.31.17
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -213,7 +213,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
213
213
 
214
214
  ## Status and documentation
215
215
 
216
- **Current published baseline:** **6.31.17** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
+ **Current published baseline:** **6.31.18** · persisted schema `1.0` · Node.js `>=20` · MIT.
217
217
 
218
218
  Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
219
219
 
package/docs/COMPARE.md CHANGED
@@ -106,7 +106,7 @@ OrcaReplay is a local CLI that records an agent run at the model-provider bounda
106
106
 
107
107
  AgentInspect is local-first CLI debugging:
108
108
 
109
- - Use AgentInspect to inspect and gate a run's trajectory; the two capture at different layers, so a run can be captured by both at once — AgentInspect instruments inside the process and produces an execution tree, while OrcaReplay proxies the provider connection and records the bytes on the wire.
109
+ - Use AgentInspect to inspect and gate a run's trajectory; the two capture at different layers. AgentInspect builds a local execution tree from in-process instrumentation and from existing log/trace readers; OrcaReplay proxies the provider connection and records the bytes on the wire. Simultaneous AgentInspect + OrcaReplay capture on one run is possible in principle but **untested** here until a retained joint experiment exists.
110
110
  - If you reach for OrcaReplay, two limits are worth knowing: a matching replay is not a determinism result, and replay blocks model-provider egress only — it is not a sandbox, so recorded tool calls still execute and a tool that opens its own connection still reaches the network.
111
111
  - AgentInspect does not replay a recorded run; the README lists "a replay engine" among the things it is not.
112
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.31.17",
3
+ "version": "6.31.18",
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",
@@ -236,7 +236,7 @@
236
236
  "test:all": "pnpm run typecheck && pnpm run linked-versions:check && pnpm run build && pnpm run test && pnpm run size",
237
237
  "prepublish:checks": "pnpm run typecheck && pnpm run build && pnpm run test && pnpm run test:coverage && pnpm run fixtures:check && pnpm run recipes:check && pnpm run test:integration-offline && pnpm run size && pnpm run linked-versions:check && pnpm run repo:health && pnpm run pack:smoke",
238
238
  "pack:dry-run": "pnpm run build && npm pack --dry-run",
239
- "pack:smoke": "pnpm run package-licenses:check && pnpm run build && node scripts/package-smoke.mjs && node scripts/packed-openai-agents-e2e.mjs && node scripts/packed-ai-sdk-e2e.mjs && node scripts/packed-mcp-e2e.mjs && node scripts/packed-quickstart-e2e.mjs && node scripts/packed-semantic-loop-e2e.mjs && node scripts/packed-swarm-loop-e2e.mjs && node scripts/evidence-ci-golden-paths.mjs",
239
+ "pack:smoke": "pnpm run package-licenses:check && pnpm run build && node scripts/package-smoke.mjs && node scripts/packed-openai-agents-e2e.mjs && node scripts/packed-ai-sdk-e2e.mjs && node scripts/packed-mcp-e2e.mjs && node scripts/packed-mcp-sdk-e2e.mjs && node scripts/packed-quickstart-e2e.mjs && node scripts/packed-semantic-loop-e2e.mjs && node scripts/packed-swarm-loop-e2e.mjs && node scripts/evidence-ci-golden-paths.mjs",
240
240
  "linked-versions:check": "node scripts/check-linked-versions.mjs",
241
241
  "docs:commands": "node scripts/validate-doc-commands.mjs",
242
242
  "docs:links": "node scripts/validate-doc-links.mjs",
@@ -5737,24 +5737,26 @@ function attemptIdOf(event) {
5737
5737
  return typeof value === "string" && value.trim() !== "" ? value : void 0;
5738
5738
  }
5739
5739
  function countOperationAttempts(members) {
5740
- const attemptIds = new Set(
5741
- members.map((event) => attemptIdOf(event)).filter((value) => value !== void 0)
5742
- );
5743
- if (attemptIds.size > 0) {
5744
- return attemptIds.size;
5740
+ const identified = /* @__PURE__ */ new Set();
5741
+ let unidentified = 0;
5742
+ for (const event of members) {
5743
+ if (event.kind !== "TOOL" && event.kind !== "LLM") continue;
5744
+ const id = attemptIdOf(event);
5745
+ if (id !== void 0) {
5746
+ identified.add(id);
5747
+ continue;
5748
+ }
5749
+ unidentified += 1;
5750
+ }
5751
+ if (identified.size > 0) {
5752
+ return identified.size + unidentified;
5745
5753
  }
5746
5754
  const numbers = members.map((event) => attemptNumberOf(event)).filter((value) => value !== void 0).sort((a, b) => a - b);
5747
5755
  if (numbers.length > 0) {
5748
5756
  const unique = [...new Set(numbers)];
5749
- const min = unique[0];
5750
- const max = unique[unique.length - 1];
5751
- const contiguous = unique.length === max - min + 1 && unique.every((value, index) => value === min + index);
5752
- if (contiguous) {
5753
- return unique.length;
5754
- }
5755
5757
  return unique.length;
5756
5758
  }
5757
- return members.filter((event) => event.kind === "TOOL" || event.kind === "LLM").length;
5759
+ return unidentified;
5758
5760
  }
5759
5761
  function classifyRetryAttempt(event, priorOrdered, allMembers) {
5760
5762
  const workflow = workflowFor(event);
@@ -6029,8 +6031,30 @@ function eventEvidence2(event) {
6029
6031
  function eventTime2(event) {
6030
6032
  return event.startedAt ?? event.timestamp ?? "";
6031
6033
  }
6034
+ function parseComparableMs(value) {
6035
+ if (!value) return void 0;
6036
+ const parsed = Date.parse(value);
6037
+ return Number.isFinite(parsed) ? parsed : void 0;
6038
+ }
6039
+ function consumerStartMs(event) {
6040
+ return parseComparableMs(event.startedAt) ?? parseComparableMs(event.timestamp);
6041
+ }
6042
+ function resultAvailableMs(event) {
6043
+ const ended = parseComparableMs(event.endedAt);
6044
+ if (ended !== void 0) return ended;
6045
+ const started = parseComparableMs(event.startedAt) ?? parseComparableMs(event.timestamp);
6046
+ if (started !== void 0 && event.durationMs !== void 0 && Number.isFinite(event.durationMs)) {
6047
+ return started + event.durationMs;
6048
+ }
6049
+ return parseComparableMs(event.timestamp);
6050
+ }
6032
6051
  function sortByTime2(events) {
6033
- return [...events].sort((a, b) => eventTime2(a).localeCompare(eventTime2(b)));
6052
+ return [...events].sort((a, b) => {
6053
+ const aMs = consumerStartMs(a) ?? 0;
6054
+ const bMs = consumerStartMs(b) ?? 0;
6055
+ if (aMs !== bMs) return aMs - bMs;
6056
+ return eventTime2(a).localeCompare(eventTime2(b));
6057
+ });
6034
6058
  }
6035
6059
  function errorCodeOf(event) {
6036
6060
  if (typeof event.error?.code === "string" && event.error.code.trim() !== "") {
@@ -6098,13 +6122,20 @@ function sameArguments(left, right) {
6098
6122
  }
6099
6123
  return { ok: true };
6100
6124
  }
6125
+ var UNEVALUABLE_WRITE_ERROR_CODES = /* @__PURE__ */ new Set([
6126
+ "TIMEOUT",
6127
+ "ETIMEDOUT",
6128
+ "UNKNOWN_COMPLETION",
6129
+ "DEADLINE_EXCEEDED"
6130
+ ]);
6101
6131
  function isUnevaluableWriteCompletion(event) {
6102
6132
  if (event.status === "running" || event.status === "unknown") return true;
6103
6133
  const attrs = event.attributes ?? {};
6104
6134
  if (attrs.timeout === true) return true;
6135
+ if (attrs.unknownCompletion === true) return true;
6105
6136
  if (attrs.completionState === "unknown" || attrs.completionState === "timeout") return true;
6106
6137
  const code = errorCodeOf(event)?.toUpperCase();
6107
- if (code === "TIMEOUT" || code === "UNKNOWN_COMPLETION" || code === "DEADLINE_EXCEEDED") {
6138
+ if (code && UNEVALUABLE_WRITE_ERROR_CODES.has(code)) {
6108
6139
  return true;
6109
6140
  }
6110
6141
  return false;
@@ -6152,14 +6183,17 @@ function collectExplicitReferences(event) {
6152
6183
  return refs;
6153
6184
  }
6154
6185
  function llmReferencesTool(llm, toolEvent, requireExplicit) {
6155
- if (!requireExplicit) {
6156
- return eventTime2(llm) >= eventTime2(toolEvent);
6157
- }
6158
- const refs = collectExplicitReferences(llm);
6159
- if (refs.has(toolEvent.eventId)) return true;
6160
- const toolCallId = workflowFor2(toolEvent).toolCallId;
6161
- if (toolCallId && refs.has(toolCallId)) return true;
6162
- return false;
6186
+ if (llm.runId !== toolEvent.runId) return false;
6187
+ if (requireExplicit) {
6188
+ const refs = collectExplicitReferences(llm);
6189
+ const toolCallId = workflowFor2(toolEvent).toolCallId;
6190
+ const hasRef = refs.has(toolEvent.eventId) || toolCallId !== void 0 && refs.has(toolCallId);
6191
+ if (!hasRef) return false;
6192
+ }
6193
+ const resultMs = resultAvailableMs(toolEvent);
6194
+ const consumerMs = consumerStartMs(llm);
6195
+ if (resultMs === void 0 || consumerMs === void 0) return false;
6196
+ return resultMs <= consumerMs;
6163
6197
  }
6164
6198
  function attemptIdOf2(event) {
6165
6199
  const value = workflowFor2(event).attemptId;
@@ -15547,5 +15581,5 @@ function renderGateReport(result, options = {}) {
15547
15581
  }
15548
15582
 
15549
15583
  export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, 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, defineTraceContract, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, evaluateTraceContract, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isAttributionConfidence, isCredentialSensitiveKey, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToRunTrees, persistedInspectEventsToTraceEvents, projectLogicalEvents, 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, stringContainsHighConfidenceCredential, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
15550
- //# sourceMappingURL=chunk-USZJEEME.mjs.map
15551
- //# sourceMappingURL=chunk-USZJEEME.mjs.map
15584
+ //# sourceMappingURL=chunk-AHARYDFO.mjs.map
15585
+ //# sourceMappingURL=chunk-AHARYDFO.mjs.map