|
| 1 | +# PR_26140_064 Deep Normalize Shared Method Domains |
| 2 | + |
| 3 | +## Summary |
| 4 | +- Moved JSON read/write helpers from `src/shared/io/jsonIO.js` to `src/shared/json/jsonIO.js`. |
| 5 | +- Moved shared record/object normalization into `src/shared/object/objects.js`. |
| 6 | +- Moved shared array normalization into `src/shared/array/arrays.js` and record-array normalization into `src/shared/array/recordArrays.js`. |
| 7 | +- Moved `isRecord` consumers to the object domain and `isNonEmptyString` to the string domain. |
| 8 | +- Removed unused pass-through shared files for `src/shared/index.js`, `src/shared/io/index.js`, `src/shared/data/index.js`, `src/shared/data/normalization.js`, and `src/shared/types/index.js`. |
| 9 | + |
| 10 | +## Domain Audit Decisions |
| 11 | +- `safeJsonParse`, `safeJsonStringify`, `cloneJsonData`: JSON serialization/deserialization helpers; canonical file is now `src/shared/json/jsonIO.js`. |
| 12 | +- `normalizeRecord`: object/record coercion helper; canonical file is now `src/shared/object/objects.js`. |
| 13 | +- `normalizeArray`: array coercion helper; canonical file is now `src/shared/array/arrays.js`. |
| 14 | +- `normalizeRecordArray`: array-of-records helper; canonical file is now `src/shared/array/recordArrays.js`. |
| 15 | +- `isRecord`: object/record predicate; canonical file is now `src/shared/object/objects.js`. |
| 16 | +- `isNonEmptyString`: string predicate; canonical file is now `src/shared/string/strings.js`. |
| 17 | +- `isFunction` and `isBoolean`: retained in `src/shared/types/typeGuards.js` because they are primitive type predicates and not array/object/string/json methods. |
| 18 | +- Existing state, contract, debug, game, runtime, validation, math, number, id, and geometry methods were reviewed and left in their current domain folders where the file domain already matched the exported behavior. |
| 19 | + |
| 20 | +## Guardrail Checks |
| 21 | +- `src/shared/io/jsonIO.js` no longer exists. |
| 22 | +- `src/shared/data/normalization.js` no longer exists, so array methods do not remain there. |
| 23 | +- No active imports or references remain for moved `shared/io`, `shared/data`, root `shared/index`, or `types/index` paths outside excluded historical/report areas. |
| 24 | +- No root-level shared pass-through export file remains at `src/shared/index.js`. |
| 25 | +- No `../` export chains exist under `src/shared/**/*.js`. |
| 26 | +- No sample JSON files were modified. |
| 27 | + |
| 28 | +## Validation |
| 29 | +- PASS: targeted syntax validation for 14 changed JavaScript files, including untracked files. |
| 30 | +- PASS: targeted import-target validation for 14 changed JavaScript files, including untracked files. |
| 31 | +- PASS: `npm run test:workspace-v2` with 59 passed. |
| 32 | +- PASS: stale moved-path scan for active JavaScript. |
| 33 | +- PASS: `git diff --check` completed with only Git CRLF normalization warnings for existing files. |
| 34 | + |
| 35 | +## Coverage Guardrail |
| 36 | +- Playwright generated the existing advisory V8 coverage report. Missing/low coverage entries remain WARN-only per project instructions. |
| 37 | + |
| 38 | +## Full Samples Smoke Test |
| 39 | +- Skipped. This PR only changes shared import/domain placement and the requested validation covered syntax/import correctness plus Workspace V2 behavior. |
| 40 | + |
| 41 | +## Manual Validation |
| 42 | +1. Review `docs/dev/reports/codex_review.diff` for the shared domain moves and import updates. |
| 43 | +2. Confirm `src/shared/json/jsonIO.js`, `src/shared/object/objects.js`, and `src/shared/array/recordArrays.js` are the canonical locations for the moved methods. |
| 44 | +3. Confirm Workspace Manager V2 still launches and runs through the tested tool flows. |
0 commit comments