|
| 1 | +# BUILD PR — Promotion Gate Contract And Public Readers |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Make the promotion-gate read boundary explicit and remove local gate-state reading assumptions by routing promotion-gate reads through the shared public reader path. |
| 5 | + |
| 6 | +## Exact Target Files |
| 7 | +- `src/advanced/promotion/createPromotionGate.js` |
| 8 | +- `src/shared/state/getState.js` |
| 9 | +- `src/shared/state/createPromotionStateSnapshot.js` |
| 10 | + |
| 11 | +## Why These Files |
| 12 | +Current repo evidence shows: |
| 13 | +- `src/advanced/promotion/createPromotionGate.js` contains a local `getState()` function |
| 14 | +- `src/shared/state/getState.js` is the shared state-reader file |
| 15 | +- `src/shared/state/createPromotionStateSnapshot.js` is the existing shared promotion snapshot file |
| 16 | + |
| 17 | +This PR is limited to those exact files only. |
| 18 | + |
| 19 | +## Required Code Changes |
| 20 | +1. In `src/shared/state/getState.js` |
| 21 | + - confirm/export the public reader contract needed by the promotion gate |
| 22 | + - make the reader shape explicit enough that promotion-gate code does not need a private/local `getState()` helper for lane-critical reads |
| 23 | + |
| 24 | +2. In `src/shared/state/createPromotionStateSnapshot.js` |
| 25 | + - align the shared promotion snapshot contract with the public reader shape if required by the exact current implementation |
| 26 | + - keep this limited to promotion-gate contract/read compatibility only |
| 27 | + |
| 28 | +3. In `src/advanced/promotion/createPromotionGate.js` |
| 29 | + - remove or reduce the local gate-specific `getState()` implementation where the shared public reader can be used instead |
| 30 | + - route promotion-gate state reads through the shared public reader path |
| 31 | + - preserve current promotion-gate behavior; this PR is contract/read-boundary work, not a replay/timeline rewrite |
| 32 | + |
| 33 | +## Hard Constraints |
| 34 | +- exact files only |
| 35 | +- do not modify replay files |
| 36 | +- do not modify timeline files |
| 37 | +- do not modify sample files |
| 38 | +- do not modify game files |
| 39 | +- do not widen into debug UI work |
| 40 | +- do not rename unrelated exports |
| 41 | +- do not perform general state cleanup |
| 42 | +- do not change promotion behavior semantics beyond replacing local/private read assumptions with the shared contract path |
| 43 | + |
| 44 | +## Validation Steps |
| 45 | +- confirm only the exact target files changed |
| 46 | +- confirm `createPromotionGate.js` no longer depends on a lane-critical private/local read path when the shared public reader can be used |
| 47 | +- confirm imports/exports resolve |
| 48 | +- confirm no unrelated refactor or formatting-only churn was introduced |
| 49 | +- confirm the promotion gate still builds/runs with the same behavior surface |
| 50 | + |
| 51 | +## Acceptance Criteria |
| 52 | +- promotion-gate read boundary is explicit |
| 53 | +- shared public reader path is used for promotion-gate state reads where applicable |
| 54 | +- no unnecessary local gate-only `getState()` reader remains for the contract-covered path |
| 55 | +- promotion snapshot/read contract remains coherent |
| 56 | +- no replay/timeline/sample/game scope expansion occurred |
0 commit comments