utils/.github/workflows
Krzysztof kuhy Rudnicki 41f014e7a7
Some checks failed
palette drift / palette (push) Waiting to run
ts_core tests / test (push) Has been cancelled
ts_core: a framework-free TypeScript utility package
`Clock` and a seeded mulberry32 RNG had each been reimplemented across the
game and web repos -- Clock twice (konbini-67, iron-and-anvil, doc comments
near-verbatim), the RNG four times. None of it is UI, so no existing shared
package owned it: `web_ui` ships `tokens.css` and React components, and a
game importing a UI package to get a seeded RNG is exactly the coupling
that makes people vendor their own copy instead.

The RNG deliberately exports **two** interfaces rather than reconciling
them into one. konbini-67 threaded mutable state through free functions;
sims3-clone and europe-county-map returned an object of closures. The
sequence is the contract here -- these repos have seeded tests and "same
seed -> identical world" guarantees, so changing how many times a helper
advances the generator silently re-rolls every saved world. A shared
package that did that would be worse than the duplication it replaces. The
core is shared, so both interfaces yield the same float sequence; that is
asserted, not assumed.

`rng.test.ts` pins the first five floats for seed 12345, captured from the
pre-extraction konbini-67 implementation rather than from this one -- a
golden test generated from the code under test only asserts that the code
matches itself. It earned its place immediately: the first constants I
wrote came from a truncated `toFixed(9)` probe and the test failed, which
is precisely the class of silent precision drift it exists to catch.

`hotline3d` is not a consumer and should not become one. Its generator uses
`%` and `Math.trunc` where mulberry32 uses `>>>`/`>>`; measured, it emits a
different sequence, so adopting this package would change its output.

29 tests, 100% branch/function/line/statement coverage, type-aware eslint,
and a committed dist/ with a CI freshness check -- the same bar web_ui
holds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U4Rj3s7K2qzrLNgJqqPhno
2026-08-15 15:42:41 +02:00
..
crdt-sync-precommit.yml Root scaffold: README, LICENSE, per-subdirectory CI for utils monorepo 2026-07-10 13:02:20 +02:00
crdt-sync-tests.yml Root scaffold: README, LICENSE, per-subdirectory CI for utils monorepo 2026-07-10 13:02:20 +02:00
design-system-tests.yml Wire design_system into CI, and drop EmptyState's speculative action slot 2026-08-14 23:08:59 +02:00
gatelock-precommit.yml Let the gatelock workflows trigger on their own files 2026-08-03 18:36:47 +02:00
gatelock-tests.yml Let the gatelock workflows trigger on their own files 2026-08-03 18:36:47 +02:00
palette-drift.yml unified-design-system: check one palette across all four token sources 2026-08-15 15:27:17 +02:00
sync-settings-ui-tests.yml Add sync_settings_ui: shared Firebase-only sync settings screen 2026-08-12 23:10:17 +02:00
ts-core-tests.yml ts_core: a framework-free TypeScript utility package 2026-08-15 15:42:41 +02:00
web-ui-tests.yml web_ui: add the CI + pre-commit gate, and make pnpm lint actually run 2026-08-15 15:08:18 +02:00