agent-inspect 6.31.34 → 6.31.35
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/docs/LIMITATIONS.md +22 -0
- package/docs/SAFE-TRACE-SHARING.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-6TXW53UR.mjs → chunk-RLFYFWIZ.mjs} +46 -7
- package/packages/cli/dist/chunk-RLFYFWIZ.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +46 -7
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +4 -4
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-GCLC4DIC.mjs → src-S23RCPL2.mjs} +3 -3
- package/packages/cli/dist/{src-GCLC4DIC.mjs.map → src-S23RCPL2.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +44 -5
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +2 -2
- package/packages/core/dist/checks.cjs +44 -5
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-CXC7L4PY.mjs → chunk-3OMB34E6.mjs} +46 -7
- package/packages/core/dist/chunk-3OMB34E6.mjs.map +1 -0
- package/packages/cli/dist/chunk-6TXW53UR.mjs.map +0 -1
- package/packages/core/dist/chunk-CXC7L4PY.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { buildTraceFacts, createBaselineRegressionRule, createDecisionRule, createGuardrailRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRetrievalRule, createRunDepthRule, createRunDurationRule, createRunEventCountRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStepOrderingRule, createStructureCycleRule, createStructureIncompleteRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolFailureRule, createToolOrderingRule, createToolUsageRule, defineTraceContract, deriveFailureFacts, deriveRelationshipFacts, evaluateToolArgumentValue, evaluateTraceContract, evaluateTraceContractRead, explainTraceContract, extractToolArgumentPayload, lintTraceContract, resolveJsonPointer, resolveTraceContractScope, runTraceChecks, summarizeSemanticParity, workflowMetadataForRun } from './chunk-
|
|
1
|
+
export { buildTraceFacts, createBaselineRegressionRule, createDecisionRule, createGuardrailRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRetrievalRule, createRunDepthRule, createRunDurationRule, createRunEventCountRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStepOrderingRule, createStructureCycleRule, createStructureIncompleteRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolFailureRule, createToolOrderingRule, createToolUsageRule, defineTraceContract, deriveFailureFacts, deriveRelationshipFacts, evaluateToolArgumentValue, evaluateTraceContract, evaluateTraceContractRead, explainTraceContract, extractToolArgumentPayload, lintTraceContract, resolveJsonPointer, resolveTraceContractScope, runTraceChecks, summarizeSemanticParity, workflowMetadataForRun } from './chunk-3OMB34E6.mjs';
|
|
2
2
|
import './chunk-6F6KLGCR.mjs';
|
|
3
3
|
import './chunk-PU3FF5AP.mjs';
|
|
4
4
|
import './chunk-VLVCLAPB.mjs';
|
|
@@ -3495,11 +3495,27 @@ function eventTimestamp(finding, eventById) {
|
|
|
3495
3495
|
const eventId = finding.evidence[0]?.eventId;
|
|
3496
3496
|
return eventId ? eventById.get(eventId)?.timestamp ?? "" : "";
|
|
3497
3497
|
}
|
|
3498
|
+
function isObservedToolPolicyFinding(finding) {
|
|
3499
|
+
return finding.ruleId === "tool.usage" && finding.evidence[0]?.eventId !== void 0;
|
|
3500
|
+
}
|
|
3501
|
+
function isMissingToolConsequenceFinding(finding) {
|
|
3502
|
+
if (finding.evidence[0]?.eventId !== void 0) return false;
|
|
3503
|
+
if (finding.ruleId === "tool.usage" && /did not appear/.test(finding.message)) {
|
|
3504
|
+
return true;
|
|
3505
|
+
}
|
|
3506
|
+
return finding.ruleId.startsWith("contract.tool.arguments") && /^No finished tool named /.test(finding.message);
|
|
3507
|
+
}
|
|
3498
3508
|
function compareFindings(eventById) {
|
|
3499
3509
|
return (a, b) => {
|
|
3500
3510
|
if (SEVERITY_RANK[a.severity] !== SEVERITY_RANK[b.severity]) {
|
|
3501
3511
|
return SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity];
|
|
3502
3512
|
}
|
|
3513
|
+
const aPolicy = isObservedToolPolicyFinding(a);
|
|
3514
|
+
const bPolicy = isObservedToolPolicyFinding(b);
|
|
3515
|
+
const aMissing = isMissingToolConsequenceFinding(a);
|
|
3516
|
+
const bMissing = isMissingToolConsequenceFinding(b);
|
|
3517
|
+
if (aPolicy && bMissing) return -1;
|
|
3518
|
+
if (bPolicy && aMissing) return 1;
|
|
3503
3519
|
const byRule = a.ruleId.localeCompare(b.ruleId);
|
|
3504
3520
|
if (byRule !== 0) return byRule;
|
|
3505
3521
|
if (STATUS_RANK[a.status] !== STATUS_RANK[b.status]) {
|
|
@@ -3635,20 +3651,43 @@ function failFinding(ruleId, message, evidence, expected, actual, meta) {
|
|
|
3635
3651
|
function toolName(event) {
|
|
3636
3652
|
return resolveCanonicalToolName(event);
|
|
3637
3653
|
}
|
|
3654
|
+
var MAX_TOOL_NAME_CODEPOINT_DETAILS = 3;
|
|
3655
|
+
function isAsciiLetterCodePoint(codePoint) {
|
|
3656
|
+
return codePoint >= 65 && codePoint <= 90 || codePoint >= 97 && codePoint <= 122;
|
|
3657
|
+
}
|
|
3658
|
+
function isRiskyToolNameCodePoint(codePoint) {
|
|
3659
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) return true;
|
|
3660
|
+
return codePoint === 1564 || codePoint === 8203 || codePoint === 8204 || codePoint === 8205 || codePoint === 8206 || codePoint === 8207 || codePoint >= 8234 && codePoint <= 8238 || codePoint >= 8294 && codePoint <= 8297 || codePoint === 65279;
|
|
3661
|
+
}
|
|
3662
|
+
function formatCodePointDetail(codePoint, index) {
|
|
3663
|
+
return `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")} at index ${index}`;
|
|
3664
|
+
}
|
|
3638
3665
|
function formatToolNameForMessage(name) {
|
|
3666
|
+
let hasAsciiLetter = false;
|
|
3667
|
+
let hasNonAscii = false;
|
|
3668
|
+
let hasRisky = false;
|
|
3639
3669
|
const details = [];
|
|
3640
3670
|
for (let index = 0; index < name.length; ) {
|
|
3641
3671
|
const codePoint = name.codePointAt(index);
|
|
3642
3672
|
const width = codePoint > 65535 ? 2 : 1;
|
|
3673
|
+
if (isAsciiLetterCodePoint(codePoint)) hasAsciiLetter = true;
|
|
3674
|
+
const risky = isRiskyToolNameCodePoint(codePoint);
|
|
3675
|
+
if (risky) hasRisky = true;
|
|
3643
3676
|
if (codePoint > 127) {
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3677
|
+
hasNonAscii = true;
|
|
3678
|
+
details.push(formatCodePointDetail(codePoint, index));
|
|
3679
|
+
} else if (risky) {
|
|
3680
|
+
details.push(formatCodePointDetail(codePoint, index));
|
|
3647
3681
|
}
|
|
3648
3682
|
index += width;
|
|
3649
3683
|
}
|
|
3650
|
-
if (details.length === 0)
|
|
3651
|
-
|
|
3684
|
+
if (!hasRisky && !(hasAsciiLetter && hasNonAscii) || details.length === 0) {
|
|
3685
|
+
return name;
|
|
3686
|
+
}
|
|
3687
|
+
const shown = details.slice(0, MAX_TOOL_NAME_CODEPOINT_DETAILS);
|
|
3688
|
+
const remaining = details.length - shown.length;
|
|
3689
|
+
const detailText = remaining > 0 ? `${shown.join("; ")}; and ${remaining} more` : shown.join("; ");
|
|
3690
|
+
return `"${name}" (contains ${detailText})`;
|
|
3652
3691
|
}
|
|
3653
3692
|
function describeRunningEvent(event) {
|
|
3654
3693
|
if (event.kind === "TOOL") {
|
|
@@ -5519,5 +5558,5 @@ function runTraceChecks(input, options = {}) {
|
|
|
5519
5558
|
}
|
|
5520
5559
|
|
|
5521
5560
|
export { buildTraceFacts, createBaselineRegressionRule, createDecisionRule, createGuardrailRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRetrievalRule, createRunDepthRule, createRunDurationRule, createRunEventCountRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStepOrderingRule, createStructureCycleRule, createStructureIncompleteRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolFailureRule, createToolOrderingRule, createToolUsageRule, defineTraceContract, deriveFailureFacts, deriveRelationshipFacts, evaluateToolArgumentValue, evaluateTraceContract, evaluateTraceContractRead, explainTraceContract, extractSessionWorkflowMetadata, extractToolArgumentPayload, lintTraceContract, resolveJsonPointer, resolveTraceContractScope, runTraceChecks, sessionKeyForRun, summarizeSemanticParity, workflowMetadataForRun };
|
|
5522
|
-
//# sourceMappingURL=chunk-
|
|
5523
|
-
//# sourceMappingURL=chunk-
|
|
5561
|
+
//# sourceMappingURL=chunk-3OMB34E6.mjs.map
|
|
5562
|
+
//# sourceMappingURL=chunk-3OMB34E6.mjs.map
|