instar 1.3.736 → 1.3.738
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/dist/commands/devPreflight.d.ts +21 -0
- package/dist/commands/devPreflight.d.ts.map +1 -1
- package/dist/commands/devPreflight.js +36 -2
- package/dist/commands/devPreflight.js.map +1 -1
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +30 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +13 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +12 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +12 -0
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +22 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/core/hostSemaphoreCore.d.ts +115 -0
- package/dist/core/hostSemaphoreCore.d.ts.map +1 -0
- package/dist/core/hostSemaphoreCore.js +215 -0
- package/dist/core/hostSemaphoreCore.js.map +1 -0
- package/dist/core/hostSpawnSemaphore.d.ts +8 -9
- package/dist/core/hostSpawnSemaphore.d.ts.map +1 -1
- package/dist/core/hostSpawnSemaphore.js +48 -126
- package/dist/core/hostSpawnSemaphore.js.map +1 -1
- package/dist/core/hostTestRunnerSemaphore.d.ts +492 -0
- package/dist/core/hostTestRunnerSemaphore.d.ts.map +1 -0
- package/dist/core/hostTestRunnerSemaphore.js +1648 -0
- package/dist/core/hostTestRunnerSemaphore.js.map +1 -0
- package/dist/core/promptClauses.d.ts +110 -0
- package/dist/core/promptClauses.d.ts.map +1 -0
- package/dist/core/promptClauses.js +125 -0
- package/dist/core/promptClauses.js.map +1 -0
- package/dist/core/testRunnerRunClassifier.d.ts +128 -0
- package/dist/core/testRunnerRunClassifier.d.ts.map +1 -0
- package/dist/core/testRunnerRunClassifier.js +382 -0
- package/dist/core/testRunnerRunClassifier.js.map +1 -0
- package/dist/core/types.d.ts +21 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/data/llmBenchCoverage.d.ts +4 -0
- package/dist/data/llmBenchCoverage.d.ts.map +1 -1
- package/dist/data/llmBenchCoverage.js +72 -0
- package/dist/data/llmBenchCoverage.js.map +1 -1
- package/dist/monitoring/guardManifest.d.ts.map +1 -1
- package/dist/monitoring/guardManifest.js +26 -0
- package/dist/monitoring/guardManifest.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +7 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +9 -0
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +150 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/scripts/lib/test-runner-selfdisable-patterns.mjs +326 -0
- package/scripts/pre-push-test-runner-selfdisable.mjs +81 -0
- package/src/data/builtin-manifest.json +64 -64
- package/src/data/llmBenchCoverage.ts +111 -0
- package/src/scaffold/templates.ts +7 -0
- package/upgrades/1.3.737.md +140 -0
- package/upgrades/1.3.738.md +73 -0
- package/upgrades/side-effects/authority-clause-standard.md +67 -0
- package/upgrades/side-effects/test-runner-concurrency-bound.md +173 -0
- package/upgrades/1.3.736.md +0 -57
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* testRunnerRunClassifier — run-class differentiation + skip detection for the
|
|
3
|
+
* test-runner concurrency bound (spec §2.3/§2.5/§2.6).
|
|
4
|
+
*
|
|
5
|
+
* Pure logic (no holders/lock I/O beyond an injected holders read + `ps`
|
|
6
|
+
* ancestry walk) so the vitest config-eval helper and the globalSetup
|
|
7
|
+
* chokepoint consume ONE shared classifier — the two evaluation points must
|
|
8
|
+
* never disagree in the dangerous direction, and sharing the code is how
|
|
9
|
+
* (State-Not-Symbol: the globalSetup additionally verifies the RESOLVED
|
|
10
|
+
* config's live pool bound — a symbol never binds the two points).
|
|
11
|
+
*
|
|
12
|
+
* CLASSIFICATION IS CONSERVATIVE BY PINNED DESIGN (§2.3): vitest positionals
|
|
13
|
+
* are substring FILTERS, not exact selectors, so a run is targeted ONLY if
|
|
14
|
+
* every positional matches EXACTLY ONE file under filter expansion against
|
|
15
|
+
* the resolved include set, the union is ≤ K files, and NO pool-shaping or
|
|
16
|
+
* filter flags are present. Every ambiguity routes suite-class (safe
|
|
17
|
+
* superset) — version drift can only ever mis-route toward the STRICTER lane.
|
|
18
|
+
*/
|
|
19
|
+
import fs from 'node:fs';
|
|
20
|
+
import path from 'node:path';
|
|
21
|
+
import { execFileSync } from 'node:child_process';
|
|
22
|
+
import { TARGETED_FILE_LIMIT, classifyRow } from './hostTestRunnerSemaphore.js';
|
|
23
|
+
// ── Pool-shaping argv (§2.3 — disqualifies at BOTH evaluation points) ─────
|
|
24
|
+
/**
|
|
25
|
+
* Recognized pool-shaping flags (defense-in-depth; the resolved-state check is
|
|
26
|
+
* the guarantee). Kebab and camel variants both match; `=value` suffix too.
|
|
27
|
+
*/
|
|
28
|
+
const POOL_SHAPING_FLAG_RE = /^--?(no-)?(max-?workers|min-?workers|pool|pool-?options(\..+)?|file-?parallelism|isolate)(=.*)?$/i;
|
|
29
|
+
export function findPoolShapingArgv(argv) {
|
|
30
|
+
return argv.filter((a) => POOL_SHAPING_FLAG_RE.test(a));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Strip recognized pool-shaping flags (and their value token where the flag
|
|
34
|
+
* form takes one) from an argv array. Used by the nested CLI-proof clamp
|
|
35
|
+
* (§2.5) — the BELT alongside the config hard-set.
|
|
36
|
+
*
|
|
37
|
+
* VERSION NOTE (verified against vitest 2.1.9): mutating `process.argv` at
|
|
38
|
+
* config-eval is a NO-OP on this line — vitest's `cac` parser reads the CLI
|
|
39
|
+
* BEFORE the config module loads, so the pool flags are already resolved by
|
|
40
|
+
* the time this runs. The load-bearing CLI-proofness therefore comes from the
|
|
41
|
+
* config `clampConfigPool` hard-set of `poolOptions.*.{min,max}` (which outrank
|
|
42
|
+
* a CLI `--maxWorkers`, measured in §5), NOT from this strip. This is kept as
|
|
43
|
+
* the belt because (a) it is harmless, (b) it does work for children spawned
|
|
44
|
+
* through `guarded-vitest.mjs`, and (c) vitest arg-parse order is not a stable
|
|
45
|
+
* contract across versions. The residual it cannot reach — a CLI
|
|
46
|
+
* `--poolOptions.forks.maxForks=N` that same-keys the config clamp — is caught
|
|
47
|
+
* loud by the globalSetup `poolOverride` WARN (resolved pool > 4 → ledgered
|
|
48
|
+
* `nested-skip clamped:false, poolOverride:true`), never silently unbounded.
|
|
49
|
+
*/
|
|
50
|
+
export function neutralizePoolShapingArgv(argv) {
|
|
51
|
+
const out = [];
|
|
52
|
+
const removed = [];
|
|
53
|
+
for (let i = 0; i < argv.length; i++) {
|
|
54
|
+
const a = argv[i];
|
|
55
|
+
if (!POOL_SHAPING_FLAG_RE.test(a)) {
|
|
56
|
+
out.push(a);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
removed.push(a);
|
|
60
|
+
if (!a.includes('=')) {
|
|
61
|
+
const next = argv[i + 1];
|
|
62
|
+
const isValueTaking = /^--?(max-?workers|min-?workers|pool|pool-?options)/i.test(a);
|
|
63
|
+
if (next !== undefined) {
|
|
64
|
+
if (isValueTaking && !next.startsWith('-')) {
|
|
65
|
+
removed.push(next);
|
|
66
|
+
i++;
|
|
67
|
+
}
|
|
68
|
+
else if (!isValueTaking && /^(true|false)$/i.test(next)) {
|
|
69
|
+
removed.push(next);
|
|
70
|
+
i++;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return { argv: out, removed };
|
|
76
|
+
}
|
|
77
|
+
// ── Filter-argv extraction (conservative allowlist — §2.3) ────────────────
|
|
78
|
+
const SUBCOMMANDS = new Set(['run', 'watch', 'list', 'related', 'bench', 'dev', 'typecheck', 'init']);
|
|
79
|
+
/** Flags that do NOT disqualify a targeted classification (value-taking noted). */
|
|
80
|
+
const SAFE_FLAGS_WITH_VALUE = new Set(['--config', '--reporter', '--root', '--dir']);
|
|
81
|
+
const SAFE_BOOLEAN_FLAGS = new Set(['--run', '--silent', '--no-color', '--color', '--globals', '--passWithNoTests', '--pass-with-no-tests', '--allowOnly', '--allow-only']);
|
|
82
|
+
/** Analyze a vitest argv (process.argv.slice(2) shape or full — both work). */
|
|
83
|
+
export function analyzeVitestArgv(argvIn) {
|
|
84
|
+
// Trim node + script tokens when a full process.argv is passed.
|
|
85
|
+
let argv = argvIn;
|
|
86
|
+
const scriptIdx = argvIn.findIndex((a) => /vitest(\.mjs|\.js)?$/.test(a) || a.endsWith('/vitest'));
|
|
87
|
+
if (scriptIdx >= 0)
|
|
88
|
+
argv = argvIn.slice(scriptIdx + 1);
|
|
89
|
+
else if (argvIn[0] && /node(\.exe)?$/.test(argvIn[0]))
|
|
90
|
+
argv = argvIn.slice(2);
|
|
91
|
+
const analysis = {
|
|
92
|
+
subcommand: null,
|
|
93
|
+
positionals: [],
|
|
94
|
+
poolShaping: [],
|
|
95
|
+
unknownFlags: [],
|
|
96
|
+
explicitWatch: false,
|
|
97
|
+
isList: false,
|
|
98
|
+
};
|
|
99
|
+
let first = true;
|
|
100
|
+
for (let i = 0; i < argv.length; i++) {
|
|
101
|
+
const a = argv[i];
|
|
102
|
+
if (first && SUBCOMMANDS.has(a)) {
|
|
103
|
+
analysis.subcommand = a;
|
|
104
|
+
if (a === 'list')
|
|
105
|
+
analysis.isList = true;
|
|
106
|
+
if (a === 'watch')
|
|
107
|
+
analysis.explicitWatch = true;
|
|
108
|
+
first = false;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
first = false;
|
|
112
|
+
if (a === '--watch' || a === '-w') {
|
|
113
|
+
analysis.explicitWatch = true;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (POOL_SHAPING_FLAG_RE.test(a)) {
|
|
117
|
+
analysis.poolShaping.push(a);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (a.startsWith('-')) {
|
|
121
|
+
const base = a.split('=')[0];
|
|
122
|
+
if (SAFE_FLAGS_WITH_VALUE.has(base)) {
|
|
123
|
+
if (!a.includes('='))
|
|
124
|
+
i++; // consume the value token
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (SAFE_BOOLEAN_FLAGS.has(base))
|
|
128
|
+
continue;
|
|
129
|
+
analysis.unknownFlags.push(a);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
analysis.positionals.push(a);
|
|
133
|
+
}
|
|
134
|
+
return analysis;
|
|
135
|
+
}
|
|
136
|
+
// ── Include-set resolution + matched-file-set classification (§2.3) ───────
|
|
137
|
+
/**
|
|
138
|
+
* Resolve the test files selected by simple include globs of the shape this
|
|
139
|
+
* repo uses (`tests/<dir>/**\/*.test.ts`). Deliberately minimal: a pattern we
|
|
140
|
+
* cannot interpret contributes NOTHING (and classification then routes
|
|
141
|
+
* suite-class via zero/ambiguous matches — the safe direction).
|
|
142
|
+
*/
|
|
143
|
+
export function resolveIncludedTestFiles(includeGlobs, rootDir) {
|
|
144
|
+
const out = [];
|
|
145
|
+
for (const glob of includeGlobs) {
|
|
146
|
+
const starIdx = glob.indexOf('*');
|
|
147
|
+
if (starIdx < 0) {
|
|
148
|
+
out.push(glob);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const baseDir = glob.slice(0, starIdx).replace(/\/$/, '');
|
|
152
|
+
const suffixMatch = glob.match(/\*\*\/\*(\.[a-z.]+)$/i) ?? glob.match(/\*(\.[a-z.]+)$/i);
|
|
153
|
+
const suffix = suffixMatch ? suffixMatch[1].replace('*', '') : '.test.ts';
|
|
154
|
+
const abs = path.resolve(rootDir, baseDir);
|
|
155
|
+
walkFiles(abs, (p) => {
|
|
156
|
+
if (p.endsWith(suffix) || p.endsWith('.test.ts'))
|
|
157
|
+
out.push(path.relative(rootDir, p));
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return [...new Set(out)];
|
|
161
|
+
}
|
|
162
|
+
function walkFiles(dir, visit) {
|
|
163
|
+
let entries;
|
|
164
|
+
try {
|
|
165
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
// @silent-fallback-ok: unreadable dir contributes no files (→ suite-class).
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
for (const e of entries) {
|
|
172
|
+
const p = path.join(dir, e.name);
|
|
173
|
+
if (e.isDirectory()) {
|
|
174
|
+
if (e.name === 'node_modules' || e.name.startsWith('.'))
|
|
175
|
+
continue;
|
|
176
|
+
walkFiles(p, visit);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
visit(p);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The pinned conservative classifier (§2.3): targeted ONLY if every positional
|
|
185
|
+
* is a non-glob, non-directory filter matching EXACTLY ONE file in the
|
|
186
|
+
* resolved include set under vitest's substring filter semantics, and the
|
|
187
|
+
* union of matches is ≤ K. Anything ambiguous routes suite-class.
|
|
188
|
+
*/
|
|
189
|
+
export function classifyTargetedRun(analysis, includedFiles, rootDir, k = TARGETED_FILE_LIMIT) {
|
|
190
|
+
if (analysis.positionals.length === 0) {
|
|
191
|
+
return { targeted: false, matchedCount: 0, reason: 'no-positional-filters' };
|
|
192
|
+
}
|
|
193
|
+
if (analysis.poolShaping.length > 0) {
|
|
194
|
+
return { targeted: false, matchedCount: 0, reason: `pool-shaping-argv:${analysis.poolShaping[0]}` };
|
|
195
|
+
}
|
|
196
|
+
if (analysis.unknownFlags.length > 0) {
|
|
197
|
+
return { targeted: false, matchedCount: 0, reason: `filter-flag:${analysis.unknownFlags[0]}` };
|
|
198
|
+
}
|
|
199
|
+
const matchedUnion = new Set();
|
|
200
|
+
for (const positional of analysis.positionals) {
|
|
201
|
+
if (/[*?[\]{}]/.test(positional)) {
|
|
202
|
+
return { targeted: false, matchedCount: 0, reason: `glob-positional:${positional}` };
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
if (fs.statSync(path.resolve(rootDir, positional)).isDirectory()) {
|
|
206
|
+
return { targeted: false, matchedCount: 0, reason: `directory-positional:${positional}` };
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
/* @silent-fallback-ok: not a resolvable path — still a legal substring filter */
|
|
211
|
+
}
|
|
212
|
+
// vitest positionals are substring FILTERS against the file path (§2.3).
|
|
213
|
+
const norm = positional.replace(/^\.\//, '');
|
|
214
|
+
const matches = includedFiles.filter((f) => f.includes(norm));
|
|
215
|
+
if (matches.length !== 1) {
|
|
216
|
+
return {
|
|
217
|
+
targeted: false,
|
|
218
|
+
matchedCount: matches.length,
|
|
219
|
+
reason: matches.length === 0 ? `no-match:${positional}` : `multi-match:${positional}(${matches.length})`,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
matchedUnion.add(matches[0]);
|
|
223
|
+
}
|
|
224
|
+
if (matchedUnion.size > k) {
|
|
225
|
+
return { targeted: false, matchedCount: matchedUnion.size, reason: `matched-count-${matchedUnion.size}>K-${k}` };
|
|
226
|
+
}
|
|
227
|
+
return { targeted: true, matchedCount: matchedUnion.size, reason: 'exact-match-set' };
|
|
228
|
+
}
|
|
229
|
+
// ── Resolved-pool bound (the STATE check — §2.3) ──────────────────────────
|
|
230
|
+
/**
|
|
231
|
+
* Compute the effective worker-pool bound from a resolved vitest config
|
|
232
|
+
* fragment. Reads maxWorkers AND every poolOptions max* — the MAX of the
|
|
233
|
+
* bounds that could apply; `fileParallelism:false` bounds file concurrency
|
|
234
|
+
* to 1. Unknown/absent values resolve to `null` (unbounded ⇒ suite-class).
|
|
235
|
+
*/
|
|
236
|
+
export function resolvedPoolBound(config) {
|
|
237
|
+
if (config.fileParallelism === false)
|
|
238
|
+
return 1;
|
|
239
|
+
const candidates = [];
|
|
240
|
+
const mw = typeof config.maxWorkers === 'string' ? Number(config.maxWorkers) : config.maxWorkers;
|
|
241
|
+
if (typeof mw === 'number' && Number.isFinite(mw) && mw >= 1)
|
|
242
|
+
candidates.push(mw);
|
|
243
|
+
const po = config.poolOptions;
|
|
244
|
+
for (const v of [po?.threads?.maxThreads, po?.forks?.maxForks, po?.vmThreads?.maxThreads, po?.vmForks?.maxForks]) {
|
|
245
|
+
if (typeof v === 'number' && Number.isFinite(v) && v >= 1)
|
|
246
|
+
candidates.push(v);
|
|
247
|
+
}
|
|
248
|
+
if (candidates.length === 0)
|
|
249
|
+
return null; // unbounded / unknown
|
|
250
|
+
return Math.max(...candidates);
|
|
251
|
+
}
|
|
252
|
+
/** Clamp a config's pool bounds to ≤ maxAllowed (Math.min — a ceiling, never a floor). */
|
|
253
|
+
export function clampConfigPool(test, maxAllowed) {
|
|
254
|
+
const t = test;
|
|
255
|
+
const clampMax = (v) => {
|
|
256
|
+
const n = typeof v === 'string' ? Number(v) : typeof v === 'number' ? v : NaN;
|
|
257
|
+
return Number.isFinite(n) && n >= 1 ? Math.min(n, maxAllowed) : maxAllowed;
|
|
258
|
+
};
|
|
259
|
+
// The MIN bound must be set EXPLICITLY to ≤ the clamped max, even when the
|
|
260
|
+
// config left it UNSET — otherwise vitest's Tinypool resolves the pool's
|
|
261
|
+
// `minThreads`/`minForks` default to (numCpus − 1), which on a ≥6-core host
|
|
262
|
+
// EXCEEDS our max of 4 and throws `minThreads and maxThreads must not
|
|
263
|
+
// conflict`, crashing the root at pool creation. That is a §1.1 false-BLOCK
|
|
264
|
+
// (the clamp meant to bound a run wedges it instead). Clamp min DOWN toward
|
|
265
|
+
// the max (default an unset/invalid min to 1); never raise a legitimately
|
|
266
|
+
// lower min — still a ceiling, never a floor.
|
|
267
|
+
const clampMin = (v, max) => {
|
|
268
|
+
const n = typeof v === 'string' ? Number(v) : typeof v === 'number' ? v : NaN;
|
|
269
|
+
return Number.isFinite(n) && n >= 1 ? Math.min(n, max) : 1;
|
|
270
|
+
};
|
|
271
|
+
const maxW = clampMax(t.maxWorkers);
|
|
272
|
+
t.maxWorkers = maxW;
|
|
273
|
+
t.minWorkers = clampMin(t.minWorkers, maxW);
|
|
274
|
+
const po = (t.poolOptions ?? {});
|
|
275
|
+
for (const [key, maxKey, minKey] of [
|
|
276
|
+
['threads', 'maxThreads', 'minThreads'],
|
|
277
|
+
['forks', 'maxForks', 'minForks'],
|
|
278
|
+
['vmThreads', 'maxThreads', 'minThreads'],
|
|
279
|
+
['vmForks', 'maxForks', 'minForks'],
|
|
280
|
+
]) {
|
|
281
|
+
const sub = { ...(po[key] ?? {}) };
|
|
282
|
+
const m = clampMax(sub[maxKey]);
|
|
283
|
+
sub[maxKey] = m;
|
|
284
|
+
sub[minKey] = clampMin(sub[minKey], m);
|
|
285
|
+
po[key] = sub;
|
|
286
|
+
}
|
|
287
|
+
t.poolOptions = po;
|
|
288
|
+
return test;
|
|
289
|
+
}
|
|
290
|
+
// ── CI / off detection (§2.6, hardened) ───────────────────────────────────
|
|
291
|
+
/** Hardened CI predicate: CI truthy-ONLY-as-'true'/'1' AND a positive signal. */
|
|
292
|
+
export function isCiEnvironment(env = process.env) {
|
|
293
|
+
const ci = env['CI'];
|
|
294
|
+
if (ci !== 'true' && ci !== '1')
|
|
295
|
+
return false;
|
|
296
|
+
return env['GITHUB_ACTIONS'] !== undefined || env['RUNNER_OS'] !== undefined;
|
|
297
|
+
}
|
|
298
|
+
/** Is this an agent-launched / non-interactive context (watch-loudness + CI-spoof heuristics)? */
|
|
299
|
+
export function isAgentContext(env = process.env) {
|
|
300
|
+
return (env['TMUX'] !== undefined ||
|
|
301
|
+
env['INSTAR_SESSION_ID'] !== undefined ||
|
|
302
|
+
env['CLAUDE_CODE_SESSION_ID'] !== undefined ||
|
|
303
|
+
env['INSTAR_HOST_TEST_RUN_CLASS'] === 'background');
|
|
304
|
+
}
|
|
305
|
+
export function isKillSwitchOff(env = process.env) {
|
|
306
|
+
return (env['INSTAR_HOST_TEST_SEMAPHORE'] ?? '').toLowerCase() === 'off';
|
|
307
|
+
}
|
|
308
|
+
/** Run-class derivation (§2.6): never from user input. */
|
|
309
|
+
export function deriveRunClass(configName, env = process.env, isTTY = Boolean(process.stdout.isTTY)) {
|
|
310
|
+
if (env['INSTAR_HOST_TEST_RUN_CLASS'] === 'background')
|
|
311
|
+
return 'background';
|
|
312
|
+
if (configName === 'push')
|
|
313
|
+
return 'interactive';
|
|
314
|
+
// Safest reading (§1.1 bias): a TTY-attached run not marked background gets
|
|
315
|
+
// the longer, user-blocking budget — a human is waiting on it.
|
|
316
|
+
return isTTY ? 'interactive' : 'background';
|
|
317
|
+
}
|
|
318
|
+
// ── Re-entrancy: ancestry + holders cross-check (§2.5) ────────────────────
|
|
319
|
+
/** Walk the ancestor pid chain via `ps` (bounded depth). */
|
|
320
|
+
export function ancestryPids(startPid = process.pid, maxDepth = 25) {
|
|
321
|
+
const chain = [];
|
|
322
|
+
let pid = startPid;
|
|
323
|
+
for (let i = 0; i < maxDepth; i++) {
|
|
324
|
+
let out;
|
|
325
|
+
try {
|
|
326
|
+
// lint-allow-sync-spawn: bounded (1s) one-shot ppid probes, cold path only.
|
|
327
|
+
out = execFileSync('ps', ['-p', String(pid), '-o', 'ppid='], { timeout: 1000, encoding: 'utf-8' });
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
// @silent-fallback-ok: unresolvable ancestry fails toward NOT-nested —
|
|
331
|
+
// the run then acquires normally (bounded, never sheltered).
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
const ppid = Number(out.trim());
|
|
335
|
+
if (!Number.isInteger(ppid) || ppid <= 1)
|
|
336
|
+
break;
|
|
337
|
+
chain.push(ppid);
|
|
338
|
+
pid = ppid;
|
|
339
|
+
}
|
|
340
|
+
return chain;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* The lane-scoped ancestry+holders cross-check (§2.5). The env marker
|
|
344
|
+
* (INSTAR_TEST_SEMAPHORE_HELD) only NARROWS the check — a stale/foreign/leaked
|
|
345
|
+
* marker fails the cross-check and does NOT skip; a scrubbed-env child still
|
|
346
|
+
* skips via pure ancestry.
|
|
347
|
+
*/
|
|
348
|
+
export function checkNestedUnderHolder(holdersRows, laneChildWouldAcquire, opts = {}) {
|
|
349
|
+
const ancestors = opts.ancestors ?? ancestryPids();
|
|
350
|
+
const ancestorSet = new Set(ancestors);
|
|
351
|
+
let markerPid = null;
|
|
352
|
+
if (opts.envMarker) {
|
|
353
|
+
const n = Number(opts.envMarker.split(':')[0]);
|
|
354
|
+
if (Number.isInteger(n) && n >= 2)
|
|
355
|
+
markerPid = n;
|
|
356
|
+
}
|
|
357
|
+
let sameLane = null;
|
|
358
|
+
let anyLane = false;
|
|
359
|
+
for (const r of holdersRows) {
|
|
360
|
+
if (classifyRow(r) !== 'held')
|
|
361
|
+
continue;
|
|
362
|
+
const row = r;
|
|
363
|
+
if (!ancestorSet.has(row.pid))
|
|
364
|
+
continue;
|
|
365
|
+
if (opts.pidAlive && !opts.pidAlive(row.pid))
|
|
366
|
+
continue;
|
|
367
|
+
if (markerPid !== null && row.pid !== markerPid) {
|
|
368
|
+
// Marker present but names a different pid: the marker only narrows —
|
|
369
|
+
// the ancestry facts still count this ancestor row.
|
|
370
|
+
}
|
|
371
|
+
anyLane = true;
|
|
372
|
+
if (row.lane === laneChildWouldAcquire && !sameLane)
|
|
373
|
+
sameLane = row;
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
nested: sameLane !== null,
|
|
377
|
+
shelteringPid: sameLane?.pid ?? null,
|
|
378
|
+
shelteringSlotId: sameLane?.id ?? null,
|
|
379
|
+
anyLaneAncestorHolder: anyLane,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
//# sourceMappingURL=testRunnerRunClassifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testRunnerRunClassifier.js","sourceRoot":"","sources":["../../src/core/testRunnerRunClassifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAoC,WAAW,EAA4B,MAAM,8BAA8B,CAAC;AAE5I,6EAA6E;AAE7E;;;GAGG;AACH,MAAM,oBAAoB,GACxB,mGAAmG,CAAC;AAEtG,MAAM,UAAU,mBAAmB,CAAC,IAAc;IAChD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAc;IACtD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACZ,SAAS;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC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QACD,OAAO,GAAG,IAAI,CAAC;QACf,IAAI,GAAG,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,QAAQ;YAAE,QAAQ,GAAG,GAAG,CAAC;IACtE,CAAC;IACD,OAAO;QACL,MAAM,EAAE,QAAQ,KAAK,IAAI;QACzB,aAAa,EAAE,QAAQ,EAAE,GAAG,IAAI,IAAI;QACpC,gBAAgB,EAAE,QAAQ,EAAE,EAAE,IAAI,IAAI;QACtC,qBAAqB,EAAE,OAAO;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -3336,6 +3336,27 @@ export interface InstarConfig {
|
|
|
3336
3336
|
rb?: number;
|
|
3337
3337
|
};
|
|
3338
3338
|
};
|
|
3339
|
+
/**
|
|
3340
|
+
* Test-Runner Concurrency Bound — host-wide vitest-root cap (the spawn
|
|
3341
|
+
* cap's sibling; docs/specs/test-runner-concurrency-bound.md §2.9).
|
|
3342
|
+
* CAVEAT (§2.6/§2.7 no-lie constraint): this block tunes the ROUTE's
|
|
3343
|
+
* report + server-launched tooling ONLY — NOT the chokepoint. The vitest
|
|
3344
|
+
* globalSetup runs in a bare test process that cannot know which agent's
|
|
3345
|
+
* config to read, so setting `enabled:false` here does NOT disable the
|
|
3346
|
+
* bound: the sole chokepoint kill switch is env
|
|
3347
|
+
* `INSTAR_HOST_TEST_SEMAPHORE=off`, and the host-uniform authority for
|
|
3348
|
+
* caps/posture is the tuning file `~/.instar/host-test-runner-tuning.json`
|
|
3349
|
+
* (env `INSTAR_HOST_TEST_MAX` etc. are per-process overrides). The
|
|
3350
|
+
* GET /test-runner-limiter route likewise resolves cap/posture through
|
|
3351
|
+
* the chokepoint's resolvers, never from these values.
|
|
3352
|
+
*/
|
|
3353
|
+
testRunnerCap?: {
|
|
3354
|
+
enabled?: boolean;
|
|
3355
|
+
/** Suite-lane concurrency (mirrors the code default 1). */
|
|
3356
|
+
maxConcurrent?: number;
|
|
3357
|
+
/** Background-class suite-lane acquire budget in ms (mirrors the code default 120000). */
|
|
3358
|
+
acquireWaitMs?: number;
|
|
3359
|
+
};
|
|
3339
3360
|
};
|
|
3340
3361
|
/**
|
|
3341
3362
|
* Agent-level set of frameworks this install actively uses. Drives
|