agent-inspect 6.4.0 → 6.4.1
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 +2 -2
- package/package.json +2 -2
- package/packages/cli/dist/{chunk-YS2I722C.mjs → chunk-M6PC5KUT.mjs} +78 -31
- package/packages/cli/dist/chunk-M6PC5KUT.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +153 -42
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +88 -36
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-FVNE44UA.mjs → src-27LC2BB3.mjs} +8 -5
- package/packages/cli/dist/src-27LC2BB3.mjs.map +1 -0
- package/packages/core/dist/advanced.cjs +91 -35
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +36 -12
- package/packages/core/dist/advanced.d.ts +36 -12
- package/packages/core/dist/advanced.mjs +77 -24
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +113 -0
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +40 -599
- package/packages/core/dist/checks.d.ts +40 -599
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-QLYOCCEF.mjs → chunk-EWHN6NA4.mjs} +114 -3
- package/packages/core/dist/chunk-EWHN6NA4.mjs.map +1 -0
- package/packages/core/dist/{context-DyKbkmd4.d.cts → context-BHAgRjOe.d.cts} +4 -4
- package/packages/core/dist/{context-BJ5UQLDi.d.ts → context-Blyjb5my.d.ts} +4 -4
- package/packages/core/dist/diff.d.cts +3 -3
- package/packages/core/dist/diff.d.ts +3 -3
- package/packages/core/dist/exporters.cjs +47 -0
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +11 -4
- package/packages/core/dist/exporters.d.ts +11 -4
- package/packages/core/dist/exporters.mjs +46 -1
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/index-BblJEdYZ.d.ts +618 -0
- package/packages/core/dist/index-DyKk7iR9.d.cts +618 -0
- package/packages/core/dist/index.d.cts +7 -7
- package/packages/core/dist/index.d.ts +7 -7
- package/packages/core/dist/{inspect-event-IqwOHbGo.d.cts → inspect-event-DVg84S4v.d.cts} +1 -1
- package/packages/core/dist/{inspect-event-IqwOHbGo.d.ts → inspect-event-DVg84S4v.d.ts} +1 -1
- package/packages/core/dist/{log-config-CW8w5YQ9.d.cts → log-config-BG1WmWf2.d.cts} +1 -1
- package/packages/core/dist/{log-config-SRA4xTp8.d.ts → log-config-Ck0aT_Ou.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-DruwqARZ.d.ts → persisted-inspect-event-ChE7pGb7.d.ts} +1 -1
- package/packages/core/dist/{persisted-inspect-event-Gd-W8vB7.d.cts → persisted-inspect-event-d-mSP8kd.d.cts} +1 -1
- package/packages/core/dist/persisted.d.cts +5 -5
- package/packages/core/dist/persisted.d.ts +5 -5
- package/packages/core/dist/readers.d.cts +2 -2
- package/packages/core/dist/readers.d.ts +2 -2
- package/packages/core/dist/{types-J3Xtuf9x.d.cts → types-B562HgN_.d.cts} +1 -1
- package/packages/core/dist/{types-J3Xtuf9x.d.ts → types-B562HgN_.d.ts} +1 -1
- package/packages/core/dist/{types-B1X87dUW.d.cts → types-BLX3tiOW.d.cts} +1 -1
- package/packages/core/dist/{types-BVkjSd0q.d.ts → types-MuwXSJ4b.d.ts} +1 -1
- package/packages/core/dist/writers.d.cts +2 -2
- package/packages/core/dist/writers.d.ts +2 -2
- package/packages/cli/dist/chunk-YS2I722C.mjs.map +0 -1
- package/packages/cli/dist/src-FVNE44UA.mjs.map +0 -1
- package/packages/core/dist/chunk-QLYOCCEF.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7e832d7: Trust and security patch: MCP result boundary, real bundle safety assessment, path sanitization, viewer XSS hardening, strict plugin manifests, gate validation, Studio init fixes, and packed quickstart E2E.
|
|
8
|
+
|
|
3
9
|
## 6.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ node examples/agent-inspect-demo.mjs
|
|
|
45
45
|
npx agent-inspect list --dir .agent-inspect
|
|
46
46
|
npx agent-inspect view <run-id> --dir .agent-inspect
|
|
47
47
|
npx agent-inspect report <run-id> --dir .agent-inspect
|
|
48
|
-
npx agent-inspect verify-safe --dir .agent-inspect
|
|
48
|
+
npx agent-inspect verify-safe <run-id> --dir .agent-inspect
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Install → one trace → one failure check → one share-safe artifact in under five minutes.
|
|
@@ -153,7 +153,7 @@ See [Compare](https://agentinspect.vercel.app/docs/compare/).
|
|
|
153
153
|
|
|
154
154
|
## Install details
|
|
155
155
|
|
|
156
|
-
Current release: **
|
|
156
|
+
Current release: **6.4.0** (sixteen linked npm packages). Persisted trace schema **1.0**. Requires **Node.js >= 20**.
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
159
|
pnpm add agent-inspect
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Trace, check, and safely share TypeScript AI-agent runs locally — no account, no upload, metadata-only by default",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"test:all": "pnpm run typecheck && pnpm run test && pnpm run build && pnpm run size",
|
|
216
216
|
"prepublish:checks": "pnpm run typecheck && pnpm run test && pnpm run test:coverage && pnpm run build && pnpm run fixtures:check && pnpm run recipes:check && pnpm run size && pnpm run pack:smoke",
|
|
217
217
|
"pack:dry-run": "pnpm run build && npm pack --dry-run",
|
|
218
|
-
"pack:smoke": "pnpm run build && node scripts/package-smoke.mjs",
|
|
218
|
+
"pack:smoke": "pnpm run build && node scripts/package-smoke.mjs && node scripts/packed-quickstart-e2e.mjs",
|
|
219
219
|
"compat:smoke": "node scripts/compat-smoke.mjs",
|
|
220
220
|
"fixtures:check": "node scripts/validate-fixtures.mjs",
|
|
221
221
|
"recipes:check": "node scripts/validate-recipes.mjs",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdir, stat, readFile, access } from 'fs/promises';
|
|
2
2
|
import os from 'os';
|
|
3
|
-
import
|
|
3
|
+
import path5 from 'path';
|
|
4
4
|
import crypto2, { webcrypto } from 'crypto';
|
|
5
5
|
import process2 from 'process';
|
|
6
6
|
import tty from 'tty';
|
|
@@ -255,7 +255,7 @@ function nanoid(size = 21) {
|
|
|
255
255
|
// packages/core/src/utils.ts
|
|
256
256
|
var DEFAULT_TRACE_DIR_NAME = ".agent-inspect";
|
|
257
257
|
var RUNS_DIR_NAME = "runs";
|
|
258
|
-
var FALLBACK_TRACE_DIR =
|
|
258
|
+
var FALLBACK_TRACE_DIR = path5.join(
|
|
259
259
|
os.tmpdir(),
|
|
260
260
|
"agent-inspect",
|
|
261
261
|
RUNS_DIR_NAME
|
|
@@ -290,7 +290,7 @@ function getDefaultTraceDir() {
|
|
|
290
290
|
if (typeof home !== "string" || home.trim() === "") {
|
|
291
291
|
return FALLBACK_TRACE_DIR;
|
|
292
292
|
}
|
|
293
|
-
return
|
|
293
|
+
return path5.join(home, DEFAULT_TRACE_DIR_NAME, RUNS_DIR_NAME);
|
|
294
294
|
} catch {
|
|
295
295
|
return FALLBACK_TRACE_DIR;
|
|
296
296
|
}
|
|
@@ -298,11 +298,11 @@ function getDefaultTraceDir() {
|
|
|
298
298
|
function getTraceFilePath(runId, traceDir) {
|
|
299
299
|
const baseDir = traceDir ?? getDefaultTraceDir();
|
|
300
300
|
let safeId = typeof runId === "string" && runId.trim() !== "" ? runId.trim() : "run_unknown";
|
|
301
|
-
safeId =
|
|
301
|
+
safeId = path5.basename(safeId);
|
|
302
302
|
if (safeId === "" || safeId === "." || safeId === "..") {
|
|
303
303
|
safeId = "run_unknown";
|
|
304
304
|
}
|
|
305
|
-
return
|
|
305
|
+
return path5.join(baseDir, `${safeId}.jsonl`);
|
|
306
306
|
}
|
|
307
307
|
function formatError(error) {
|
|
308
308
|
if (error instanceof Error) {
|
|
@@ -1619,7 +1619,7 @@ var TraceDirectory = class {
|
|
|
1619
1619
|
this.#dir = resolveTraceDir(options);
|
|
1620
1620
|
}
|
|
1621
1621
|
getPath(filename) {
|
|
1622
|
-
return filename ?
|
|
1622
|
+
return filename ? path5.join(this.#dir, filename) : this.#dir;
|
|
1623
1623
|
}
|
|
1624
1624
|
async list() {
|
|
1625
1625
|
try {
|
|
@@ -1646,7 +1646,7 @@ function parseIsoToMs2(value) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
async function extractMetadata(filePath, _quickScan) {
|
|
1648
1648
|
const stats = await stat(filePath);
|
|
1649
|
-
let runIdFromFile =
|
|
1649
|
+
let runIdFromFile = path5.basename(filePath);
|
|
1650
1650
|
if (runIdFromFile.endsWith(".jsonl")) {
|
|
1651
1651
|
runIdFromFile = runIdFromFile.slice(0, -".jsonl".length);
|
|
1652
1652
|
}
|
|
@@ -3841,21 +3841,43 @@ function buildBundleSummaryMarkdown(parts) {
|
|
|
3841
3841
|
);
|
|
3842
3842
|
return lines.join("\n");
|
|
3843
3843
|
}
|
|
3844
|
+
function sanitizeBundleRunId(runId) {
|
|
3845
|
+
let safe = typeof runId === "string" && runId.trim() !== "" ? runId.trim() : "run_unknown";
|
|
3846
|
+
safe = path5.basename(safe);
|
|
3847
|
+
safe = safe.replace(/[^a-zA-Z0-9._-]+/g, "_");
|
|
3848
|
+
if (safe === "" || safe === "." || safe === "..") {
|
|
3849
|
+
safe = "run_unknown";
|
|
3850
|
+
}
|
|
3851
|
+
return safe;
|
|
3852
|
+
}
|
|
3853
|
+
function bundleRunAssetRelativePath(runId, extension) {
|
|
3854
|
+
const safe = sanitizeBundleRunId(runId);
|
|
3855
|
+
const ext = extension.startsWith(".") ? extension : `.${extension}`;
|
|
3856
|
+
return path5.posix.join("assets", "runs", `${safe}${ext}`);
|
|
3857
|
+
}
|
|
3858
|
+
function assertBundlePathContained(outputDir, relativePath) {
|
|
3859
|
+
const base = path5.resolve(outputDir);
|
|
3860
|
+
const resolved = path5.resolve(base, relativePath);
|
|
3861
|
+
if (resolved !== base && !resolved.startsWith(base + path5.sep)) {
|
|
3862
|
+
throw new Error(`Bundle path escapes output directory: ${relativePath}`);
|
|
3863
|
+
}
|
|
3864
|
+
return resolved;
|
|
3865
|
+
}
|
|
3844
3866
|
function normalizeBundleOutputPath(out) {
|
|
3845
3867
|
const trimmed = out.trim();
|
|
3846
3868
|
if (trimmed === "") {
|
|
3847
3869
|
throw new Error("--out requires a non-empty path.");
|
|
3848
3870
|
}
|
|
3849
|
-
const resolved =
|
|
3871
|
+
const resolved = path5.resolve(trimmed);
|
|
3850
3872
|
if (resolved.toLowerCase().endsWith(".zip")) {
|
|
3851
3873
|
return resolved.slice(0, -4);
|
|
3852
3874
|
}
|
|
3853
3875
|
return resolved;
|
|
3854
3876
|
}
|
|
3855
3877
|
function defaultBundleOutputPath(runIds) {
|
|
3856
|
-
const label = runIds.length === 1 ? runIds[0] : `multi-${runIds.length}`;
|
|
3878
|
+
const label = runIds.length === 1 ? sanitizeBundleRunId(runIds[0]) : `multi-${runIds.length}`;
|
|
3857
3879
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
3858
|
-
return
|
|
3880
|
+
return path5.resolve(`agent-inspect-bundle-${label}-${stamp}`);
|
|
3859
3881
|
}
|
|
3860
3882
|
|
|
3861
3883
|
// packages/core/src/suite/types.ts
|
|
@@ -4009,7 +4031,7 @@ function normalizeSuiteConfig(value) {
|
|
|
4009
4031
|
}
|
|
4010
4032
|
async function validateSuiteConfig(config, options) {
|
|
4011
4033
|
const diagnostics = [];
|
|
4012
|
-
const tracesDir =
|
|
4034
|
+
const tracesDir = path5.resolve(options.configDir, config.traces);
|
|
4013
4035
|
try {
|
|
4014
4036
|
await access(tracesDir);
|
|
4015
4037
|
} catch {
|
|
@@ -4019,7 +4041,7 @@ async function validateSuiteConfig(config, options) {
|
|
|
4019
4041
|
}
|
|
4020
4042
|
for (const suiteCase of config.cases) {
|
|
4021
4043
|
if (suiteCase.input !== void 0) {
|
|
4022
|
-
const inputPath =
|
|
4044
|
+
const inputPath = path5.resolve(options.configDir, suiteCase.input);
|
|
4023
4045
|
try {
|
|
4024
4046
|
await access(inputPath);
|
|
4025
4047
|
} catch {
|
|
@@ -4050,12 +4072,12 @@ async function fileExists(filePath) {
|
|
|
4050
4072
|
}
|
|
4051
4073
|
}
|
|
4052
4074
|
async function resolveSuiteConfigPath(options = {}) {
|
|
4053
|
-
const cwd =
|
|
4075
|
+
const cwd = path5.resolve(options.cwd ?? process.cwd());
|
|
4054
4076
|
if (options.configPath !== void 0 && options.configPath.trim() !== "") {
|
|
4055
|
-
return
|
|
4077
|
+
return path5.resolve(cwd, options.configPath.trim());
|
|
4056
4078
|
}
|
|
4057
4079
|
for (const name of DEFAULT_SUITE_CONFIG_NAMES) {
|
|
4058
|
-
const candidate =
|
|
4080
|
+
const candidate = path5.join(cwd, name);
|
|
4059
4081
|
if (await fileExists(candidate)) return candidate;
|
|
4060
4082
|
}
|
|
4061
4083
|
throw new Error(
|
|
@@ -4072,7 +4094,7 @@ async function loadSuiteConfig(options = {}) {
|
|
|
4072
4094
|
diagnostics: [diagnostic2("AI_SUITE_CONFIG_LOAD_FAILED", message)]
|
|
4073
4095
|
});
|
|
4074
4096
|
}
|
|
4075
|
-
const extension =
|
|
4097
|
+
const extension = path5.extname(configPath);
|
|
4076
4098
|
if (TS_CONFIG_EXTENSIONS.has(extension)) {
|
|
4077
4099
|
const message = "TypeScript suite configs require an explicit precompiled JavaScript config or future --config-loader support.";
|
|
4078
4100
|
throw Object.assign(new Error(message), {
|
|
@@ -4097,7 +4119,7 @@ async function loadSuiteConfig(options = {}) {
|
|
|
4097
4119
|
return {
|
|
4098
4120
|
config,
|
|
4099
4121
|
configPath,
|
|
4100
|
-
configDir:
|
|
4122
|
+
configDir: path5.dirname(configPath)
|
|
4101
4123
|
};
|
|
4102
4124
|
} catch (error) {
|
|
4103
4125
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -6136,7 +6158,7 @@ function findReaderByFormat(format, readers) {
|
|
|
6136
6158
|
}
|
|
6137
6159
|
async function jsonlFilesInDirectory(dirPath) {
|
|
6138
6160
|
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
6139
|
-
return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).map((entry) =>
|
|
6161
|
+
return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).map((entry) => path5.join(dirPath, entry.name)).sort((a, b) => a.localeCompare(b));
|
|
6140
6162
|
}
|
|
6141
6163
|
async function resolveInput(input) {
|
|
6142
6164
|
const cached = resolvedInputCache.get(input);
|
|
@@ -7596,7 +7618,7 @@ async function exists(filePath) {
|
|
|
7596
7618
|
}
|
|
7597
7619
|
async function resolveSuiteCaseTrace(suiteCase, options) {
|
|
7598
7620
|
if (suiteCase.trace !== void 0) {
|
|
7599
|
-
const tracePath =
|
|
7621
|
+
const tracePath = path5.resolve(options.configDir, suiteCase.trace);
|
|
7600
7622
|
if (await exists(tracePath)) {
|
|
7601
7623
|
return { caseId: suiteCase.id, tracePath, missing: false };
|
|
7602
7624
|
}
|
|
@@ -7612,7 +7634,7 @@ async function resolveSuiteCaseTrace(suiteCase, options) {
|
|
|
7612
7634
|
if (await exists(directPath)) {
|
|
7613
7635
|
return { caseId: suiteCase.id, tracePath: directPath, runId: runKey, missing: false };
|
|
7614
7636
|
}
|
|
7615
|
-
const nestedPath =
|
|
7637
|
+
const nestedPath = path5.join(options.tracesDir, `${path5.basename(runKey)}.jsonl`);
|
|
7616
7638
|
if (await exists(nestedPath)) {
|
|
7617
7639
|
return { caseId: suiteCase.id, tracePath: nestedPath, runId: runKey, missing: false };
|
|
7618
7640
|
}
|
|
@@ -7793,7 +7815,7 @@ async function runSuiteCase(suiteCase, config, options) {
|
|
|
7793
7815
|
async function runSuite(options = {}) {
|
|
7794
7816
|
const startedAt = new Date(options.nowMs ?? Date.now()).toISOString();
|
|
7795
7817
|
const { config, configPath, configDir } = await loadSuiteConfig(options);
|
|
7796
|
-
const tracesDir =
|
|
7818
|
+
const tracesDir = path5.resolve(configDir, config.traces);
|
|
7797
7819
|
const cases = [];
|
|
7798
7820
|
const diagnostics = [];
|
|
7799
7821
|
for (const suiteCase of config.cases) {
|
|
@@ -7811,8 +7833,9 @@ async function runSuite(options = {}) {
|
|
|
7811
7833
|
skipped: cases.filter((item) => item.status === "skipped").length
|
|
7812
7834
|
};
|
|
7813
7835
|
const finishedAt = new Date(options.nowMs ?? Date.now()).toISOString();
|
|
7814
|
-
const
|
|
7815
|
-
const
|
|
7836
|
+
const allSkipped = cases.length > 0 && summary.skipped === cases.length;
|
|
7837
|
+
const ok = summary.failed === 0 && summary.errors === 0 && !allSkipped;
|
|
7838
|
+
const status = summary.errors > 0 ? "error" : allSkipped ? "fail" : summary.failed > 0 || !ok ? "fail" : "pass";
|
|
7816
7839
|
return {
|
|
7817
7840
|
ok,
|
|
7818
7841
|
status,
|
|
@@ -8068,10 +8091,14 @@ function filterRunsForCohort(runs, options) {
|
|
|
8068
8091
|
}
|
|
8069
8092
|
|
|
8070
8093
|
// packages/core/src/cohort/compare.ts
|
|
8071
|
-
function compareNumber(metric, label, baseline, candidate, higherIsWorse = true) {
|
|
8094
|
+
function compareNumber(metric, label, baseline, candidate, higherIsWorse = true, maxRelativeDelta) {
|
|
8072
8095
|
if (baseline === void 0 && candidate === void 0) return void 0;
|
|
8073
8096
|
const delta = baseline !== void 0 && candidate !== void 0 ? candidate - baseline : void 0;
|
|
8074
|
-
|
|
8097
|
+
let regression = delta !== void 0 && (higherIsWorse && delta > 0 || !higherIsWorse && delta < 0);
|
|
8098
|
+
if (regression && maxRelativeDelta !== void 0 && baseline !== void 0 && baseline !== 0 && delta !== void 0) {
|
|
8099
|
+
const relative = Math.abs(delta / baseline);
|
|
8100
|
+
if (relative <= maxRelativeDelta) regression = false;
|
|
8101
|
+
}
|
|
8075
8102
|
return {
|
|
8076
8103
|
metric,
|
|
8077
8104
|
baseline,
|
|
@@ -8090,6 +8117,7 @@ function compareCohortAggregates(groups, options) {
|
|
|
8090
8117
|
const baselineAgg = pickAggregate(groups, options.baseline, options.groupKey);
|
|
8091
8118
|
const candidateAgg = pickAggregate(groups, options.candidate, options.groupKey);
|
|
8092
8119
|
const comparisons = [];
|
|
8120
|
+
const tolerance = options.maxRelativeDelta;
|
|
8093
8121
|
for (const metric of options.metrics) {
|
|
8094
8122
|
switch (metric) {
|
|
8095
8123
|
case "errorRate": {
|
|
@@ -8097,7 +8125,9 @@ function compareCohortAggregates(groups, options) {
|
|
|
8097
8125
|
metric,
|
|
8098
8126
|
"Error rate",
|
|
8099
8127
|
baselineAgg?.errorRate,
|
|
8100
|
-
candidateAgg?.errorRate
|
|
8128
|
+
candidateAgg?.errorRate,
|
|
8129
|
+
true,
|
|
8130
|
+
tolerance
|
|
8101
8131
|
);
|
|
8102
8132
|
if (item) comparisons.push(item);
|
|
8103
8133
|
break;
|
|
@@ -8384,13 +8414,27 @@ async function analyzeCohort(runsInput, options) {
|
|
|
8384
8414
|
...new Set(groups.map((group) => group.groupKey))
|
|
8385
8415
|
].sort((a, b) => a.localeCompare(b));
|
|
8386
8416
|
const items = [];
|
|
8417
|
+
const minSample = options.tolerance?.minSampleSize ?? 1;
|
|
8387
8418
|
for (const groupKey of groupKeys) {
|
|
8419
|
+
const baselineGroup = groups.find(
|
|
8420
|
+
(group) => group.groupKey === groupKey && group.cohortLabel === options.baseline
|
|
8421
|
+
);
|
|
8422
|
+
const candidateGroup = groups.find(
|
|
8423
|
+
(group) => group.groupKey === groupKey && group.cohortLabel === options.candidate
|
|
8424
|
+
);
|
|
8425
|
+
if (baselineGroup && baselineGroup.runCount < minSample || candidateGroup && candidateGroup.runCount < minSample) {
|
|
8426
|
+
warnings.push(
|
|
8427
|
+
`Insufficient sample for group ${groupKey}: need at least ${minSample} run(s) per cohort.`
|
|
8428
|
+
);
|
|
8429
|
+
continue;
|
|
8430
|
+
}
|
|
8388
8431
|
items.push(
|
|
8389
8432
|
...compareCohortAggregates(groups, {
|
|
8390
8433
|
baseline: options.baseline,
|
|
8391
8434
|
candidate: options.candidate,
|
|
8392
8435
|
metrics,
|
|
8393
|
-
groupKey
|
|
8436
|
+
groupKey,
|
|
8437
|
+
maxRelativeDelta: options.tolerance?.maxRelativeDelta
|
|
8394
8438
|
})
|
|
8395
8439
|
);
|
|
8396
8440
|
}
|
|
@@ -8791,6 +8835,9 @@ function validateOptions(options) {
|
|
|
8791
8835
|
if (options.maxErrorRate !== void 0 && options.maxErrorRate < 0) {
|
|
8792
8836
|
errors.push("--max-error-rate must be a non-negative percentage.");
|
|
8793
8837
|
}
|
|
8838
|
+
if (options.maxErrorRate !== void 0 && options.maxErrorRate > 100) {
|
|
8839
|
+
errors.push("--max-error-rate must be at most 100.");
|
|
8840
|
+
}
|
|
8794
8841
|
if (options.maxP95DurationMs !== void 0 && options.maxP95DurationMs < 0) {
|
|
8795
8842
|
errors.push("--max-p95-duration must be a non-negative millisecond value.");
|
|
8796
8843
|
}
|
|
@@ -8798,7 +8845,7 @@ function validateOptions(options) {
|
|
|
8798
8845
|
}
|
|
8799
8846
|
function isConfigLoadError(error) {
|
|
8800
8847
|
if (!(error instanceof Error)) return false;
|
|
8801
|
-
const ext =
|
|
8848
|
+
const ext = path5.extname(error.message);
|
|
8802
8849
|
if (error.message.includes("Unsupported suite config extension")) return true;
|
|
8803
8850
|
if (error.message.includes("TypeScript suite configs require")) return true;
|
|
8804
8851
|
if (error.message.includes("No suite config found")) return true;
|
|
@@ -8997,6 +9044,6 @@ function renderGateReport(result, options = {}) {
|
|
|
8997
9044
|
return renderGateSummaryMarkdown(result);
|
|
8998
9045
|
}
|
|
8999
9046
|
|
|
9000
|
-
export { COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, Redactor, TraceDirectory, TraceReadError, TreeBuilder, __commonJS, __require, __toESM, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, bundleFailsOnSafety, compactAttributes3 as compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, isAgentInspectTrace, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, searchTraces, source_default, stableJson, summarizeObservedOutcomes, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, zeroKinds };
|
|
9001
|
-
//# sourceMappingURL=chunk-
|
|
9002
|
-
//# sourceMappingURL=chunk-
|
|
9047
|
+
export { COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, Redactor, TraceDirectory, TraceReadError, TreeBuilder, __commonJS, __require, __toESM, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, bundleFailsOnSafety, bundleRunAssetRelativePath, compactAttributes3 as compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, isAgentInspectTrace, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, source_default, stableJson, summarizeObservedOutcomes, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, zeroKinds };
|
|
9048
|
+
//# sourceMappingURL=chunk-M6PC5KUT.mjs.map
|
|
9049
|
+
//# sourceMappingURL=chunk-M6PC5KUT.mjs.map
|