Skip to content

Commit 35891d7

Browse files
author
DavidQ
committed
BUILD PR: remove remaining advanced-local isPlainObject duplicates and use shared object utils.
1 parent 6a8af39 commit 35891d7

7 files changed

Lines changed: 114 additions & 8 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
MODEL: GPT-5.3-codex
22
REASONING: high
33
COMMAND:
4-
Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_07_AS_POSITIVE_INTEGER_ADVANCED_ONLY.md exactly.
4+
Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_08_IS_PLAIN_OBJECT_ADVANCED_ONLY.md exactly.
55
Edit only these files:
66
- src/advanced/promotion/createPromotionGate.js
77
- src/advanced/state/createWorldGameStateSystem.js
8+
- src/shared/utils/objectUtils.js (only if minimum export change is needed)
9+
Fail fast if src/shared/utils/objectUtils.js does not already exist and export or contain isPlainObject.
810
Do not expand scope.
9-
Package the delta output to <project folder>/tmp/BUILD_PR_SHARED_EXTRACTION_07_AS_POSITIVE_INTEGER_ADVANCED_ONLY_delta.zip
11+
Package the delta output to <project folder>/tmp/BUILD_PR_SHARED_EXTRACTION_08_IS_PLAIN_OBJECT_ADVANCED_ONLY_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: remove remaining advanced-local asPositiveInteger duplicates and use shared number utils.
1+
BUILD PR: remove remaining advanced-local isPlainObject duplicates and use shared object utils.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Built the next executable shared-extraction step by narrowing to the two remaining advanced modules that still carried local asPositiveInteger definitions in the repo snapshot used for this workflow.
1+
Built the next executable shared-extraction step for isPlainObject, constrained to the two advanced modules only and guarded by a fail-fast check on the existing shared object helper.

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_07_AS_POSITIVE_INTEGER_ADVANCED_ONLY.md
3+
BUILD_PR_SHARED_EXTRACTION_08_IS_PLAIN_OBJECT_ADVANCED_ONLY.md
44
dev/
55
codex_commands.md
66
commit_comment.txt

docs/dev/reports/validation_checklist.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ SESSION VALIDATION GATE
22
- Bundle type: BUILD
33
- One PR purpose only: yes
44
- Exact target files listed: yes
5-
- Exact import target listed: yes
6-
- No guessing beyond established shared helper path: yes
5+
- Fail-fast dependency gate explicit: yes
6+
- No guessing/new helper creation: yes
77
- Repo-wide scan/refactor language avoided: yes
88
- Scope minimized: yes
99
- ZIP repo-structured and execution-ready: yes
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# BUILD_PR_SHARED_EXTRACTION_08_IS_PLAIN_OBJECT_ADVANCED_ONLY
2+
3+
## Purpose
4+
Remove any remaining advanced-local `isPlainObject` duplication from the two advanced promotion/state modules and switch them to the shared object helper.
5+
6+
## Single PR Purpose
7+
Normalize `isPlainObject` usage in:
8+
9+
- `src/advanced/promotion/createPromotionGate.js`
10+
- `src/advanced/state/createWorldGameStateSystem.js`
11+
12+
This BUILD does **not** change any other helper or file.
13+
14+
## Exact Files Allowed
15+
Edit only these 3 files:
16+
17+
1. `src/advanced/promotion/createPromotionGate.js`
18+
2. `src/advanced/state/createWorldGameStateSystem.js`
19+
3. `src/shared/utils/objectUtils.js` **only if needed to confirm/export existing shared `isPlainObject`**
20+
21+
Do not edit any other file.
22+
23+
## Shared Dependency Assumption
24+
Use the shared helper path:
25+
26+
- `src/shared/utils/objectUtils.js`
27+
28+
## Fail-Fast Gate
29+
Before making source edits, confirm `src/shared/utils/objectUtils.js` already exists and exports `isPlainObject`.
30+
31+
If either condition is false:
32+
- stop
33+
- report blocker
34+
- make no changes
35+
- do not create a delta ZIP
36+
37+
Do **not** create a new shared object helper in this PR.
38+
39+
## Exact Source Changes
40+
41+
### 1) `src/advanced/promotion/createPromotionGate.js`
42+
If a local `isPlainObject` function definition exists:
43+
- remove the local `isPlainObject` function definition
44+
- add exactly one import for `isPlainObject` from:
45+
46+
```js
47+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
48+
```
49+
50+
If an import for `isPlainObject` already exists, do not duplicate it.
51+
52+
If no local `isPlainObject` function definition exists:
53+
- leave this file unchanged
54+
55+
### 2) `src/advanced/state/createWorldGameStateSystem.js`
56+
If a local `isPlainObject` function definition exists:
57+
- remove the local `isPlainObject` function definition
58+
- add exactly one import for `isPlainObject` from:
59+
60+
```js
61+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
62+
```
63+
64+
If an import for `isPlainObject` already exists, do not duplicate it.
65+
66+
If no local `isPlainObject` function definition exists:
67+
- leave this file unchanged
68+
69+
### 3) `src/shared/utils/objectUtils.js`
70+
Do not modify implementation logic.
71+
72+
Allowed edit only:
73+
- if `isPlainObject` already exists in this file but is not exported, make the minimum export change required
74+
75+
If `isPlainObject` is already exported, leave this file unchanged.
76+
77+
## Hard Constraints
78+
- do not edit any file other than the 3 listed above
79+
- do not change `asFiniteNumber`
80+
- do not change `asPositiveInteger`
81+
- do not change `getState`
82+
- do not create new shared helper files
83+
- do not perform repo-wide helper cleanup
84+
- do not modify logic or behavior
85+
- do not normalize any other imports
86+
87+
## Validation Checklist
88+
1. Confirm no more than the 3 listed files changed
89+
2. Confirm `src/shared/utils/objectUtils.js` exists
90+
3. Confirm `src/shared/utils/objectUtils.js` exports `isPlainObject`
91+
4. Confirm local `isPlainObject` function definitions no longer exist in:
92+
- `src/advanced/promotion/createPromotionGate.js` (if one existed before)
93+
- `src/advanced/state/createWorldGameStateSystem.js` (if one existed before)
94+
5. Confirm any updated advanced file imports `isPlainObject` from exactly:
95+
- `../../shared/utils/objectUtils.js`
96+
6. Confirm no other helper definitions or logic changed
97+
98+
## Non-Goals
99+
- no changes to `src/advanced/state/events.js`
100+
- no changes to `src/advanced/state/initialState.js`
101+
- no changes to `src/advanced/state/transitions.js`
102+
- no broader object helper normalization
103+
- no new helper creation
104+
- no refactor beyond this exact duplicate-removal step

src/advanced/state/createWorldGameStateSystem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import {
2020
} from './events.js';
2121
import { createPromotionStateSnapshot } from '../../shared/state/createPromotionStateSnapshot.js';
2222
import { asFiniteNumber, asPositiveInteger } from '../../shared/utils/numberUtils.js';
23+
import { isPlainObject } from '../../shared/utils/objectUtils.js';
2324
import {
2425
cloneDeep,
2526
createReadonlyClone,
26-
isPlainObject,
2727
mergeDeep
2828
} from './utils.js';
2929

0 commit comments

Comments
 (0)