Parent
#1
What to build
The gold-standard cross-environment determinism test (PRD: "the gold-standard test"). After this slice, CI runs both the Node CLI demo and the browser demo from the same shared game-data, same seed, same input transcript — and byte-compares their per-tick snapshots. CI fails loudly on the first divergent tick with the divergence highlighted.
Demoable outcome: CI runs the test; the test runs Node demo → snapshots node/tick-0000.json … tick-NNNN.json; runs browser demo → snapshots browser/tick-0000.json … tick-NNNN.json; byte-compares each pair; passes. If a determinism breaker is introduced (e.g. a Plugin author starts using Math.random() or transcendentals in tick code), the test fails at the first divergent tick with a unified diff and the offending tick number printed.
End-to-end behaviour the slice must produce:
- A CI test harness (single test file, implementation team's choice of runner) that:
- Invokes the Node CLI demo (Slice 16) and collects per-tick snapshots into one directory.
- Invokes the browser demo (Slice 17) in a headless browser and collects per-tick snapshots into a parallel directory.
- Byte-compares each
tick-NNNN.json pair in numeric order.
- On the first mismatch: prints
(first divergent tick: N), a unified diff of the two JSON snapshots, and fails the test.
- Asserts both runs produced the same number of ticks before either completion or divergence.
- A "negative test" fixture that deliberately introduces a determinism breaker (e.g. a fake System using
Math.random via a back-channel that bypasses the dev-mode Proxy) and verifies the harness fails it loudly — i.e. proves the harness can catch real breakers.
- CI wiring (GitHub Actions, or whatever the team picks — note any setup in the README outline for Slice 20).
Acceptance criteria
Blocked by
Parent
#1
What to build
The gold-standard cross-environment determinism test (PRD: "the gold-standard test"). After this slice, CI runs both the Node CLI demo and the browser demo from the same shared game-data, same seed, same input transcript — and byte-compares their per-tick snapshots. CI fails loudly on the first divergent tick with the divergence highlighted.
Demoable outcome: CI runs the test; the test runs Node demo → snapshots
node/tick-0000.json … tick-NNNN.json; runs browser demo → snapshotsbrowser/tick-0000.json … tick-NNNN.json; byte-compares each pair; passes. If a determinism breaker is introduced (e.g. a Plugin author starts usingMath.random()or transcendentals in tick code), the test fails at the first divergent tick with a unified diff and the offending tick number printed.End-to-end behaviour the slice must produce:
tick-NNNN.jsonpair in numeric order.(first divergent tick: N), a unified diff of the two JSON snapshots, and fails the test.Math.randomvia a back-channel that bypasses the dev-mode Proxy) and verifies the harness fails it loudly — i.e. proves the harness can catch real breakers.Acceptance criteria
tick-NNNN.jsonpair; reports the first divergent tick number on failure.Blocked by