From ba640b2fb5a023f905ee4bc8b0ab7258d4129c38 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 11 Jun 2026 20:08:25 -0700 Subject: [PATCH] test: harden question-preference-hook harness against ambient Conductor env runHook copied all of process.env into the hook subprocess, so running the suite inside Conductor (CONDUCTOR_WORKSPACE_PATH/PORT set) would leak those markers. Strip them so the existing cases deterministically characterize NON-Conductor behavior before the Conductor branch lands. Baseline: 15 pass. Co-Authored-By: Claude Fable 5 --- test/question-preference-hook.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/question-preference-hook.test.ts b/test/question-preference-hook.test.ts index 6b06d22f4..47342c19a 100644 --- a/test/question-preference-hook.test.ts +++ b/test/question-preference-hook.test.ts @@ -72,6 +72,12 @@ function runHook(stdin: object, cwd?: string): { } env.GSTACK_STATE_ROOT = stateRoot; delete env.GSTACK_HOME; + // Strip ambient Conductor markers so these cases characterize NON-Conductor + // behavior deterministically — otherwise running the suite inside Conductor + // (CONDUCTOR_WORKSPACE_PATH/PORT set) would flip every defer into the + // [conductor] prose deny. The Conductor cases below opt back in explicitly. + delete env.CONDUCTOR_WORKSPACE_PATH; + delete env.CONDUCTOR_PORT; env.GSTACK_QUESTION_LOG_NO_DERIVE = '1'; const res = spawnSync(HOOK, [], { env,