|
Determinism is load-bearing in Hollowdark (ARCHITECTURE.md §26).
Same seed plus same choices must produce bit-identical outcomes —
otherwise bug reproduction, lazy NPC backfill, and save integrity
all break. Every random call has to route through the seeded PRNG
in rng/.
Three restricted-syntax rules, scoped to gameplay directories via
an explicit files glob:
- Math.random() — forbidden
- crypto.getRandomValues() — forbidden for gameplay
- Date.now() — forbidden; use GameTime from time/
Each rule carries a specific error message pointing at the
architectural rationale. The restrictions lift inside tests/,
scripts/, and *.{test,spec}.ts where non-deterministic helpers
are fine.
@typescript-eslint/no-explicit-any set to error across the board.
|