|
| 1 | +# PR_26139_004-collision-inspector-engine-alignment Report |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +Aligned Collision Inspector V2 with shared engine Object Vector collision logic and kept Asteroids collision consumers on the same manifest geometry path. The inspector now calls `src/engine/collision/objectVector.js` for bounds, vector, pixel/sprite, and hybrid checks instead of maintaining its own competing polygon/mask implementation. |
| 6 | + |
| 7 | +Playwright impacted: Yes. |
| 8 | + |
| 9 | +## Scope Completed |
| 10 | + |
| 11 | +- Added shared Object Vector collision support under `src/engine/collision/objectVector.js` and exported it through `src/engine/collision/index.js`. |
| 12 | +- Moved reusable Object Vector geometry normalization, transformed points, bounds, raster-mask, and collision-mode recommendation logic into the engine. |
| 13 | +- Updated Collision Inspector V2 to consume `evaluateObjectVectorCollisionPair(...)` and shared engine diagnostics only. |
| 14 | +- Refactored `CollisionInspectorV2App.js` into one-class files: |
| 15 | + - `CollisionInspectorV2App.js` |
| 16 | + - `CollisionInspectorV2Controls.js` |
| 17 | + - `CollisionInspectorV2Logger.js` |
| 18 | + - `CollisionInspectorV2ManifestLoader.js` |
| 19 | + - `CollisionInspectorV2Renderer.js` |
| 20 | +- Kept `bootstrap.js` as a thin element/class wiring entry point. |
| 21 | +- Added inspector schema support with `tools/schemas/tools/collision-inspector-v2.schema.json` and wired it through `workspace.manifest.schema.json`. |
| 22 | +- Moved Collision Inspector V2 into the Workspace Manager V2 `Viewers` group and tools index viewer category. |
| 23 | +- Added object-pair collision-mode auto-selection with manual override. |
| 24 | +- Moved Collision Mode under Object B, moved Reset into the Collision Pair accordion, removed Copy Report, and added zoom. |
| 25 | +- Updated Asteroids entity/object-geometry collision transforms to use shared collision helpers while continuing to load manifest Object Vector Studio V2 objects only. |
| 26 | + |
| 27 | +## Guardrails |
| 28 | + |
| 29 | +- No hardcoded Asteroids object geometry was added. |
| 30 | +- No fallback/default vector maps were added. |
| 31 | +- Collision Inspector V2 uses manifest `objects[].shapes[]` geometry only. |
| 32 | +- Existing intentional ship flame flicker and asteroid scale tuning were preserved. |
| 33 | + |
| 34 | +## Validation |
| 35 | + |
| 36 | +PASS: |
| 37 | + |
| 38 | +- `node --check` on touched Collision Inspector V2 modules and touched Asteroids entity modules. |
| 39 | +- `npx playwright test tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list` |
| 40 | + - 2 passed. |
| 41 | +- `node -e "import('./tests/final/PrecisionCollisionSystems.test.mjs').then(({ run }) => run())"` |
| 42 | +- `node -e "import('./tests/games/AsteroidsVectorTransforms.test.mjs').then(({ run }) => run())"` |
| 43 | +- `node -e "import('./tests/games/AsteroidsCollisionTimingStress.test.mjs').then(({ run }) => run())"` |
| 44 | +- `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list --grep "registers Workspace Manager V2 from the tools index"` |
| 45 | +- `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list --grep "uses header lifecycle controls and launches tools from fixed Workspace Manager V2 tiles"` |
| 46 | +- `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list --grep "loads Object Vector Studio V2 runtime assets into Asteroids gameplay rendering"` |
| 47 | +- `git diff --check` |
| 48 | + - Passed with line-ending warnings only. |
| 49 | + |
| 50 | +FAIL, broader existing gate: |
| 51 | + |
| 52 | +- `npm test` |
| 53 | + - Fails in `pretest` at `tools/dev/checkSharedExtractionGuard.mjs`. |
| 54 | + - Reported `185 unexpected violation(s)`, `baseline_expected=609`, `baseline_resolved=6`, `total_violations=848`. |
| 55 | + - The PR_003 Collision Inspector helper hits are removed; remaining failures are broad repository guard drift across existing game, sample, engine, and tool files. |
| 56 | + |
| 57 | +FAIL, broader existing Workspace V2 suite: |
| 58 | + |
| 59 | +- `npm run test:workspace-v2` |
| 60 | + - 54 passed, 2 failed. |
| 61 | + - Failing test: `validates optional Text to Speech V2 schema contract through Workspace Manager V2 schema` |
| 62 | + - Expected `activeContext.tools` to include `text2speech-V2`; received false. |
| 63 | + - Failing test: `tracks Object Vector Studio V2 dirty state through persisted edits and save outcomes` |
| 64 | + - Expected generated manifest schema validation failure; save succeeded. |
| 65 | + - Collision Inspector V2 category, schema, hydration, tile enablement, launch, and storage-session checks passed inside this run. |
| 66 | + |
| 67 | +## Notes |
| 68 | + |
| 69 | +- The targeted Asteroids collision stress fixture was adjusted to place the ship at the current manifest-accurate asteroid edge. The prior point was outside the restored Object Vector geometry and correctly produced no collision under the shared polygon path. |
| 70 | +- Full samples smoke test was not run; this PR is scoped to Collision Inspector V2, shared Object Vector collision, Asteroids targeted collision validation, and Workspace Manager launch wiring. |
0 commit comments