Skip to content

Commit fed9c9e

Browse files
committed
fix(pm): keep the production spawn naming TOOL, so the gate keeps its RUN edge
The first draft routed both the real and the substituted child through one `resolve(ROOT, child)` call. The tool's derivation follows that spawn as a RUN edge to inherit TOOL's watch hints — the workflow tree among them — and its run scan refuses a rebound program component, so the edge vanished: five cases of the tool's own 1730-case battery red, and a workflows-only surface stopped deriving `check:pm-dispatch-gates` at all (measured 1 -> 0 on .github/workflows/board-snapshot.yml). The substituted child now gets its own call and the production one is the expression that was there before. Claude-Session: https://claude.ai/code/session_01HZfg2AwVX191qCizp88gQr Co-authored-by: Claude <noreply@anthropic.com>
1 parent 272be13 commit fed9c9e

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

scripts/pm/check-dispatch-gates.mjs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,23 @@ if (child !== TOOL) {
316316
}
317317

318318
const started = Date.now();
319-
const result = spawnSync(process.execPath, [resolve(ROOT, child), '--self-test'], { stdio: 'inherit' });
319+
/**
320+
* ⛔ The production spawn names TOOL DIRECTLY, and it has to keep doing so.
321+
*
322+
* The tool's derivation follows this call as a RUN edge, which is how this gate
323+
* inherits TOOL's own watch hints — the workflow tree among them — so that a
324+
* card touching only `.github/workflows` derives this gate at all. That scan
325+
* refuses a REBOUND program component on purpose, so collapsing both spawns
326+
* into one `resolve(ROOT, child)` silently cuts the edge. Measured when this
327+
* file's self-test was first written that way: five cases of the tool's own
328+
* battery red, and a workflows-only derivation stopped naming this gate
329+
* entirely. The substituted child therefore gets its OWN call, and the
330+
* production one is byte-for-byte the expression that was here before.
331+
*/
332+
const result =
333+
childAt < 0
334+
? spawnSync(process.execPath, [join(ROOT, TOOL), '--self-test'], { stdio: 'inherit' })
335+
: spawnSync(process.execPath, [resolve(ROOT, child), '--self-test'], { stdio: 'inherit' });
320336
/**
321337
* What the battery cost on THIS box, printed rather than frozen anywhere.
322338
*

0 commit comments

Comments
 (0)