Skip to content

Commit 57d1776

Browse files
author
DavidQ
committed
BUILD PR: import normalization with explicit file list and exact import replacements only.
1 parent 787c42d commit 57d1776

14 files changed

Lines changed: 262 additions & 16 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
No Codex command. PLAN only.
1+
MODEL: GPT-5.3-codex
2+
REASONING: high
3+
COMMAND:
4+
Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION_RETRY.md exactly.
5+
Edit only the 9 files listed in that BUILD doc.
6+
Do not expand scope.
7+
Package the delta output to <project folder>/tmp/BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION_RETRY_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PLAN PR: normalize helper imports to src/shared.
1+
BUILD PR: retry import normalization with explicit file list and exact import replacements only.

docs/dev/NEXT_COMMAND.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Next: BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION
1+
Next:
2+
If Codex reports clean execution, produce APPLY_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION_RETRY.
3+
If Codex stops, capture the exact blocker and narrow further without changing PR purpose.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
Defined import normalization plan.
1+
Replaced the prior non-executable import-normalization BUILD with an execution-grade retry.
2+
This retry resolves the fail-fast blocker by supplying:
3+
- one unambiguous BUILD target
4+
- exact file list
5+
- exact old->new import replacements
6+
- explicit non-goals for helpers with no identified import targets

docs/dev/reports/file_tree.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
docs/pr + docs/dev structure
1+
docs/
2+
pr/
3+
BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION_RETRY.md
4+
dev/
5+
codex_commands.md
6+
commit_comment.txt
7+
next_command.txt
8+
reports/
9+
change_summary.txt
10+
validation_checklist.txt
11+
file_tree.txt
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
- Imports point to src/shared
2-
- No relative helper imports
3-
- No duplicates
4-
- Build passes
1+
SESSION VALIDATION GATE
2+
- Bundle type: BUILD
3+
- One PR purpose only: yes
4+
- Exact target files listed: yes
5+
- Exact source->target import map listed: yes
6+
- Vague repo-wide scan language removed: yes
7+
- Scope minimized: yes
8+
- Start-of-day directories touched: no
9+
- Fake code claims avoided: yes
10+
- ZIP repo-structured and execution-ready: yes
11+
12+
BUILD-SPECIFIC CHECKS
13+
- Codex can execute without guessing: yes
14+
- Exact ambiguous prior BUILD replaced with one explicit target: yes
15+
- Only 9 files allowed: yes
16+
- Non-goals explicit: yes
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION
2+
3+
## Purpose
4+
Normalize all imports to use src/shared for extracted helpers.
5+
6+
## Scope
7+
- Update imports ONLY for helpers already moved:
8+
- asFiniteNumber
9+
- asPositiveInteger
10+
- isPlainObject
11+
- getState (shared variants only)
12+
13+
## Rules
14+
- DO NOT scan repo beyond listed files
15+
- DO NOT modify logic
16+
- DO NOT move files
17+
- DO NOT rename helpers
18+
19+
## Explicit Targets
20+
21+
### numberUtils
22+
Update imports in files that used:
23+
- asFiniteNumber
24+
- asPositiveInteger
25+
26+
TO:
27+
import { asFiniteNumber, asPositiveInteger } from "src/shared/utils/numberUtils.js";
28+
29+
### objectUtils
30+
Update imports in files that used:
31+
- isPlainObject
32+
33+
TO:
34+
import { isPlainObject } from "src/shared/utils/objectUtils.js";
35+
36+
### state/getState
37+
Update imports in files that used shared getState:
38+
39+
TO:
40+
import { getState } from "src/shared/state/getState.js";
41+
42+
## Required Actions
43+
1. Remove old relative imports
44+
2. Add src/shared imports
45+
3. Ensure no duplicate imports remain
46+
47+
## Acceptance
48+
- All imports reference src/shared
49+
- No relative helper imports remain
50+
- Build passes
51+
52+
## Non-Goals
53+
- No refactoring
54+
- No helper changes
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION_RETRY
2+
3+
## Purpose
4+
Normalize import usage for helpers already extracted to `src/shared`, using an explicit file list and exact import replacements only.
5+
6+
## Source Basis
7+
This BUILD is derived from the uploaded repo snapshot used in-session.
8+
This BUILD replaces the prior non-executable import-normalization BUILD.
9+
10+
## Single PR Purpose
11+
Normalize imports for:
12+
- `isPlainObject`
13+
- `asPositiveInteger`
14+
15+
This retry does **not** include:
16+
- `asFiniteNumber`
17+
- `getState`
18+
19+
Reason:
20+
No explicit import-update targets for those helpers were identified in the uploaded repo snapshot, so including them would require guessing.
21+
22+
## Hard Constraints
23+
- DO NOT scan the repo beyond the exact files listed below
24+
- DO NOT modify logic
25+
- DO NOT move files
26+
- DO NOT rename helpers
27+
- DO NOT expand scope to additional helpers or files
28+
- Keep one PR purpose only
29+
30+
## Exact File List + Exact Import Map
31+
32+
### 1) `src/advanced/state/events.js`
33+
Replace:
34+
```js
35+
import { cloneDeep, isPlainObject } from './utils.js';
36+
```
37+
38+
With:
39+
```js
40+
import { cloneDeep } from './utils.js';
41+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
42+
```
43+
44+
### 2) `src/advanced/state/initialState.js`
45+
Replace:
46+
```js
47+
import { isPlainObject, mergeDeep } from './utils.js';
48+
```
49+
50+
With:
51+
```js
52+
import { mergeDeep } from './utils.js';
53+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
54+
```
55+
56+
### 3) `src/advanced/state/transitions.js`
57+
Replace:
58+
```js
59+
import { isPlainObject } from './utils.js';
60+
```
61+
62+
With:
63+
```js
64+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
65+
```
66+
67+
### 4) `src/engine/debug/inspectors/host/debugInspectorHost.js`
68+
Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`.
69+
70+
Update to:
71+
- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block
72+
- add:
73+
```js
74+
import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js';
75+
```
76+
77+
### 5) `src/engine/debug/inspectors/registry/debugInspectorRegistry.js`
78+
Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`.
79+
80+
Update to:
81+
- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block
82+
- add:
83+
```js
84+
import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js';
85+
```
86+
87+
### 6) `src/engine/debug/inspectors/viewModels/entityInspectorViewModel.js`
88+
Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`.
89+
90+
Update to:
91+
- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block
92+
- add:
93+
```js
94+
import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js';
95+
```
96+
97+
### 7) `src/engine/debug/inspectors/viewModels/eventStreamInspectorViewModel.js`
98+
Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`.
99+
100+
Update to:
101+
- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block
102+
- add:
103+
```js
104+
import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js';
105+
```
106+
107+
### 8) `src/engine/debug/inspectors/viewModels/stateDiffInspectorViewModel.js`
108+
Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`.
109+
110+
Update to:
111+
- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block
112+
- add:
113+
```js
114+
import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js';
115+
```
116+
117+
### 9) `src/engine/debug/inspectors/viewModels/timelineInspectorViewModel.js`
118+
Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`.
119+
120+
Update to:
121+
- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block
122+
- add:
123+
```js
124+
import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js';
125+
```
126+
127+
## Required Execution Rules
128+
- Only edit the 9 files listed above
129+
- Do not touch any other import lines
130+
- Preserve existing import ordering/style as much as possible
131+
- If a file already matches the target import state, leave it unchanged
132+
- No repo-wide cleanup pass
133+
134+
## Validation Checklist
135+
1. Confirm only the 9 listed files changed
136+
2. Confirm `isPlainObject` is no longer imported from `./utils.js` in:
137+
- `src/advanced/state/events.js`
138+
- `src/advanced/state/initialState.js`
139+
- `src/advanced/state/transitions.js`
140+
3. Confirm `asPositiveInteger` is no longer imported from `../shared/inspectorUtils.js` in:
141+
- `src/engine/debug/inspectors/host/debugInspectorHost.js`
142+
- `src/engine/debug/inspectors/registry/debugInspectorRegistry.js`
143+
- `src/engine/debug/inspectors/viewModels/entityInspectorViewModel.js`
144+
- `src/engine/debug/inspectors/viewModels/eventStreamInspectorViewModel.js`
145+
- `src/engine/debug/inspectors/viewModels/stateDiffInspectorViewModel.js`
146+
- `src/engine/debug/inspectors/viewModels/timelineInspectorViewModel.js`
147+
4. Confirm the new shared imports resolve to:
148+
- `../../shared/utils/objectUtils.js`
149+
- `../../../../shared/utils/numberUtils.js`
150+
5. Confirm no logic/runtime changes were made
151+
152+
## Non-Goals
153+
- No changes to `asFiniteNumber`
154+
- No changes to `getState`
155+
- No helper movement
156+
- No dedupe beyond the 9 exact files above
157+
- No alias-path migration

src/engine/debug/inspectors/host/debugInspectorHost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import {
1010
asArray,
1111
asNonNegativeInteger,
1212
asObject,
13-
asPositiveInteger,
1413
boundedPush,
1514
cloneJson,
1615
sanitizeText
1716
} from "../shared/inspectorUtils.js";
17+
import { asPositiveInteger } from "../../../../shared/utils/numberUtils.js";
1818
import { createComponentInspectorViewModel } from "../viewModels/componentInspectorViewModel.js";
1919
import { createEntityInspectorViewModel } from "../viewModels/entityInspectorViewModel.js";
2020
import { createEventStreamInspectorViewModel } from "../viewModels/eventStreamInspectorViewModel.js";

src/engine/debug/inspectors/registry/debugInspectorRegistry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ debugInspectorRegistry.js
88
import {
99
asArray,
1010
asObject,
11-
asPositiveInteger,
1211
sanitizeText
1312
} from "../shared/inspectorUtils.js";
13+
import { asPositiveInteger } from "../../../../shared/utils/numberUtils.js";
1414

1515
const DEFAULT_INSPECTORS = Object.freeze([
1616
Object.freeze({

0 commit comments

Comments
 (0)