Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
test(core): finish child clocks and diagnostics [C7]
Corey Olson360a8b981877
diff --git a/test/agent-session.test.js b/test/agent-session.test.jsindex e8f7b019..5161a81f 100644--- a/test/agent-session.test.js+++ b/test/agent-session.test.js@@ -1,7 +1,6 @@/** Checkout-session ownership and takeover behavior [B3,B7]. */import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';-import { fixtureChildMessage, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';+import { startFixtureChild as spawn, fixtureChildMessage, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { createHash } from 'node:crypto';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync, readdirSync } from 'node:fs';import { tmpdir } from 'node:os';@@ -219,7 +218,7 @@ test('the actual view adapter writes without taking over an agent session [B3,B7process.stdout.write(JSON.stringify(response));`;const response = runFixtureChild(process.execPath, ['--input-type=module', '-e', source], {- cwd: box.repo, env: { ...box.base, CODEX_THREAD_ID: 'other-process-view-session-273' }, encoding: 'utf8', timeout: 15_000,+ cwd: box.repo, env: { ...box.base, CODEX_THREAD_ID: 'other-process-view-session-273' }, encoding: 'utf8',});assert.equal(response.status, 0, fixtureChildMessage(response));const document = JSON.parse(response.stdout);diff --git a/test/api.test.js b/test/api.test.jsindex 4f0e3815..46df3d18 100644--- a/test/api.test.js+++ b/test/api.test.js@@ -1,8 +1,7 @@/** The public, versioned JSON surface of every pullboard command (A1). */import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { performance } from 'node:perf_hooks';-import { reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/approved-row-changes.test.js b/test/approved-row-changes.test.jsindex c2e9ee1c..0e492453 100644--- a/test/approved-row-changes.test.js+++ b/test/approved-row-changes.test.js@@ -1,7 +1,6 @@/** Approved-row edits need an exact person decision or staged SSH receipt [S19,V3]. */import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';-import { fixtureChildMessage, runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync, fixtureChildMessage, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, rmdirSync, statSync, writeFileSync } from 'node:fs';import { once } from 'node:events';import { tmpdir } from 'node:os';diff --git a/test/board.test.js b/test/board.test.jsindex a4cc9f6e..a6463b36 100644--- a/test/board.test.js+++ b/test/board.test.js@@ -3,8 +3,7 @@* R2). The git-facing rules (V3, V4, V7) run against real repos in e2e.test.js.*/import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureGit } from './fixture-child.js';import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';diff --git a/test/check-baseline-delivery.test.js b/test/check-baseline-delivery.test.jsindex c5763f9a..515bba07 100644--- a/test/check-baseline-delivery.test.js+++ b/test/check-baseline-delivery.test.js@@ -1,7 +1,6 @@/** Durable check observations retry delivery without running their shell again [V2,H16]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';@@ -114,7 +113,7 @@ function completionCount(board, id) {function runWorker(box, id, request) {const source = `import { runCheckBaselineWorker } from ${JSON.stringify(WORKER_MODULE)};\nawait runCheckBaselineWorker(process.cwd(), Number(process.argv[1]), process.argv[2]);`;return runFixtureChild(process.execPath, ['--input-type=module', '-e', source, String(id), request], {- cwd: box.repo, env: box.env, encoding: 'utf8', timeout: 45_000,+ cwd: box.repo, env: box.env, encoding: 'utf8',});}diff --git a/test/check-baseline.test.js b/test/check-baseline.test.jsindex 53d792b6..ae3012f5 100644--- a/test/check-baseline.test.js+++ b/test/check-baseline.test.js@@ -1,7 +1,6 @@/** Check baselines run against main and travel with deterministic board moves [V2,H3,H16,N23]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';@@ -363,7 +362,7 @@ function applyInReplica(file, replicaDir, moveFile, env, at = '2026-10-07T12:00:'finally { closeBoard(board); }',].join('\n');return runFixtureChild(process.execPath, ['--input-type=module', '-e', source, file, moveFile, String(env.sequence), at], {- cwd: replicaDir, env, encoding: 'utf8', timeout: 10_000,+ cwd: replicaDir, env, encoding: 'utf8',});}diff --git a/test/check.test.js b/test/check.test.jsindex dc25a668..860f604a 100644--- a/test/check.test.js+++ b/test/check.test.js@@ -1,7 +1,6 @@/** Coordinator-owned check commands and explicit caller consent [V2,N23]. */import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';@@ -135,13 +134,12 @@ async function confirmInteractively(box, itemId, command, markerFile, json = falchild.stderr.setEncoding('utf8').on('data', (chunk) => { stderr += chunk; answerPrompt(); });child.once('error', promptReject);const closed = new Promise((resolveClose, rejectClose) => {- child.once('close', (code, signal) => resolveClose({ code, signal }));+ child.once('close', (code, signal) => {+ if (!sent) promptReject(new Error(child.fixtureFailure ?? 'check exited before its prompt'));+ resolveClose({ code, signal, failure: child.fixtureFailure });+ });child.once('error', rejectClose);});- const timer = setTimeout(() => {- promptReject(new Error('timed out waiting for the coordinator check prompt'));- child.kill('SIGKILL');- }, 10_000);try {await prompt;const result = await closed;@@ -151,8 +149,6 @@ async function confirmInteractively(box, itemId, command, markerFile, json = falchild.kill('SIGKILL');await Promise.race([closed, new Promise((resolveClose) => setTimeout(resolveClose, 1_000))]);throw error;- } finally {- clearTimeout(timer);}}diff --git a/test/chrome-fixture.js b/test/chrome-fixture.jsindex 16387f18..e7aed797 100644--- a/test/chrome-fixture.js+++ b/test/chrome-fixture.js@@ -1,5 +1,5 @@/** Shared isolated Chrome launcher with bounded startup and complete process-group cleanup [C7]. */-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';import { tmpdir } from 'node:os';import { monitorEventLoopDelay } from 'node:perf_hooks';diff --git a/test/cleanup-diagnostics.js b/test/cleanup-diagnostics.jsindex 44871dcf..86864c33 100644--- a/test/cleanup-diagnostics.js+++ b/test/cleanup-diagnostics.js@@ -1,6 +1,6 @@/** Capture bounded filesystem and live-holder evidence for a fixture cleanup failure. */import { readdirSync, rmSync, statSync } from 'node:fs';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { join } from 'node:path';/** List the newest filesystem entries below a failed cleanup path. */diff --git a/test/coordinator-resume.test.js b/test/coordinator-resume.test.jsindex 04b1fc57..3787e31d 100644--- a/test/coordinator-resume.test.js+++ b/test/coordinator-resume.test.js@@ -1,7 +1,6 @@/** Keep the coordinator's handoff brief short, ordered, and derived from real Git and board state [N19,B3]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { DatabaseSync } from 'node:sqlite';import { chmodSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';diff --git a/test/doctrine-name.test.js b/test/doctrine-name.test.jsindex 5f4f32d3..b37b8fee 100644--- a/test/doctrine-name.test.js+++ b/test/doctrine-name.test.js@@ -1,7 +1,6 @@/** Canonical doctrine naming keeps legacy repos and the stable state API readable [D1,D2,A5]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/e2e-cli.test.js b/test/e2e-cli.test.jsindex bff20ef5..1abf8e3c 100644--- a/test/e2e-cli.test.js+++ b/test/e2e-cli.test.js@@ -3,7 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/e2e-helpers.js b/test/e2e-helpers.jsindex 4e1eff32..bc4435eb 100644--- a/test/e2e-helpers.js+++ b/test/e2e-helpers.js@@ -1,7 +1,6 @@import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { performance } from 'node:perf_hooks';-import { reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import {chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync,rmSync, statSync, symlinkSync, writeFileSync,diff --git a/test/e2e-items.test.js b/test/e2e-items.test.jsindex acf7eedb..956b255b 100644--- a/test/e2e-items.test.js+++ b/test/e2e-items.test.js@@ -3,8 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';-import { runFixtureChild } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync, runFixtureChild } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/e2e-policy.test.js b/test/e2e-policy.test.jsindex e83d0be8..65758e93 100644--- a/test/e2e-policy.test.js+++ b/test/e2e-policy.test.js@@ -3,7 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/e2e-private-checks.test.js b/test/e2e-private-checks.test.jsindex 9c3a5f29..e599e183 100644--- a/test/e2e-private-checks.test.js+++ b/test/e2e-private-checks.test.js@@ -3,7 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import {chmodSync,existsSync,@@ -114,7 +114,7 @@ test('private worker drains noisy output and reports a failed log path instead oconst output = spawnSync(process.execPath, [worker], {input: JSON.stringify({ command: `node -e 'process.stdout.write("START-WORKER\\n"); process.stdout.write(Buffer.alloc(20 * 1024 * 1024, 120)); process.stdout.write("\\nEND-WORKER\\n")'`,timeout: 10_000, pidFile: join(box.dir, 'worker.pid'), logPath: join(box.dir, 'missing', 'check.log') }),- encoding: 'utf8', timeout: 15_000, maxBuffer: 64 * 1024 * 1024,+ encoding: 'utf8', maxBuffer: 64 * 1024 * 1024,});assert.equal(output.status, 0, output.stderr);const result = JSON.parse(output.stdout);@@ -310,7 +310,7 @@ test('private check timeout kills a TERM-resistant shell and its tracked child [let outer;try {outer = spawnSync(process.execPath, ['--input-type=module', '-e', source, box.repo, JSON.stringify(trackedItem)], {- cwd: box.repo, env: box.env, encoding: 'utf8', timeout: 15_000, detached: true,+ cwd: box.repo, env: box.env, encoding: 'utf8', detached: true,});assert.equal(outer.error, undefined, outer.error?.message);assert.equal(outer.status, 0, outer.stderr);diff --git a/test/e2e-runner.test.js b/test/e2e-runner.test.jsindex 5a9abee8..3d8a67ee 100644--- a/test/e2e-runner.test.js+++ b/test/e2e-runner.test.js@@ -3,7 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/e2e-view.test.js b/test/e2e-view.test.jsindex d773b503..5ea5b1aa 100644--- a/test/e2e-view.test.js+++ b/test/e2e-view.test.js@@ -3,7 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/e2e.test.js b/test/e2e.test.jsindex 0ff748c8..28d591bd 100644--- a/test/e2e.test.js+++ b/test/e2e.test.js@@ -3,7 +3,7 @@* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).*/import assert from 'node:assert/strict';-import { execFileSync, spawn, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import {chmodSync,existsSync,diff --git a/test/engine.test.js b/test/engine.test.jsindex b30e4266..cfa72296 100644--- a/test/engine.test.js+++ b/test/engine.test.js@@ -1,6 +1,6 @@/** Real-SQLite tests for the deterministic, sequence-ordered move engine [H3,H16]. */import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync } from './fixture-child.js';import { mkdtempSync, rmSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/fixture-child.js b/test/fixture-child.jsindex b6ba4e51..f1087759 100644--- a/test/fixture-child.js+++ b/test/fixture-child.js@@ -14,7 +14,7 @@ export function safeFixtureDiagnostic(value, env = process.env) {}}return text- .replace(/\b(?:ps|pa)_[A-Za-z0-9_-]+\b/gu, '[redacted-token]')+ .replace(/\b(?:ps|pa|pm|pg)_[A-Za-z0-9_-]+\b/gu, '[redacted-token]').replace(/\b[a-f\d]{32}\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}\b/giu, '[redacted-pairing-code]').replace(/((?:token|secret|password|private[_ -]?key|access[_ -]?key|relay[_ -]?key|pairing[_ -]?code|verification[_ -]?code)\s*[:=]\s*)[^\s,;]+/giu, '$1[redacted]').replace(/(authorization\s*:\s*bearer\s+)[^\s,;]+/giu, '$1[redacted]');@@ -43,7 +43,10 @@ export function reportFixtureChildFailure(options) {export function runFixtureChild(command, args = [], options = {}) {if (!Array.isArray(args)) { options = args; args = []; }const started = performance.now();- const result = spawnSync(command, args, options);+ const stderrIgnored = options.stdio === 'ignore' || (Array.isArray(options.stdio) && options.stdio[2] === 'ignore');+ const childOptions = stderrIgnored ? { ...options, stdio: options.stdio === 'ignore'+ ? ['ignore', 'ignore', 'pipe'] : [options.stdio[0], options.stdio[1], 'pipe'] } : options;+ const result = spawnSync(command, args, childOptions);const elapsedMs = Math.round(performance.now() - started);const env = options.env ?? process.env;const stderr = safeFixtureDiagnostic(Buffer.isBuffer(result.stderr) ? result.stderr.toString('utf8') : (result.stderr ?? ''), env);@@ -59,7 +62,7 @@ export function runFixtureChild(command, args = [], options = {}) {command, args, status: result.status, signal: result.signal, elapsedMs, stderr, env,detail: result.error?.message ?? '',});- return { ...result, command: [command, ...args], elapsedMs, context, failure };+ return { ...result, stderr: stderrIgnored ? null : result.stderr, command: [command, ...args], elapsedMs, context, failure };}/** Run an async fixture child, retaining redacted diagnostics without imposing a child clock. */@@ -122,3 +125,39 @@ export function runFixtureGit(args, options = {}) {if (result.status !== 0) throw new Error(result.failure);return result.stdout.trim();}++/** Preserve execFileSync output and failure fields while adding common child diagnostics. */+export function runFixtureExecFile(command, args = [], options = {}) {+ if (!Array.isArray(args)) { options = args; args = []; }+ const result = runFixtureChild(command, args, options);+ if (result.failure) {+ const error = new Error(result.failure);+ Object.assign(error, result);+ throw error;+ }+ return result.stdout;+}++/** Execute a fixture shell command with the same output contract and failure evidence. */+export function runFixtureExec(command, options = {}) {+ return runFixtureExecFile(options.shell ?? '/bin/sh', ['-c', command], options);+}++/** Observe a spawned fixture without changing its streams, exit events or child-clock policy. */+export function startFixtureChild(command, args = [], options = {}) {+ if (!Array.isArray(args)) { options = args; args = []; }+ const started = performance.now();+ const child = spawn(command, args, options);+ let stderr = '';+ let spawnError;+ child.stderr?.on('data', part => { stderr += part.toString(); });+ child.once('error', error => { spawnError = error; });+ child.once('close', (status, signal) => {+ if (status !== 0 || signal || spawnError) {+ child.fixtureFailure = reportFixtureChildFailure({ command, args, status, signal,+ elapsedMs: performance.now() - started, stderr, env: options.env ?? process.env,+ detail: spawnError?.message ?? '' });+ }+ });+ return child;+}diff --git a/test/fixture-child.test.js b/test/fixture-child.test.jsindex dc08b64e..0c3dff4f 100644--- a/test/fixture-child.test.js+++ b/test/fixture-child.test.js@@ -2,7 +2,7 @@import assert from 'node:assert/strict';import { performance } from 'node:perf_hooks';import { after, test } from 'node:test';-import { cleanupFixtureChildren, runFixtureChild, runFixtureChildAsync } from './fixture-child.js';+import { cleanupFixtureChildren, runFixtureChild, runFixtureChildAsync, runFixtureExecFile, runFixtureExec, startFixtureChild } from './fixture-child.js';after(cleanupFixtureChildren);@@ -41,6 +41,20 @@ test('a fixture child killed or failed names its command, signal and stderr [C7]assert.ok(Number(elapsed?.[1]) - (readyAt - startedAt) >= 80, killed.failure);assert.match(killed.failure, /stderr: sleeping child/u);+ assert.throws(() => runFixtureExecFile(process.execPath, ['-e', "console.error('exec stderr'); process.exit(6)"], { encoding: 'utf8' }),+ error => /command:/.test(error.message) && /status: 6/.test(error.message) && /stderr: exec stderr/.test(error.message));+ assert.equal(runFixtureExec('printf shell-output', { encoding: 'utf8' }), 'shell-output');+ const observed = startFixtureChild(process.execPath, ['-e', "console.error('observed stderr'); process.exit(4)"]);+ await new Promise(resolveClose => observed.once('close', resolveClose));+ assert.match(observed.fixtureFailure, /command: .*node/u);+ assert.match(observed.fixtureFailure, /status: 4/u);+ assert.match(observed.fixtureFailure, /signal: none/u);+ assert.match(observed.fixtureFailure, /elapsed: \d+ms/u);+ assert.match(observed.fixtureFailure, /stderr: observed stderr/u);+ const ignored = runFixtureChild(process.execPath, ['-e', "console.error('otherwise discarded stderr'); process.exit(5)"], { stdio: 'ignore' });+ assert.equal(ignored.stderr, null, 'ignore preserves the caller output contract');+ assert.match(ignored.failure, /stderr: otherwise discarded stderr/u);+const pairingCode = '0123456789abcdef0123456789abcdef.ABCDEFGHIJKLMNOPQRSTUV.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ';const credentialFailure = runFixtureChild(process.execPath, ['-e', `console.error('token ps_fixtureSecret_98765 pairing-code pa_fixtureCode_12345 relay-key relay-fixture-secret-abcdef ${pairingCode}'); process.exit(2)`], {encoding: 'utf8', env: { ...process.env, PULLBOARD_RELAY_KEY: 'relay-fixture-secret-abcdef' },diff --git a/test/gate-resource.test.js b/test/gate-resource.test.jsindex 1ee2f5f5..d4f46d84 100644--- a/test/gate-resource.test.js+++ b/test/gate-resource.test.js@@ -1,7 +1,6 @@/** Real gates and item checks share the machine queue; landing priority and lease behavior stay intact [Q1,Q2,Q4,O5,O6,V18]. */import assert from 'node:assert/strict';-import { spawn, spawnSync } from 'node:child_process';-import { runFixtureChild } from './fixture-child.js';+import { startFixtureChild as spawn, runFixtureChild as spawnSync, runFixtureChild } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/gate.test.js b/test/gate.test.jsindex c48844ea..e6d5c53f 100644--- a/test/gate.test.js+++ b/test/gate.test.js@@ -3,8 +3,7 @@* no stamp stands in for it, and the tree must hold still while it runs.*/import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';@@ -157,7 +156,7 @@ function privateCheck(box, command) {const pidFile = logPath + '.pid';const run = runFixtureChild(process.execPath, [PRIVATE_WORKER], {cwd: box.repo, env: box.env, encoding: 'utf8',- input: JSON.stringify({ command, timeout: 30_000, pidFile, logPath }), timeout: 35_000,+ input: JSON.stringify({ command, timeout: 30_000, pidFile, logPath }),});rmSync(pidFile, { force: true });assert.equal(run.status, 0, `${run.stdout}${run.stderr}`);diff --git a/test/git-calls.test.js b/test/git-calls.test.jsindex 04343770..28842293 100644--- a/test/git-calls.test.js+++ b/test/git-calls.test.js@@ -1,7 +1,6 @@/** Count real Git child processes and prove command-scoped facts refresh after a commit [C7]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { delimiter, join, resolve } from 'node:path';import { tmpdir } from 'node:os';diff --git a/test/hooks.test.js b/test/hooks.test.jsindex d47af4e0..73b802b1 100644--- a/test/hooks.test.js+++ b/test/hooks.test.js@@ -2,8 +2,7 @@* The commit-message rules (C1, C2) and the pre-commit pattern checks on real staged changes.*/import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureGit } from './fixture-child.js';import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';diff --git a/test/http-fixture.test.js b/test/http-fixture.test.jsindex c3e3641d..241602db 100644--- a/test/http-fixture.test.js+++ b/test/http-fixture.test.js@@ -1,8 +1,7 @@/** Fixture requests reach a live server even after the test blocked its own event loop past keep-alive [C7]. */import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { performance } from 'node:perf_hooks';-import { reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { once } from 'node:events';import { mkdirSync, mkdtempSync, realpathSync, rmSync } from 'node:fs';import { createServer } from 'node:http';diff --git a/test/lane-bypass.test.js b/test/lane-bypass.test.jsindex 66096c1b..5aa59f6b 100644--- a/test/lane-bypass.test.js+++ b/test/lane-bypass.test.js@@ -1,7 +1,6 @@/** Reproduce lane-policy bypasses with private Git repositories and their installed hooks [L1,L3]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/machine.test.js b/test/machine.test.jsindex a097f0cb..9a70bbc6 100644--- a/test/machine.test.js+++ b/test/machine.test.js@@ -14,8 +14,7 @@ import { HELP } from '../src/cli.js';import { loadConfig } from '../src/config.js';import { Refused } from '../src/refused.js';import { BLANKS, IN_STATE, MACHINE, effectiveGuards, lifecycleHelp, lifecycleMarkdown, machineProblems, storeTriggers } from '../src/machine.js';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';/*** Refusals that are not about an item's lifecycle, so no move declares them: command input, callerdiff --git a/test/newcomer.test.js b/test/newcomer.test.jsindex 9797d3d3..d0a44cc5 100644--- a/test/newcomer.test.js+++ b/test/newcomer.test.js@@ -1,7 +1,6 @@/** First-run guidance on private Git repos, including unrelated files setup must not stage [I1,I2]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/node-version.test.js b/test/node-version.test.jsindex d7c7e4e7..46b3008a 100644--- a/test/node-version.test.js+++ b/test/node-version.test.js@@ -4,7 +4,7 @@* run on whatever Node runs the suite.*/import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync } from './fixture-child.js';import { chmodSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/package.test.js b/test/package.test.jsindex 3e379157..5f3a17c9 100644--- a/test/package.test.js+++ b/test/package.test.js@@ -3,7 +3,7 @@* trust, and every import is a Node built-in or a file of its own.*/import assert from 'node:assert/strict';-import { spawn, spawnSync } from 'node:child_process';+import { startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import { once } from 'node:events';import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';@@ -47,7 +47,6 @@ function look(sources) {stdio: ['ignore', 'pipe', 'pipe'],encoding: 'utf8',maxBuffer: 2 ** 26,- timeout: 3000,});assert.equal(child.status, 0, child.stderr);return JSON.parse(child.stdout);diff --git a/test/person.test.js b/test/person.test.jsindex 7109f33d..979778e7 100644--- a/test/person.test.js+++ b/test/person.test.js@@ -1,8 +1,7 @@/** Person terminal identity and immutable channel receipts on real repositories [B26]. */import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn, fixtureChildMessage, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { performance } from 'node:perf_hooks';-import { fixtureChildMessage, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/project-meta.test.js b/test/project-meta.test.jsindex f7dca65a..eee8e213 100644--- a/test/project-meta.test.js+++ b/test/project-meta.test.js@@ -1,7 +1,6 @@/** Project metadata and registry lifecycle (N33, N35, N36). */import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/registry.test.js b/test/registry.test.jsindex 78613a0a..e3a8cc2d 100644--- a/test/registry.test.js+++ b/test/registry.test.js@@ -1,6 +1,6 @@/** Registry metadata, refresh, pruning and forgetting (N33, N35, N36). */import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn, reportFixtureChildFailure, runFixtureGit } from './fixture-child.js';import { performance } from 'node:perf_hooks';import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';@@ -8,7 +8,6 @@ import { basename, join, resolve } from 'node:path';import { test } from 'node:test';import { configProblems, defaults, loadConfig } from '../src/config.js';import { forgetProject, listProjects, registerProject, registryFile } from '../src/projects.js';-import { reportFixtureChildFailure, runFixtureGit } from './fixture-child.js';/*** Create an initialized temporary Git repository with a private Pullboard home.diff --git a/test/relay-agent.test.js b/test/relay-agent.test.jsindex 7748d01e..542e03c3 100644--- a/test/relay-agent.test.js+++ b/test/relay-agent.test.js@@ -1,13 +1,12 @@/** Private end-to-end proof for ordered agent enrollment and scoped relay credentials [H2,H9,A4]. */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync, cleanupFixtureChildren, runFixtureChild, runFixtureChildAsync } from './fixture-child.js';import { createHash } from 'node:crypto';import { DatabaseSync } from 'node:sqlite';import { chmodSync, existsSync, readFileSync, realpathSync, unlinkSync, writeFileSync } from 'node:fs';import { basename, dirname, join } from 'node:path';import { fileURLToPath } from 'node:url';import { after, test } from 'node:test';-import { cleanupFixtureChildren, runFixtureChild, runFixtureChildAsync } from './fixture-child.js';import { claim as claimStoredItem, closeBoard, openBoard, register as registerStoredAgent, submit as submitStoredItem } from '../src/board.js';import { serveApi } from '../src/api.js';import { main } from '../src/cli.js';diff --git a/test/relay-client-fixture.js b/test/relay-client-fixture.jsindex a6e2ee31..92b7ec64 100644--- a/test/relay-client-fixture.js+++ b/test/relay-client-fixture.js@@ -1,7 +1,7 @@/** Private real CLI, auth and relay fixture; credentials never enter assertion messages [H1,H7,H18]. */import assert from 'node:assert/strict';import { createHash } from 'node:crypto';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn, reportFixtureChildFailure, runFixtureChild } from './fixture-child.js';import { performance } from 'node:perf_hooks';import { createServer } from 'node:http';import { Transform } from 'node:stream';@@ -16,7 +16,6 @@ import { createRelayHandler } from '../relay/service.js';import { createGitHubClient } from '../relay/github.js';import { githubFixture } from './relay-fixture.js';import { relayWorkBudgetMs, MAX_SNAPSHOT_ATTEMPTS } from './relay-budget.js';-import { reportFixtureChildFailure, runFixtureChild } from './fixture-child.js';const CLI = resolve(import.meta.dirname, '../bin/pullboard.js');const MAX_OBSERVED_SNAPSHOT_UPLOADS = MAX_SNAPSHOT_ATTEMPTS;diff --git a/test/relay-client.test.js b/test/relay-client.test.jsindex 9c1e8af5..cb4b992b 100644--- a/test/relay-client.test.js+++ b/test/relay-client.test.js@@ -1,13 +1,12 @@/** Real device-flow CLI ordering through the opaque relay [H1,H7,H15]. */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync, cleanupFixtureChildren, runFixtureChildAsync, runFixtureGit, safeFixtureDiagnostic } from './fixture-child.js';import { createServer } from 'node:http';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from 'node:fs';import { delimiter, join, resolve } from 'node:path';import { tmpdir } from 'node:os';import { after, test } from 'node:test';import { gunzipSync } from 'node:zlib';-import { cleanupFixtureChildren, runFixtureChildAsync, runFixtureGit, safeFixtureDiagnostic } from './fixture-child.js';import { DatabaseSync } from 'node:sqlite';import { createAuthHandler } from '../relay/auth-http.js';import { createRelayAuth } from '../relay/auth.js';diff --git a/test/relay-deploy.test.js b/test/relay-deploy.test.jsindex a93aae29..611d2cb4 100644--- a/test/relay-deploy.test.js+++ b/test/relay-deploy.test.js@@ -1,6 +1,6 @@/** Exercise the deploy smoke script against a private loopback relay [H5,H18]. */import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn, reportFixtureChildFailure, safeFixtureDiagnostic } from './fixture-child.js';import { performance } from 'node:perf_hooks';import { createServer } from 'node:http';import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, copyFileSync } from 'node:fs';@@ -10,7 +10,6 @@ import { test } from 'node:test';import { ENGINE_VERSION } from '../src/machine.js';import { relayClientFixture } from './relay-client-fixture.js';import { githubFixture } from './relay-fixture.js';-import { reportFixtureChildFailure, safeFixtureDiagnostic } from './fixture-child.js';const SMOKE = resolve(import.meta.dirname, '../relay/smoke.mjs');const SERVER = resolve(import.meta.dirname, '../relay/server.mjs');diff --git a/test/relay-device-keys.test.js b/test/relay-device-keys.test.jsindex a4ff7ee8..3663298b 100644--- a/test/relay-device-keys.test.js+++ b/test/relay-device-keys.test.js@@ -1,7 +1,7 @@/** Real device enrollment and key wraps; actual WebCrypto only [H5,H15,H17]. */import assert from 'node:assert/strict';import { test } from 'node:test';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { mkdtempSync, rmSync, statSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';@@ -136,7 +136,7 @@ test('machine device enrollment survives a new process and refuses unrecorded orconst module = new URL('../src/relay-machine.js', import.meta.url).href;const restarted = spawnSync(process.execPath, ['--input-type=module', '-e',`import {readRelayMachine} from ${JSON.stringify(module)}; console.log(JSON.stringify(readRelayMachine().devices.map(device => device.deviceId)));`],- { env: process.env, encoding: 'utf8', timeout: 10_000 });+ { env: process.env, encoding: 'utf8' });assert.equal(restarted.status, 0, restarted.stderr);assert.deepEqual(JSON.parse(restarted.stdout), [phone.deviceId], 'a fresh process sees the same authenticated device');removeRecordedDevice(phone.deviceId);diff --git a/test/relay-retention.test.js b/test/relay-retention.test.jsindex 4bc24a69..488df0b5 100644--- a/test/relay-retention.test.js+++ b/test/relay-retention.test.js@@ -1,6 +1,6 @@/** Real private relay lifecycle storage, controlled clocks and HTTP authorization [H18]. */import assert from 'node:assert/strict';-import { spawn } from 'node:child_process';+import { startFixtureChild as spawn } from './fixture-child.js';import { DatabaseSync } from 'node:sqlite';import { createCipheriv, randomBytes } from 'node:crypto';import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, symlinkSync, writeFileSync } from 'node:fs';diff --git a/test/relay-sealed.test.js b/test/relay-sealed.test.jsindex 88767b66..d76345b4 100644--- a/test/relay-sealed.test.js+++ b/test/relay-sealed.test.js@@ -1,14 +1,13 @@/** Two real clients and encrypted CLI records exercise the relay without sharing their key [A4,H7]. */import assert from 'node:assert/strict';import { createCipheriv, createDecipheriv, createHash, randomBytes } from 'node:crypto';-import { execFileSync, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, cleanupFixtureChildren, runFixtureChild, runFixtureGit, runFixtureChildAsync } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { delimiter, join, resolve } from 'node:path';import { pathToFileURL } from 'node:url';import { createServer } from 'node:http';import { after, test } from 'node:test';-import { cleanupFixtureChildren, runFixtureChild, runFixtureGit, runFixtureChildAsync } from './fixture-child.js';import { serveRelay } from '../relay/service.js';import { createRelayAuth } from '../relay/auth.js';import { createGitHubClient } from '../relay/github.js';diff --git a/test/relay-setup-once.test.js b/test/relay-setup-once.test.jsindex f6934f0b..99dac83e 100644--- a/test/relay-setup-once.test.js+++ b/test/relay-setup-once.test.js@@ -1,6 +1,6 @@/** One real machine setup reaches current and future projects through one phone key [H5,H15,H17]. */import assert from 'node:assert/strict';-import { spawn, spawnSync } from 'node:child_process';+import { startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';import { existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs';import { dirname, join, resolve } from 'node:path';import { test } from 'node:test';@@ -21,21 +21,22 @@ async function waitFor(read, message, timeout = 20_000) {}/** Launch the production CLI against an isolated real repository and retain only private diagnostics. */-function command(root, env, args, timeout = 25_000) {+function command(root, env, args) {const child = spawn(process.execPath, [CLI, ...args, '--json'], { cwd: root, env, stdio: ['ignore', 'pipe', 'pipe'] });let stdout = '';let stderr = '';child.stdout.setEncoding('utf8').on('data', value => { stdout += value; });child.stderr.setEncoding('utf8').on('data', value => { stderr += value; });const done = new Promise((resolveResult, reject) => {- const timer = setTimeout(() => child.kill('SIGKILL'), timeout);- child.once('error', error => { clearTimeout(timer); reject(error); });+ child.once('error', reject);child.once('close', (code, signal) => {- clearTimeout(timer);- if (signal) return reject(new Error('The private setup command exceeded its bounded fixture lifetime.'));+ if (signal || code !== 0) {+ const failure = child.fixtureFailure;+ if (signal) return reject(new Error(failure));+ }let document;try { document = JSON.parse(stdout); } catch { return reject(new Error('The private setup command did not return JSON.')); }- resolveResult({ code, document, stderr });+ resolveResult({ code, document, stderr, failure: child.fixtureFailure });});});return { child, done };@@ -78,7 +79,7 @@ test('set up once links three registered boards, later registration and a persisconst second = await project(box, 'second-project');const third = await project(box, 'third-project');const machineFile = join(box.env.PULLBOARD_HOME, 'relay-machine/state.json');- setup = command(box.root, box.env, ['relay', 'on', '--all', '--url', box.origin], 90_000);+ setup = command(box.root, box.env, ['relay', 'on', '--all', '--url', box.origin]);const pending = await waitFor(() => {if (!existsSync(machineFile)) return null;return JSON.parse(readFileSync(machineFile, 'utf8')).pending;diff --git a/test/relay-stuck-upload.test.js b/test/relay-stuck-upload.test.jsindex 6cfd3fb0..c935ffd4 100644--- a/test/relay-stuck-upload.test.js+++ b/test/relay-stuck-upload.test.js@@ -1,6 +1,6 @@/** A refused baseline pauses safely and recovers without blocking ordered moves [H16,B26]. */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { mkdirSync, readFileSync, symlinkSync, writeFileSync } from 'node:fs';import { join, resolve } from 'node:path';import { test } from 'node:test';diff --git a/test/relay.test.js b/test/relay.test.jsindex 613886e6..c9290f22 100644--- a/test/relay.test.js+++ b/test/relay.test.js@@ -1,6 +1,6 @@/** Relay identity, expiry, permission freshness and scoped credential isolation [H8, H1]. */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, symlinkSync } from 'node:fs';import { tmpdir } from 'node:os';import { dirname, join, resolve } from 'node:path';diff --git a/test/release.test.js b/test/release.test.jsindex e8cee67f..72f79bb5 100644--- a/test/release.test.js+++ b/test/release.test.js@@ -4,8 +4,7 @@* command, and every git hook, runs the installed pullboard, never this repo's bin.*/import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/resources.test.js b/test/resources.test.jsindex aa4e5fb1..225492c5 100644--- a/test/resources.test.js+++ b/test/resources.test.js@@ -1,8 +1,7 @@/** Real-process resource queue and lease coverage [Q1,Q2,Q3]. */import assert from 'node:assert/strict';-import { spawn, spawnSync } from 'node:child_process';+import { startFixtureChild as spawn, runFixtureChild as spawnSync, reportFixtureChildFailure, runFixtureChild } from './fixture-child.js';import { performance } from 'node:perf_hooks';-import { reportFixtureChildFailure, runFixtureChild } from './fixture-child.js';import { once } from 'node:events';import { chmodSync, existsSync, mkdtempSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';@@ -165,7 +164,7 @@ async function event(child, timeoutMs = 10_000) {const failure = reportFixtureChildFailure({ command: child.spawnfile, args: child.spawnargs.slice(1),status: child.exitResult?.code ?? null, signal: child.exitResult?.signal ?? null,elapsedMs: performance.now() - child.startedAt, stderr: child.errors, env: child.spawnEnv,- detail: `worker event wait expired after ${timeoutMs}ms` });+ detail: `worker timed out waiting for its event after ${timeoutMs}ms` });reject(new Error(failure));}, timeoutMs) };child.lineWaiters.push(waiter);diff --git a/test/row-decisions.test.js b/test/row-decisions.test.jsindex 412b1952..e6b9e7f7 100644--- a/test/row-decisions.test.js+++ b/test/row-decisions.test.js@@ -1,8 +1,7 @@/** Person-authored row decisions stay on the board until a coordinator applies them [B26,S18,S19,C7]. */import assert from 'node:assert/strict';-import { spawn, spawnSync } from 'node:child_process';+import { startFixtureChild as spawn, runFixtureChild as spawnSync, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { performance } from 'node:perf_hooks';-import { reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/run-tests-reporter.test.js b/test/run-tests-reporter.test.jsindex ddba3e0d..164d7866 100644--- a/test/run-tests-reporter.test.js+++ b/test/run-tests-reporter.test.js@@ -1,6 +1,6 @@/** Keep the production runner's report stable across Node versions and caller options [C7]. */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { mkdtempSync, rmSync, writeFileSync, readFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';@@ -40,7 +40,6 @@ syncBuiltinESMExports();PULLBOARD_REPORTER_CAPTURE_FILE: capture,},encoding: 'utf8',- timeout: 15_000,});const output = `${result.stdout ?? ''}${result.stderr ?? ''}`;const childArgs = JSON.parse(readFileSync(capture, 'utf8'));diff --git a/test/run-tests-timeout.test.js b/test/run-tests-timeout.test.jsindex a1745d2a..8b404290 100644--- a/test/run-tests-timeout.test.js+++ b/test/run-tests-timeout.test.js@@ -1,6 +1,6 @@/** Prove each test has a named bounded timeout and the run continues [C7, V10]. */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';@@ -32,7 +32,6 @@ function runFixture(t, stalledSource, timeoutOverride = '1200') {env: { ...process.env, PULLBOARD_TEST_TIMEOUT_MS: timeoutOverride },encoding: 'utf8',detached: true,- timeout: 15_000,});if (result.error?.code === 'ETIMEDOUT' && result.pid) {try { process.kill(-result.pid, 'SIGKILL'); } catch { /* The owned fixture process group already exited. */ }@@ -89,7 +88,6 @@ test('a helper-only test file exits after importing the runner [C7, V10]', (t) =env: { ...process.env, PULLBOARD_TEST_TIMEOUT_MS: '1200' },encoding: 'utf8',detached: true,- timeout: 10_000,});if (result.error?.code === 'ETIMEDOUT' && result.pid) {try { process.kill(-result.pid, 'SIGKILL'); } catch { /* The owned fixture process group already exited. */ }@@ -112,7 +110,6 @@ test('must not run [C7,V10]', () => writeFileSync(${JSON.stringify(marker)}, 'racwd: root,env: { ...process.env, PULLBOARD_TEST_TIMEOUT_MS: '0' },encoding: 'utf8',- timeout: 15_000,});assert.equal(existsSync(marker), false, 'invalid timeout was refused before the fixture ran');assert.equal(result.status, 1, outputOf(result));diff --git a/test/seal.test.js b/test/seal.test.jsindex fc3818d7..ed7d6e0f 100644--- a/test/seal.test.js+++ b/test/seal.test.js@@ -1,6 +1,6 @@/** Device-side sealing is the same bytes and WebCrypto code in Node and Chrome (H15, H17). */import assert from 'node:assert/strict';-import { spawnSync } from 'node:child_process';+import { runFixtureChild as spawnSync } from './fixture-child.js';import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { createServer } from 'node:http';import { tmpdir } from 'node:os';@@ -140,7 +140,7 @@ test('generate, encode, decode, seal and unseal never write to console or outputprocess.stdout.write(String(outputCalls));process.exitCode = failed ? 1 : 0;`;- const result = spawnSync(process.execPath, ['--input-type=module', '-e', harness], { encoding: 'utf8', timeout: 10_000 });+ const result = spawnSync(process.execPath, ['--input-type=module', '-e', harness], { encoding: 'utf8' });assert.equal(result.status, 0, 'the isolated output-capture probe completed its operations');assert.equal(result.stderr.length, 0, 'the probe wrote nothing to stderr');assert.equal(Number(result.stdout), 0, 'no console, stdout or stderr output was attempted');diff --git a/test/show.test.js b/test/show.test.jsindex 250aad23..f14090d6 100644--- a/test/show.test.js+++ b/test/show.test.js@@ -3,8 +3,7 @@* note in full on --history or --json.*/import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { runFixtureChild } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild } from './fixture-child.js';import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/signoff.test.js b/test/signoff.test.jsindex 04dd9796..acd57f3f 100644--- a/test/signoff.test.js+++ b/test/signoff.test.js@@ -1,7 +1,6 @@/** SSH sign-off opt-in, rotation, row requirements and tamper rejection [S17,S18,S19,S20,S21]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { fixtureChildMessage, runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, fixtureChildMessage, runFixtureChild, runFixtureGit } from './fixture-child.js';import { createHash } from 'node:crypto';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';diff --git a/test/spec.test.js b/test/spec.test.jsindex 23c8e1ec..89de2f9f 100644--- a/test/spec.test.js+++ b/test/spec.test.js@@ -2,8 +2,7 @@* The spec (S1–S5): parsing SPEC.md rows, the lint, the frozen criterion and sign-offs.*/import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/stale-frozen-items.test.js b/test/stale-frozen-items.test.jsindex 03f5688d..6ff4148d 100644--- a/test/stale-frozen-items.test.js+++ b/test/stale-frozen-items.test.js@@ -1,7 +1,6 @@/** Approved row edits identify every affected frozen item without rewriting receipts [S19,V3]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/submit-gate.test.js b/test/submit-gate.test.jsindex dc8a2f26..31511a20 100644--- a/test/submit-gate.test.js+++ b/test/submit-gate.test.js@@ -3,8 +3,7 @@* selection can stand in for the project gate, which still runs at landing [V4,C7,V16].*/import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { appendFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { dirname, join, resolve } from 'node:path';diff --git a/test/test-runner.test.js b/test/test-runner.test.jsindex 054f9dd5..ab1c5aeb 100644--- a/test/test-runner.test.js+++ b/test/test-runner.test.js@@ -1,6 +1,6 @@/** Test the CI-like test runner against real Git and PATH behavior [C7, S13]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync } from './fixture-child.js';import { chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { delimiter, join } from 'node:path';@@ -117,7 +117,6 @@ test('one discovered test', () => appendFileSync(${JSON.stringify(marker)}, 'x')cwd: root,encoding: 'utf8',env: launchEnv,- timeout: 15_000,});assert.equal(result.status, 0, `${result.stdout}${result.stderr}`);assert.equal(readFileSync(marker, 'utf8'), 'x', 'one test ran exactly once under default discovery');diff --git a/test/thread.test.js b/test/thread.test.jsindex 72008968..9befe354 100644--- a/test/thread.test.js+++ b/test/thread.test.js@@ -1,7 +1,6 @@/** Exercise typed item threads and deterministic replication on isolated SQLite boards [B29,B30,B31,B32]. */import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/trunk.test.js b/test/trunk.test.jsindex 4c26fe07..64e941e7 100644--- a/test/trunk.test.js+++ b/test/trunk.test.js@@ -1,7 +1,6 @@/** Branch-name-independent check baselines and lane merge ownership [B34,P2,L3]. */import assert from 'node:assert/strict';-import { execFileSync, spawnSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/test/verdict-check.test.js b/test/verdict-check.test.jsindex 067a5898..66c56b91 100644--- a/test/verdict-check.test.js+++ b/test/verdict-check.test.js@@ -1,7 +1,6 @@/** The frozen check outcome travels with accepts without changing the board schema [V19,V8]. */import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { runFixtureChild, runFixtureGit } from './fixture-child.js';+import { runFixtureExecFile as execFileSync, runFixtureChild, runFixtureGit } from './fixture-child.js';import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';