agent-inspect 6.31.34 → 6.31.36
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 +1 -1
- package/docs/API.md +2 -2
- package/docs/CLI.md +1 -0
- package/docs/KNOWN-ISSUES.md +1 -0
- package/docs/LIMITATIONS.md +23 -0
- package/docs/SAFE-TRACE-SHARING.md +1 -1
- package/docs/SCHEMA.md +10 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-6TXW53UR.mjs → chunk-Z3WXP44D.mjs} +64 -7
- package/packages/cli/dist/chunk-Z3WXP44D.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +64 -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-LCUTRLRQ.mjs} +3 -3
- package/packages/cli/dist/{src-GCLC4DIC.mjs.map → src-LCUTRLRQ.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +62 -5
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +2 -2
- package/packages/core/dist/checks.cjs +62 -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-KQX3Z4DH.mjs} +64 -7
- package/packages/core/dist/chunk-KQX3Z4DH.mjs.map +1 -0
- package/packages/cli/dist/chunk-6TXW53UR.mjs.map +0 -1
- package/packages/core/dist/chunk-CXC7L4PY.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.31.36
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4e4d8dc: Fail closed when a token budget is set but completed LLM calls record no usage (#534/#535; thanks Rodrigo). Recipe INV-08 now cross-checks Bezalel remediation relationship endpoints (#537). Docs clarify manual `inspectRun`/`step` still omit `Error.code` (#541), standalone starter install on 6.31.35, and dated Windows packed MCP evidence (#526). Publish workflow splits verify (read-only) from OIDC publish (#536/#539).
|
|
8
|
+
|
|
9
|
+
## 6.31.35
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 3cb8284: Bound and order tool-name diagnostics: cap codepoint annotations, skip pure non-Latin noise, keep bidi/control visible, and sort allowlist causes ahead of missing-tool consequences across rules (#522 follow-up). Add recipe-local refund ceiling/entity/approval (#527) and illustrative RETRIEVER→LLM OpenInference order examples via TraceCheckRule extension.
|
|
14
|
+
|
|
3
15
|
## 6.31.34
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
|
|
|
213
213
|
|
|
214
214
|
## Status and documentation
|
|
215
215
|
|
|
216
|
-
**Current published baseline:** **6.31.
|
|
216
|
+
**Current published baseline:** **6.31.36** · persisted schema `1.0` · Node.js `>=20` · MIT.
|
|
217
217
|
|
|
218
218
|
Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
|
|
219
219
|
|
package/docs/API.md
CHANGED
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
} from "agent-inspect";
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
- **`inspectRun(name, fn, options?)`**: wraps a workflow in a local JSONL trace (`run_started` / `run_completed`), prints terminal progress, and swallows instrumentation failures (user errors are re-thrown). **Traces by default** when `enabled` is omitted or `true`. Pass **`enabled: false`** to run `fn` with no trace file, no execution context, and no terminal output.
|
|
74
|
+
- **`inspectRun(name, fn, options?)`**: wraps a workflow in a local JSONL trace (`run_started` / `run_completed`), prints terminal progress, and swallows instrumentation failures (user errors are re-thrown). **Traces by default** when `enabled` is omitted or `true`. Pass **`enabled: false`** to run `fn` with no trace file, no execution context, and no terminal output. On failure, persisted `error` is `{ message, stack? }` only — thrown `Error.code` / numeric `status` are **not** retained on this manual v0.1 path (use `createInspector()` when bounded `error.code` persistence matters; see §19 and [SCHEMA.md](./SCHEMA.md) §4).
|
|
75
75
|
- **`redact`**: default `true` — redacts sensitive metadata keys before disk (`authorization`, `cookie`, `token`, `apiKey`, `password`, `secret`, `email`). Pass `false` to persist metadata as-is. Pass `{ rules?: RedactionRule[] }` for custom rules (defaults still apply). **`redact: false` wins** over `redactionProfile` for trace writing.
|
|
76
76
|
- **`redactionProfile`**: optional preset — `local` (default), `share`, or `strict`. Adds extra key-based redaction and tighter metadata string bounds for trace writing. Key-based only — not compliance-grade DLP.
|
|
77
77
|
- **`maxMetadataValueLength`**: max string length for metadata values (default `2000`).
|
|
@@ -474,7 +474,7 @@ Public methods:
|
|
|
474
474
|
|
|
475
475
|
`capture` is explicit and metadata-only. `onSuccess: "metadata-only"` records safe type/length/key-count summaries in `outputSummary`; `onError: "metadata-only"` records thrown-value type/name summaries. It does not store raw return values, prompts, outputs, or thrown objects. Use `"none"` to disable a capture side.
|
|
476
476
|
|
|
477
|
-
Persisted step/run errors keep `name` and `message`. When present, a **bounded safe** `code` is also retained: finite numeric `code`/`status` values (for example HTTP `404`) or short strings matching letters, digits, underscore, hyphen, dot, and colon (max 128 characters). Response bodies, headers, multiline values, and arbitrary enumerable error properties are not persisted.
|
|
477
|
+
Persisted step/run errors keep `name` and `message`. When present, a **bounded safe** `code` is also retained: finite numeric `code`/`status` values (for example HTTP `404` / `429`) or short strings matching letters, digits, underscore, hyphen, dot, and colon (max 128 characters, for example `ECONNRESET`). Response bodies, headers, multiline values, and arbitrary enumerable error properties are not persisted. This `code` retention applies to **`createInspector()`** schema 1.0 writers only — not to global `inspectRun` / `step` (those still omit codes; see [SCHEMA.md](./SCHEMA.md) §4).
|
|
478
478
|
|
|
479
479
|
Pass structured tool arguments for contracts via step `metadata.arguments` / `metadata.input` / `metadata.toolArguments` (or top-level attributes with the same keys). TraceContract tool-argument checks read those locations; they do not enable default raw capture.
|
|
480
480
|
|
package/docs/CLI.md
CHANGED
|
@@ -332,6 +332,7 @@ Options:
|
|
|
332
332
|
- `--max-duration-ms <number>`: add `run.duration`
|
|
333
333
|
- `--required-tool <name>` / `--forbidden-tool <name>` / `--forbid-tool <name>` (alias): add `tool.usage`
|
|
334
334
|
- `--allowed-model <model>` / `--max-total-tokens <number>`: add `llm.usage`
|
|
335
|
+
- A token limit fails when no token usage is read for a completed LLM call, because the limit cannot be verified. A failed LLM call does not need to record usage.
|
|
335
336
|
- `--session <id>`: check all runs in a workflow session (uses `--dir`; target may be `.`)
|
|
336
337
|
- `--group <id>`: check all runs sharing a `groupId` metadata value
|
|
337
338
|
- `--correlate-group`: when using `--session`, also match synthetic `group:` session keys
|
package/docs/KNOWN-ISSUES.md
CHANGED
|
@@ -4,6 +4,7 @@ AgentInspect is **local-first** and **CLI-first**. These behaviors are intention
|
|
|
4
4
|
|
|
5
5
|
## Contracts and safety
|
|
6
6
|
|
|
7
|
+
- **Manual traces omit `Error.code`:** Global `inspectRun` / `step` still persist `{ message, stack? }` only. Bounded `error.code` retention shipped for `createInspector()` in 6.29.2 (#415); the issue title said “manual instrumentation,” but the manual helpers were not changed. Prefer `createInspector()` or explicit metadata `errorCode` when codes matter. Documented in [SCHEMA.md](./SCHEMA.md) §4 / [LIMITATIONS.md](./LIMITATIONS.md).
|
|
7
8
|
- **Retry / side-effect rules (6.23+; chronology fixed in 6.25.1):** `requireIdempotencyEvidenceForRetry` applies to genuine retries including `error → success`, not only retries after a prior `ok`. Ambiguous attempt identity fails closed under that rule. Write timeouts remain **unknown completion** — safe write retry is not claimed.
|
|
8
9
|
- **Omitted-payload digests:** inputs larger than 1 MiB are rejected after a length preflight; oversized rejection must not be treated as a free full-buffer copy path.
|
|
9
10
|
|
package/docs/LIMITATIONS.md
CHANGED
|
@@ -20,6 +20,7 @@ This document states what AgentInspect **does not** provide today. It complement
|
|
|
20
20
|
## Persisted event model
|
|
21
21
|
|
|
22
22
|
- **Manual global tracing remains v0.1.** `inspectRun()` / `step()` still write `schemaVersion: "0.1"` JSONL for compatibility.
|
|
23
|
+
- **Manual `error` omits codes.** Thrown `Error.code` values (for example `429`, `ECONNRESET`) and numeric `status` are **not** written on the manual path (`formatError` → `{ message, stack? }` only). `createInspector()` retains bounded safe codes on schema 1.0 rows. Issue #415 shipped the inspector path; the manual helpers are unchanged. See [SCHEMA.md](./SCHEMA.md) §4.
|
|
23
24
|
- **Persisted writer/runtime output targets schema 1.0.** `createInspector()` with built-in writers emits schema 1.0 persisted rows; v0.1 and v0.2 remain readable.
|
|
24
25
|
- **Migration is explicit, not automatic.** `agent-inspect migrate <input> --to 1.0 --dry-run` reports what would change, and `--output <file>` writes a separate file. AgentInspect does not rewrite old traces in place.
|
|
25
26
|
|
|
@@ -98,4 +99,26 @@ Visual demos: [SCREENSHOTS.md](./SCREENSHOTS.md) · [CLI.md](./CLI.md)
|
|
|
98
99
|
|
|
99
100
|
- Designed for **developer machines** and **inner-loop debugging**, not petabyte log warehouses.
|
|
100
101
|
|
|
102
|
+
## Trust boundary (four independent questions)
|
|
103
|
+
|
|
104
|
+
AgentInspect answers local evidence questions. Treat these as **separate**:
|
|
105
|
+
|
|
106
|
+
1. **Capture / coverage** — What events were recorded under the declared instrumentation boundary? Missing spans, uninstrumented SDK calls, and effects outside that boundary are not inventable from silence.
|
|
107
|
+
2. **Trajectory contract** — Did a TraceContract / check preset pass on the selected run(s)? Pass/fail is rule evaluation over captured evidence, not proof of business correctness.
|
|
108
|
+
3. **Residual artifact safety** — Do written share/strict artifacts pass the residual safety policy (`verify-safe` / Evidence assessment)? This is best-effort local policy, not a compliance certification or whole-org DLP guarantee.
|
|
109
|
+
4. **Independent authorization / effect / origin** — Is there separate evidence of lawful authority, successful side effect, and trusted producer origin? AgentInspect does not supply those by default.
|
|
110
|
+
|
|
111
|
+
Implications:
|
|
112
|
+
|
|
113
|
+
- A recomputed **unsigned** Evidence manifest can verify **internal consistency** (listed files + hashes). It does **not** prove authenticity or producer identity.
|
|
114
|
+
- A **signature** (if supplied externally) can authenticate bytes to a trusted signer. It still does **not** prove completeness, lawful authority, successful business effect, or absence of an uninstrumented side effect.
|
|
115
|
+
- A recorded **approval-before-action** event is evidence that an approval was *recorded*. It is **not** proof that the approver had authority.
|
|
116
|
+
- Signed receipts or durable journals (parked designs) do **not** create exactly-once side effects.
|
|
117
|
+
|
|
118
|
+
Hypothetical approval evidence fields for a future recipe (not a shipped schema): distinct `decisionId`, `policyVersion`, `actorAuthorityRef`, `actionDigest`, `targetScope`, `decisionTime`, `executionId`, and a downstream `receiptId`. These are a proposed evidence set for discussion, not a banking integration.
|
|
119
|
+
|
|
120
|
+
Parked larger designs (coverage registry, cross-run linkage, durable intent journal, signing/sealing, general value comparisons, data-flow causal explanations) stay out of incidental patches — see [implementation/active/PARKED-DESIGNS.md](./implementation/active/PARKED-DESIGNS.md).
|
|
121
|
+
|
|
122
|
+
Related: [EVIDENCE-FORMAT.md](./EVIDENCE-FORMAT.md), [ADR-0012](./decisions/ADR-0012-evidence-contract-binding.md), [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md), [NETWORK-BEHAVIOR.md](./NETWORK-BEHAVIOR.md), [NO-EGRESS-POLICY.md](./NO-EGRESS-POLICY.md).
|
|
123
|
+
|
|
101
124
|
For roadmap intent, see [ROADMAP.md](../ROADMAP.md) (direction only — not a delivery guarantee).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
AgentInspect traces, log-ingest outputs, and exports are local files. They may still contain sensitive metadata that you attached manually, collected from logs, or included through optional preview settings. Use this checklist before sharing an artifact in a GitHub issue, Discussion, PR, support thread, or public post.
|
|
6
6
|
|
|
7
|
-
This guide is practical sharing guidance, not a guarantee that any artifact is safe to publish. Redaction profiles are **best-effort transformation**, not compliance-grade DLP or a safety certification. Always finish with `verify-safe` before sharing.
|
|
7
|
+
This guide is practical sharing guidance, not a guarantee that any artifact is safe to publish. Redaction profiles are **best-effort transformation**, not compliance-grade DLP or a safety certification. Always finish with `verify-safe` before sharing. Passing residual safety is still only one of the [four trust-boundary questions](./LIMITATIONS.md#trust-boundary-four-independent-questions) — it does not prove capture completeness, contract truth, or independent authorization.
|
|
8
8
|
|
|
9
9
|
Built-in profiles redact high-confidence credential forms (provider keys, JWTs, bearer tokens, and bounded `token=` / `api_key=` / `internal_token=` style key/value secrets). Broad or context-sensitive findings—such as private filesystem paths—may still appear under `verify-safe` and as residual status after `redact`. Org-specific patterns can use a local CLI `--policy` JSON file (`extraKeys` plus bounded literal/prefix patterns; no user regex) or programmatic custom detectors.
|
|
10
10
|
|
package/docs/SCHEMA.md
CHANGED
|
@@ -139,8 +139,17 @@ Records whether an external side effect matched expectations. Distinct from step
|
|
|
139
139
|
|
|
140
140
|
## 4. Error representation
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
Writer paths differ; this is intentional compatibility, **not** a claim that manual tracing preserves `Error.code`:
|
|
143
|
+
|
|
144
|
+
| Writer path | Schema | Persisted `error` shape | `Error.code` / numeric `status` |
|
|
145
|
+
| ----------- | ------ | ----------------------- | -------------------------------- |
|
|
146
|
+
| Manual global helpers (`inspectRun` / `step` / `maybeInspectRun`) | `"0.1"` | `{ message, stack? }` (`ErrorInfo`) | **Omitted.** `formatError()` keeps message and optional stack only. |
|
|
147
|
+
| `createInspector()` + built-in persisted writers | `"1.0"` (also readable as v0.2 shape) | `{ name?, message, code? }` (`PersistedInspectError`) | **Bounded safe codes retained** when present (finite numeric `code`/`status`, or short alphanumeric strings). See [API.md](./API.md) §19. |
|
|
148
|
+
|
|
149
|
+
- Manual JSONL examples above use `{ message, stack? }` because that is what the v0.1 writer still emits.
|
|
150
|
+
- Persisted schema 1.0 rows may include `error.code` (for example `"429"` or `"ECONNRESET"`). Migrating a manual v0.1 file to 1.0 does **not** invent codes that were never written.
|
|
143
151
|
- AgentInspect prints short human errors by default; verbose modes may include stack strings.
|
|
152
|
+
- Recovery / retry checks that need codes should prefer `createInspector()` traces, or place an explicit `errorCode` / `code` in start metadata when using the manual path (see recovery-operations notes in core).
|
|
144
153
|
|
|
145
154
|
## 5. Status representation
|
|
146
155
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.31.
|
|
3
|
+
"version": "6.31.36",
|
|
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",
|
|
@@ -8011,11 +8011,27 @@ function eventTimestamp(finding, eventById) {
|
|
|
8011
8011
|
const eventId = finding.evidence[0]?.eventId;
|
|
8012
8012
|
return eventId ? eventById.get(eventId)?.timestamp ?? "" : "";
|
|
8013
8013
|
}
|
|
8014
|
+
function isObservedToolPolicyFinding(finding) {
|
|
8015
|
+
return finding.ruleId === "tool.usage" && finding.evidence[0]?.eventId !== void 0;
|
|
8016
|
+
}
|
|
8017
|
+
function isMissingToolConsequenceFinding(finding) {
|
|
8018
|
+
if (finding.evidence[0]?.eventId !== void 0) return false;
|
|
8019
|
+
if (finding.ruleId === "tool.usage" && /did not appear/.test(finding.message)) {
|
|
8020
|
+
return true;
|
|
8021
|
+
}
|
|
8022
|
+
return finding.ruleId.startsWith("contract.tool.arguments") && /^No finished tool named /.test(finding.message);
|
|
8023
|
+
}
|
|
8014
8024
|
function compareFindings(eventById) {
|
|
8015
8025
|
return (a, b) => {
|
|
8016
8026
|
if (SEVERITY_RANK[a.severity] !== SEVERITY_RANK[b.severity]) {
|
|
8017
8027
|
return SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity];
|
|
8018
8028
|
}
|
|
8029
|
+
const aPolicy = isObservedToolPolicyFinding(a);
|
|
8030
|
+
const bPolicy = isObservedToolPolicyFinding(b);
|
|
8031
|
+
const aMissing = isMissingToolConsequenceFinding(a);
|
|
8032
|
+
const bMissing = isMissingToolConsequenceFinding(b);
|
|
8033
|
+
if (aPolicy && bMissing) return -1;
|
|
8034
|
+
if (bPolicy && aMissing) return 1;
|
|
8019
8035
|
const byRule = a.ruleId.localeCompare(b.ruleId);
|
|
8020
8036
|
if (byRule !== 0) return byRule;
|
|
8021
8037
|
if (STATUS_RANK[a.status] !== STATUS_RANK[b.status]) {
|
|
@@ -8151,20 +8167,43 @@ function failFinding(ruleId, message, evidence, expected, actual, meta) {
|
|
|
8151
8167
|
function toolName(event) {
|
|
8152
8168
|
return resolveCanonicalToolName(event);
|
|
8153
8169
|
}
|
|
8170
|
+
var MAX_TOOL_NAME_CODEPOINT_DETAILS = 3;
|
|
8171
|
+
function isAsciiLetterCodePoint(codePoint) {
|
|
8172
|
+
return codePoint >= 65 && codePoint <= 90 || codePoint >= 97 && codePoint <= 122;
|
|
8173
|
+
}
|
|
8174
|
+
function isRiskyToolNameCodePoint(codePoint) {
|
|
8175
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) return true;
|
|
8176
|
+
return codePoint === 1564 || codePoint === 8203 || codePoint === 8204 || codePoint === 8205 || codePoint === 8206 || codePoint === 8207 || codePoint >= 8234 && codePoint <= 8238 || codePoint >= 8294 && codePoint <= 8297 || codePoint === 65279;
|
|
8177
|
+
}
|
|
8178
|
+
function formatCodePointDetail(codePoint, index) {
|
|
8179
|
+
return `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")} at index ${index}`;
|
|
8180
|
+
}
|
|
8154
8181
|
function formatToolNameForMessage(name) {
|
|
8182
|
+
let hasAsciiLetter = false;
|
|
8183
|
+
let hasNonAscii = false;
|
|
8184
|
+
let hasRisky = false;
|
|
8155
8185
|
const details = [];
|
|
8156
8186
|
for (let index = 0; index < name.length; ) {
|
|
8157
8187
|
const codePoint = name.codePointAt(index);
|
|
8158
8188
|
const width = codePoint > 65535 ? 2 : 1;
|
|
8189
|
+
if (isAsciiLetterCodePoint(codePoint)) hasAsciiLetter = true;
|
|
8190
|
+
const risky = isRiskyToolNameCodePoint(codePoint);
|
|
8191
|
+
if (risky) hasRisky = true;
|
|
8159
8192
|
if (codePoint > 127) {
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8193
|
+
hasNonAscii = true;
|
|
8194
|
+
details.push(formatCodePointDetail(codePoint, index));
|
|
8195
|
+
} else if (risky) {
|
|
8196
|
+
details.push(formatCodePointDetail(codePoint, index));
|
|
8163
8197
|
}
|
|
8164
8198
|
index += width;
|
|
8165
8199
|
}
|
|
8166
|
-
if (details.length === 0)
|
|
8167
|
-
|
|
8200
|
+
if (!hasRisky && !(hasAsciiLetter && hasNonAscii) || details.length === 0) {
|
|
8201
|
+
return name;
|
|
8202
|
+
}
|
|
8203
|
+
const shown = details.slice(0, MAX_TOOL_NAME_CODEPOINT_DETAILS);
|
|
8204
|
+
const remaining = details.length - shown.length;
|
|
8205
|
+
const detailText = remaining > 0 ? `${shown.join("; ")}; and ${remaining} more` : shown.join("; ");
|
|
8206
|
+
return `"${name}" (contains ${detailText})`;
|
|
8168
8207
|
}
|
|
8169
8208
|
function describeRunningEvent(event) {
|
|
8170
8209
|
if (event.kind === "TOOL") {
|
|
@@ -9109,6 +9148,9 @@ function createToolFailureRule(options) {
|
|
|
9109
9148
|
}
|
|
9110
9149
|
};
|
|
9111
9150
|
}
|
|
9151
|
+
function recordsTokenUsage(event) {
|
|
9152
|
+
return Object.values(event.tokenUsage ?? {}).some((count) => typeof count === "number");
|
|
9153
|
+
}
|
|
9112
9154
|
function createLlmUsageRule(options) {
|
|
9113
9155
|
return {
|
|
9114
9156
|
id: "llm.usage",
|
|
@@ -9166,6 +9208,21 @@ function createLlmUsageRule(options) {
|
|
|
9166
9208
|
["total", options.maxTotalTokens],
|
|
9167
9209
|
["cached", options.maxCachedTokens]
|
|
9168
9210
|
];
|
|
9211
|
+
const hasTokenLimit = tokenLimits.some(([, limit]) => limit !== void 0);
|
|
9212
|
+
const callsWithoutUsage = llms.filter(
|
|
9213
|
+
(event) => event.status !== "error" && !recordsTokenUsage(event)
|
|
9214
|
+
);
|
|
9215
|
+
if (hasTokenLimit && callsWithoutUsage.length > 0) {
|
|
9216
|
+
findings.push(
|
|
9217
|
+
failFinding(
|
|
9218
|
+
"llm.usage",
|
|
9219
|
+
`No token usage was read for ${callsWithoutUsage.length} of ${llms.length} LLM call(s), so the token limit cannot be verified.`,
|
|
9220
|
+
callsWithoutUsage.map((event) => eventEvidence3(event, "tokenUsage")),
|
|
9221
|
+
"token usage on every completed LLM call",
|
|
9222
|
+
{ callsWithoutUsage: callsWithoutUsage.length, calls: llms.length }
|
|
9223
|
+
)
|
|
9224
|
+
);
|
|
9225
|
+
}
|
|
9169
9226
|
for (const [key, limit] of tokenLimits) {
|
|
9170
9227
|
if (limit !== void 0 && tokenTotals[key] > limit) {
|
|
9171
9228
|
findings.push(
|
|
@@ -16186,5 +16243,5 @@ function renderGateReport(result, options = {}) {
|
|
|
16186
16243
|
}
|
|
16187
16244
|
|
|
16188
16245
|
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, DELIVERY_CONFLICT_ATTR, DELIVERY_EVENT_BASE_ATTR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, IDENTITY_CONFLICT_ATTR, 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, isCredentialSensitiveKey, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToRunTrees, 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, stringContainsHighConfidenceCredential, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
|
|
16189
|
-
//# sourceMappingURL=chunk-
|
|
16190
|
-
//# sourceMappingURL=chunk-
|
|
16246
|
+
//# sourceMappingURL=chunk-Z3WXP44D.mjs.map
|
|
16247
|
+
//# sourceMappingURL=chunk-Z3WXP44D.mjs.map
|