# Prototype: Rules and Authoritative RNG Verification This directory contains six executable contract tests against the shared AI-GM vertical-slice engine. It does not contain a duplicate rules engine, event log, state model or rules profile. Authoritative dependencies: - [`../../2026-07-25-ai-gm-vertical-slice/prototype/src/fixtures.ts`](../../2026-07-25-ai-gm-vertical-slice/prototype/src/fixtures.ts) provides `loadFixtureBundle()`; - [`../../2026-07-25-ai-gm-vertical-slice/prototype/fixtures/game-contract.json`](../../2026-07-25-ai-gm-vertical-slice/prototype/fixtures/game-contract.json) is the single attributed/original Game Contract and rules-profile fixture; - shared `contracts`, `engine`, `event-log`, `hash` and `state` modules are imported directly by `rules-engine.verification.test.ts`. The former local `original-genre-neutral-profile.ts` duplicate was deleted so the shared fixture remains authoritative. Run from the repository root on Node.js `v24.14.0`: ```bash node --test RnD/technical/2026-07-25-rules-engine-authoritative-rng/prototype/rules-engine.verification.test.ts ``` Run from the study directory: ```bash node --test prototype/rules-engine.verification.test.ts ``` The recorded result is `6` tests, `6` pass, `0` fail, `0` skipped and `0` TODO: - AC-01 checks complete roll calculation plus stored event reference for both registered roll-producing command kinds; - AC-02 rejects fabricated client/LLM roll fields and accepts only server RNG; - AC-03 stops every labelled invalid command before RNG/event/state work; - AC-04 returns the original event for a duplicate without a second effect; - AC-05 rejects a stale expected state version before mutation; - AC-06 verifies the shared versioned profile’s official attribution and original genre-neutral executable fields. Official primary source for the recorded inspiration/license evidence: [Questing Beast — Knave](https://questingbeast.itch.io/knave). Run the root compiler separately: ```bash npm run typecheck ``` The final compiler run exits successfully. The first behavior run exposed a non-erasable TypeScript constructor parameter property; the test now uses an ordinary field plus constructor assignment and runs under Node’s built-in strip mode without an experimental flag. No network service, environment variable or study-local dependency install is required.