From 039b97df3650d4f439c6831d94da047a8a6b4c3c Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 22 Jul 2026 10:50:45 -0700 Subject: [PATCH] fix(facts): route exit codes through setCliExitVerdict The cli-exit-verdict-pin guard requires every exit-code write in src/ to go through setCliExitVerdict (raw process.exitCode assignments get zeroed by the owned-verdict read on PGLite). Replace the two raw assignments in the new facts command. Co-Authored-By: Claude Fable 5 --- src/commands/facts.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/facts.ts b/src/commands/facts.ts index 616a2b6e8..87d96a7ae 100644 --- a/src/commands/facts.ts +++ b/src/commands/facts.ts @@ -11,6 +11,7 @@ * any time the backlog reappears. */ import type { BrainEngine } from '../core/engine.ts'; +import { setCliExitVerdict } from '../core/cli-force-exit.ts'; import { phaseBFenceFacts } from './migrations/v0_32_2.ts'; function printHelp(): void { @@ -34,7 +35,7 @@ export async function runFactsCommand(engine: BrainEngine, args: string[]): Prom if (sub !== 'fence-backfill') { process.stderr.write(`Unknown facts subcommand: ${sub}\n`); printHelp(); - process.exitCode = 1; + setCliExitVerdict(1); return; } @@ -43,5 +44,5 @@ export async function runFactsCommand(engine: BrainEngine, args: string[]): Prom process.stderr.write( `fence-backfill: ${result.status}${result.detail ? ` — ${result.detail}` : ''}\n`, ); - if (result.status === 'failed') process.exitCode = 1; + if (result.status === 'failed') setCliExitVerdict(1); }