agent-inspect 6.31.19 → 6.31.21

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.31.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 7e385c1: Compose MCP RequestOptions with trace metadata (operation/attempt identity), accept real SDK Client under strict TypeScript, add packed malformed/instrumentation negatives, and collapse identical O05 redelivery for source/OTLP parity at both maxAttempts ceilings.
8
+
9
+ ## 6.31.20
10
+
11
+ ### Patch Changes
12
+
13
+ - 714475a: Forward MCP SDK RequestOptions (signal/timeout/progress) through wrapMcpClient; distinguish Headsign ADVANCE from COMPLETE; join Keniel receipts to comment+article; harden Roy/Gary/Shola/Navya evidence packets and retryable-error metadata lookup.
14
+
3
15
  ## 6.31.19
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.19** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
+ **Current published baseline:** **6.31.21** · 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.19",
3
+ "version": "6.31.21",
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",
@@ -5817,13 +5817,33 @@ function classifyRetryAttempt(event, priorOrdered, allMembers) {
5817
5817
  }
5818
5818
  return { kind: "unknown", reason: "ambiguous attempt identity" };
5819
5819
  }
5820
- function hasDuplicateAttemptIds(members) {
5821
- const seen = /* @__PURE__ */ new Set();
5820
+ function redeliveryFingerprint(event) {
5821
+ const workflow = workflowFor(event);
5822
+ const stableEventId = (event.eventId ?? "").replace(/:\d+$/, "");
5823
+ return JSON.stringify({
5824
+ stableEventId,
5825
+ runId: event.runId,
5826
+ kind: event.kind,
5827
+ name: event.name,
5828
+ status: event.status,
5829
+ operationId: workflow.operationId ?? null,
5830
+ attemptId: workflow.attemptId ?? null,
5831
+ attemptNumber: workflow.attemptNumber ?? null,
5832
+ retryOf: workflow.retryOf ?? null
5833
+ });
5834
+ }
5835
+ function hasConflictingAttemptIdReuse(members) {
5836
+ const byAttempt = /* @__PURE__ */ new Map();
5822
5837
  for (const event of members) {
5838
+ if (event.kind !== "TOOL" && event.kind !== "LLM") continue;
5823
5839
  const id = attemptIdOf(event);
5824
5840
  if (!id) continue;
5825
- if (seen.has(id)) return true;
5826
- seen.add(id);
5841
+ const fingerprints = byAttempt.get(id) ?? /* @__PURE__ */ new Set();
5842
+ fingerprints.add(redeliveryFingerprint(event));
5843
+ byAttempt.set(id, fingerprints);
5844
+ }
5845
+ for (const fingerprints of byAttempt.values()) {
5846
+ if (fingerprints.size > 1) return true;
5827
5847
  }
5828
5848
  return false;
5829
5849
  }
@@ -5840,11 +5860,11 @@ function evaluateRetrySafetyRules(events, rules, _runEvidence) {
5840
5860
  }
5841
5861
  if (rules.maxAttempts !== void 0) {
5842
5862
  for (const [operationId, members] of byOperation) {
5843
- if (hasDuplicateAttemptIds(members)) {
5863
+ if (hasConflictingAttemptIdReuse(members)) {
5844
5864
  findings.push(
5845
5865
  fail2(
5846
5866
  "contract.retry.duplicate-attempt-id",
5847
- `Operation ${operationId} has duplicate attemptId values.`,
5867
+ `Operation ${operationId} has conflicting attemptId reuse (distinct executions).`,
5848
5868
  members.slice(0, 4).map(eventEvidence),
5849
5869
  "unique attemptId",
5850
5870
  "duplicate"
@@ -6093,6 +6113,13 @@ function errorCodeOf(event) {
6093
6113
  const code = nested.code;
6094
6114
  if (typeof code === "string" && code.trim() !== "") return code.trim();
6095
6115
  }
6116
+ const meta = attrs.metadata;
6117
+ if (meta && typeof meta === "object") {
6118
+ for (const key of ["errorCode", "code"]) {
6119
+ const value = meta[key];
6120
+ if (typeof value === "string" && value.trim() !== "") return value.trim();
6121
+ }
6122
+ }
6096
6123
  return void 0;
6097
6124
  }
6098
6125
  function argumentDigestOf(event) {
@@ -6222,7 +6249,7 @@ function attemptIdOf2(event) {
6222
6249
  const value = workflowFor2(event).attemptId;
6223
6250
  return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
6224
6251
  }
6225
- function hasDuplicateAttemptIds2(members) {
6252
+ function hasDuplicateAttemptIds(members) {
6226
6253
  const seen = /* @__PURE__ */ new Set();
6227
6254
  for (const event of members) {
6228
6255
  const id = attemptIdOf2(event);
@@ -6318,7 +6345,7 @@ function evaluateRecoveryOperations(events, operations) {
6318
6345
  }
6319
6346
  for (const [operationKey, members] of groups) {
6320
6347
  const ordered = sortByTime2(members);
6321
- if (hasDuplicateAttemptIds2(members)) {
6348
+ if (hasDuplicateAttemptIds(members)) {
6322
6349
  findings.push(
6323
6350
  fail3(
6324
6351
  "contract.retry.operations.duplicate-attempt-id",
@@ -15670,5 +15697,5 @@ function renderGateReport(result, options = {}) {
15670
15697
  }
15671
15698
 
15672
15699
  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 };
15673
- //# sourceMappingURL=chunk-NALE36AJ.mjs.map
15674
- //# sourceMappingURL=chunk-NALE36AJ.mjs.map
15700
+ //# sourceMappingURL=chunk-N5JN26MW.mjs.map
15701
+ //# sourceMappingURL=chunk-N5JN26MW.mjs.map