agent-inspect 6.30.0 → 6.31.0
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/TRACE-CONTRACTS.md +25 -0
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-BDRJENLM.mjs → chunk-Y5Z4BXUO.mjs} +166 -45
- package/packages/cli/dist/chunk-Y5Z4BXUO.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +240 -44
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +79 -4
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-ZUGAUXY6.mjs → src-WTTH5G33.mjs} +3 -3
- package/packages/cli/dist/{src-ZUGAUXY6.mjs.map → src-WTTH5G33.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +12 -1
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +2 -2
- package/packages/core/dist/advanced.d.ts +2 -2
- package/packages/core/dist/advanced.mjs +2 -2
- package/packages/core/dist/checks.cjs +172 -43
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +2 -2
- package/packages/core/dist/checks.d.ts +2 -2
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-OOX25GTH.mjs → chunk-VEQKLWGJ.mjs} +174 -46
- package/packages/core/dist/chunk-VEQKLWGJ.mjs.map +1 -0
- package/packages/core/dist/{index-7hG_qggp.d.ts → index-CgOAGuM5.d.ts} +111 -1
- package/packages/core/dist/{index-CQJUNPPe.d.cts → index-EQihlEei.d.cts} +111 -1
- package/packages/cli/dist/chunk-BDRJENLM.mjs.map +0 -1
- package/packages/core/dist/chunk-OOX25GTH.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -212,7 +212,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
|
|
|
212
212
|
|
|
213
213
|
## Status and documentation
|
|
214
214
|
|
|
215
|
-
**Current published baseline:** **6.
|
|
215
|
+
**Current published baseline:** **6.31.0** · persisted schema `1.0` · Node.js `>=20` · MIT.
|
|
216
216
|
|
|
217
217
|
Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
|
|
218
218
|
|
package/docs/TRACE-CONTRACTS.md
CHANGED
|
@@ -12,6 +12,7 @@ Contracts compile to deterministic check rules for common cases:
|
|
|
12
12
|
- tool required / forbidden / allowed / maxCalls / order (`requiredTools` / `forbiddenTools` aliases)
|
|
13
13
|
- selectable `requiredOrderMode` (`first-occurrence` | `happens-before` | `all-occurrences`)
|
|
14
14
|
- additive `tools.orderRules` with per-rule occurrence modes
|
|
15
|
+
- typed cross-kind `steps.orderRelations` (TOOL ↔ LLM endpoints; additive in 6.31)
|
|
15
16
|
- bounded `tools.arguments` JSON Pointer checks (`exists` | `type` | `equals` | `oneOf`)
|
|
16
17
|
- `controls` declared-versus-enforced invariants
|
|
17
18
|
- `retry` / side-effect safety using explicit attempt identity (additive `retry.operations[]` recovery oracles in 6.27)
|
|
@@ -61,6 +62,30 @@ For overlapping first calls, omitted / `first-occurrence` warns while `happens-b
|
|
|
61
62
|
|
|
62
63
|
Immediate or positional `all-pairs` matching is not implemented.
|
|
63
64
|
|
|
65
|
+
## `steps.orderRelations` (shipped — experimental, 6.31)
|
|
66
|
+
|
|
67
|
+
Typed before/after relations with explicit `kind: "TOOL" | "LLM"` endpoints. Use this when a TOOL must precede an LLM (or vice versa). It does **not** change TOOL-only `tools.requiredOrder` / `orderRules` semantics.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
defineTraceContract({
|
|
71
|
+
steps: {
|
|
72
|
+
orderRelations: [
|
|
73
|
+
{
|
|
74
|
+
before: { kind: "TOOL", name: "retrieve_policy" },
|
|
75
|
+
after: { kind: "LLM", name: "generate_answer" },
|
|
76
|
+
// mode?: "first-occurrence" | "happens-before" | "all-occurrences"
|
|
77
|
+
// requireEndpoints?: boolean // default true
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- Default `mode` is `first-occurrence` (same three modes as tool order).
|
|
85
|
+
- Default `requireEndpoints: true` — missing kind+name fails; a same display name under the other kind does **not** satisfy the endpoint.
|
|
86
|
+
- LLM names match finished LLM events after stripping common prefixes (`llm:`, `generation:`, …).
|
|
87
|
+
- Low-level `createStepOrderingRule` is compositional when `requireEndpoints` is omitted/false.
|
|
88
|
+
|
|
64
89
|
### Experimental Vitest / Jest matchers (shipped)
|
|
65
90
|
|
|
66
91
|
| Package | Export | Matchers |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.31.0",
|
|
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",
|
|
@@ -6368,6 +6368,17 @@ function cloneBody(body) {
|
|
|
6368
6368
|
}
|
|
6369
6369
|
} : {},
|
|
6370
6370
|
...body.llm ? { llm: { ...body.llm } } : {},
|
|
6371
|
+
...body.steps ? {
|
|
6372
|
+
steps: {
|
|
6373
|
+
...body.steps.orderRelations ? {
|
|
6374
|
+
orderRelations: body.steps.orderRelations.map((item) => ({
|
|
6375
|
+
...item,
|
|
6376
|
+
before: { ...item.before },
|
|
6377
|
+
after: { ...item.after }
|
|
6378
|
+
}))
|
|
6379
|
+
} : {}
|
|
6380
|
+
}
|
|
6381
|
+
} : {},
|
|
6371
6382
|
...body.observations ? {
|
|
6372
6383
|
observations: {
|
|
6373
6384
|
...body.observations,
|
|
@@ -6407,7 +6418,7 @@ function cloneBody(body) {
|
|
|
6407
6418
|
};
|
|
6408
6419
|
}
|
|
6409
6420
|
function bodyHasRules(body) {
|
|
6410
|
-
return body.run !== void 0 || body.tools !== void 0 || body.llm !== void 0 || body.observations !== void 0 || body.controls !== void 0 || body.retry !== void 0;
|
|
6421
|
+
return body.run !== void 0 || body.tools !== void 0 || body.llm !== void 0 || body.steps !== void 0 || body.observations !== void 0 || body.controls !== void 0 || body.retry !== void 0;
|
|
6411
6422
|
}
|
|
6412
6423
|
var MAX_EVIDENCE_EVENT_IDS = 16;
|
|
6413
6424
|
var METHOD_VOCABULARY = new Set(OBSERVED_OUTCOME_METHODS);
|
|
@@ -6750,6 +6761,18 @@ function contractToRules(contract) {
|
|
|
6750
6761
|
})
|
|
6751
6762
|
);
|
|
6752
6763
|
}
|
|
6764
|
+
const orderRelations = contract.steps?.orderRelations ?? [];
|
|
6765
|
+
for (const [index, relation] of orderRelations.entries()) {
|
|
6766
|
+
rules.push(
|
|
6767
|
+
createStepOrderingRule({
|
|
6768
|
+
before: { kind: relation.before.kind, name: relation.before.name },
|
|
6769
|
+
after: { kind: relation.after.kind, name: relation.after.name },
|
|
6770
|
+
id: `contract.step.orderRelation.${index}`,
|
|
6771
|
+
mode: relation.mode ?? "first-occurrence",
|
|
6772
|
+
requireEndpoints: relation.requireEndpoints !== false
|
|
6773
|
+
})
|
|
6774
|
+
);
|
|
6775
|
+
}
|
|
6753
6776
|
if (contract.observations) {
|
|
6754
6777
|
const required = contract.observations.required ?? [];
|
|
6755
6778
|
if (required.length > 0) {
|
|
@@ -7536,6 +7559,31 @@ function failFinding(ruleId, message, evidence, expected, actual, meta) {
|
|
|
7536
7559
|
function toolName(event) {
|
|
7537
7560
|
return resolveCanonicalToolName(event);
|
|
7538
7561
|
}
|
|
7562
|
+
function stepEndpointName(event, kind) {
|
|
7563
|
+
if (kind === "TOOL") return resolveCanonicalToolName(event);
|
|
7564
|
+
for (const prefix of ["llm:", "generation:", "transcription:", "speech:"]) {
|
|
7565
|
+
if (event.name.startsWith(prefix)) return event.name.slice(prefix.length);
|
|
7566
|
+
}
|
|
7567
|
+
return event.name;
|
|
7568
|
+
}
|
|
7569
|
+
function formatStepEndpoint(endpoint) {
|
|
7570
|
+
return `${endpoint.kind} ${endpoint.name}`;
|
|
7571
|
+
}
|
|
7572
|
+
function otherKindsForStepName(context, expectedKind, name) {
|
|
7573
|
+
return [
|
|
7574
|
+
...new Set(
|
|
7575
|
+
semanticEvents(context).filter((event) => {
|
|
7576
|
+
const kind = typeof event.kind === "string" ? event.kind.toUpperCase() : "";
|
|
7577
|
+
if (kind === expectedKind) return false;
|
|
7578
|
+
if (kind === "TOOL") return resolveCanonicalToolName(event) === name;
|
|
7579
|
+
if (kind === "LLM") return stepEndpointName(event, "LLM") === name;
|
|
7580
|
+
return event.name === name || event.name === `tool:${name}` || event.name === `llm:${name}` || event.name.endsWith(`:${name}`);
|
|
7581
|
+
}).map(
|
|
7582
|
+
(event) => typeof event.kind === "string" ? event.kind.toUpperCase() : "UNKNOWN"
|
|
7583
|
+
)
|
|
7584
|
+
)
|
|
7585
|
+
].sort();
|
|
7586
|
+
}
|
|
7539
7587
|
function semanticEvents(context) {
|
|
7540
7588
|
return context.logicalEvents ?? context.events;
|
|
7541
7589
|
}
|
|
@@ -7562,14 +7610,6 @@ function finishedEvents(context, kind) {
|
|
|
7562
7610
|
function toolInvocationEvents(context) {
|
|
7563
7611
|
return semanticEvents(context).filter((event) => event.kind === "TOOL");
|
|
7564
7612
|
}
|
|
7565
|
-
function firstIndexByName(events) {
|
|
7566
|
-
const index = /* @__PURE__ */ new Map();
|
|
7567
|
-
for (const [position, event] of events.entries()) {
|
|
7568
|
-
const name = toolName(event);
|
|
7569
|
-
if (!index.has(name)) index.set(name, position);
|
|
7570
|
-
}
|
|
7571
|
-
return index;
|
|
7572
|
-
}
|
|
7573
7613
|
function isRecord9(value) {
|
|
7574
7614
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7575
7615
|
}
|
|
@@ -8040,18 +8080,85 @@ function createToolUsageRule(options) {
|
|
|
8040
8080
|
}
|
|
8041
8081
|
};
|
|
8042
8082
|
}
|
|
8043
|
-
function
|
|
8044
|
-
const
|
|
8083
|
+
function createStepOrderingRule(options) {
|
|
8084
|
+
const bothTools = options.before.kind === "TOOL" && options.after.kind === "TOOL";
|
|
8085
|
+
const ruleId = options.id ?? (bothTools ? "tool.order" : "step.order");
|
|
8045
8086
|
const mode = options.mode ?? "first-occurrence";
|
|
8087
|
+
const requireEndpoints = options.requireEndpoints === true;
|
|
8088
|
+
const beforeLabel = bothTools ? options.before.name : formatStepEndpoint(options.before);
|
|
8089
|
+
const afterLabel = bothTools ? options.after.name : formatStepEndpoint(options.after);
|
|
8090
|
+
const subject = bothTools ? "Tool" : "Step";
|
|
8046
8091
|
return {
|
|
8047
8092
|
id: ruleId,
|
|
8048
|
-
category: "tool",
|
|
8093
|
+
category: bothTools ? "tool" : "structure",
|
|
8049
8094
|
defaultSeverity: "error",
|
|
8050
8095
|
evaluate(context) {
|
|
8051
|
-
const
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
const
|
|
8096
|
+
const beforeEvents = finishedEvents(context, options.before.kind).filter(
|
|
8097
|
+
(event) => stepEndpointName(event, options.before.kind) === options.before.name
|
|
8098
|
+
);
|
|
8099
|
+
const afterEvents = finishedEvents(context, options.after.kind).filter(
|
|
8100
|
+
(event) => stepEndpointName(event, options.after.kind) === options.after.name
|
|
8101
|
+
);
|
|
8102
|
+
if (beforeEvents.length === 0 || afterEvents.length === 0) {
|
|
8103
|
+
if (!requireEndpoints) return [];
|
|
8104
|
+
const findings = [];
|
|
8105
|
+
if (beforeEvents.length === 0) {
|
|
8106
|
+
const otherKinds = otherKindsForStepName(
|
|
8107
|
+
context,
|
|
8108
|
+
options.before.kind,
|
|
8109
|
+
options.before.name
|
|
8110
|
+
);
|
|
8111
|
+
const hint = otherKinds.length > 0 ? ` Required name appears under non-${options.before.kind} kind(s): ${otherKinds.join(", ")}.` : "";
|
|
8112
|
+
findings.push(
|
|
8113
|
+
failFinding(
|
|
8114
|
+
ruleId,
|
|
8115
|
+
`Required ${formatStepEndpoint(options.before)} did not appear.${hint}`,
|
|
8116
|
+
runEvidence(context.selectedRun),
|
|
8117
|
+
options.before,
|
|
8118
|
+
{
|
|
8119
|
+
code: bothTools ? "tool.order.missing-endpoint" : "step.order.missing-endpoint",
|
|
8120
|
+
endpoint: "before",
|
|
8121
|
+
otherKinds
|
|
8122
|
+
}
|
|
8123
|
+
)
|
|
8124
|
+
);
|
|
8125
|
+
}
|
|
8126
|
+
if (afterEvents.length === 0) {
|
|
8127
|
+
const otherKinds = otherKindsForStepName(
|
|
8128
|
+
context,
|
|
8129
|
+
options.after.kind,
|
|
8130
|
+
options.after.name
|
|
8131
|
+
);
|
|
8132
|
+
const hint = otherKinds.length > 0 ? ` Required name appears under non-${options.after.kind} kind(s): ${otherKinds.join(", ")}.` : "";
|
|
8133
|
+
findings.push(
|
|
8134
|
+
failFinding(
|
|
8135
|
+
ruleId,
|
|
8136
|
+
`Required ${formatStepEndpoint(options.after)} did not appear.${hint}`,
|
|
8137
|
+
runEvidence(context.selectedRun),
|
|
8138
|
+
options.after,
|
|
8139
|
+
{
|
|
8140
|
+
code: bothTools ? "tool.order.missing-endpoint" : "step.order.missing-endpoint",
|
|
8141
|
+
endpoint: "after",
|
|
8142
|
+
otherKinds
|
|
8143
|
+
}
|
|
8144
|
+
)
|
|
8145
|
+
);
|
|
8146
|
+
}
|
|
8147
|
+
return findings;
|
|
8148
|
+
}
|
|
8149
|
+
const encounter = finishedEvents(context).filter(
|
|
8150
|
+
(event) => event.kind === options.before.kind && stepEndpointName(event, options.before.kind) === options.before.name || event.kind === options.after.kind && stepEndpointName(event, options.after.kind) === options.after.name
|
|
8151
|
+
);
|
|
8152
|
+
let beforeIndex;
|
|
8153
|
+
let afterIndex;
|
|
8154
|
+
for (const [position, event] of encounter.entries()) {
|
|
8155
|
+
if (beforeIndex === void 0 && event.kind === options.before.kind && stepEndpointName(event, options.before.kind) === options.before.name) {
|
|
8156
|
+
beforeIndex = position;
|
|
8157
|
+
}
|
|
8158
|
+
if (afterIndex === void 0 && event.kind === options.after.kind && stepEndpointName(event, options.after.kind) === options.after.name) {
|
|
8159
|
+
afterIndex = position;
|
|
8160
|
+
}
|
|
8161
|
+
}
|
|
8055
8162
|
if (beforeIndex === void 0 || afterIndex === void 0) {
|
|
8056
8163
|
return [];
|
|
8057
8164
|
}
|
|
@@ -8059,32 +8166,37 @@ function createToolOrderingRule(options) {
|
|
|
8059
8166
|
return [
|
|
8060
8167
|
failFinding(
|
|
8061
8168
|
ruleId,
|
|
8062
|
-
|
|
8063
|
-
[
|
|
8064
|
-
|
|
8065
|
-
|
|
8169
|
+
`${subject} ${beforeLabel} must appear before ${afterLabel}.`,
|
|
8170
|
+
[
|
|
8171
|
+
eventEvidence3(encounter[beforeIndex]),
|
|
8172
|
+
eventEvidence3(encounter[afterIndex])
|
|
8173
|
+
],
|
|
8174
|
+
bothTools ? { before: options.before.name, after: options.after.name } : { before: options.before, after: options.after },
|
|
8175
|
+
bothTools ? finishedEvents(context, "TOOL").map(toolName) : encounter.map(
|
|
8176
|
+
(event) => event.kind === "TOOL" || event.kind === "LLM" ? `${event.kind}:${stepEndpointName(event, event.kind)}` : event.name
|
|
8177
|
+
)
|
|
8066
8178
|
)
|
|
8067
8179
|
];
|
|
8068
8180
|
}
|
|
8069
|
-
const beforeEvent =
|
|
8070
|
-
const afterEvent =
|
|
8181
|
+
const beforeEvent = beforeEvents[0];
|
|
8182
|
+
const afterEvent = afterEvents[0];
|
|
8071
8183
|
const beforeEnd = eventEndMs(beforeEvent);
|
|
8072
8184
|
const afterStart = eventStartMs(afterEvent);
|
|
8185
|
+
const endpointExpected = bothTools ? { before: options.before.name, after: options.after.name } : { before: options.before, after: options.after };
|
|
8073
8186
|
if (mode === "happens-before") {
|
|
8074
8187
|
const expected = {
|
|
8075
|
-
|
|
8076
|
-
after: options.after,
|
|
8188
|
+
...endpointExpected,
|
|
8077
8189
|
mode,
|
|
8078
8190
|
relation: "before.end <= after.start"
|
|
8079
8191
|
};
|
|
8080
|
-
if (options.before === options.after) {
|
|
8192
|
+
if (options.before.kind === options.after.kind && options.before.name === options.after.name) {
|
|
8081
8193
|
return [
|
|
8082
8194
|
failFinding(
|
|
8083
8195
|
ruleId,
|
|
8084
|
-
|
|
8196
|
+
`${subject} ${beforeLabel} cannot causally happen before itself.`,
|
|
8085
8197
|
[eventEvidence3(beforeEvent)],
|
|
8086
8198
|
expected,
|
|
8087
|
-
{ code: "tool.order.same-tool" }
|
|
8199
|
+
{ code: bothTools ? "tool.order.same-tool" : "step.order.same-step" }
|
|
8088
8200
|
)
|
|
8089
8201
|
];
|
|
8090
8202
|
}
|
|
@@ -8092,11 +8204,11 @@ function createToolOrderingRule(options) {
|
|
|
8092
8204
|
return [
|
|
8093
8205
|
failFinding(
|
|
8094
8206
|
ruleId,
|
|
8095
|
-
|
|
8207
|
+
`${subject} order ${beforeLabel} before ${afterLabel} could not establish causal timing.`,
|
|
8096
8208
|
[eventEvidence3(beforeEvent), eventEvidence3(afterEvent)],
|
|
8097
8209
|
expected,
|
|
8098
8210
|
{
|
|
8099
|
-
code: "tool.order.interval-unresolved",
|
|
8211
|
+
code: bothTools ? "tool.order.interval-unresolved" : "step.order.interval-unresolved",
|
|
8100
8212
|
beforeEndResolved: beforeEnd !== void 0,
|
|
8101
8213
|
afterStartResolved: afterStart !== void 0
|
|
8102
8214
|
}
|
|
@@ -8107,7 +8219,7 @@ function createToolOrderingRule(options) {
|
|
|
8107
8219
|
return [
|
|
8108
8220
|
failFinding(
|
|
8109
8221
|
ruleId,
|
|
8110
|
-
|
|
8222
|
+
`${subject} ${beforeLabel} must finish before ${afterLabel} starts.`,
|
|
8111
8223
|
[eventEvidence3(beforeEvent), eventEvidence3(afterEvent)],
|
|
8112
8224
|
expected,
|
|
8113
8225
|
{
|
|
@@ -8120,22 +8232,19 @@ function createToolOrderingRule(options) {
|
|
|
8120
8232
|
return [];
|
|
8121
8233
|
}
|
|
8122
8234
|
if (mode === "all-occurrences") {
|
|
8123
|
-
const beforeEvents = tools.filter((event) => toolName(event) === options.before);
|
|
8124
|
-
const afterEvents = tools.filter((event) => toolName(event) === options.after);
|
|
8125
8235
|
const expected = {
|
|
8126
|
-
|
|
8127
|
-
after: options.after,
|
|
8236
|
+
...endpointExpected,
|
|
8128
8237
|
mode,
|
|
8129
8238
|
relation: "max(before.end) <= min(after.start)"
|
|
8130
8239
|
};
|
|
8131
|
-
if (options.before === options.after) {
|
|
8240
|
+
if (options.before.kind === options.after.kind && options.before.name === options.after.name) {
|
|
8132
8241
|
return [
|
|
8133
8242
|
failFinding(
|
|
8134
8243
|
ruleId,
|
|
8135
|
-
|
|
8244
|
+
`${subject} ${beforeLabel} cannot causally happen before itself.`,
|
|
8136
8245
|
[eventEvidence3(beforeEvent)],
|
|
8137
8246
|
expected,
|
|
8138
|
-
{ code: "tool.order.same-tool" }
|
|
8247
|
+
{ code: bothTools ? "tool.order.same-tool" : "step.order.same-step" }
|
|
8139
8248
|
)
|
|
8140
8249
|
];
|
|
8141
8250
|
}
|
|
@@ -8167,11 +8276,11 @@ function createToolOrderingRule(options) {
|
|
|
8167
8276
|
return [
|
|
8168
8277
|
failFinding(
|
|
8169
8278
|
ruleId,
|
|
8170
|
-
|
|
8279
|
+
`${subject} order ${beforeLabel} before ${afterLabel} could not establish all causal intervals.`,
|
|
8171
8280
|
[firstMissingBefore, firstMissingAfter].filter((event) => event !== void 0).map((event) => eventEvidence3(event)),
|
|
8172
8281
|
expected,
|
|
8173
8282
|
{
|
|
8174
|
-
code: "tool.order.interval-unresolved",
|
|
8283
|
+
code: bothTools ? "tool.order.interval-unresolved" : "step.order.interval-unresolved",
|
|
8175
8284
|
missingBeforeEnds,
|
|
8176
8285
|
missingAfterStarts
|
|
8177
8286
|
}
|
|
@@ -8182,7 +8291,7 @@ function createToolOrderingRule(options) {
|
|
|
8182
8291
|
return [
|
|
8183
8292
|
failFinding(
|
|
8184
8293
|
ruleId,
|
|
8185
|
-
`Every ${options.before} tool call must finish before any ${options.after} tool call starts.`,
|
|
8294
|
+
bothTools ? `Every ${options.before.name} tool call must finish before any ${options.after.name} tool call starts.` : `Every ${beforeLabel} must finish before any ${afterLabel} starts.`,
|
|
8186
8295
|
[eventEvidence3(latestBefore.event), eventEvidence3(earliestAfter.event)],
|
|
8187
8296
|
expected,
|
|
8188
8297
|
{
|
|
@@ -8200,10 +8309,13 @@ function createToolOrderingRule(options) {
|
|
|
8200
8309
|
ruleId,
|
|
8201
8310
|
severity: "warning",
|
|
8202
8311
|
status: "warning",
|
|
8203
|
-
message:
|
|
8204
|
-
expected: {
|
|
8312
|
+
message: `${subject} order ${beforeLabel} before ${afterLabel} satisfied start/encounter order, but intervals overlap so causal completion before the next ${bothTools ? "tool" : "step"} was not established.`,
|
|
8313
|
+
expected: {
|
|
8314
|
+
...endpointExpected,
|
|
8315
|
+
mode: "first-occurrence"
|
|
8316
|
+
},
|
|
8205
8317
|
actual: {
|
|
8206
|
-
code: "tool.order.overlap",
|
|
8318
|
+
code: bothTools ? "tool.order.overlap" : "step.order.overlap",
|
|
8207
8319
|
beforeEndedAt: beforeEvent.endedAt,
|
|
8208
8320
|
afterStartedAt: afterEvent.startedAt ?? afterEvent.timestamp
|
|
8209
8321
|
},
|
|
@@ -8215,6 +8327,15 @@ function createToolOrderingRule(options) {
|
|
|
8215
8327
|
}
|
|
8216
8328
|
};
|
|
8217
8329
|
}
|
|
8330
|
+
function createToolOrderingRule(options) {
|
|
8331
|
+
return createStepOrderingRule({
|
|
8332
|
+
before: { kind: "TOOL", name: options.before },
|
|
8333
|
+
after: { kind: "TOOL", name: options.after },
|
|
8334
|
+
...options.id !== void 0 ? { id: options.id } : {},
|
|
8335
|
+
...options.mode !== void 0 ? { mode: options.mode } : {},
|
|
8336
|
+
requireEndpoints: false
|
|
8337
|
+
});
|
|
8338
|
+
}
|
|
8218
8339
|
function createLlmUsageRule(options) {
|
|
8219
8340
|
return {
|
|
8220
8341
|
id: "llm.usage",
|
|
@@ -14733,5 +14854,5 @@ function renderGateReport(result, options = {}) {
|
|
|
14733
14854
|
}
|
|
14734
14855
|
|
|
14735
14856
|
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, 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, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, 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, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
|
|
14736
|
-
//# sourceMappingURL=chunk-
|
|
14737
|
-
//# sourceMappingURL=chunk-
|
|
14857
|
+
//# sourceMappingURL=chunk-Y5Z4BXUO.mjs.map
|
|
14858
|
+
//# sourceMappingURL=chunk-Y5Z4BXUO.mjs.map
|