agent-inspect 6.31.20 → 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,11 @@
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
+
3
9
  ## 6.31.20
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.20** · 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.20",
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"
@@ -6229,7 +6249,7 @@ function attemptIdOf2(event) {
6229
6249
  const value = workflowFor2(event).attemptId;
6230
6250
  return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
6231
6251
  }
6232
- function hasDuplicateAttemptIds2(members) {
6252
+ function hasDuplicateAttemptIds(members) {
6233
6253
  const seen = /* @__PURE__ */ new Set();
6234
6254
  for (const event of members) {
6235
6255
  const id = attemptIdOf2(event);
@@ -6325,7 +6345,7 @@ function evaluateRecoveryOperations(events, operations) {
6325
6345
  }
6326
6346
  for (const [operationKey, members] of groups) {
6327
6347
  const ordered = sortByTime2(members);
6328
- if (hasDuplicateAttemptIds2(members)) {
6348
+ if (hasDuplicateAttemptIds(members)) {
6329
6349
  findings.push(
6330
6350
  fail3(
6331
6351
  "contract.retry.operations.duplicate-attempt-id",
@@ -15677,5 +15697,5 @@ function renderGateReport(result, options = {}) {
15677
15697
  }
15678
15698
 
15679
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 };
15680
- //# sourceMappingURL=chunk-EVSIYDB2.mjs.map
15681
- //# sourceMappingURL=chunk-EVSIYDB2.mjs.map
15700
+ //# sourceMappingURL=chunk-N5JN26MW.mjs.map
15701
+ //# sourceMappingURL=chunk-N5JN26MW.mjs.map