agent-inspect 6.29.4 → 6.29.5
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 +11 -0
- package/README.md +1 -1
- package/docs/LIMITATIONS.md +1 -1
- package/docs/TRACE-CONTRACTS.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-FJRUJSST.mjs → chunk-XWQEHKGB.mjs} +41 -29
- package/packages/cli/dist/chunk-XWQEHKGB.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +194 -70
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +146 -43
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-GZQVDREP.mjs → src-XNC4EUN3.mjs} +3 -3
- package/packages/cli/dist/{src-GZQVDREP.mjs.map → src-XNC4EUN3.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +20 -9
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +10 -10
- package/packages/core/dist/advanced.d.ts +10 -10
- package/packages/core/dist/advanced.mjs +15 -14
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +45 -31
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +7 -7
- package/packages/core/dist/checks.d.ts +7 -7
- package/packages/core/dist/checks.mjs +5 -5
- package/packages/core/dist/{chunk-7LSVGXCN.mjs → chunk-26YJSETN.mjs} +3 -3
- package/packages/core/dist/{chunk-7LSVGXCN.mjs.map → chunk-26YJSETN.mjs.map} +1 -1
- package/packages/core/dist/{chunk-5M4QUYFH.mjs → chunk-BGF5JDJN.mjs} +3 -3
- package/packages/core/dist/{chunk-5M4QUYFH.mjs.map → chunk-BGF5JDJN.mjs.map} +1 -1
- package/packages/core/dist/{chunk-3I6KX32E.mjs → chunk-EE5Z2GQ3.mjs} +20 -12
- package/packages/core/dist/chunk-EE5Z2GQ3.mjs.map +1 -0
- package/packages/core/dist/{chunk-FKVCTIP6.mjs → chunk-KWBO36PH.mjs} +4 -4
- package/packages/core/dist/{chunk-FKVCTIP6.mjs.map → chunk-KWBO36PH.mjs.map} +1 -1
- package/packages/core/dist/{chunk-BMRK6XHO.mjs → chunk-PBNBQRXV.mjs} +4 -4
- package/packages/core/dist/{chunk-BMRK6XHO.mjs.map → chunk-PBNBQRXV.mjs.map} +1 -1
- package/packages/core/dist/{chunk-KNRY24RS.mjs → chunk-Q5SLKV2Y.mjs} +3 -3
- package/packages/core/dist/{chunk-KNRY24RS.mjs.map → chunk-Q5SLKV2Y.mjs.map} +1 -1
- package/packages/core/dist/{chunk-XPDNO3KH.mjs → chunk-TU47EKKS.mjs} +29 -34
- package/packages/core/dist/chunk-TU47EKKS.mjs.map +1 -0
- package/packages/core/dist/{chunk-AT7TICCQ.mjs → chunk-WN5PT4GV.mjs} +4 -4
- package/packages/core/dist/{chunk-AT7TICCQ.mjs.map → chunk-WN5PT4GV.mjs.map} +1 -1
- package/packages/core/dist/{chunk-DZBNXCLA.mjs → chunk-ZFJ2ICTC.mjs} +5 -5
- package/packages/core/dist/{chunk-DZBNXCLA.mjs.map → chunk-ZFJ2ICTC.mjs.map} +1 -1
- package/packages/core/dist/{context-B8zzsmjX.d.ts → context-B7DqUmsJ.d.ts} +3 -3
- package/packages/core/dist/{context-BhaVHtOT.d.cts → context-rR_jW9TH.d.cts} +3 -3
- package/packages/core/dist/diff.d.cts +3 -3
- package/packages/core/dist/diff.d.ts +3 -3
- package/packages/core/dist/exporters.d.cts +3 -3
- package/packages/core/dist/exporters.d.ts +3 -3
- package/packages/core/dist/exporters.mjs +5 -5
- package/packages/core/dist/{index-BT3KcO6-.d.cts → index-Cdww9h50.d.cts} +2 -2
- package/packages/core/dist/{index-BaQ48jrq.d.cts → index-DKv7esIo.d.cts} +4 -4
- package/packages/core/dist/{index-CrnEOoRu.d.ts → index-DvSbXNot.d.ts} +4 -4
- package/packages/core/dist/{index-reskZCVW.d.ts → index-xUbdpcrP.d.ts} +2 -2
- package/packages/core/dist/index.cjs +11 -9
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +6 -6
- package/packages/core/dist/index.d.ts +6 -6
- package/packages/core/dist/index.mjs +6 -6
- package/packages/core/dist/{inspect-event-CDqjcrG_.d.cts → inspect-event-ClM5Z8om.d.cts} +6 -1
- package/packages/core/dist/{inspect-event-CDqjcrG_.d.ts → inspect-event-ClM5Z8om.d.ts} +6 -1
- package/packages/core/dist/{log-config-DcjV8ZjF.d.cts → log-config-CyRGaaWd.d.cts} +1 -1
- package/packages/core/dist/{log-config-N_c5AE09.d.ts → log-config-DAV_sR9A.d.ts} +1 -1
- package/packages/core/dist/logs.d.cts +3 -3
- package/packages/core/dist/logs.d.ts +3 -3
- package/packages/core/dist/{persisted-inspect-event-BMwvGIB8.d.ts → persisted-inspect-event-DG02LhEP.d.ts} +1 -1
- package/packages/core/dist/{persisted-inspect-event-DPaCiars.d.cts → persisted-inspect-event-q2ViiBW6.d.cts} +1 -1
- package/packages/core/dist/persisted.cjs +11 -9
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.d.cts +5 -5
- package/packages/core/dist/persisted.d.ts +5 -5
- package/packages/core/dist/persisted.mjs +3 -3
- package/packages/core/dist/readers.cjs +11 -9
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +3 -3
- package/packages/core/dist/readers.d.ts +3 -3
- package/packages/core/dist/readers.mjs +4 -4
- package/packages/core/dist/{types-C5Y8Idle.d.ts → types-BX1EPji1.d.ts} +1 -1
- package/packages/core/dist/{types-BSzhK7Z1.d.cts → types-bwL8cBv5.d.cts} +1 -1
- package/packages/core/dist/writers.cjs +11 -9
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.d.cts +2 -2
- package/packages/core/dist/writers.d.ts +2 -2
- package/packages/core/dist/writers.mjs +3 -3
- package/packages/cli/dist/chunk-FJRUJSST.mjs.map +0 -1
- package/packages/core/dist/chunk-3I6KX32E.mjs.map +0 -1
- package/packages/core/dist/chunk-XPDNO3KH.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { OBSERVED_OUTCOME_METHODS, extractOutcomesFromPersistedEvents, outcomesMatchingStatus } from './chunk-
|
|
1
|
+
import { OBSERVED_OUTCOME_METHODS, extractOutcomesFromPersistedEvents, outcomesMatchingStatus } from './chunk-BGF5JDJN.mjs';
|
|
2
2
|
import { formatProgrammaticDiagnostic } from './chunk-FWK3Q3OJ.mjs';
|
|
3
|
+
import { isAttributionConfidence, ATTRIBUTION_CONFIDENCES, ATTRIBUTION_CONFIDENCE_RANK } from './chunk-EE5Z2GQ3.mjs';
|
|
3
4
|
|
|
4
5
|
// packages/core/src/sessions/metadata.ts
|
|
5
6
|
function isNonEmptyString(value) {
|
|
@@ -1901,16 +1902,6 @@ function eventTime2(event) {
|
|
|
1901
1902
|
function sortByTime2(events) {
|
|
1902
1903
|
return [...events].sort((a, b) => eventTime2(a).localeCompare(eventTime2(b)));
|
|
1903
1904
|
}
|
|
1904
|
-
function hasIdempotencyEvidence2(event) {
|
|
1905
|
-
const workflow = workflowFor2(event);
|
|
1906
|
-
if (typeof workflow.idempotencyKey === "string" && workflow.idempotencyKey.trim() !== "") {
|
|
1907
|
-
return true;
|
|
1908
|
-
}
|
|
1909
|
-
const attrs2 = event.attributes ?? {};
|
|
1910
|
-
if (attrs2.noSideEffect === true) return true;
|
|
1911
|
-
if (attrs2.sideEffect === false) return true;
|
|
1912
|
-
return false;
|
|
1913
|
-
}
|
|
1914
1905
|
function errorCodeOf(event) {
|
|
1915
1906
|
if (typeof event.error?.code === "string" && event.error.code.trim() !== "") {
|
|
1916
1907
|
return event.error.code.trim();
|
|
@@ -2167,13 +2158,13 @@ function evaluateRecoveryOperations(events, operations) {
|
|
|
2167
2158
|
}
|
|
2168
2159
|
if (sideEffectClass === "write") {
|
|
2169
2160
|
for (const event of ordered) {
|
|
2170
|
-
if (isUnevaluableWriteCompletion(event)
|
|
2161
|
+
if (isUnevaluableWriteCompletion(event)) {
|
|
2171
2162
|
findings.push(
|
|
2172
2163
|
fail3(
|
|
2173
2164
|
"contract.retry.operations.write-completion-unevaluable",
|
|
2174
|
-
`Write tool ${operation.tool} has timeout/unknown completion
|
|
2165
|
+
`Write tool ${operation.tool} has timeout/unknown/running completion that cannot be verified as an authoritative write result.`,
|
|
2175
2166
|
[eventEvidence2(event)],
|
|
2176
|
-
"
|
|
2167
|
+
"authoritative write completion observation",
|
|
2177
2168
|
{
|
|
2178
2169
|
code: "AI_CHECK_RECOVERY_WRITE_COMPLETION_UNAVAILABLE",
|
|
2179
2170
|
status: event.status
|
|
@@ -2317,7 +2308,7 @@ function evaluateRecoveryOperations(events, operations) {
|
|
|
2317
2308
|
if (dependency?.consumerKind === "LLM") {
|
|
2318
2309
|
const successForDependency = latest?.status === "ok" ? latest : identityUnavailable ? void 0 : lastOk;
|
|
2319
2310
|
if (successForDependency) {
|
|
2320
|
-
if (sideEffectClass === "write" && isUnevaluableWriteCompletion(successForDependency)
|
|
2311
|
+
if (sideEffectClass === "write" && isUnevaluableWriteCompletion(successForDependency)) {
|
|
2321
2312
|
findings.push(
|
|
2322
2313
|
fail3(
|
|
2323
2314
|
"contract.retry.operations.successful-result-dependency",
|
|
@@ -3369,12 +3360,7 @@ var STATUS_RANK = {
|
|
|
3369
3360
|
warning: 1,
|
|
3370
3361
|
pass: 2
|
|
3371
3362
|
};
|
|
3372
|
-
var CONFIDENCE_RANK =
|
|
3373
|
-
unknown: 0,
|
|
3374
|
-
heuristic: 1,
|
|
3375
|
-
correlated: 2,
|
|
3376
|
-
explicit: 3
|
|
3377
|
-
};
|
|
3363
|
+
var CONFIDENCE_RANK = ATTRIBUTION_CONFIDENCE_RANK;
|
|
3378
3364
|
var DEFAULT_SENSITIVE_KEYS = DEFAULT_CREDENTIAL_SENSITIVE_KEYS;
|
|
3379
3365
|
var DEFAULT_RAW_CONTENT_KEYS = [
|
|
3380
3366
|
"body",
|
|
@@ -4643,6 +4629,12 @@ function createStructureCycleRule() {
|
|
|
4643
4629
|
};
|
|
4644
4630
|
}
|
|
4645
4631
|
function createStructureRelationshipRule(options = {}) {
|
|
4632
|
+
if (options.minConfidence !== void 0 && !isAttributionConfidence(options.minConfidence)) {
|
|
4633
|
+
throw new TypeError(
|
|
4634
|
+
`createStructureRelationshipRule: minConfidence must be one of: ${ATTRIBUTION_CONFIDENCES.join(", ")}.`
|
|
4635
|
+
);
|
|
4636
|
+
}
|
|
4637
|
+
const minConfidence = options.minConfidence;
|
|
4646
4638
|
return {
|
|
4647
4639
|
id: "structure.relationship",
|
|
4648
4640
|
category: "structure",
|
|
@@ -4650,18 +4642,21 @@ function createStructureRelationshipRule(options = {}) {
|
|
|
4650
4642
|
evaluate(context) {
|
|
4651
4643
|
const byId = eventMap(semanticEvents(context));
|
|
4652
4644
|
const findings = [];
|
|
4653
|
-
const minConfidence = options.minConfidence;
|
|
4654
4645
|
for (const event of semanticEvents(context)) {
|
|
4655
|
-
if (minConfidence
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4646
|
+
if (minConfidence) {
|
|
4647
|
+
const eventRank = CONFIDENCE_RANK[event.confidence] ?? CONFIDENCE_RANK.unknown;
|
|
4648
|
+
const minRank = CONFIDENCE_RANK[minConfidence];
|
|
4649
|
+
if (eventRank < minRank) {
|
|
4650
|
+
findings.push(
|
|
4651
|
+
failFinding(
|
|
4652
|
+
"structure.relationship",
|
|
4653
|
+
`Event confidence ${event.confidence} is below ${minConfidence}.`,
|
|
4654
|
+
[eventEvidence3(event, "confidence")],
|
|
4655
|
+
{ minConfidence },
|
|
4656
|
+
event.confidence
|
|
4657
|
+
)
|
|
4658
|
+
);
|
|
4659
|
+
}
|
|
4665
4660
|
}
|
|
4666
4661
|
if (!event.parentId) continue;
|
|
4667
4662
|
if (event.parentId === event.eventId) {
|
|
@@ -5334,5 +5329,5 @@ function runTraceChecks(input, options = {}) {
|
|
|
5334
5329
|
}
|
|
5335
5330
|
|
|
5336
5331
|
export { buildTraceFacts, createBaselineRegressionRule, createDecisionRule, createGuardrailRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRetrievalRule, createRunDepthRule, createRunDurationRule, createRunEventCountRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureIncompleteRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolFailureRule, createToolOrderingRule, createToolUsageRule, defineTraceContract, deriveFailureFacts, deriveRelationshipFacts, evaluateToolArgumentValue, evaluateTraceContract, evaluateTraceContractRead, explainTraceContract, extractSessionWorkflowMetadata, extractToolArgumentPayload, lintTraceContract, projectLogicalEvents, resolveCanonicalToolName, resolveJsonPointer, resolveTraceContractScope, runTraceChecks, sessionKeyForRun, summarizeSemanticParity, workflowMetadataForRun };
|
|
5337
|
-
//# sourceMappingURL=chunk-
|
|
5338
|
-
//# sourceMappingURL=chunk-
|
|
5332
|
+
//# sourceMappingURL=chunk-TU47EKKS.mjs.map
|
|
5333
|
+
//# sourceMappingURL=chunk-TU47EKKS.mjs.map
|