Skip to content

Commit 49667a9

Browse files
author
DavidQ
committed
BUILD PR: standardize shared helper imports to approved relative path forms in advanced and network_sample_c slices.
1 parent 8978e21 commit 49667a9

10 files changed

Lines changed: 134 additions & 18 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
MODEL: GPT-5.3-codex
22
REASONING: high
33
COMMAND:
4-
Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_17_ENFORCEMENT_GUARD.md exactly.
5-
Edit only these repo files:
6-
- tools/dev/checkSharedExtractionGuard.mjs (new file)
7-
- package.json (only if it already exists and already has a scripts section; add only the one script if missing)
4+
Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_18_RELATIVE_PATH_STANDARDIZATION.md exactly.
5+
Edit only these files:
6+
- src/advanced/promotion/createPromotionGate.js
7+
- src/advanced/state/createWorldGameStateSystem.js
8+
- games/network_sample_c/game/ReconciliationLayerAdapter.js
9+
- games/network_sample_c/game/StateTimelineBuffer.js
10+
Fail fast if any required shared target file is missing.
811
Do not expand scope.
9-
Package the delta output to <project folder>/tmp/BUILD_PR_SHARED_EXTRACTION_17_ENFORCEMENT_GUARD_delta.zip
12+
Package the delta output to <project folder>/tmp/BUILD_PR_SHARED_EXTRACTION_18_RELATIVE_PATH_STANDARDIZATION_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD PR: add shared extraction enforcement guard and block alias usage/regression.
1+
BUILD PR: standardize shared helper imports to approved relative path forms in advanced and network_sample_c slices.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Built an enforcement guard step that protects the shared-extraction work, blocks reintroduced local helpers, blocks fragile relative shared imports, and blocks further @shared alias usage.
1+
Built the next executable step to remove alias/disallowed shared import variants and standardize the approved relative shared import paths in the current normalized slices only.

docs/dev/reports/file_tree.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
docs/
22
pr/
3-
BUILD_PR_SHARED_EXTRACTION_17_ENFORCEMENT_GUARD.md
3+
BUILD_PR_SHARED_EXTRACTION_18_RELATIVE_PATH_STANDARDIZATION.md
44
dev/
55
codex_commands.md
66
commit_comment.txt

docs/dev/reports/validation_checklist.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ SESSION VALIDATION GATE
22
- Bundle type: BUILD
33
- One PR purpose only: yes
44
- Exact target files listed: yes
5-
- Exact guard behavior listed: yes
6-
- Alias usage explicitly treated as disallowed: yes
5+
- Exact approved import targets listed: yes
6+
- No config changes allowed: yes
7+
- No alias usage allowed after BUILD: yes
78
- Scope minimized: yes
89
- ZIP repo-structured and execution-ready: yes
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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

games/network_sample_c/game/ReconciliationLayerAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ David Quesenberry
55
ReconciliationLayerAdapter.js
66
*/
77
import StateTimelineBuffer from "./StateTimelineBuffer.js";
8-
import { asFiniteNumber, asPositiveInteger } from "@shared/utils/numberUtils.js";
8+
import { asFiniteNumber, asPositiveInteger } from "../../../src/shared/utils/numberUtils.js";
99

1010
const APPROVED_PUBLIC_EVENT_TYPES = new Set([
1111
"worldState.transition.applied",

games/network_sample_c/game/StateTimelineBuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ David Quesenberry
55
StateTimelineBuffer.js
66
*/
77

8-
import { asPositiveInteger } from "@shared/utils/numberUtils.js";
8+
import { asPositiveInteger } from "../../../src/shared/utils/numberUtils.js";
99

1010
function normalizeFrameId(frameId) {
1111
const numeric = Number(frameId);

src/advanced/promotion/createPromotionGate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ David Quesenberry
55
createPromotionGate.js
66
*/
77

8-
import { asFiniteNumber, asPositiveInteger } from '@shared/utils/numberUtils.js';
9-
import { isPlainObject } from '@shared/utils/objectUtils.js';
10-
import { createPromotionStateSnapshot } from '@shared/state/createPromotionStateSnapshot.js';
8+
import { asFiniteNumber, asPositiveInteger } from '../../shared/utils/numberUtils.js';
9+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
10+
import { createPromotionStateSnapshot } from '../../shared/state/createPromotionStateSnapshot.js';
1111

1212
function normalizeCriteriaMap(input, requiredCriteria = []) {
1313
const normalized = {};

src/advanced/state/createWorldGameStateSystem.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import {
1818
createTransitionAppliedEvent,
1919
createTransitionRejectedEvent
2020
} from './events.js';
21-
import { createPromotionStateSnapshot } from '@shared/state/createPromotionStateSnapshot.js';
22-
import { asFiniteNumber, asPositiveInteger } from '@shared/utils/numberUtils.js';
23-
import { isPlainObject } from '@shared/utils/objectUtils.js';
21+
import { createPromotionStateSnapshot } from '../../shared/state/createPromotionStateSnapshot.js';
22+
import { asFiniteNumber, asPositiveInteger } from '../../shared/utils/numberUtils.js';
23+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
2424
import {
2525
cloneDeep,
2626
createReadonlyClone,

0 commit comments

Comments
 (0)