// lib/util/command-env.mjs // The environment a check command runs in. The command's exit code must be its // own: under `node --test` a child inherits NODE_TEST_CONTEXT, and a nested // `node --test` then reports to that parent and exits 0 whatever its tests did // (measured 2026-10-06: a red start point read as green). So the variable // never reaches the command. Used by red-proof.mjs, regression-check.mjs and // the criteria runner's default exec. export function commandEnv(env = process.env) { const { NODE_TEST_CONTEXT, ...rest } = env; return rest; }