From 95399aec8a6d0081b30d02a1c0bfd6a09680cec1 Mon Sep 17 00:00:00 2001 From: araharah-executor Date: Sun, 25 Oct 2026 22:35:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(08):=20WR-02=20=E2=80=94=20CPU3=20demands?= =?UTF-8?q?=20the=20ladder=20only=20when=20the=20gitignored=20binary=20is?= =?UTF-8?q?=20present?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the graph binary is NOT committed: routing/data/.gitignore ignores *.bin (git check-ignore verified) — forks rebuild their own (docs/ROAD-GRAPH.md), so the old assertion message was factually false - CPU3 now mirrors CPU4's law: absent binary -> honest SKIP (not a failure); the run-the-ladder assertions fire only when it is present - reason text aligned with reality: 'gitignored fork-rebuildable artifact' --- scripts/test/budget-audit.test.mjs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/test/budget-audit.test.mjs b/scripts/test/budget-audit.test.mjs index 3bfbcb8..2513e51 100644 --- a/scripts/test/budget-audit.test.mjs +++ b/scripts/test/budget-audit.test.mjs @@ -101,10 +101,20 @@ await test("CPU2 the ladder is RE-RUN (the gate references measure-route-cpu) an assert.ok(src.includes("P95_BUDGET_MS = 8"), "the gate must carry the 8 ms product budget constant"); }); -await test("CPU3 on the current tree the ladder runs, the measured p95 is printed against the 8 ms budget and the 10 ms free ceiling, and the child's own GATE line is carried", async () => { +await test("CPU3 when the local graph binary is present the ladder runs, the measured p95 is printed against the 8 ms budget and the 10 ms free ceiling, and the child's own GATE line is carried", async () => { const m = await import(gatesUrl); + // The binary is a GITIGNORED FORK-REBUILDABLE ARTIFACT, not a committed + // file (routing/data/.gitignore ignores *.bin; docs/ROAD-GRAPH.md — forks + // build + upload their own). On a fresh fork its absence is the legal + // notRun class — CPU4's law — so the real-graph leg SKIPs honestly and is + // NEVER a failure; the ladder is demanded only when the binary is present. + const graphPresent = existsSync(path.join(ROOT, "routing", "data", "kl-roadgraph.v1.bin")); + if (!graphPresent) { + console.log(" SKIP — CPU3 needs the gitignored local binary (build it first: node routing/scripts/build-road-graph.mjs); not a failure"); + return; + } const r = await m.runCpuLadderGate(); - assert.equal(r.notRun, undefined, "the graph binary is committed — the ladder must run, not skip"); + assert.equal(r.notRun, undefined, "the binary is present — the ladder must run, not skip"); assert.equal(r.pass, true, `the measured state must sit inside the documented accepted c3 band: ${r.evidence}`); assert.match(r.evidence, /p95 \d+(\.\d+)? ms/, "the measured p95 must be printed"); assert.match(r.evidence, /8 ms/, "the 8 ms product budget must be printed beside the measurement");