|
| 1 | +# PR 11.89 - Asteroids Engine Render Ownership Stabilization |
| 2 | + |
| 3 | +## Scope and Source of Truth |
| 4 | +- BUILD doc: `docs/pr/BUILD_PR_LEVEL_11_89_ASTEROIDS_ENGINE_RENDER_OWNERSHIP_STABILIZATION.md` |
| 5 | +- PLAN doc: `docs/pr/PLAN_PR_LEVEL_11_89_ASTEROIDS_ENGINE_RENDER_OWNERSHIP_STABILIZATION.md` |
| 6 | + |
| 7 | +## Files Inspected |
| 8 | +- `games/Asteroids/index.js` |
| 9 | +- `games/Asteroids/game.manifest.json` |
| 10 | +- `games/Asteroids/game/AsteroidsGameScene.js` |
| 11 | +- `games/Asteroids/game/AsteroidsAttractAdapter.js` |
| 12 | +- `games/Asteroids/game/FullscreenBezelOverlay.js` |
| 13 | +- `src/engine/runtime/backgroundImage.js` |
| 14 | +- `src/engine/runtime/gameImageConvention.js` |
| 15 | +- `src/engine/runtime/fullscreenBezel.js` |
| 16 | +- `scripts/run-node-tests.mjs` |
| 17 | + |
| 18 | +## Baseline Search Findings (Before Fix) |
| 19 | + |
| 20 | +### Command |
| 21 | +`Select-String -Path .\games\Asteroids\**\*.js -Pattern "clearRect|fillRect|drawRect|background|bezel|chrome|overlay|rgba|globalAlpha" -CaseSensitive:$false` |
| 22 | + |
| 23 | +### Result (high-signal) |
| 24 | +- `games/Asteroids/game/AsteroidsGameScene.js`: full-canvas draws are translucent when manifest background present (`rgba(...,0.22)`), opaque fallback only when manifest background unavailable. |
| 25 | +- `games/Asteroids/game/AsteroidsAttractAdapter.js`: attract overlay uses translucent fill when manifest background present (`rgba(...,0.36)`), stronger dim only when background unavailable. |
| 26 | +- `games/Asteroids/game/FullscreenBezelOverlay.js`: resolves bezel by asset id (`image.asteroids.bezel`), not guessed image path. |
| 27 | + |
| 28 | +### Command |
| 29 | +`Select-String -Path .\games\Asteroids\**\*.* -Pattern "bezel.png|background.png|bezel1.png|deluxe.png|image.asteroids.bezel|image.asteroids.background" -CaseSensitive:$false` |
| 30 | + |
| 31 | +### Result (high-signal) |
| 32 | +- Found `image.asteroids.bezel` id usage in `FullscreenBezelOverlay.js`. |
| 33 | +- Manifest initially still referenced `/games/Asteroids/assets/images/bezel.png` (required correction to `bezel1.png`). |
| 34 | + |
| 35 | +### Command |
| 36 | +`Select-String -Path .\src\**\*.js, .\games\**\*.js -Pattern "/games/.*/assets/images/bezel.png|/games/.*/assets/images/background.png" -CaseSensitive:$false` |
| 37 | + |
| 38 | +### Result |
| 39 | +- No matches in active source JS. |
| 40 | + |
| 41 | +### Command |
| 42 | +`Select-String -Path .\games\Asteroids\game.manifest.json -Pattern "asset-browser|stretchOverride|image.asteroids.bezel|image.asteroids.background|bezel1.png|deluxe.png" -CaseSensitive:$false` |
| 43 | + |
| 44 | +### Result (baseline) |
| 45 | +- `image.asteroids.bezel` present with `stretchOverride.uniformEdgeStretchPx = 10`. |
| 46 | +- `image.asteroids.background` present and points to `deluxe.png`. |
| 47 | +- Bezel path required correction from `bezel.png` to `bezel1.png`. |
| 48 | + |
| 49 | +## Changes Made |
| 50 | +1. Updated manifest bezel path: |
| 51 | +- `games/Asteroids/game.manifest.json` |
| 52 | + - `image.asteroids.bezel.path` |
| 53 | + - from: `/games/Asteroids/assets/images/bezel.png` |
| 54 | + - to: `/games/Asteroids/assets/images/bezel1.png` |
| 55 | + |
| 56 | +2. Renamed asset file to match manifest declaration: |
| 57 | +- from: `games/Asteroids/assets/images/bezel.png` |
| 58 | +- to: `games/Asteroids/assets/images/bezel1.png` |
| 59 | + |
| 60 | +## Manifest Correction Verification (After Fix) |
| 61 | +- `image.asteroids.bezel.path = /games/Asteroids/assets/images/bezel1.png` |
| 62 | +- `image.asteroids.bezel.stretchOverride.uniformEdgeStretchPx = 10` |
| 63 | +- `image.asteroids.background.path = /games/Asteroids/assets/images/deluxe.png` |
| 64 | +- No duplicate `asset-browser.assets.bezel.stretchOverride` block introduced. |
| 65 | + |
| 66 | +## Remaining Full-Screen Fills and Why Safe |
| 67 | +- `AsteroidsGameScene` base full-canvas fill is translucent (`rgba(2, 6, 23, 0.22)`) when manifest background exists. |
| 68 | +- `AsteroidsAttractAdapter` full-canvas dim is translucent (`rgba(2, 6, 23, 0.36)`) when manifest background exists. |
| 69 | +- `PAUSE_OVERLAY_COLOR` and initials entry overlays are translucent and intentionally preserve background visibility/readability. |
| 70 | +- Opaque fallback clears remain only for no-background conditions and are not persistent suppression of a declared manifest background. |
| 71 | + |
| 72 | +## Before/After Guessed-Path Search |
| 73 | + |
| 74 | +### Before |
| 75 | +- JS source guessed path search (`/games/.*/assets/images/bezel.png|background.png`): 0 matches. |
| 76 | +- Manifest bezel path was still `bezel.png` (not guessed runtime behavior, but mismatched required asset name). |
| 77 | + |
| 78 | +### After |
| 79 | +- JS source guessed path search: 0 matches. |
| 80 | +- Manifest now uses required `bezel1.png` path and existing `deluxe.png` background path. |
| 81 | + |
| 82 | +## Before/After `src/engine/utils/` Search |
| 83 | + |
| 84 | +### Command |
| 85 | +`Select-String -Path .\src\**\*.js, .\games\**\*.js -Pattern "src/engine/utils/|/src/engine/utils/" -CaseSensitive:$false` |
| 86 | + |
| 87 | +### Result |
| 88 | +- Before: 0 matches |
| 89 | +- After: 0 matches |
| 90 | + |
| 91 | +## Validation Commands Run |
| 92 | +1. Required command from BUILD: |
| 93 | +- `npm test -- --runInBand` |
| 94 | +- Result: **failed during pretest guard** (`checkSharedExtractionGuard`) with existing repository-wide baseline violations unrelated to this PR's manifest/render ownership scope. |
| 95 | + |
| 96 | +2. Supported targeted runtime validation (used per BUILD fallback guidance): |
| 97 | +- `npm run test:launch-smoke:games` |
| 98 | +- Result: **PASS (12/12)**, including `Asteroids` and `SolarSystem`. |
| 99 | + |
| 100 | +## Manual/Browser Checklist Documentation |
| 101 | +- Workspace Manager launch + multi-state visual verification was not executed interactively in this CLI session. |
| 102 | +- Evidence used: |
| 103 | + - Source-level ownership verification in Asteroids render paths. |
| 104 | + - Manifest path correction verification. |
| 105 | + - Automated game launch smoke pass across all games with no launch failures. |
| 106 | +- Console 404 proxy check from smoke run: |
| 107 | + - No failing entries reported for Asteroids/SolarSystem. |
| 108 | + |
| 109 | +## Full Samples Suite |
| 110 | +- Skipped intentionally. |
| 111 | +- Reason: BUILD directs targeted validation only; this PR is scoped to Asteroids manifest/chrome/render ownership stabilization and does not modify broad sample framework behavior. |
0 commit comments