Skip to content

Commit 0ac298b

Browse files
committed
build: update bundled dist files
1 parent 202fcaa commit 0ac298b

14 files changed

+186
-36
lines changed

dist/index.js

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22
process.env.VISOR_VERSION = '0.1.42';
33
process.env.PROBE_VERSION = '0.6.0-rc201';
4-
process.env.VISOR_COMMIT_SHA = '57b6a087992acc17594f92f29a6b92d1fac09d5e';
5-
process.env.VISOR_COMMIT_SHORT = '57b6a087';
4+
process.env.VISOR_COMMIT_SHA = '202fcaa45d1de898a8ce2b798cdeae175a8f6beb';
5+
process.env.VISOR_COMMIT_SHORT = '202fcaa4';
66
/******/ (() => { // webpackBootstrap
77
/******/ var __webpack_modules__ = ({
88

@@ -175775,13 +175775,21 @@ async function executeCheckWithForEachItems(checkId, forEachParent, forEachItems
175775175775
Object.defineProperty(exports, "__esModule", ({ value: true }));
175776175776
exports.buildOutputHistoryFromJournal = buildOutputHistoryFromJournal;
175777175777
const logger_1 = __nccwpck_require__(86999);
175778+
function getHistoryLimit() {
175779+
const raw = process.env.VISOR_TEST_HISTORY_LIMIT || process.env.VISOR_OUTPUT_HISTORY_LIMIT;
175780+
if (!raw)
175781+
return undefined;
175782+
const n = parseInt(raw, 10);
175783+
return Number.isFinite(n) && n > 0 ? n : undefined;
175784+
}
175778175785
/**
175779175786
* Build output history Map from journal for template rendering
175780175787
* This matches the format expected by AI providers.
175781175788
* Moved from LevelDispatch to reduce file size and improve reuse.
175782175789
*/
175783175790
function buildOutputHistoryFromJournal(context) {
175784175791
const outputHistory = new Map();
175792+
const limit = getHistoryLimit();
175785175793
try {
175786175794
const snapshot = context.journal.beginSnapshot();
175787175795
const allEntries = context.journal.readVisible(context.sessionId, snapshot, undefined);
@@ -175811,8 +175819,13 @@ function buildOutputHistoryFromJournal(context) {
175811175819
}
175812175820
}
175813175821
catch { }
175814-
if (payload !== undefined)
175815-
outputHistory.get(checkId).push(payload);
175822+
if (payload !== undefined) {
175823+
const arr = outputHistory.get(checkId);
175824+
arr.push(payload);
175825+
if (limit && arr.length > limit) {
175826+
arr.splice(0, arr.length - limit);
175827+
}
175828+
}
175816175829
}
175817175830
}
175818175831
catch (error) {
@@ -177160,12 +177173,20 @@ function recordOnFinishRoutingEvent(args) {
177160177173
attrs.goto_event = args.gotoEvent;
177161177174
(0, trace_helpers_1.addEvent)('visor.routing', attrs);
177162177175
}
177176+
function getHistoryLimit() {
177177+
const raw = process.env.VISOR_TEST_HISTORY_LIMIT || process.env.VISOR_OUTPUT_HISTORY_LIMIT;
177178+
if (!raw)
177179+
return undefined;
177180+
const n = parseInt(raw, 10);
177181+
return Number.isFinite(n) && n > 0 ? n : undefined;
177182+
}
177163177183
/**
177164177184
* Build output history Map from journal for template rendering
177165177185
* This matches the format expected by AI providers
177166177186
*/
177167177187
function buildOutputHistoryFromJournal(context) {
177168177188
const outputHistory = new Map();
177189+
const limit = getHistoryLimit();
177169177190
try {
177170177191
const snapshot = context.journal.beginSnapshot();
177171177192
const allEntries = context.journal.readVisible(context.sessionId, snapshot, undefined);
@@ -177179,8 +177200,13 @@ function buildOutputHistoryFromJournal(context) {
177179177200
// code-review where issues are returned directly). This ensures
177180177201
// outputs_history['security'].last.issues[...] works in prompts and tests.
177181177202
const payload = entry.result.output !== undefined ? entry.result.output : entry.result;
177182-
if (payload !== undefined)
177183-
outputHistory.get(checkId).push(payload);
177203+
if (payload !== undefined) {
177204+
const arr = outputHistory.get(checkId);
177205+
arr.push(payload);
177206+
if (limit && arr.length > limit) {
177207+
arr.splice(0, arr.length - limit);
177208+
}
177209+
}
177184177210
}
177185177211
}
177186177212
catch (error) {
@@ -180316,6 +180342,13 @@ function createMemoryHelpers() {
180316180342
},
180317180343
};
180318180344
}
180345+
function getHistoryLimit() {
180346+
const raw = process.env.VISOR_TEST_HISTORY_LIMIT || process.env.VISOR_OUTPUT_HISTORY_LIMIT;
180347+
if (!raw)
180348+
return undefined;
180349+
const n = parseInt(raw, 10);
180350+
return Number.isFinite(n) && n > 0 ? n : undefined;
180351+
}
180319180352
function formatScopeLabel(scope) {
180320180353
if (!scope || scope.length === 0)
180321180354
return '';
@@ -181168,6 +181201,7 @@ async function processOnFail(checkId, scope, result, checkConfig, context, state
181168181201
async function evaluateRunJs(runJs, checkId, checkConfig, result, context, _state) {
181169181202
try {
181170181203
const sandbox = (0, sandbox_1.createSecureSandbox)();
181204+
const historyLimit = getHistoryLimit();
181171181205
// Build outputs record and outputs_history
181172181206
const snapshotId = context.journal.beginSnapshot();
181173181207
const contextView = new ((__nccwpck_require__(3355).ContextView))(context.journal, context.sessionId, snapshotId, [], context.event);
@@ -181193,8 +181227,11 @@ async function evaluateRunJs(runJs, checkId, checkConfig, result, context, _stat
181193181227
try {
181194181228
const history = contextView.getHistory(checkIdFromJournal);
181195181229
if (history && history.length > 0) {
181230+
const trimmed = historyLimit && history.length > historyLimit
181231+
? history.slice(history.length - historyLimit)
181232+
: history;
181196181233
// Extract outputs from history (prefer output field if available)
181197-
outputsHistory[checkIdFromJournal] = history.map((r) => r.output !== undefined ? r.output : r);
181234+
outputsHistory[checkIdFromJournal] = trimmed.map((r) => r.output !== undefined ? r.output : r);
181198181235
}
181199181236
}
181200181237
catch {
@@ -181282,6 +181319,7 @@ async function evaluateGoto(gotoJs, gotoStatic, checkId, checkConfig, result, co
181282181319
if (gotoJs) {
181283181320
try {
181284181321
const sandbox = (0, sandbox_1.createSecureSandbox)();
181322+
const historyLimit = getHistoryLimit();
181285181323
// Build outputs record and outputs_history from the full session snapshot.
181286181324
// Do not filter by event here — on_finish (especially forEach post-children) may
181287181325
// need to see results committed under different event triggers within the same run.
@@ -181309,8 +181347,11 @@ async function evaluateGoto(gotoJs, gotoStatic, checkId, checkConfig, result, co
181309181347
try {
181310181348
const history = contextView.getHistory(checkIdFromJournal);
181311181349
if (history && history.length > 0) {
181350+
const trimmed = historyLimit && history.length > historyLimit
181351+
? history.slice(history.length - historyLimit)
181352+
: history;
181312181353
// Extract outputs from history (prefer output field if available)
181313-
outputsHistory[checkIdFromJournal] = history.map((r) => r.output !== undefined ? r.output : r);
181354+
outputsHistory[checkIdFromJournal] = trimmed.map((r) => r.output !== undefined ? r.output : r);
181314181355
}
181315181356
}
181316181357
catch {
@@ -181430,6 +181471,7 @@ async function evaluateTransitions(transitions, checkId, checkConfig, result, co
181430181471
return undefined;
181431181472
try {
181432181473
const sandbox = (0, sandbox_1.createSecureSandbox)();
181474+
const historyLimit = getHistoryLimit();
181433181475
// Build outputs record and outputs_history from the full session snapshot
181434181476
const snapshotId = context.journal.beginSnapshot();
181435181477
const ContextView = (__nccwpck_require__(3355).ContextView);
@@ -181448,7 +181490,10 @@ async function evaluateTransitions(transitions, checkId, checkConfig, result, co
181448181490
try {
181449181491
const hist = view.getHistory(cid);
181450181492
if (hist && hist.length > 0) {
181451-
outputsHistory[cid] = hist.map((r) => (r.output !== undefined ? r.output : r));
181493+
const trimmed = historyLimit && hist.length > historyLimit
181494+
? hist.slice(hist.length - historyLimit)
181495+
: hist;
181496+
outputsHistory[cid] = trimmed.map((r) => r.output !== undefined ? r.output : r);
181452181497
}
181453181498
}
181454181499
catch { }
@@ -185350,6 +185395,7 @@ const config_1 = __nccwpck_require__(22973);
185350185395
const state_machine_execution_engine_1 = __nccwpck_require__(39004);
185351185396
const github_recorder_1 = __nccwpck_require__(81493);
185352185397
const memory_store_1 = __nccwpck_require__(18216);
185398+
const session_registry_1 = __nccwpck_require__(46059);
185353185399
const global_recorder_1 = __nccwpck_require__(54325);
185354185400
const flow_stage_1 = __nccwpck_require__(12758);
185355185401
const test_execution_wrapper_1 = __nccwpck_require__(30392);
@@ -185358,6 +185404,16 @@ const environment_1 = __nccwpck_require__(13228);
185358185404
const mocks_1 = __nccwpck_require__(20490);
185359185405
const fixture_1 = __nccwpck_require__(29716);
185360185406
const validator_1 = __nccwpck_require__(8075);
185407+
function ensureTestEnvDefaults() {
185408+
if (!process.env.VISOR_TEST_MODE)
185409+
process.env.VISOR_TEST_MODE = 'true';
185410+
if (!process.env.VISOR_TEST_PROMPT_MAX_CHARS) {
185411+
process.env.VISOR_TEST_PROMPT_MAX_CHARS = process.env.CI === 'true' ? '4000' : '8000';
185412+
}
185413+
if (!process.env.VISOR_TEST_HISTORY_LIMIT) {
185414+
process.env.VISOR_TEST_HISTORY_LIMIT = process.env.CI === 'true' ? '200' : '500';
185415+
}
185416+
}
185361185417
/**
185362185418
* Very small glob-to-RegExp converter supporting **, *, and ?
185363185419
* - ** matches across path separators
@@ -185487,6 +185543,7 @@ function discoverSuites(rootOrPattern, cwd = process.cwd()) {
185487185543
return Array.from(new Set(suites)).sort((a, b) => a.localeCompare(b));
185488185544
}
185489185545
async function runSuites(files, options) {
185546+
ensureTestEnvDefaults();
185490185547
const perSuite = [];
185491185548
let failedSuites = 0;
185492185549
let totalCases = 0;
@@ -185613,6 +185670,11 @@ class VisorTestRunner {
185613185670
memory_store_1.MemoryStore.resetInstance();
185614185671
}
185615185672
catch { }
185673+
// Always clear AI sessions between cases to prevent cross-case leakage
185674+
try {
185675+
session_registry_1.SessionRegistry.getInstance().clearAllSessions();
185676+
}
185677+
catch { }
185616185678
// Always use StateMachineExecutionEngine
185617185679
const engine = new state_machine_execution_engine_1.StateMachineExecutionEngine(undefined, recorder);
185618185680
try {
@@ -185996,7 +186058,10 @@ class VisorTestRunner {
185996186058
const defaultStrict = defaultsAny?.strict !== false;
185997186059
const aiProviderDefault = defaultsAny?.ai_provider || 'mock';
185998186060
const ghRec = defaultsAny?.github_recorder;
185999-
const defaultPromptCap = options.promptMaxChars ||
186061+
const envPromptCapRaw = process.env.VISOR_TEST_PROMPT_MAX_CHARS;
186062+
const envPromptCap = envPromptCapRaw ? parseInt(envPromptCapRaw, 10) : undefined;
186063+
const defaultPromptCap = options.promptMaxChars ??
186064+
(Number.isFinite(envPromptCap) ? envPromptCap : undefined) ??
186000186065
(typeof defaultsAny?.prompt_max_chars === 'number'
186001186066
? defaultsAny.prompt_max_chars
186002186067
: undefined);
@@ -186416,6 +186481,11 @@ class VisorTestRunner {
186416186481
memory_store_1.MemoryStore.resetInstance();
186417186482
}
186418186483
catch { }
186484+
// Clear AI sessions before each stage to avoid leakage across stages
186485+
try {
186486+
session_registry_1.SessionRegistry.getInstance().clearAllSessions();
186487+
}
186488+
catch { }
186419186489
// Prepare default tag filters for this flow (inherit suite defaults)
186420186490
const parseTags = (v) => {
186421186491
if (!v)

dist/sdk/check-provider-registry-NKNJA43B.mjs renamed to dist/sdk/check-provider-registry-JMNLGIMJ.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {
22
CheckProviderRegistry,
33
init_check_provider_registry
4-
} from "./chunk-TMJ55U4W.mjs";
4+
} from "./chunk-VPEQOQ7G.mjs";
55
import "./chunk-NAW3DB3I.mjs";
66
import "./chunk-J2QWVDXK.mjs";
77
import "./chunk-HQL734ZI.mjs";
88
import "./chunk-J6EVEXC2.mjs";
99
import "./chunk-CUNPH6TR.mjs";
1010
import "./chunk-O5EZDNYL.mjs";
11-
import "./chunk-Q4HOAG2X.mjs";
11+
import "./chunk-35NT3725.mjs";
1212
import "./chunk-SWEEZ5D5.mjs";
1313
import "./chunk-BOVFH3LI.mjs";
1414
import "./chunk-ZYAUYXSW.mjs";
@@ -24,4 +24,4 @@ init_check_provider_registry();
2424
export {
2525
CheckProviderRegistry
2626
};
27-
//# sourceMappingURL=check-provider-registry-NKNJA43B.mjs.map
27+
//# sourceMappingURL=check-provider-registry-JMNLGIMJ.mjs.map
File renamed without changes.
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ function createMemoryHelpers() {
210210
}
211211
};
212212
}
213+
function getHistoryLimit() {
214+
const raw = process.env.VISOR_TEST_HISTORY_LIMIT || process.env.VISOR_OUTPUT_HISTORY_LIMIT;
215+
if (!raw) return void 0;
216+
const n = parseInt(raw, 10);
217+
return Number.isFinite(n) && n > 0 ? n : void 0;
218+
}
213219
function formatScopeLabel(scope) {
214220
if (!scope || scope.length === 0) return "";
215221
return scope.map((item) => `${item.check}:${item.index}`).join("|");
@@ -1023,6 +1029,7 @@ async function processOnFail(checkId, scope, result, checkConfig, context, state
10231029
async function evaluateRunJs(runJs, checkId, checkConfig, result, context, _state) {
10241030
try {
10251031
const sandbox = createSecureSandbox();
1032+
const historyLimit = getHistoryLimit();
10261033
const snapshotId = context.journal.beginSnapshot();
10271034
const contextView = new (init_snapshot_store(), __toCommonJS(snapshot_store_exports)).ContextView(
10281035
context.journal,
@@ -1047,7 +1054,8 @@ async function evaluateRunJs(runJs, checkId, checkConfig, result, context, _stat
10471054
try {
10481055
const history = contextView.getHistory(checkIdFromJournal);
10491056
if (history && history.length > 0) {
1050-
outputsHistory[checkIdFromJournal] = history.map(
1057+
const trimmed = historyLimit && history.length > historyLimit ? history.slice(history.length - historyLimit) : history;
1058+
outputsHistory[checkIdFromJournal] = trimmed.map(
10511059
(r) => r.output !== void 0 ? r.output : r
10521060
);
10531061
}
@@ -1129,6 +1137,7 @@ async function evaluateGoto(gotoJs, gotoStatic, checkId, checkConfig, result, co
11291137
if (gotoJs) {
11301138
try {
11311139
const sandbox = createSecureSandbox();
1140+
const historyLimit = getHistoryLimit();
11321141
const snapshotId = context.journal.beginSnapshot();
11331142
const contextView = new (init_snapshot_store(), __toCommonJS(snapshot_store_exports)).ContextView(
11341143
context.journal,
@@ -1153,7 +1162,8 @@ async function evaluateGoto(gotoJs, gotoStatic, checkId, checkConfig, result, co
11531162
try {
11541163
const history = contextView.getHistory(checkIdFromJournal);
11551164
if (history && history.length > 0) {
1156-
outputsHistory[checkIdFromJournal] = history.map(
1165+
const trimmed = historyLimit && history.length > historyLimit ? history.slice(history.length - historyLimit) : history;
1166+
outputsHistory[checkIdFromJournal] = trimmed.map(
11571167
(r) => r.output !== void 0 ? r.output : r
11581168
);
11591169
}
@@ -1256,6 +1266,7 @@ async function evaluateTransitions(transitions, checkId, checkConfig, result, co
12561266
if (!transitions || transitions.length === 0) return void 0;
12571267
try {
12581268
const sandbox = createSecureSandbox();
1269+
const historyLimit = getHistoryLimit();
12591270
const snapshotId = context.journal.beginSnapshot();
12601271
const ContextView2 = (init_snapshot_store(), __toCommonJS(snapshot_store_exports)).ContextView;
12611272
const view = new ContextView2(context.journal, context.sessionId, snapshotId, [], void 0);
@@ -1272,7 +1283,10 @@ async function evaluateTransitions(transitions, checkId, checkConfig, result, co
12721283
try {
12731284
const hist = view.getHistory(cid);
12741285
if (hist && hist.length > 0) {
1275-
outputsHistory[cid] = hist.map((r) => r.output !== void 0 ? r.output : r);
1286+
const trimmed = historyLimit && hist.length > historyLimit ? hist.slice(hist.length - historyLimit) : hist;
1287+
outputsHistory[cid] = trimmed.map(
1288+
(r) => r.output !== void 0 ? r.output : r
1289+
);
12761290
}
12771291
} catch {
12781292
}
@@ -1374,4 +1388,4 @@ export {
13741388
evaluateTransitions,
13751389
init_routing
13761390
};
1377-
//# sourceMappingURL=chunk-Q4HOAG2X.mjs.map
1391+
//# sourceMappingURL=chunk-35NT3725.mjs.map

dist/sdk/chunk-35NT3725.mjs.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sdk/chunk-Q4HOAG2X.mjs.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/sdk/chunk-TMJ55U4W.mjs.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)