|
| 1 | +# BUILD_PR_SHARED_EXTRACTION_11_CONSUMER_EDGE_VALIDATION |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Validate the immediate consumer edges for the helpers extracted into shared utilities and fix only direct import-path breakage if present. |
| 5 | + |
| 6 | +## Single PR Purpose |
| 7 | +Check and, if necessary, repair direct consumer imports for these shared helpers only: |
| 8 | + |
| 9 | +- `asFiniteNumber` |
| 10 | +- `asPositiveInteger` |
| 11 | +- `isPlainObject` |
| 12 | +- `createPromotionStateSnapshot` |
| 13 | + |
| 14 | +This BUILD is a narrow consumer-edge validation pass, not a refactor. |
| 15 | + |
| 16 | +## Exact Files Allowed |
| 17 | +Edit only these files if needed: |
| 18 | + |
| 19 | +1. `src/advanced/promotion/createPromotionGate.js` |
| 20 | +2. `src/advanced/state/createWorldGameStateSystem.js` |
| 21 | +3. `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 22 | +4. `src/shared/utils/numberUtils.js` |
| 23 | +5. `src/shared/utils/objectUtils.js` |
| 24 | +6. `src/shared/state/createPromotionStateSnapshot.js` |
| 25 | + |
| 26 | +Do not edit any other file. |
| 27 | + |
| 28 | +## Allowed Validation Scope |
| 29 | +Only validate the direct import/export edge among the 6 exact files above. |
| 30 | + |
| 31 | +That means: |
| 32 | +- confirm the 3 consumer files import the expected shared helpers correctly |
| 33 | +- confirm the 3 shared files export the expected helpers correctly |
| 34 | + |
| 35 | +Do not inspect, modify, or normalize unrelated consumers. |
| 36 | + |
| 37 | +## Exact Expected Consumer Imports |
| 38 | + |
| 39 | +### 1) `src/advanced/promotion/createPromotionGate.js` |
| 40 | +Expected shared helper imports: |
| 41 | +```js |
| 42 | +import { asFiniteNumber } from '../../shared/utils/numberUtils.js'; |
| 43 | +import { asPositiveInteger } from '../../shared/utils/numberUtils.js'; |
| 44 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 45 | +import { createPromotionStateSnapshot } from '../shared/state/createPromotionStateSnapshot.js'; |
| 46 | +``` |
| 47 | + |
| 48 | +Rules: |
| 49 | +- if imports are already correct, leave them unchanged |
| 50 | +- if duplicate imports exist for any of the listed helpers, collapse to one correct import |
| 51 | +- if one combined import from the same file is possible without changing behavior/style, prefer the minimum-edit option |
| 52 | +- do not touch unrelated imports |
| 53 | + |
| 54 | +### 2) `src/advanced/state/createWorldGameStateSystem.js` |
| 55 | +Expected shared helper imports: |
| 56 | +```js |
| 57 | +import { asFiniteNumber } from '../../shared/utils/numberUtils.js'; |
| 58 | +import { asPositiveInteger } from '../../shared/utils/numberUtils.js'; |
| 59 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 60 | +import { createPromotionStateSnapshot } from '../../shared/state/createPromotionStateSnapshot.js'; |
| 61 | +``` |
| 62 | + |
| 63 | +Rules: |
| 64 | +- if imports are already correct, leave them unchanged |
| 65 | +- if duplicate imports exist for any of the listed helpers, collapse to one correct import |
| 66 | +- if one combined import from the same file is possible without changing behavior/style, prefer the minimum-edit option |
| 67 | +- do not touch unrelated imports |
| 68 | + |
| 69 | +### 3) `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 70 | +Expected shared helper import: |
| 71 | +```js |
| 72 | +import { asFiniteNumber } from '../../../src/shared/utils/numberUtils.js'; |
| 73 | +``` |
| 74 | + |
| 75 | +Rules: |
| 76 | +- if import is already correct, leave it unchanged |
| 77 | +- do not add any other helper import to this file |
| 78 | +- do not touch unrelated imports |
| 79 | + |
| 80 | +## Exact Expected Shared Exports |
| 81 | + |
| 82 | +### 4) `src/shared/utils/numberUtils.js` |
| 83 | +Must export exactly these helpers for this PR's validation scope: |
| 84 | +- `asFiniteNumber` |
| 85 | +- `asPositiveInteger` |
| 86 | + |
| 87 | +Allowed edits: |
| 88 | +- minimum export-fix only if one of those helpers is present but not exported correctly |
| 89 | +- if exports are already correct, leave unchanged |
| 90 | + |
| 91 | +Not allowed: |
| 92 | +- no behavior changes |
| 93 | +- no new helper additions |
| 94 | +- no renaming |
| 95 | + |
| 96 | +### 5) `src/shared/utils/objectUtils.js` |
| 97 | +Must export: |
| 98 | +- `isPlainObject` |
| 99 | + |
| 100 | +Allowed edits: |
| 101 | +- minimum export-fix only if present but not exported correctly |
| 102 | +- if already correct, leave unchanged |
| 103 | + |
| 104 | +Not allowed: |
| 105 | +- no behavior changes |
| 106 | +- no new helper additions |
| 107 | +- no renaming |
| 108 | + |
| 109 | +### 6) `src/shared/state/createPromotionStateSnapshot.js` |
| 110 | +Must export: |
| 111 | +- `createPromotionStateSnapshot` |
| 112 | + |
| 113 | +Allowed edits: |
| 114 | +- minimum export-fix only if present but not exported correctly |
| 115 | +- if already correct, leave unchanged |
| 116 | + |
| 117 | +Not allowed: |
| 118 | +- no behavior changes |
| 119 | +- no renaming |
| 120 | +- no file move |
| 121 | + |
| 122 | +## Fail-Fast Rule |
| 123 | +If any of the 3 shared files do not exist: |
| 124 | +- stop |
| 125 | +- report blocker |
| 126 | +- make no changes |
| 127 | +- do not produce a delta ZIP |
| 128 | + |
| 129 | +If a required helper is missing entirely from a listed shared file: |
| 130 | +- stop |
| 131 | +- report blocker |
| 132 | +- make no changes |
| 133 | +- do not invent implementation in this PR |
| 134 | + |
| 135 | +## Hard Constraints |
| 136 | +- edit only the 6 listed files |
| 137 | +- fix import/export edge issues only |
| 138 | +- no logic changes |
| 139 | +- no file creation |
| 140 | +- no repo-wide scan |
| 141 | +- no broader consumer normalization |
| 142 | +- no engine or sample refactor |
| 143 | +- keep one PR purpose only |
| 144 | + |
| 145 | +## Validation Checklist |
| 146 | +1. Confirm no more than the 6 listed files changed |
| 147 | +2. Confirm `src/shared/utils/numberUtils.js` exports: |
| 148 | + - `asFiniteNumber` |
| 149 | + - `asPositiveInteger` |
| 150 | +3. Confirm `src/shared/utils/objectUtils.js` exports: |
| 151 | + - `isPlainObject` |
| 152 | +4. Confirm `src/shared/state/createPromotionStateSnapshot.js` exports: |
| 153 | + - `createPromotionStateSnapshot` |
| 154 | +5. Confirm the 3 consumer files import the expected helpers from the exact paths listed above |
| 155 | +6. Confirm no helper behavior changed |
| 156 | +7. Confirm no unrelated consumers were touched |
| 157 | + |
| 158 | +## Non-Goals |
| 159 | +- no repo-wide consumer audit |
| 160 | +- no alias path migration |
| 161 | +- no formatting cleanup |
| 162 | +- no lint-only edits |
| 163 | +- no helper redesign |
| 164 | +- no new shared helper creation |
0 commit comments