agent-inspect 6.31.22 → 6.31.23
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 +6 -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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { ATTRIBUTION_CONFIDENCES, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, resolveBundleRunIds, getTraceFilePath, openTrace, sha256Hex, collectTraceSchemaVersions, aggregateBundleSafeStatus, bundleFailsOnSafety, bundleRunAssetRelativePath, buildPlaceholderArtifact, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceHtmlShell, buildEvidenceProvenanceViewHtml, EVIDENCE_FORMAT_VERSION, inferEvidenceFileRole, buildEvidenceSafetyViewHtml, buildEvidenceDiffViewHtml, buildEvidenceCircuitViewHtml, buildEvidenceOutcomesViewHtml, buildEvidenceContractsViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceCausalFailureViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceTreeViewHtml, buildEvidenceManifest, serializeEvidenceManifest, buildZipArchive, assertBundlePathContained, enrichSessionRunRecord, normalizeBundleOutputPath, sanitizeBundleRunId, defaultBundleOutputPath, runTraceChecks, assertEvidenceRelativePath, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, TraceReadError, resolveRedactionProfile, applyProfileMetadataCaps, Redactor, flattenTree, escapeHtml, safeString, compactAttributes, stableJson, escapeMarkdown, IDENTITY_CONFLICT_ATTR, DELIVERY_CONFLICT_ATTR, DEFAULT_REDACT_KEYS, truncateStringForProfile, stringContainsHighConfidenceCredential, isCredentialSensitiveKey, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, renderErrorLine, isAgentInspectTrace, persistedInspectEventsToRunTrees, defineTraceContract, filterMetasBySessionScope, evaluateTraceContract, aggregateSessionCheckResults, createBaselineRegressionRule, summarizeSemanticParity, buildEvidenceCiPackage, verifyEvidenceDirectory, diffTraceEvents, renderRunDiff, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, formatStepLabel, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, getIndent, TreeBuilder, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, projectLogicalEvents, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, isAttributionConfidence, zeroKinds, diffRuns, manualTraceEventsToComparableRun } from './chunk-
|
|
2
|
+
import { ATTRIBUTION_CONFIDENCES, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, resolveBundleRunIds, getTraceFilePath, openTrace, sha256Hex, collectTraceSchemaVersions, aggregateBundleSafeStatus, bundleFailsOnSafety, bundleRunAssetRelativePath, buildPlaceholderArtifact, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceHtmlShell, buildEvidenceProvenanceViewHtml, EVIDENCE_FORMAT_VERSION, inferEvidenceFileRole, buildEvidenceSafetyViewHtml, buildEvidenceDiffViewHtml, buildEvidenceCircuitViewHtml, buildEvidenceOutcomesViewHtml, buildEvidenceContractsViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceCausalFailureViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceTreeViewHtml, buildEvidenceManifest, serializeEvidenceManifest, buildZipArchive, assertBundlePathContained, enrichSessionRunRecord, normalizeBundleOutputPath, sanitizeBundleRunId, defaultBundleOutputPath, runTraceChecks, assertEvidenceRelativePath, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, TraceReadError, resolveRedactionProfile, applyProfileMetadataCaps, Redactor, flattenTree, escapeHtml, safeString, compactAttributes, stableJson, escapeMarkdown, IDENTITY_CONFLICT_ATTR, DELIVERY_CONFLICT_ATTR, DELIVERY_EVENT_BASE_ATTR, DEFAULT_REDACT_KEYS, truncateStringForProfile, stringContainsHighConfidenceCredential, isCredentialSensitiveKey, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, renderErrorLine, isAgentInspectTrace, persistedInspectEventsToRunTrees, defineTraceContract, filterMetasBySessionScope, evaluateTraceContract, aggregateSessionCheckResults, createBaselineRegressionRule, summarizeSemanticParity, buildEvidenceCiPackage, verifyEvidenceDirectory, diffTraceEvents, renderRunDiff, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, formatStepLabel, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, getIndent, TreeBuilder, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, projectLogicalEvents, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, isAttributionConfidence, zeroKinds, diffRuns, manualTraceEventsToComparableRun } from './chunk-P27XTK5U.mjs';
|
|
3
3
|
import { realpathSync, constants as constants$1, existsSync, readFileSync } from 'fs';
|
|
4
4
|
import path19 from 'path';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
@@ -14,7 +14,7 @@ import { createServer } from 'http';
|
|
|
14
14
|
import { createRequire } from 'module';
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
|
-
var version = "6.31.
|
|
17
|
+
var version = "6.31.23";
|
|
18
18
|
|
|
19
19
|
// packages/cli/src/trace-dir-scale.ts
|
|
20
20
|
var TRACE_COUNT_WARN = 1e3;
|
|
@@ -2626,10 +2626,16 @@ function pickBoundedIdentityString(bag, key, maxLen) {
|
|
|
2626
2626
|
if (!bag || typeof bag !== "object") return {};
|
|
2627
2627
|
const directRaw = bag[key];
|
|
2628
2628
|
const nestedRaw = nestedBag(bag)?.[key];
|
|
2629
|
-
const
|
|
2630
|
-
const
|
|
2631
|
-
|
|
2632
|
-
|
|
2629
|
+
const directFull = typeof directRaw === "string" && directRaw.trim() !== "" ? directRaw.trim() : void 0;
|
|
2630
|
+
const nestedFull = typeof nestedRaw === "string" && nestedRaw.trim() !== "" ? nestedRaw.trim() : void 0;
|
|
2631
|
+
const direct = directFull !== void 0 ? directFull.slice(0, maxLen) : void 0;
|
|
2632
|
+
const nested = nestedFull !== void 0 ? nestedFull.slice(0, maxLen) : void 0;
|
|
2633
|
+
if (directFull !== void 0 && nestedFull !== void 0 && directFull !== nestedFull) {
|
|
2634
|
+
return {
|
|
2635
|
+
value: direct,
|
|
2636
|
+
conflictAlternate: nested,
|
|
2637
|
+
truncatedCollision: direct === nested
|
|
2638
|
+
};
|
|
2633
2639
|
}
|
|
2634
2640
|
if (direct !== void 0) return { value: direct };
|
|
2635
2641
|
if (nested !== void 0) return { value: nested };
|
|
@@ -2650,32 +2656,21 @@ function pickBoundedIdentityNumber(bag, key) {
|
|
|
2650
2656
|
}
|
|
2651
2657
|
function appendStructuralIdentityAttrs(attrs, meta, maxLen) {
|
|
2652
2658
|
const conflicts = [];
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
attrs.push(stringAttr(IDENTITY_CONFLICT_ATTR.attemptId, attemptId.conflictAlternate));
|
|
2669
|
-
conflicts.push("attemptId");
|
|
2670
|
-
}
|
|
2671
|
-
const retryOf = pickBoundedIdentityString(meta, "retryOf", maxLen);
|
|
2672
|
-
if (retryOf.value !== void 0) {
|
|
2673
|
-
attrs.push(stringAttr("agent_inspect.retry_of", retryOf.value));
|
|
2674
|
-
}
|
|
2675
|
-
if (retryOf.conflictAlternate !== void 0) {
|
|
2676
|
-
attrs.push(stringAttr(IDENTITY_CONFLICT_ATTR.retryOf, retryOf.conflictAlternate));
|
|
2677
|
-
conflicts.push("retryOf");
|
|
2678
|
-
}
|
|
2659
|
+
const emitString = (key, otlpKey, conflictKey) => {
|
|
2660
|
+
const picked = pickBoundedIdentityString(meta, key, maxLen);
|
|
2661
|
+
if (picked.value !== void 0) {
|
|
2662
|
+
attrs.push(stringAttr(otlpKey, picked.value));
|
|
2663
|
+
}
|
|
2664
|
+
if (picked.conflictAlternate !== void 0 || picked.truncatedCollision) {
|
|
2665
|
+
if (picked.conflictAlternate !== void 0) {
|
|
2666
|
+
attrs.push(stringAttr(conflictKey, picked.conflictAlternate));
|
|
2667
|
+
}
|
|
2668
|
+
conflicts.push(key);
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
emitString("operationId", "agent_inspect.operation_id", IDENTITY_CONFLICT_ATTR.operationId);
|
|
2672
|
+
emitString("attemptId", "agent_inspect.attempt_id", IDENTITY_CONFLICT_ATTR.attemptId);
|
|
2673
|
+
emitString("retryOf", "agent_inspect.retry_of", IDENTITY_CONFLICT_ATTR.retryOf);
|
|
2679
2674
|
const attemptNumberPrimary = pickBoundedIdentityNumber(meta, "attemptNumber");
|
|
2680
2675
|
const attemptNumber2 = attemptNumberPrimary.value !== void 0 || attemptNumberPrimary.conflictAlternate !== void 0 ? attemptNumberPrimary : pickBoundedIdentityNumber(meta, "attempt");
|
|
2681
2676
|
if (attemptNumber2.value !== void 0) {
|
|
@@ -2687,9 +2682,18 @@ function appendStructuralIdentityAttrs(attrs, meta, maxLen) {
|
|
|
2687
2682
|
);
|
|
2688
2683
|
conflicts.push("attemptNumber");
|
|
2689
2684
|
}
|
|
2685
|
+
if (conflicts.length > 0) {
|
|
2686
|
+
attrs.push(
|
|
2687
|
+
stringAttr(IDENTITY_CONFLICT_ATTR.fields, conflicts.join(",").slice(0, maxLen))
|
|
2688
|
+
);
|
|
2689
|
+
}
|
|
2690
2690
|
if (meta?.[DELIVERY_CONFLICT_ATTR] === true) {
|
|
2691
2691
|
attrs.push(boolAttr(DELIVERY_CONFLICT_ATTR, true));
|
|
2692
2692
|
}
|
|
2693
|
+
const deliveryBase = meta?.[DELIVERY_EVENT_BASE_ATTR];
|
|
2694
|
+
if (typeof deliveryBase === "string" && deliveryBase.trim() !== "") {
|
|
2695
|
+
attrs.push(stringAttr(DELIVERY_EVENT_BASE_ATTR, deliveryBase.trim().slice(0, maxLen)));
|
|
2696
|
+
}
|
|
2693
2697
|
return conflicts;
|
|
2694
2698
|
}
|
|
2695
2699
|
function resolveSpanTimes(ev) {
|
|
@@ -4084,7 +4088,7 @@ async function newestTraceMtimeMs(traceDir) {
|
|
|
4084
4088
|
}
|
|
4085
4089
|
async function loadSessionRuns(traceDir) {
|
|
4086
4090
|
try {
|
|
4087
|
-
const mod = await import('./src-
|
|
4091
|
+
const mod = await import('./src-EWZYLDST.mjs');
|
|
4088
4092
|
const dbPath = mod.resolveIndexDbPath(traceDir);
|
|
4089
4093
|
const status = mod.indexStatus(dbPath);
|
|
4090
4094
|
if (!status.healthy) {
|
|
@@ -14066,7 +14070,7 @@ function isModuleNotFound4(e) {
|
|
|
14066
14070
|
}
|
|
14067
14071
|
async function loadIndexSqlite() {
|
|
14068
14072
|
try {
|
|
14069
|
-
return await import('./src-
|
|
14073
|
+
return await import('./src-EWZYLDST.mjs');
|
|
14070
14074
|
} catch (e) {
|
|
14071
14075
|
if (isModuleNotFound4(e)) {
|
|
14072
14076
|
console.error(
|