TASK-pilot-executor-outcomes: require terminal executor evidence

This commit is contained in:
thePR0M3TH3AN committed 2026-09-30 20:17:06 -04:00
1 parent a04d9c3625
commit 12e1e33cc8
7 files changed
+363 -14

No files matched your search

+14 -3
View File
@@ -32,6 +32,7 @@ import { IntegrationService } from './integration/service.mjs';
import { analyzeCombatrigFleet } from './importers/combatrig.mjs';
import { proposeDomains } from './kernel/domains.mjs';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { join, resolve } from 'node:path';
import { fileHash, writeNewFile } from './kernel/files.mjs';
import { createWorktrees, planWorktrees } from './kernel/worktrees.mjs';
@@ -46,6 +47,16 @@ import { observeProject } from './observability/snapshot.mjs';
// Provider output is evidence, not an unbounded artifact channel. startFleet
// classifies ENOBUFS as an interrupted outcome instead of a completed turn.
const MAX_RUNTIME_EXECUTOR_OUTPUT_BYTES = 1024 * 1024;
const CODEX_PROTOCOL_REDUCER = fileURLToPath(new URL('./runtime/codex-protocol-reducer.mjs', import.meta.url));
export function executeRuntimeLaunch(spawn, launch, options = {}) {
// Tests and adapter qualification inject a deterministic executor. The real
// synchronous CLI boundary alone needs protocol reduction before buffering.
if (launch.runtime === 'codex' && spawn === spawnSync) {
return spawn(process.execPath, [CODEX_PROTOCOL_REDUCER, launch.command, ...launch.args], options);
}
return spawn(launch.command, launch.args, options);
}
import { OwnerDigestService } from './observability/owner-digest.mjs';
import { ContextTelemetryService } from './telemetry/context.mjs';
import { ScheduleService } from './schedules/service.mjs';
@@ -1110,7 +1121,7 @@ export async function runCli(argv = process.argv.slice(2), {
}
print(startFleet({
plan, controlPlane: control, adapters,
executor: (launch) => spawn(launch.command, launch.args, {
executor: (launch) => executeRuntimeLaunch(spawn, launch, {
cwd: launch.cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'],
maxBuffer: MAX_RUNTIME_EXECUTOR_OUTPUT_BYTES,
}),
@@ -1444,7 +1455,7 @@ export async function runCli(argv = process.argv.slice(2), {
}
print(startFleet({
plan, controlPlane: control, adapters,
executor: (launch) => spawn(launch.command, launch.args, {
executor: (launch) => executeRuntimeLaunch(spawn, launch, {
cwd: launch.cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'],
maxBuffer: MAX_RUNTIME_EXECUTOR_OUTPUT_BYTES,
}),
@@ -1619,7 +1630,7 @@ export async function runCli(argv = process.argv.slice(2), {
}
return startFleet({
plan, controlPlane: control, adapters,
executor: (launch) => spawn(launch.command, launch.args, {
executor: (launch) => executeRuntimeLaunch(spawn, launch, {
cwd: launch.cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'],
timeout: 300_000, maxBuffer: MAX_RUNTIME_EXECUTOR_OUTPUT_BYTES, killSignal: 'SIGTERM',
}),