agent-inspect 6.17.2 → 6.17.4
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 +5 -8
- package/docs/ADAPTER-CONFORMANCE.md +24 -0
- package/docs/CI-ARTIFACTS.md +2 -1
- package/docs/OPENAI-AGENTS-LOCAL.md +14 -0
- package/docs/SAFE-TRACE-SHARING.md +3 -0
- package/docs/SCREENSHOTS.md +2 -1
- package/docs/SELF-HOSTING.md +2 -0
- package/docs/STANDARDS.md +15 -0
- package/docs/SUPPORT-LEVELS.md +23 -0
- package/docs/assets/agent-inspect-logo-mark.svg +12 -0
- package/docs/assets/readme-product-loop.svg +17 -26
- package/package.json +5 -3
- package/packages/cli/dist/{chunk-FXGWXSFV.mjs → chunk-YX6RFLV5.mjs} +15 -5
- package/packages/cli/dist/chunk-YX6RFLV5.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +32 -10
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +22 -10
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-EW7KW2BK.mjs → src-X6SLMBNH.mjs} +3 -3
- package/packages/cli/dist/{src-EW7KW2BK.mjs.map → src-X6SLMBNH.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +7 -2
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +7 -2
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +7 -2
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-UFP54T7F.mjs → chunk-HN377P23.mjs} +9 -4
- package/packages/core/dist/chunk-HN377P23.mjs.map +1 -0
- package/packages/cli/dist/chunk-FXGWXSFV.mjs.map +0 -1
- package/packages/core/dist/chunk-UFP54T7F.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { 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, truncateStringForProfile, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, isAgentInspectTrace, filterMetasBySessionScope, 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, renderErrorLine, getIndent, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, diffRuns, manualTraceEventsToComparableRun } from './chunk-
|
|
2
|
+
import { 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, truncateStringForProfile, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, isAgentInspectTrace, filterMetasBySessionScope, 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, renderErrorLine, getIndent, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, diffRuns, manualTraceEventsToComparableRun } from './chunk-YX6RFLV5.mjs';
|
|
3
3
|
import { realpathSync, constants as constants$1, existsSync, readFileSync } from 'fs';
|
|
4
4
|
import path18 from 'path';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
@@ -12,7 +12,7 @@ import { spawn } from 'child_process';
|
|
|
12
12
|
import { createRequire } from 'module';
|
|
13
13
|
|
|
14
14
|
// package.json
|
|
15
|
-
var version = "6.17.
|
|
15
|
+
var version = "6.17.4";
|
|
16
16
|
|
|
17
17
|
// packages/cli/src/trace-dir-scale.ts
|
|
18
18
|
var TRACE_COUNT_WARN = 1e3;
|
|
@@ -3347,7 +3347,7 @@ async function newestTraceMtimeMs(traceDir) {
|
|
|
3347
3347
|
}
|
|
3348
3348
|
async function loadSessionRuns(traceDir) {
|
|
3349
3349
|
try {
|
|
3350
|
-
const mod = await import('./src-
|
|
3350
|
+
const mod = await import('./src-X6SLMBNH.mjs');
|
|
3351
3351
|
const dbPath = mod.resolveIndexDbPath(traceDir);
|
|
3352
3352
|
const status = mod.indexStatus(dbPath);
|
|
3353
3353
|
if (!status.healthy) {
|
|
@@ -3820,8 +3820,11 @@ async function reportCommand(runId, options = {}) {
|
|
|
3820
3820
|
}
|
|
3821
3821
|
|
|
3822
3822
|
// packages/redact/src/sensitive-key.ts
|
|
3823
|
+
function keyHasExplicitSeparator(value) {
|
|
3824
|
+
return /[_\-.]/.test(value);
|
|
3825
|
+
}
|
|
3823
3826
|
function normalizeSensitiveKey(value) {
|
|
3824
|
-
return value.toLowerCase().replace(/[^a-z0-
|
|
3827
|
+
return value.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
3825
3828
|
}
|
|
3826
3829
|
var NON_CREDENTIAL_TOKEN_CONFIG_KEYS = new Set(
|
|
3827
3830
|
[
|
|
@@ -3851,6 +3854,7 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
|
|
|
3851
3854
|
const normalized = normalizeSensitiveKey(key);
|
|
3852
3855
|
if (!normalized) return false;
|
|
3853
3856
|
if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS.has(normalized)) return false;
|
|
3857
|
+
const allowPrefixCompound = keyHasExplicitSeparator(key);
|
|
3854
3858
|
for (const sensitive of sensitiveKeys) {
|
|
3855
3859
|
const s = normalizeSensitiveKey(sensitive);
|
|
3856
3860
|
if (!s) continue;
|
|
@@ -3859,7 +3863,8 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
|
|
|
3859
3863
|
continue;
|
|
3860
3864
|
}
|
|
3861
3865
|
if (normalized === s) return true;
|
|
3862
|
-
if (normalized.endsWith(`_${s}`)
|
|
3866
|
+
if (normalized.endsWith(`_${s}`)) return true;
|
|
3867
|
+
if (allowPrefixCompound && normalized.startsWith(`${s}_`)) return true;
|
|
3863
3868
|
}
|
|
3864
3869
|
return false;
|
|
3865
3870
|
}
|
|
@@ -11255,7 +11260,7 @@ function isModuleNotFound4(e) {
|
|
|
11255
11260
|
}
|
|
11256
11261
|
async function loadIndexSqlite() {
|
|
11257
11262
|
try {
|
|
11258
|
-
return await import('./src-
|
|
11263
|
+
return await import('./src-X6SLMBNH.mjs');
|
|
11259
11264
|
} catch (e) {
|
|
11260
11265
|
if (isModuleNotFound4(e)) {
|
|
11261
11266
|
console.error(
|
|
@@ -11752,9 +11757,15 @@ function normalizeMetrics(raw) {
|
|
|
11752
11757
|
const parsed = parseCohortMetricList(raw);
|
|
11753
11758
|
if (parsed.length === 0) return void 0;
|
|
11754
11759
|
const allowed = new Set(COHORT_METRIC_IDS);
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11760
|
+
const invalid = parsed.filter((metric) => !allowed.has(metric));
|
|
11761
|
+
if (invalid.length > 0) {
|
|
11762
|
+
const valueLabel = invalid.length === 1 ? "value" : "values";
|
|
11763
|
+
const invalidList = invalid.map((metric) => `"${metric}"`).join(", ");
|
|
11764
|
+
throw new Error(
|
|
11765
|
+
`Unsupported cohort --metric ${valueLabel}: ${invalidList}. Valid metrics: ${COHORT_METRIC_IDS.join(", ")}.`
|
|
11766
|
+
);
|
|
11767
|
+
}
|
|
11768
|
+
return parsed;
|
|
11758
11769
|
}
|
|
11759
11770
|
async function writeArtifacts(result, outputDir) {
|
|
11760
11771
|
await mkdir(outputDir, { recursive: true });
|
|
@@ -11775,6 +11786,7 @@ async function writeArtifacts(result, outputDir) {
|
|
|
11775
11786
|
}
|
|
11776
11787
|
async function cohortCommand(options = {}) {
|
|
11777
11788
|
try {
|
|
11789
|
+
const metrics = normalizeMetrics(options.metric);
|
|
11778
11790
|
const traceDir = resolveTraceDir({ dir: options.dir });
|
|
11779
11791
|
const { runs } = await loadSessionRuns(traceDir);
|
|
11780
11792
|
const result = await analyzeCohort(runs, {
|
|
@@ -11783,7 +11795,7 @@ async function cohortCommand(options = {}) {
|
|
|
11783
11795
|
candidate: options.candidate,
|
|
11784
11796
|
cohortKey: options.cohortKey,
|
|
11785
11797
|
groupBy: options.groupBy,
|
|
11786
|
-
metrics
|
|
11798
|
+
metrics
|
|
11787
11799
|
});
|
|
11788
11800
|
const format = options.format ?? (options.json ? "json" : "markdown");
|
|
11789
11801
|
let artifacts;
|