agent-inspect 6.31.22 → 6.31.24
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 +12 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-EMWA5EKU.mjs → chunk-P27XTK5U.mjs} +62 -20
- package/packages/cli/dist/chunk-P27XTK5U.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +97 -49
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +38 -34
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-VZHGOLTO.mjs → src-EWZYLDST.mjs} +3 -3
- package/packages/cli/dist/{src-VZHGOLTO.mjs.map → src-EWZYLDST.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +38 -10
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +6 -6
- package/packages/core/dist/checks.cjs +36 -11
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +2 -2
- package/packages/core/dist/{chunk-RBXD7BNX.mjs → chunk-77PUPLPG.mjs} +14 -8
- package/packages/core/dist/chunk-77PUPLPG.mjs.map +1 -0
- package/packages/core/dist/{chunk-GCZUWY47.mjs → chunk-AN5MOADW.mjs} +31 -9
- package/packages/core/dist/chunk-AN5MOADW.mjs.map +1 -0
- package/packages/core/dist/{chunk-ZOF6ON65.mjs → chunk-IMCM42W6.mjs} +15 -9
- package/packages/core/dist/chunk-IMCM42W6.mjs.map +1 -0
- package/packages/core/dist/{chunk-S4NU55LU.mjs → chunk-J2ST4VCX.mjs} +3 -3
- package/packages/core/dist/{chunk-S4NU55LU.mjs.map → chunk-J2ST4VCX.mjs.map} +1 -1
- package/packages/core/dist/{chunk-UPGBMRL4.mjs → chunk-JJSL346L.mjs} +12 -3
- package/packages/core/dist/chunk-JJSL346L.mjs.map +1 -0
- package/packages/core/dist/exporters.cjs +38 -31
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.mjs +35 -31
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/logs.cjs +14 -5
- package/packages/core/dist/logs.cjs.map +1 -1
- package/packages/core/dist/logs.mjs +3 -3
- package/packages/core/dist/persisted.cjs +185 -163
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.mjs +9 -6
- package/packages/core/dist/persisted.mjs.map +1 -1
- package/packages/core/dist/readers.cjs +189 -161
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.mjs +4 -4
- package/packages/cli/dist/chunk-EMWA5EKU.mjs.map +0 -1
- package/packages/core/dist/chunk-GCZUWY47.mjs.map +0 -1
- package/packages/core/dist/chunk-RBXD7BNX.mjs.map +0 -1
- package/packages/core/dist/chunk-UPGBMRL4.mjs.map +0 -1
- package/packages/core/dist/chunk-ZOF6ON65.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.31.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9058e64: Describe MCP runId as an existing local run from the listing tools, and describe find_slowest_path as the legacy alias of get_slowest_path.
|
|
8
|
+
|
|
9
|
+
## 6.31.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 297b1f1: Compare full retry identity before OTLP length bounding and stamp converter delivery_event_base provenance so long collisions and native manual:/inspect:-shaped IDs cannot silently pass strict retry gates (Prompt A residuals / #484).
|
|
14
|
+
|
|
3
15
|
## 6.31.22
|
|
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.
|
|
216
|
+
**Current published baseline:** **6.31.24** · 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.
|
|
3
|
+
"version": "6.31.24",
|
|
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",
|
|
@@ -5687,16 +5687,33 @@ function evaluateToolArgumentValue(value, check, evidencePresent) {
|
|
|
5687
5687
|
|
|
5688
5688
|
// packages/core/src/persisted/delivery-identity.ts
|
|
5689
5689
|
var DELIVERY_CONFLICT_ATTR = "agent_inspect.delivery_conflict";
|
|
5690
|
+
var DELIVERY_EVENT_BASE_ATTR = "agent_inspect.delivery_event_base";
|
|
5690
5691
|
var IDENTITY_CONFLICT_ATTR = {
|
|
5691
5692
|
operationId: "agent_inspect.identity_conflict.operation_id",
|
|
5692
5693
|
attemptId: "agent_inspect.identity_conflict.attempt_id",
|
|
5693
5694
|
retryOf: "agent_inspect.identity_conflict.retry_of",
|
|
5694
|
-
attemptNumber: "agent_inspect.identity_conflict.attempt_number"
|
|
5695
|
+
attemptNumber: "agent_inspect.identity_conflict.attempt_number",
|
|
5696
|
+
/** Comma-separated field names when a conflict survives lossy bounding. */
|
|
5697
|
+
fields: "agent_inspect.identity_conflict.fields"
|
|
5695
5698
|
};
|
|
5696
|
-
var
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
return eventId
|
|
5699
|
+
var MAX_CONFLICT_FIELDS = 8;
|
|
5700
|
+
var MAX_DELIVERY_BASE_LEN = 500;
|
|
5701
|
+
function stripReaderDeliveryDiscriminator(eventId, attributes) {
|
|
5702
|
+
if (!eventId) return eventId;
|
|
5703
|
+
const rawBase = attributes?.[DELIVERY_EVENT_BASE_ATTR];
|
|
5704
|
+
if (typeof rawBase !== "string" || rawBase.trim() === "") return eventId;
|
|
5705
|
+
const base = rawBase.trim().slice(0, MAX_DELIVERY_BASE_LEN);
|
|
5706
|
+
if (eventId === base) return base;
|
|
5707
|
+
const prefix = `${base}:`;
|
|
5708
|
+
if (!eventId.startsWith(prefix)) return eventId;
|
|
5709
|
+
const suffix = eventId.slice(prefix.length);
|
|
5710
|
+
if (/^\d+$/.test(suffix)) return base;
|
|
5711
|
+
return eventId;
|
|
5712
|
+
}
|
|
5713
|
+
function deliveryEventBaseFromIndexedId(eventId) {
|
|
5714
|
+
if (!/:\d+$/.test(eventId)) return void 0;
|
|
5715
|
+
const base = eventId.replace(/:\d+$/, "");
|
|
5716
|
+
return base.length > 0 ? base.slice(0, MAX_DELIVERY_BASE_LEN) : void 0;
|
|
5700
5717
|
}
|
|
5701
5718
|
function canonicalDigest(value) {
|
|
5702
5719
|
if (value === void 0) return null;
|
|
@@ -5730,7 +5747,7 @@ function timeKey(fields) {
|
|
|
5730
5747
|
function deliverySemanticFingerprint(fields) {
|
|
5731
5748
|
const content = capturedContentDigest(fields.attributes);
|
|
5732
5749
|
return JSON.stringify({
|
|
5733
|
-
stableEventId: stripReaderDeliveryDiscriminator(fields.eventId),
|
|
5750
|
+
stableEventId: stripReaderDeliveryDiscriminator(fields.eventId, fields.attributes),
|
|
5734
5751
|
runId: fields.runId,
|
|
5735
5752
|
kind: fields.kind,
|
|
5736
5753
|
name: fields.name,
|
|
@@ -5781,6 +5798,11 @@ function identityFieldsFromAttributes(attributes) {
|
|
|
5781
5798
|
attemptNumber: pickNumber2()
|
|
5782
5799
|
};
|
|
5783
5800
|
}
|
|
5801
|
+
function identityConflictFieldsFromAttributes(attributes) {
|
|
5802
|
+
const raw = attributes?.[IDENTITY_CONFLICT_ATTR.fields];
|
|
5803
|
+
if (typeof raw !== "string" || raw.trim() === "") return [];
|
|
5804
|
+
return raw.split(",").map((part) => part.trim()).filter((part) => part.length > 0).slice(0, MAX_CONFLICT_FIELDS);
|
|
5805
|
+
}
|
|
5784
5806
|
function hasDeliveryConflictMarker(attributes) {
|
|
5785
5807
|
return attributes?.[DELIVERY_CONFLICT_ATTR] === true;
|
|
5786
5808
|
}
|
|
@@ -5959,13 +5981,19 @@ function directNestedIdentityConflicts(event) {
|
|
|
5959
5981
|
const attrs = event.attributes;
|
|
5960
5982
|
if (!attrs || typeof attrs !== "object") return [];
|
|
5961
5983
|
const nested = attrs.metadata && typeof attrs.metadata === "object" && !Array.isArray(attrs.metadata) ? attrs.metadata : void 0;
|
|
5962
|
-
if (!nested) return [];
|
|
5963
5984
|
const conflicts = [];
|
|
5964
|
-
|
|
5965
|
-
const
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5985
|
+
if (nested) {
|
|
5986
|
+
for (const key of IDENTITY_KEYS) {
|
|
5987
|
+
const direct = attrs[key];
|
|
5988
|
+
const nestedValue = nested[key];
|
|
5989
|
+
if (direct === void 0 || nestedValue === void 0) continue;
|
|
5990
|
+
if (!identityValuesEqual(direct, nestedValue)) {
|
|
5991
|
+
conflicts.push(key);
|
|
5992
|
+
}
|
|
5993
|
+
}
|
|
5994
|
+
}
|
|
5995
|
+
for (const key of identityConflictFieldsFromAttributes(attrs)) {
|
|
5996
|
+
if (IDENTITY_KEYS.includes(key) && !conflicts.includes(key)) {
|
|
5969
5997
|
conflicts.push(key);
|
|
5970
5998
|
}
|
|
5971
5999
|
}
|
|
@@ -12095,6 +12123,11 @@ function compactAttributes2(entries) {
|
|
|
12095
12123
|
}
|
|
12096
12124
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
12097
12125
|
}
|
|
12126
|
+
function stampDeliveryEventBase(eventId, attributes) {
|
|
12127
|
+
const base = deliveryEventBaseFromIndexedId(eventId);
|
|
12128
|
+
if (!base) return attributes;
|
|
12129
|
+
return { ...attributes ?? {}, [DELIVERY_EVENT_BASE_ATTR]: base };
|
|
12130
|
+
}
|
|
12098
12131
|
function traceEventToPersistedInspectEvent(event, options) {
|
|
12099
12132
|
const eventIndex = options?.eventIndex ?? 0;
|
|
12100
12133
|
const eventId = createPersistedEventId(event, eventIndex);
|
|
@@ -12124,7 +12157,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12124
12157
|
startedAt: tsStart.iso,
|
|
12125
12158
|
confidence: "explicit",
|
|
12126
12159
|
source,
|
|
12127
|
-
attributes
|
|
12160
|
+
attributes: stampDeliveryEventBase(eventId, attributes)
|
|
12128
12161
|
};
|
|
12129
12162
|
}
|
|
12130
12163
|
case "run_completed": {
|
|
@@ -12147,7 +12180,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12147
12180
|
durationMs: event.durationMs,
|
|
12148
12181
|
confidence: "explicit",
|
|
12149
12182
|
source,
|
|
12150
|
-
attributes,
|
|
12183
|
+
attributes: stampDeliveryEventBase(eventId, attributes),
|
|
12151
12184
|
error
|
|
12152
12185
|
};
|
|
12153
12186
|
}
|
|
@@ -12172,7 +12205,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12172
12205
|
startedAt: tsStart.iso,
|
|
12173
12206
|
confidence: "explicit",
|
|
12174
12207
|
source,
|
|
12175
|
-
attributes
|
|
12208
|
+
attributes: stampDeliveryEventBase(eventId, attributes)
|
|
12176
12209
|
};
|
|
12177
12210
|
if (event.parentId !== void 0) {
|
|
12178
12211
|
out.parentId = event.parentId;
|
|
@@ -12203,7 +12236,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12203
12236
|
durationMs: event.durationMs,
|
|
12204
12237
|
confidence: "explicit",
|
|
12205
12238
|
source,
|
|
12206
|
-
attributes,
|
|
12239
|
+
attributes: stampDeliveryEventBase(eventId, attributes),
|
|
12207
12240
|
error
|
|
12208
12241
|
};
|
|
12209
12242
|
}
|
|
@@ -12230,7 +12263,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12230
12263
|
timestamp: tsMain.iso,
|
|
12231
12264
|
confidence: "explicit",
|
|
12232
12265
|
source,
|
|
12233
|
-
attributes
|
|
12266
|
+
attributes: stampDeliveryEventBase(eventId, attributes)
|
|
12234
12267
|
};
|
|
12235
12268
|
if (event.parentId !== void 0) {
|
|
12236
12269
|
out.parentId = event.parentId;
|
|
@@ -13985,6 +14018,15 @@ function promoteAgentInspectWorkflowIdentity(attributes, pathPrefix) {
|
|
|
13985
14018
|
metadata[camel] = alternate;
|
|
13986
14019
|
}
|
|
13987
14020
|
}
|
|
14021
|
+
const conflictFields = attributes["agent_inspect.identity_conflict.fields"];
|
|
14022
|
+
if (typeof conflictFields === "string" && conflictFields.trim() !== "") {
|
|
14023
|
+
warnings.push({
|
|
14024
|
+
code: "otlp_identity_conflict",
|
|
14025
|
+
message: `Identity representation conflict fields retained after OTLP bounding: ${conflictFields.trim().slice(0, 200)}.`,
|
|
14026
|
+
severity: "warning",
|
|
14027
|
+
field: `${pathPrefix}.agent_inspect.identity_conflict.fields`
|
|
14028
|
+
});
|
|
14029
|
+
}
|
|
13988
14030
|
if (Object.keys(metadata).length > 0) {
|
|
13989
14031
|
attributes.metadata = metadata;
|
|
13990
14032
|
}
|
|
@@ -15965,6 +16007,6 @@ function renderGateReport(result, options = {}) {
|
|
|
15965
16007
|
return renderGateSummaryMarkdown(result);
|
|
15966
16008
|
}
|
|
15967
16009
|
|
|
15968
|
-
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, DELIVERY_CONFLICT_ATTR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, IDENTITY_CONFLICT_ATTR, 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 };
|
|
15969
|
-
//# sourceMappingURL=chunk-
|
|
15970
|
-
//# sourceMappingURL=chunk-
|
|
16010
|
+
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, DELIVERY_CONFLICT_ATTR, DELIVERY_EVENT_BASE_ATTR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, IDENTITY_CONFLICT_ATTR, 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 };
|
|
16011
|
+
//# sourceMappingURL=chunk-P27XTK5U.mjs.map
|
|
16012
|
+
//# sourceMappingURL=chunk-P27XTK5U.mjs.map
|