Files
RingBRP/tools/check-firstblood.mjs
T
slaguru666andClaude Opus 5 ce1103ec0d R-267: a guarded home for the first disabling blow
Another session verified R-266's measurement, agreed the frame was better than
its own, and declined to publish it because the figure had no guarded lineage a
doubter could re-derive. It was right, and the fix costs 0.7s of build time --
which is the number I should have checked before calling it a reading tool and
not a guard.

first-blood.mjs gains --update/--check and is now both the reader and the
measurement of record; check-firstblood.mjs is a thin wrapper over it, the same
shape as check-bestiary. Compares the recorded figures exactly, then asserts only
what a page would claim: first blood lands within 5 points of even in the cut,
and its swing exceeds the six-a-side line's by more than both noises.

Recording it moved the swing from the scratch run's 43 to 40 against a
seed-to-seed spread of 2.1 -- high by more than its own noise, which is the
argument in miniature. update-readme's COUNT_WORD could not reach thirteen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 09:42:31 +01:00

29 lines
1.5 KiB
JavaScript

/**
* The four-player cut turns on its first disabling blow, and it must keep doing so.
*
* R-266 found the mechanism behind CLEAN GROUND's bimodal outcome: both sides disable on
* one good hit, so whoever lands the first one thins the return fire and makes the next
* likelier. It was measured in a scratch harness, and another session declined to put it
* in the scenario for that reason — correctly, and that refusal is why this guard exists.
*
* Thin on purpose. The measurement lives in first-blood.mjs, which is also the tool a
* reader runs; re-deriving it here would be the duplication check-rules exists to forbid,
* and would let the page and the guard drift apart again.
*/
import { spawnSync } from "node:child_process";
const r = spawnSync(process.execPath, [new URL("first-blood.mjs", import.meta.url).pathname, "--check"],
{ encoding: "utf8" });
if (r.status !== 0) {
process.stdout.write(r.stdout ?? "");
process.stderr.write(r.stderr ?? "");
console.error("check-firstblood: FAILED — the fight no longer turns the way it was recorded. "
+ "Read `node tools/first-blood.mjs` before re-recording: a changed swing is a changed scenario.");
process.exit(1);
}
// update-readme reads the line beginning with this file's own name.
const m = r.stdout.match(/worth ([\d.]+) points of wipe rate in the cut, ([\d.]+) in the line/) ?? [];
console.log(`check-firstblood: OK — the first disabling blow is worth ${m[1] ?? "?"} points of wipe rate `
+ `in the four-player cut, ${m[2] ?? "?"} in the six-a-side line`);