agent-inspect 6.31.12 → 6.31.14

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 (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/packages/cli/dist/{chunk-GBAGZVUX.mjs → chunk-ZAYVAHIH.mjs} +82 -13
  5. package/packages/cli/dist/chunk-ZAYVAHIH.mjs.map +1 -0
  6. package/packages/cli/dist/index.cjs +286 -44
  7. package/packages/cli/dist/index.cjs.map +1 -1
  8. package/packages/cli/dist/index.mjs +209 -36
  9. package/packages/cli/dist/index.mjs.map +1 -1
  10. package/packages/cli/dist/{src-F44EQY4S.mjs → src-KP4UIFK5.mjs} +3 -3
  11. package/packages/cli/dist/{src-F44EQY4S.mjs.map → src-KP4UIFK5.mjs.map} +1 -1
  12. package/packages/core/dist/advanced.cjs +80 -11
  13. package/packages/core/dist/advanced.cjs.map +1 -1
  14. package/packages/core/dist/advanced.mjs +27 -7
  15. package/packages/core/dist/advanced.mjs.map +1 -1
  16. package/packages/core/dist/{chunk-OAUNS5CS.mjs → chunk-JE3TUFAQ.mjs} +3 -3
  17. package/packages/core/dist/{chunk-OAUNS5CS.mjs.map → chunk-JE3TUFAQ.mjs.map} +1 -1
  18. package/packages/core/dist/{chunk-QOC3PJO3.mjs → chunk-NJUSSJX3.mjs} +3 -3
  19. package/packages/core/dist/{chunk-QOC3PJO3.mjs.map → chunk-NJUSSJX3.mjs.map} +1 -1
  20. package/packages/core/dist/{chunk-AK5EN4U2.mjs → chunk-YU6XT5A2.mjs} +58 -9
  21. package/packages/core/dist/chunk-YU6XT5A2.mjs.map +1 -0
  22. package/packages/core/dist/exporters.cjs +205 -32
  23. package/packages/core/dist/exporters.cjs.map +1 -1
  24. package/packages/core/dist/exporters.mjs +205 -32
  25. package/packages/core/dist/exporters.mjs.map +1 -1
  26. package/packages/core/dist/logs.cjs +56 -7
  27. package/packages/core/dist/logs.cjs.map +1 -1
  28. package/packages/core/dist/logs.mjs +2 -2
  29. package/packages/core/dist/persisted.cjs +56 -7
  30. package/packages/core/dist/persisted.cjs.map +1 -1
  31. package/packages/core/dist/persisted.mjs +3 -3
  32. package/packages/core/dist/readers.cjs +56 -7
  33. package/packages/core/dist/readers.cjs.map +1 -1
  34. package/packages/core/dist/readers.mjs +3 -3
  35. package/packages/cli/dist/chunk-GBAGZVUX.mjs.map +0 -1
  36. package/packages/core/dist/chunk-AK5EN4U2.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.31.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 2bb5c1d: Stability C07–C09: exact OTLP transport identity comparator; Collector and Elastic verifiers use structured span identity checks and honest offline/stub controls (actual Docker/Elastic remain pending where not executed).
8
+
9
+ ## 6.31.13
10
+
11
+ ### Patch Changes
12
+
13
+ - be67c1b: Stability C04–C06: prefer explicit RUN start/end/duration in tree summaries; exclude OUTCOME from execution-step counts and slowest ranking; bounded recursive OTLP AnyValue/int64/uint64 producer validation.
14
+
3
15
  ## 6.31.12
4
16
 
5
17
  ### 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.12** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
+ **Current published baseline:** **6.31.14** · 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.31.12",
3
+ "version": "6.31.14",
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",
@@ -3002,12 +3002,14 @@ function topKinds(run) {
3002
3002
  function countErrorNodes(nodes) {
3003
3003
  return nodes.filter((entry) => entry.node.event.status === "error").length;
3004
3004
  }
3005
+ function isExecutionStepKind(kind) {
3006
+ return kind !== "RUN" && kind !== "OUTCOME";
3007
+ }
3005
3008
  function slowestNode(nodes) {
3006
3009
  return nodes.filter(
3007
3010
  (entry) => entry.node.event.durationMs !== void 0 && // The RUN boundary spans the whole run, so its duration always dominates
3008
- // and shadows every real step. Rank actual work nodes only, matching the
3009
- // stats slowest-step ranking, which never counts the run envelope.
3010
- entry.node.event.kind !== "RUN"
3011
+ // and shadows every real step. OUTCOME is a linked result, not execution.
3012
+ isExecutionStepKind(entry.node.event.kind)
3011
3013
  ).sort((a, b) => {
3012
3014
  const delta = (b.node.event.durationMs ?? 0) - (a.node.event.durationMs ?? 0);
3013
3015
  return delta !== 0 ? delta : a.index - b.index;
@@ -3060,6 +3062,12 @@ function buildFacts(run, redactor, events) {
3060
3062
  const scoped = events.filter((event) => event.runId === run.runId);
3061
3063
  const { logicalEvents: logical } = projectLogicalEvents(scoped);
3062
3064
  const logicalSteps = logical.filter((event) => event.kind !== "RUN");
3065
+ const executionSteps = logical.filter((event) => isExecutionStepKind(event.kind));
3066
+ const executionByKind = {
3067
+ LLM: executionSteps.filter((event) => event.kind === "LLM").length,
3068
+ TOOL: executionSteps.filter((event) => event.kind === "TOOL").length,
3069
+ LOGIC: executionSteps.filter((event) => event.kind === "LOGIC").length
3070
+ };
3063
3071
  facts.push(
3064
3072
  fact("run.rawEventCount", "Raw persisted event count", scoped.length, redactor),
3065
3073
  fact(
@@ -3073,9 +3081,21 @@ function buildFacts(run, redactor, events) {
3073
3081
  "Logical lifecycle event count (including RUN)",
3074
3082
  logical.length,
3075
3083
  redactor
3084
+ ),
3085
+ fact(
3086
+ "run.executionStepCount",
3087
+ "Execution step count (excludes RUN and OUTCOME)",
3088
+ executionSteps.length,
3089
+ redactor
3090
+ ),
3091
+ fact(
3092
+ "run.executionStepKinds",
3093
+ "Execution step kind counts",
3094
+ executionByKind,
3095
+ redactor
3076
3096
  )
3077
3097
  );
3078
- const slowestLogical = [...logicalSteps].filter((event) => typeof event.durationMs === "number").sort((a, b) => {
3098
+ const slowestLogical = [...executionSteps].filter((event) => typeof event.durationMs === "number").sort((a, b) => {
3079
3099
  const delta = (b.durationMs ?? 0) - (a.durationMs ?? 0);
3080
3100
  return delta !== 0 ? delta : a.eventId.localeCompare(b.eventId);
3081
3101
  })[0];
@@ -12110,18 +12130,16 @@ var TreeBuilder = class {
12110
12130
  inc(confidenceBreakdown, e.confidence);
12111
12131
  kinds[e.kind] = (kinds[e.kind] ?? 0) + 1;
12112
12132
  }
12113
- const startedAt = sorted.length > 0 ? sorted[0].timestamp : void 0;
12114
- const endedAt = sorted.length > 0 ? sorted[sorted.length - 1].timestamp : void 0;
12115
- const status = computeRunStatus(sorted);
12116
- const durationMs = startedAt !== void 0 && endedAt !== void 0 && Number.isFinite(startedAt) && Number.isFinite(endedAt) && endedAt >= startedAt && status !== "running" ? endedAt - startedAt : void 0;
12117
12133
  const name = sorted.find((e) => e.kind === "RUN")?.name;
12134
+ const status = computeRunStatus(sorted);
12135
+ const timing = resolveRunTiming(sorted, status);
12118
12136
  out.push({
12119
12137
  runId,
12120
12138
  name,
12121
12139
  status,
12122
- startedAt,
12123
- endedAt: status === "running" ? void 0 : endedAt,
12124
- durationMs,
12140
+ startedAt: timing.startedAt,
12141
+ endedAt: timing.endedAt,
12142
+ durationMs: timing.durationMs,
12125
12143
  children: roots,
12126
12144
  metadata: {
12127
12145
  totalEvents: sorted.length,
@@ -12135,6 +12153,57 @@ var TreeBuilder = class {
12135
12153
  return out;
12136
12154
  }
12137
12155
  };
12156
+ function resolveRunTiming(sorted, status) {
12157
+ let startedAtMs;
12158
+ let endedAtMs;
12159
+ let explicitDurationMs;
12160
+ for (const event of sorted) {
12161
+ if (event.kind !== "RUN") continue;
12162
+ const attrs = event.attributes ?? {};
12163
+ if (typeof attrs.startedAtMs === "number" && Number.isFinite(attrs.startedAtMs)) {
12164
+ startedAtMs = startedAtMs === void 0 ? attrs.startedAtMs : Math.min(startedAtMs, attrs.startedAtMs);
12165
+ }
12166
+ if (typeof attrs.endedAtMs === "number" && Number.isFinite(attrs.endedAtMs)) {
12167
+ endedAtMs = endedAtMs === void 0 ? attrs.endedAtMs : Math.max(endedAtMs, attrs.endedAtMs);
12168
+ }
12169
+ if ((event.status === "ok" || event.status === "error") && typeof event.durationMs === "number" && Number.isFinite(event.durationMs) && event.durationMs >= 0) {
12170
+ explicitDurationMs = event.durationMs;
12171
+ if (endedAtMs === void 0 && startedAtMs !== void 0) {
12172
+ endedAtMs = startedAtMs + event.durationMs;
12173
+ } else if (endedAtMs === void 0 && Number.isFinite(event.timestamp)) {
12174
+ endedAtMs = event.timestamp + event.durationMs;
12175
+ if (startedAtMs === void 0) {
12176
+ startedAtMs = event.timestamp;
12177
+ }
12178
+ }
12179
+ }
12180
+ if (startedAtMs === void 0 && event.status === "running" && Number.isFinite(event.timestamp)) {
12181
+ startedAtMs = event.timestamp;
12182
+ }
12183
+ }
12184
+ if (startedAtMs !== void 0 && endedAtMs !== void 0 && Number.isFinite(startedAtMs) && Number.isFinite(endedAtMs) && endedAtMs >= startedAtMs && status !== "running") {
12185
+ return {
12186
+ startedAt: startedAtMs,
12187
+ endedAt: endedAtMs,
12188
+ durationMs: endedAtMs - startedAtMs
12189
+ };
12190
+ }
12191
+ if (startedAtMs !== void 0 && explicitDurationMs !== void 0 && status !== "running") {
12192
+ return {
12193
+ startedAt: startedAtMs,
12194
+ endedAt: startedAtMs + explicitDurationMs,
12195
+ durationMs: explicitDurationMs
12196
+ };
12197
+ }
12198
+ const startedAt = sorted.length > 0 ? sorted[0].timestamp : void 0;
12199
+ const endedAt = sorted.length > 0 ? sorted[sorted.length - 1].timestamp : void 0;
12200
+ const durationMs = startedAt !== void 0 && endedAt !== void 0 && Number.isFinite(startedAt) && Number.isFinite(endedAt) && endedAt >= startedAt && status !== "running" ? endedAt - startedAt : void 0;
12201
+ return {
12202
+ startedAt,
12203
+ endedAt: status === "running" ? void 0 : endedAt,
12204
+ durationMs
12205
+ };
12206
+ }
12138
12207
 
12139
12208
  // packages/core/src/persisted/to-inspect-event.ts
12140
12209
  function compactAttributes3(entries) {
@@ -15478,5 +15547,5 @@ function renderGateReport(result, options = {}) {
15478
15547
  }
15479
15548
 
15480
15549
  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 };
15481
- //# sourceMappingURL=chunk-GBAGZVUX.mjs.map
15482
- //# sourceMappingURL=chunk-GBAGZVUX.mjs.map
15550
+ //# sourceMappingURL=chunk-ZAYVAHIH.mjs.map
15551
+ //# sourceMappingURL=chunk-ZAYVAHIH.mjs.map