|
| 1 | +# PR_26140_063 Shared Folder Layout Normalization |
| 2 | + |
| 3 | +## Summary |
| 4 | +- Moved the remaining root-level shared helper modules into explicit domain folders under `src/shared/`. |
| 5 | +- Kept imports pointing directly at the canonical domain files instead of creating root-level compatibility shims. |
| 6 | +- Removed the object helper's cross-domain `asArray` re-export and split affected imports so array helpers come from `src/shared/array/arrays.js`. |
| 7 | +- Refreshed the shared extraction guard baseline after the canonical path moves. |
| 8 | +- Preserved behavior; this PR is layout/import normalization only. |
| 9 | + |
| 10 | +## Layout Decisions |
| 11 | +- Array helpers: `src/shared/array/arrays.js`. |
| 12 | +- Object helpers: `src/shared/object/objects.js`. |
| 13 | +- JSON clone helpers: `src/shared/json/clone.js`. |
| 14 | +- String helpers: `src/shared/string/strings.js`, `textWrap.js`, `commandText.js`, `fuzzyMatchScore.js`, and `stringifyValue.js`. |
| 15 | +- Math/spatial helpers: `src/shared/math/scalars.js`, `geometry.js`, `directions.js`, `vectorMath.js`, `vectorNormalize.js`, and `numberNormalization.js`. |
| 16 | +- Debug helpers: `src/shared/debug/config.js`, `network.js`, and `noopDevConsoleIntegration.js`. |
| 17 | +- Runtime helpers: `src/shared/runtime/registry.js` and `snapshotClone.js`. |
| 18 | +- Game-generic helpers: `src/shared/game/highScores.js` and `initialsEntry.js`. |
| 19 | +- Validation helper: `src/shared/validation/invariant.js`. |
| 20 | + |
| 21 | +## Guardrail Checks |
| 22 | +- Confirmed `src/shared/` root contains only the existing `index.js` namespace barrel. |
| 23 | +- Confirmed no active import/export statements reference `shared/utils/`. |
| 24 | +- Confirmed no active import/export statements reference the relocated dangling root shared files such as `shared/arrays.js`, `shared/objects.js`, `shared/json.js`, or `shared/strings.js`. |
| 25 | +- Confirmed no `../` export-from chains exist inside `src/shared/**/*.js`. |
| 26 | +- Confirmed no `Utils`/`utils` naming remains in `src/shared/**/*.js`. |
| 27 | +- No root shared compatibility re-export shims were created. |
| 28 | +- No sample JSON files were modified. |
| 29 | + |
| 30 | +## Validation |
| 31 | +- PASS: `node tools/dev/checkSharedExtractionGuard.mjs --update-baseline`. |
| 32 | +- PASS: `node tools/dev/checkSharedExtractionGuard.mjs`. |
| 33 | +- PASS: root shared file check confirmed only `src/shared/index.js` remains at root. |
| 34 | +- PASS: no active imports from `shared/utils` or relocated root shared files. |
| 35 | +- PASS: no `../` export-from chains in `src/shared`. |
| 36 | +- PASS: no `Utils`/`utils` naming in `src/shared/**/*.js`. |
| 37 | +- PASS: changed-file syntax validation for 135 JavaScript files. |
| 38 | +- PASS: changed-file import target validation for 135 JavaScript files. |
| 39 | +- PASS: `node tools/dev/checkSharedExtractionGuard.selftest.mjs`. |
| 40 | +- PASS: `node tests/shared/SharedFoundationCombinedPass.test.mjs`. |
| 41 | +- PASS: `node tests/shared/SharedNumberStringIdCloseout.test.mjs`. |
| 42 | +- PASS: `npm run test:workspace-v2` (59 passed). |
| 43 | +- PASS: `git diff --check`. |
| 44 | + |
| 45 | +## Coverage Guardrail |
| 46 | +- `npm run test:workspace-v2` regenerated advisory Playwright V8 coverage reports. |
| 47 | +- `docs/dev/reports/coverage_changed_js_guardrail.txt` lists changed runtime JavaScript files with covered entries where Workspace V2 exercised them and WARN details for files not collected by that Playwright run. |
| 48 | +- Coverage is advisory and missing changed runtime files are WARN, not FAIL, per project instructions. |
| 49 | + |
| 50 | +## Full Samples Smoke Test |
| 51 | +- Skipped as requested. This PR changes shared module layout/imports and is covered by targeted syntax/import checks plus Workspace V2; sample JSON remains out of scope. |
| 52 | + |
| 53 | +## Manual Validation |
| 54 | +- Open Workspace Manager V2 and select the repo. |
| 55 | +- Launch Object Vector Studio V2, Palette Manager V2, Asset Manager V2, and Asteroids from Workspace Manager V2. |
| 56 | +- Expected: tools and Asteroids launch without module resolution errors, and behavior matches the pre-layout-change state. |
0 commit comments