agent-inspect 6.12.2 → 6.14.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 +16 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-4WA7DQCM.mjs → chunk-MEO2Z3KE.mjs} +40 -9
- package/packages/cli/dist/chunk-MEO2Z3KE.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +87 -11
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +47 -8
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-YAASTXGE.mjs → src-6VZNGIF6.mjs} +3 -3
- package/packages/cli/dist/{src-YAASTXGE.mjs.map → src-6VZNGIF6.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +13 -6
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +24 -1
- package/packages/core/dist/advanced.d.ts +24 -1
- package/packages/core/dist/advanced.mjs +4 -2
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +78 -7
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +58 -4
- package/packages/core/dist/checks.d.ts +58 -4
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-KJICERSD.mjs → chunk-BS2QCAJX.mjs} +79 -10
- package/packages/core/dist/chunk-BS2QCAJX.mjs.map +1 -0
- package/packages/core/dist/{index-CgCH8NE9.d.ts → index-Bu_vOjql.d.ts} +1 -1
- package/packages/core/dist/{index-BOP33T4O.d.cts → index-CmXMS-MF.d.cts} +1 -1
- package/packages/cli/dist/chunk-4WA7DQCM.mjs.map +0 -1
- package/packages/core/dist/chunk-KJICERSD.mjs.map +0 -1
|
@@ -1,10 +1,60 @@
|
|
|
1
|
-
import { T as TraceCheckInput,
|
|
2
|
-
export { B as BaselineRegressionRuleOptions, D as DecisionRuleOptions, G as GuardrailRuleOptions,
|
|
1
|
+
import { L as LogicalProjectionDiagnostic, a as LogicalTraceEvent, T as TraceCheckInput, b as TraceCheckResult } from './index-CmXMS-MF.cjs';
|
|
2
|
+
export { B as BaselineRegressionRuleOptions, D as DecisionRuleOptions, G as GuardrailRuleOptions, c as LlmUsageRuleOptions, M as MaxStepDurationRuleOptions, O as ObservedOutcomeRuleOptions, R as RetrievalRuleOptions, d as RunDepthRuleOptions, e as RunDurationRuleOptions, f as RunEventCountRuleOptions, g as RunStatusRuleOptions, h as RunTraceChecksOptions, S as SafetyFindingCategory, i as SafetyFindingConfidence, j as SafetyOversizedAttributeRuleOptions, k as SafetyRawContentRuleOptions, l as SafetyRedactionRuleOptions, m as SafetySecretPattern, n as SafetySecretPatternRuleOptions, o as StallDetectionRuleOptions, p as StructureIncompleteRuleOptions, q as StructureOrphanRuleOptions, r as StructureParallelWidthRuleOptions, s as StructureRelationshipRuleOptions, t as ToolFailureRuleOptions, u as ToolOrderingRuleOptions, v as ToolUsageRuleOptions, w as TraceCheckContext, x as TraceCheckDiagnostic, y as TraceCheckDiagnosticCode, z as TraceCheckEvidence, A as TraceCheckFacts, C as TraceCheckFinding, E as TraceCheckFindingStatus, F as TraceCheckRule, H as TraceCheckRuleCategory, I as TraceCheckSeverity, J as TraceCheckStatus, K as TraceCheckSummary, N as TraceSignalRuleOptions, P as createBaselineRegressionRule, Q as createDecisionRule, U as createGuardrailRule, V as createLlmUsageRule, W as createMaxStepDurationRule, X as createObservedOutcomeRule, Y as createRequireCompletedRule, Z as createRetrievalRule, _ as createRunDepthRule, $ as createRunDurationRule, a0 as createRunEventCountRule, a1 as createRunStatusRule, a2 as createSafetyOversizedAttributeRule, a3 as createSafetyRawContentRule, a4 as createSafetyRedactionRule, a5 as createSafetySecretPatternRule, a6 as createStallDetectionRule, a7 as createStructureCycleRule, a8 as createStructureIncompleteRule, a9 as createStructureOrphanRule, aa as createStructureParallelWidthRule, ab as createStructureRelationshipRule, ac as createToolFailureRule, ad as createToolOrderingRule, ae as createToolUsageRule, af as projectLogicalEvents, ag as resolveCanonicalToolName, ah as runTraceChecks } from './index-CmXMS-MF.cjs';
|
|
3
|
+
import { P as PersistedInspectEvent } from './persisted-inspect-event-d-mSP8kd.cjs';
|
|
3
4
|
import './readers.cjs';
|
|
4
5
|
import './inspect-event-DVg84S4v.cjs';
|
|
5
|
-
import './persisted-inspect-event-d-mSP8kd.cjs';
|
|
6
6
|
import './types-B562HgN_.cjs';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Shared semantic parity summary over logical lifecycle projection.
|
|
10
|
+
*
|
|
11
|
+
* @experimental Available through `agent-inspect/checks`; formal TraceFacts in 6.13.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Bounded semantic counts shared by check / contract / MCP / Evidence consumers.
|
|
16
|
+
*
|
|
17
|
+
* @experimental
|
|
18
|
+
*/
|
|
19
|
+
interface SemanticParitySummary {
|
|
20
|
+
readonly rawEventCount: number;
|
|
21
|
+
readonly logicalEventCount: number;
|
|
22
|
+
readonly runningLogicalCount: number;
|
|
23
|
+
readonly finishedToolNames: readonly string[];
|
|
24
|
+
readonly finishedToolCount: number;
|
|
25
|
+
readonly pairedCount: number;
|
|
26
|
+
readonly parentRemapCount: number;
|
|
27
|
+
readonly diagnostics: readonly LogicalProjectionDiagnostic[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Summarize logical projection for cross-surface parity assertions.
|
|
31
|
+
*
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
declare function summarizeSemanticParity(events: readonly PersistedInspectEvent[]): SemanticParitySummary;
|
|
35
|
+
/**
|
|
36
|
+
* Experimental TraceFacts foundation (6.13): indexes over logical events.
|
|
37
|
+
*
|
|
38
|
+
* Extends the 6.12.2 projection rather than introducing a parallel evaluator.
|
|
39
|
+
*
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
interface TraceFacts {
|
|
43
|
+
readonly rawEvents: readonly PersistedInspectEvent[];
|
|
44
|
+
readonly logicalEvents: readonly LogicalTraceEvent[];
|
|
45
|
+
readonly diagnostics: readonly LogicalProjectionDiagnostic[];
|
|
46
|
+
readonly toolsByName: ReadonlyMap<string, readonly LogicalTraceEvent[]>;
|
|
47
|
+
readonly llmEvents: readonly LogicalTraceEvent[];
|
|
48
|
+
readonly outcomeEvents: readonly LogicalTraceEvent[];
|
|
49
|
+
readonly summary: SemanticParitySummary;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build TraceFacts from raw persisted events.
|
|
53
|
+
*
|
|
54
|
+
* @experimental
|
|
55
|
+
*/
|
|
56
|
+
declare function buildTraceFacts(events: readonly PersistedInspectEvent[]): TraceFacts;
|
|
57
|
+
|
|
8
58
|
/**
|
|
9
59
|
* @experimental Typed trace contract input. Evolves during v6.5.x.
|
|
10
60
|
*/
|
|
@@ -15,7 +65,11 @@ interface TraceContractRunRules {
|
|
|
15
65
|
}
|
|
16
66
|
interface TraceContractToolRules {
|
|
17
67
|
required?: string[];
|
|
68
|
+
/** Alias of `required` (TraceContract v2 normalization). */
|
|
69
|
+
requiredTools?: string[];
|
|
18
70
|
forbidden?: string[];
|
|
71
|
+
/** Alias of `forbidden`. */
|
|
72
|
+
forbiddenTools?: string[];
|
|
19
73
|
allowed?: string[];
|
|
20
74
|
maxCalls?: number;
|
|
21
75
|
requiredOrder?: string[];
|
|
@@ -56,4 +110,4 @@ declare function evaluateTraceContract(input: TraceCheckInput, contract: TraceCo
|
|
|
56
110
|
runId?: string;
|
|
57
111
|
}): TraceCheckResult;
|
|
58
112
|
|
|
59
|
-
export { TraceCheckInput, TraceCheckResult, type TraceContract, type TraceContractInput, type TraceContractLlmRules, type TraceContractObservationRules, type TraceContractRunRules, type TraceContractToolRules, defineTraceContract, evaluateTraceContract };
|
|
113
|
+
export { LogicalProjectionDiagnostic, LogicalTraceEvent, type SemanticParitySummary, TraceCheckInput, TraceCheckResult, type TraceContract, type TraceContractInput, type TraceContractLlmRules, type TraceContractObservationRules, type TraceContractRunRules, type TraceContractToolRules, type TraceFacts, buildTraceFacts, defineTraceContract, evaluateTraceContract, summarizeSemanticParity };
|
|
@@ -1,10 +1,60 @@
|
|
|
1
|
-
import { T as TraceCheckInput,
|
|
2
|
-
export { B as BaselineRegressionRuleOptions, D as DecisionRuleOptions, G as GuardrailRuleOptions,
|
|
1
|
+
import { L as LogicalProjectionDiagnostic, a as LogicalTraceEvent, T as TraceCheckInput, b as TraceCheckResult } from './index-Bu_vOjql.js';
|
|
2
|
+
export { B as BaselineRegressionRuleOptions, D as DecisionRuleOptions, G as GuardrailRuleOptions, c as LlmUsageRuleOptions, M as MaxStepDurationRuleOptions, O as ObservedOutcomeRuleOptions, R as RetrievalRuleOptions, d as RunDepthRuleOptions, e as RunDurationRuleOptions, f as RunEventCountRuleOptions, g as RunStatusRuleOptions, h as RunTraceChecksOptions, S as SafetyFindingCategory, i as SafetyFindingConfidence, j as SafetyOversizedAttributeRuleOptions, k as SafetyRawContentRuleOptions, l as SafetyRedactionRuleOptions, m as SafetySecretPattern, n as SafetySecretPatternRuleOptions, o as StallDetectionRuleOptions, p as StructureIncompleteRuleOptions, q as StructureOrphanRuleOptions, r as StructureParallelWidthRuleOptions, s as StructureRelationshipRuleOptions, t as ToolFailureRuleOptions, u as ToolOrderingRuleOptions, v as ToolUsageRuleOptions, w as TraceCheckContext, x as TraceCheckDiagnostic, y as TraceCheckDiagnosticCode, z as TraceCheckEvidence, A as TraceCheckFacts, C as TraceCheckFinding, E as TraceCheckFindingStatus, F as TraceCheckRule, H as TraceCheckRuleCategory, I as TraceCheckSeverity, J as TraceCheckStatus, K as TraceCheckSummary, N as TraceSignalRuleOptions, P as createBaselineRegressionRule, Q as createDecisionRule, U as createGuardrailRule, V as createLlmUsageRule, W as createMaxStepDurationRule, X as createObservedOutcomeRule, Y as createRequireCompletedRule, Z as createRetrievalRule, _ as createRunDepthRule, $ as createRunDurationRule, a0 as createRunEventCountRule, a1 as createRunStatusRule, a2 as createSafetyOversizedAttributeRule, a3 as createSafetyRawContentRule, a4 as createSafetyRedactionRule, a5 as createSafetySecretPatternRule, a6 as createStallDetectionRule, a7 as createStructureCycleRule, a8 as createStructureIncompleteRule, a9 as createStructureOrphanRule, aa as createStructureParallelWidthRule, ab as createStructureRelationshipRule, ac as createToolFailureRule, ad as createToolOrderingRule, ae as createToolUsageRule, af as projectLogicalEvents, ag as resolveCanonicalToolName, ah as runTraceChecks } from './index-Bu_vOjql.js';
|
|
3
|
+
import { P as PersistedInspectEvent } from './persisted-inspect-event-ChE7pGb7.js';
|
|
3
4
|
import './readers.js';
|
|
4
5
|
import './inspect-event-DVg84S4v.js';
|
|
5
|
-
import './persisted-inspect-event-ChE7pGb7.js';
|
|
6
6
|
import './types-B562HgN_.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Shared semantic parity summary over logical lifecycle projection.
|
|
10
|
+
*
|
|
11
|
+
* @experimental Available through `agent-inspect/checks`; formal TraceFacts in 6.13.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Bounded semantic counts shared by check / contract / MCP / Evidence consumers.
|
|
16
|
+
*
|
|
17
|
+
* @experimental
|
|
18
|
+
*/
|
|
19
|
+
interface SemanticParitySummary {
|
|
20
|
+
readonly rawEventCount: number;
|
|
21
|
+
readonly logicalEventCount: number;
|
|
22
|
+
readonly runningLogicalCount: number;
|
|
23
|
+
readonly finishedToolNames: readonly string[];
|
|
24
|
+
readonly finishedToolCount: number;
|
|
25
|
+
readonly pairedCount: number;
|
|
26
|
+
readonly parentRemapCount: number;
|
|
27
|
+
readonly diagnostics: readonly LogicalProjectionDiagnostic[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Summarize logical projection for cross-surface parity assertions.
|
|
31
|
+
*
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
declare function summarizeSemanticParity(events: readonly PersistedInspectEvent[]): SemanticParitySummary;
|
|
35
|
+
/**
|
|
36
|
+
* Experimental TraceFacts foundation (6.13): indexes over logical events.
|
|
37
|
+
*
|
|
38
|
+
* Extends the 6.12.2 projection rather than introducing a parallel evaluator.
|
|
39
|
+
*
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
interface TraceFacts {
|
|
43
|
+
readonly rawEvents: readonly PersistedInspectEvent[];
|
|
44
|
+
readonly logicalEvents: readonly LogicalTraceEvent[];
|
|
45
|
+
readonly diagnostics: readonly LogicalProjectionDiagnostic[];
|
|
46
|
+
readonly toolsByName: ReadonlyMap<string, readonly LogicalTraceEvent[]>;
|
|
47
|
+
readonly llmEvents: readonly LogicalTraceEvent[];
|
|
48
|
+
readonly outcomeEvents: readonly LogicalTraceEvent[];
|
|
49
|
+
readonly summary: SemanticParitySummary;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build TraceFacts from raw persisted events.
|
|
53
|
+
*
|
|
54
|
+
* @experimental
|
|
55
|
+
*/
|
|
56
|
+
declare function buildTraceFacts(events: readonly PersistedInspectEvent[]): TraceFacts;
|
|
57
|
+
|
|
8
58
|
/**
|
|
9
59
|
* @experimental Typed trace contract input. Evolves during v6.5.x.
|
|
10
60
|
*/
|
|
@@ -15,7 +65,11 @@ interface TraceContractRunRules {
|
|
|
15
65
|
}
|
|
16
66
|
interface TraceContractToolRules {
|
|
17
67
|
required?: string[];
|
|
68
|
+
/** Alias of `required` (TraceContract v2 normalization). */
|
|
69
|
+
requiredTools?: string[];
|
|
18
70
|
forbidden?: string[];
|
|
71
|
+
/** Alias of `forbidden`. */
|
|
72
|
+
forbiddenTools?: string[];
|
|
19
73
|
allowed?: string[];
|
|
20
74
|
maxCalls?: number;
|
|
21
75
|
requiredOrder?: string[];
|
|
@@ -56,4 +110,4 @@ declare function evaluateTraceContract(input: TraceCheckInput, contract: TraceCo
|
|
|
56
110
|
runId?: string;
|
|
57
111
|
}): TraceCheckResult;
|
|
58
112
|
|
|
59
|
-
export { TraceCheckInput, TraceCheckResult, type TraceContract, type TraceContractInput, type TraceContractLlmRules, type TraceContractObservationRules, type TraceContractRunRules, type TraceContractToolRules, defineTraceContract, evaluateTraceContract };
|
|
113
|
+
export { LogicalProjectionDiagnostic, LogicalTraceEvent, type SemanticParitySummary, TraceCheckInput, TraceCheckResult, type TraceContract, type TraceContractInput, type TraceContractLlmRules, type TraceContractObservationRules, type TraceContractRunRules, type TraceContractToolRules, type TraceFacts, buildTraceFacts, defineTraceContract, evaluateTraceContract, summarizeSemanticParity };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { 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, evaluateTraceContract, projectLogicalEvents, resolveCanonicalToolName, runTraceChecks } from './chunk-
|
|
1
|
+
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, evaluateTraceContract, projectLogicalEvents, resolveCanonicalToolName, runTraceChecks, summarizeSemanticParity } from './chunk-BS2QCAJX.mjs';
|
|
2
2
|
import './chunk-VFO76UH3.mjs';
|
|
3
3
|
import './chunk-ULCGIRTC.mjs';
|
|
4
4
|
import './chunk-VU6O5QAH.mjs';
|
|
@@ -196,11 +196,16 @@ function projectLogicalEvents(events) {
|
|
|
196
196
|
}
|
|
197
197
|
if (!remapped) {
|
|
198
198
|
if (!logicalById.has(originalParentId) && !logicalByRawId.has(originalParentId)) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
const mapping = event.attributes?.parentMapping;
|
|
200
|
+
const unresolved = mapping === "unresolved" || event.attributes?.parentUnresolved === true || event.attributes?.unresolvedParent === true || // LangGraph/framework scaffolding sentinel labels are not event ids.
|
|
201
|
+
/^LangGraph$/i.test(originalParentId) || originalParentId.startsWith("unresolved:");
|
|
202
|
+
if (!unresolved) {
|
|
203
|
+
diagnostics.push({
|
|
204
|
+
code: "AI_LOGICAL_PARENT_UNRESOLVED",
|
|
205
|
+
message: `Parent ${originalParentId} unresolved for ${event.eventId}.`,
|
|
206
|
+
eventIds: [event.eventId]
|
|
207
|
+
});
|
|
208
|
+
}
|
|
204
209
|
}
|
|
205
210
|
normalized.push(event);
|
|
206
211
|
continue;
|
|
@@ -254,6 +259,62 @@ function pickString(record, keys) {
|
|
|
254
259
|
return void 0;
|
|
255
260
|
}
|
|
256
261
|
|
|
262
|
+
// packages/core/src/checks/trace-facts.ts
|
|
263
|
+
function summarizeSemanticParity(events) {
|
|
264
|
+
const projection = projectLogicalEvents(events);
|
|
265
|
+
const logical = projection.logicalEvents;
|
|
266
|
+
const finishedTools = logical.filter(
|
|
267
|
+
(event) => event.kind === "TOOL" && event.status !== "running"
|
|
268
|
+
);
|
|
269
|
+
const finishedToolNames = Object.freeze(
|
|
270
|
+
finishedTools.map((event) => resolveCanonicalToolName(event)).sort((a, b) => a.localeCompare(b))
|
|
271
|
+
);
|
|
272
|
+
return {
|
|
273
|
+
rawEventCount: events.length,
|
|
274
|
+
logicalEventCount: logical.length,
|
|
275
|
+
runningLogicalCount: logical.filter((event) => event.status === "running").length,
|
|
276
|
+
finishedToolNames,
|
|
277
|
+
finishedToolCount: finishedTools.length,
|
|
278
|
+
pairedCount: logical.filter((event) => event.projection.paired).length,
|
|
279
|
+
parentRemapCount: projection.diagnostics.filter(
|
|
280
|
+
(item) => item.code === "AI_LOGICAL_PARENT_REMAPPED"
|
|
281
|
+
).length,
|
|
282
|
+
diagnostics: projection.diagnostics
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function buildTraceFacts(events) {
|
|
286
|
+
const projection = projectLogicalEvents(events);
|
|
287
|
+
const toolsByName = /* @__PURE__ */ new Map();
|
|
288
|
+
const llmEvents = [];
|
|
289
|
+
const outcomeEvents = [];
|
|
290
|
+
for (const event of projection.logicalEvents) {
|
|
291
|
+
if (event.kind === "TOOL" && event.status !== "running") {
|
|
292
|
+
const name = resolveCanonicalToolName(event);
|
|
293
|
+
const list = toolsByName.get(name) ?? [];
|
|
294
|
+
list.push(event);
|
|
295
|
+
toolsByName.set(name, list);
|
|
296
|
+
}
|
|
297
|
+
if (event.kind === "LLM" && event.status !== "running") {
|
|
298
|
+
llmEvents.push(event);
|
|
299
|
+
}
|
|
300
|
+
if (event.kind === "OUTCOME") {
|
|
301
|
+
outcomeEvents.push(event);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
for (const [name, list] of [...toolsByName.entries()]) {
|
|
305
|
+
toolsByName.set(name, Object.freeze([...list]));
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
rawEvents: Object.freeze([...events]),
|
|
309
|
+
logicalEvents: projection.logicalEvents,
|
|
310
|
+
diagnostics: projection.diagnostics,
|
|
311
|
+
toolsByName,
|
|
312
|
+
llmEvents: Object.freeze(llmEvents),
|
|
313
|
+
outcomeEvents: Object.freeze(outcomeEvents),
|
|
314
|
+
summary: summarizeSemanticParity(events)
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
257
318
|
// packages/core/src/checks/index.ts
|
|
258
319
|
var SEVERITY_RANK = {
|
|
259
320
|
error: 0,
|
|
@@ -2088,10 +2149,18 @@ function contractToRules(contract) {
|
|
|
2088
2149
|
rules.push(createStructureIncompleteRule({ requireEndedAtForStarted: true }));
|
|
2089
2150
|
}
|
|
2090
2151
|
if (contract.tools) {
|
|
2152
|
+
const required = [
|
|
2153
|
+
...contract.tools.required ?? [],
|
|
2154
|
+
...contract.tools.requiredTools ?? []
|
|
2155
|
+
];
|
|
2156
|
+
const forbidden = [
|
|
2157
|
+
...contract.tools.forbidden ?? [],
|
|
2158
|
+
...contract.tools.forbiddenTools ?? []
|
|
2159
|
+
];
|
|
2091
2160
|
rules.push(
|
|
2092
2161
|
createToolUsageRule({
|
|
2093
|
-
...
|
|
2094
|
-
...
|
|
2162
|
+
...required.length > 0 ? { required } : {},
|
|
2163
|
+
...forbidden.length > 0 ? { forbidden } : {},
|
|
2095
2164
|
...contract.tools.allowed ? { allowed: contract.tools.allowed } : {},
|
|
2096
2165
|
...contract.tools.maxCalls !== void 0 ? { maxCount: contract.tools.maxCalls } : {}
|
|
2097
2166
|
})
|
|
@@ -2162,6 +2231,6 @@ function evaluateTraceContract(input, contract, options = {}) {
|
|
|
2162
2231
|
});
|
|
2163
2232
|
}
|
|
2164
2233
|
|
|
2165
|
-
export { 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, evaluateTraceContract, projectLogicalEvents, resolveCanonicalToolName, runTraceChecks };
|
|
2166
|
-
//# sourceMappingURL=chunk-
|
|
2167
|
-
//# sourceMappingURL=chunk-
|
|
2234
|
+
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, evaluateTraceContract, projectLogicalEvents, resolveCanonicalToolName, runTraceChecks, summarizeSemanticParity };
|
|
2235
|
+
//# sourceMappingURL=chunk-BS2QCAJX.mjs.map
|
|
2236
|
+
//# sourceMappingURL=chunk-BS2QCAJX.mjs.map
|