|
| 1 | +# BUILD_PR_SHARED_EXTRACTION_18_RELATIVE_PATH_STANDARDIZATION |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Standardize shared-helper import paths to the approved relative-path form and remove any remaining disallowed variants inside the currently normalized slices only. |
| 5 | + |
| 6 | +## Single PR Purpose |
| 7 | +Normalize shared imports ONLY in these files: |
| 8 | + |
| 9 | +1. `src/advanced/promotion/createPromotionGate.js` |
| 10 | +2. `src/advanced/state/createWorldGameStateSystem.js` |
| 11 | +3. `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 12 | +4. `games/network_sample_c/game/StateTimelineBuffer.js` |
| 13 | + |
| 14 | +This BUILD exists to align current imports with the no-alias / no-fragile-shared-import policy now enforced by the guard. |
| 15 | + |
| 16 | +## Exact Files Allowed |
| 17 | +Edit only these 4 files. |
| 18 | + |
| 19 | +Do not edit any other file. |
| 20 | + |
| 21 | +## Approved Relative Path Standard |
| 22 | + |
| 23 | +### Advanced layer |
| 24 | +For files under `src/advanced/...`, shared imports must use: |
| 25 | + |
| 26 | +```js |
| 27 | +../../shared/ |
| 28 | +``` |
| 29 | + |
| 30 | +Approved exact target forms for: |
| 31 | +#### `src/advanced/promotion/createPromotionGate.js` |
| 32 | +```js |
| 33 | +import { asFiniteNumber, asPositiveInteger } from '../../shared/utils/numberUtils.js'; |
| 34 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 35 | +import { createPromotionStateSnapshot } from '../../shared/state/createPromotionStateSnapshot.js'; |
| 36 | +``` |
| 37 | + |
| 38 | +#### `src/advanced/state/createWorldGameStateSystem.js` |
| 39 | +```js |
| 40 | +import { asFiniteNumber, asPositiveInteger } from '../../shared/utils/numberUtils.js'; |
| 41 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 42 | +import { createPromotionStateSnapshot } from '../../shared/state/createPromotionStateSnapshot.js'; |
| 43 | +``` |
| 44 | + |
| 45 | +### network_sample_c layer |
| 46 | +For files under `games/network_sample_c/game/...`, shared imports must use: |
| 47 | + |
| 48 | +```js |
| 49 | +../../../src/shared/ |
| 50 | +``` |
| 51 | + |
| 52 | +Approved exact target forms for: |
| 53 | +#### `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 54 | +```js |
| 55 | +import { asFiniteNumber, asPositiveInteger } from '../../../src/shared/utils/numberUtils.js'; |
| 56 | +import { isPlainObject } from '../../../src/shared/utils/objectUtils.js'; |
| 57 | +``` |
| 58 | + |
| 59 | +#### `games/network_sample_c/game/StateTimelineBuffer.js` |
| 60 | +```js |
| 61 | +import { asPositiveInteger } from '../../../src/shared/utils/numberUtils.js'; |
| 62 | +import { isPlainObject } from '../../../src/shared/utils/objectUtils.js'; |
| 63 | +``` |
| 64 | + |
| 65 | +## Exact Change Rules |
| 66 | +For each of the 4 files: |
| 67 | + |
| 68 | +- replace any `@shared/...` import with the approved relative path form above |
| 69 | +- replace any disallowed shared relative path variant with the approved form above |
| 70 | +- if multiple imports from the same approved module exist, minimum-edit consolidation is allowed |
| 71 | +- do not add helper imports that the file does not already use |
| 72 | +- do not remove helper imports that the file still uses |
| 73 | +- do not touch unrelated imports |
| 74 | +- do not change logic |
| 75 | + |
| 76 | +## Fail-Fast Gate |
| 77 | +Before editing, confirm these shared targets exist: |
| 78 | + |
| 79 | +- `src/shared/utils/numberUtils.js` |
| 80 | +- `src/shared/utils/objectUtils.js` |
| 81 | +- `src/shared/state/createPromotionStateSnapshot.js` |
| 82 | + |
| 83 | +If any is missing: |
| 84 | +- stop |
| 85 | +- report blocker |
| 86 | +- make no changes |
| 87 | +- do not create a delta ZIP |
| 88 | + |
| 89 | +## Hard Constraints |
| 90 | +- edit only the 4 listed files |
| 91 | +- no config changes |
| 92 | +- no guard changes |
| 93 | +- no engine changes |
| 94 | +- no broader repo-wide import pass |
| 95 | +- no alias usage after this BUILD |
| 96 | +- no removal of `.js` extensions |
| 97 | +- keep one PR purpose only |
| 98 | + |
| 99 | +## Validation Checklist |
| 100 | +1. Confirm only the 4 listed files changed |
| 101 | +2. Confirm no `@shared/` imports remain in the 4 listed files |
| 102 | +3. Confirm advanced files use only `../../shared/...` imports for shared helpers |
| 103 | +4. Confirm network_sample_c files use only `../../../src/shared/...` imports for shared helpers |
| 104 | +5. Confirm no unrelated imports changed |
| 105 | +6. Confirm no logic changed |
| 106 | + |
| 107 | +## Non-Goals |
| 108 | +- no repo-wide path cleanup |
| 109 | +- no changes to the guard script |
| 110 | +- no alias bootstrap cleanup outside these 4 files |
| 111 | +- no helper behavior changes |
| 112 | +- no import cleanup outside the approved shared helper imports listed above |
0 commit comments