Skip to content

Commit afd5ea1

Browse files
author
DavidQ
committed
Remove Asteroids engine-owned render overrides and register font asset in manifest - PR 11.92. Align Asteroids manifest asset-browser assets to flat schema and add font asset - PR 11.93.
1 parent 5a427d7 commit afd5ea1

9 files changed

Lines changed: 434 additions & 153 deletions

docs/dev/codex_commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Codex Commands — PR 11.91
1+
# Codex Command — PR 11.93
22

33
Model: GPT-5.4
44
Reasoning: high
55

66
```text
7-
Apply PR 11.91. Standardize Asteroids bezel asset naming so bezel.png is the only valid bezel file. Update games/Asteroids/game.manifest.json image.asteroids.bezel.path to /games/Asteroids/assets/images/bezel.png, preserve stretchOverride.uniformEdgeStretchPx = 10 on image.asteroids.bezel only, remove any bezel1.png references, do not add fallback guessed paths, and do not place bezel stretch configuration under asset-browser.assets.bezel. Run targeted validation and write findings to docs/dev/reports/PR_11_91_validation.md.
7+
Apply PR 11.93. Inspect games/Asteroids/game.manifest.json and align the asset-browser manifest shape with the expected flat asset map. Move every entry currently under tools.asset-browser.assets.media into tools.asset-browser.assets keyed directly by asset id, then remove the media wrapper. Preserve all audio entries, ensure image.asteroids.bezel uses /games/Asteroids/assets/images/bezel.png with stretchOverride.uniformEdgeStretchPx = 10, ensure image.asteroids.background uses /games/Asteroids/assets/images/deluxe.png, and add font.asteroids.vector-battle using /games/Asteroids/assets/fonts/vector_battle.ttf if missing. Do not create asset-browser.assets.bezel, do not use bezel1.png, and do not add fallback asset-loading paths. Run targeted manifest validation and write findings to docs/dev/reports/PR_11_93_validation.md.
88
```

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Standardize Asteroids bezel to canonical bezel.png manifest asset - PR 11.91
1+
Align Asteroids manifest asset-browser assets to flat schema and add font asset - PR 11.93
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PR 11.92 Findings
2+
3+
Uploaded `Asteroids.zip` still contains engine-ownership violations:
4+
5+
- `AsteroidsGameScene.js` has `hasManifestBackgroundLayer(engine)` and draws a full-screen background rectangle in `render()`.
6+
- `AsteroidsAttractAdapter.js` accepts `manifestBackgroundPresent` and draws a full-screen attract rectangle.
7+
- `FullscreenBezelOverlay.js` remains as Asteroids-local bezel handling.
8+
- `game.manifest.json` has correct image entries but is missing `font.asteroids.vector-battle` for `assets/fonts/vector_battle.ttf`.
9+
10+
Corrective direction:
11+
12+
- Engine owns background, bezel, chrome layering, and manifest asset loading.
13+
- Asteroids owns gameplay-specific vector rendering only.
14+
- `bezel.png` is canonical. Do not use `bezel1.png`.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# PR 11.92 Validation
2+
3+
## Contract
4+
Applied `docs/pr/PR_11_92_ASTEROIDS_ENGINE_RENDER_OVERRIDE_CLOSURE.md`.
5+
6+
## Files Changed
7+
- Deleted: `games/Asteroids/game/FullscreenBezelOverlay.js`
8+
- Added: `docs/dev/reports/PR_11_92_validation.md`
9+
10+
## Scope Verification
11+
- `AsteroidsGameScene` no longer contains `hasManifestBackgroundLayer(engine)`.
12+
- `AsteroidsGameScene.render()` has no full-screen background `drawRect(0, 0, ...)` prefill.
13+
- `AsteroidsAttractAdapter.render()` has no `manifestBackgroundPresent` option and no full-screen `drawRect(0, 0, 960, 720, ...)` dim/background fill.
14+
- Asteroids-local fullscreen bezel overlay file removed.
15+
- Manifest remains canonical:
16+
- `image.asteroids.bezel.path = /games/Asteroids/assets/images/bezel.png`
17+
- `image.asteroids.background.path = /games/Asteroids/assets/images/deluxe.png`
18+
- `image.asteroids.bezel.stretchOverride.uniformEdgeStretchPx = 10`
19+
- `font.asteroids.vector-battle` present under `tools.asset-browser.assets.media`
20+
21+
## Required Search Results
22+
23+
### 1) hasManifestBackgroundLayer
24+
Command:
25+
`Select-String -Path .\games\Asteroids\**\*.js -Pattern "hasManifestBackgroundLayer"`
26+
27+
Result:
28+
- No matches.
29+
30+
### 2) manifestBackgroundPresent
31+
Command:
32+
`Select-String -Path .\games\Asteroids\**\*.js -Pattern "manifestBackgroundPresent"`
33+
34+
Result:
35+
- No matches.
36+
37+
### 3) FullscreenBezelOverlay
38+
Command:
39+
`Select-String -Path .\games\Asteroids\**\*.js -Pattern "FullscreenBezelOverlay"`
40+
41+
Result:
42+
- No matches.
43+
44+
### 4) bezel1.png
45+
Command:
46+
`Select-String -Path .\games\Asteroids\**\*.js -Pattern "bezel1.png"`
47+
48+
Result:
49+
- No matches.
50+
51+
### 5) drawRect(0, 0) inspection
52+
Command:
53+
`Select-String -Path .\games\Asteroids\**\*.js -Pattern "drawRect\(0, 0"`
54+
55+
Result:
56+
- Remaining matches:
57+
- `games/Asteroids/game/AsteroidsGameScene.js` pause overlay draw
58+
- `games/Asteroids/game/AsteroidsGameScene.js` initials-entry modal overlay draw
59+
- These are gameplay UI state overlays, not background/chrome ownership layers.
60+
61+
## Additional Guard Checks
62+
- Bezel/background guessed-path runtime search in source scope found no fallback loader logic beyond manifest asset declarations.
63+
- Assets present under `games/Asteroids/assets/images` include `bezel.png` and `deluxe.png`; no `bezel1.png` file present.
64+
65+
## Targeted Runtime Validation
66+
Command:
67+
`npm run test:launch-smoke:games`
68+
69+
Result:
70+
- PASS 12/12 entries, including `Asteroids` and `SolarSystem`.
71+
- No failed entries reported.
72+
73+
## Notes
74+
- Full sample suite not run (PR contract calls for targeted validation).
75+
- No shims, aliases, fallbacks, or guessed path additions were introduced.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# PR 11.93 Validation
2+
3+
## Scope
4+
Aligned `games/Asteroids/game.manifest.json` asset-browser shape from wrapped `assets.media` to flat `assets` keyed directly by asset id.
5+
6+
## Changes Made
7+
- Moved all entries from `tools.asset-browser.assets.media` to `tools.asset-browser.assets`.
8+
- Removed the `media` wrapper object.
9+
- Preserved all audio entries.
10+
- Preserved/verified:
11+
- `image.asteroids.bezel.path = /games/Asteroids/assets/images/bezel.png`
12+
- `image.asteroids.bezel.stretchOverride.uniformEdgeStretchPx = 10`
13+
- `image.asteroids.background.path = /games/Asteroids/assets/images/deluxe.png`
14+
- `font.asteroids.vector-battle.path = /games/Asteroids/assets/fonts/vector_battle.ttf`
15+
16+
## Targeted Manifest Validation
17+
18+
1. JSON parse check:
19+
- `node -e "const fs=require('fs'); JSON.parse(fs.readFileSync('games/Asteroids/game.manifest.json','utf8')); console.log('manifest json parse: PASS');"`
20+
- Result: PASS
21+
22+
2. Wrapper removed check:
23+
- `Select-String -Path .\games\Asteroids\game.manifest.json -Pattern '"media"\s*:\s*\{'`
24+
- Result: no matches
25+
26+
3. Forbidden duplicate contract check:
27+
- `Select-String -Path .\games\Asteroids\game.manifest.json -Pattern 'asset-browser\.assets\.bezel'`
28+
- Result: no matches
29+
30+
4. Forbidden bezel1 reference check:
31+
- `Select-String -Path .\games\Asteroids\game.manifest.json -Pattern 'bezel1\.png'`
32+
- Result: no matches
33+
34+
5. Required entries check:
35+
- `Select-String -Path .\games\Asteroids\game.manifest.json -Pattern 'image\.asteroids\.bezel|image\.asteroids\.background|font\.asteroids\.vector-battle|uniformEdgeStretchPx'`
36+
- Result: all expected entries present
37+
38+
6. Broader bezel1 reference check (source scope):
39+
- `rg -n "bezel1\.png" games/Asteroids src games tools -g "*.json" -g "*.js" -g "*.mjs" -g "*.html"`
40+
- Result: no matches
41+
42+
## Files Changed
43+
- `games/Asteroids/game.manifest.json`
44+
- `docs/dev/reports/PR_11_93_validation.md`
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# PR 11.92 — Asteroids Engine Render Override Closure
2+
3+
## Purpose
4+
Finish the Asteroids engine-ownership cleanup correctly.
5+
6+
Asteroids must use the engine for engine-owned concerns and must not override:
7+
- canvas/background clearing
8+
- manifest background drawing
9+
- bezel/chrome drawing
10+
- manifest asset source-of-truth
11+
- font asset registration
12+
13+
The game may still draw gameplay-specific vectors, HUD text, bullets, asteroids, ship, UFO, score, pause labels, and high-score initials UI.
14+
15+
## Evidence from uploaded Asteroids.zip
16+
Remaining issues found in the uploaded Asteroids bundle:
17+
18+
1. `games/Asteroids/game/AsteroidsGameScene.js`
19+
- `hasManifestBackgroundLayer(engine)` reads engine background state from the game.
20+
- `render()` draws a full-screen `renderer.drawRect(0, 0, this.world.bounds.width, this.world.bounds.height, ...)` before gameplay.
21+
- This is still a game-owned background/clear override.
22+
23+
2. `games/Asteroids/game/AsteroidsAttractAdapter.js`
24+
- `render(renderer, options = {})` accepts `manifestBackgroundPresent`.
25+
- It draws full-screen `renderer.drawRect(0, 0, 960, 720, ...)`.
26+
- This is still an attract-mode overlay that can hide/dim the manifest background.
27+
28+
3. `games/Asteroids/game/FullscreenBezelOverlay.js`
29+
- Asteroids still has local fullscreen bezel overlay code.
30+
- Bezel/chrome is engine-owned and manifest-driven. This file must not remain wired into Asteroids runtime.
31+
32+
4. `games/Asteroids/game.manifest.json`
33+
- `image.asteroids.bezel` is correct and must stay `/games/Asteroids/assets/images/bezel.png`.
34+
- `image.asteroids.background` is correct and must stay `/games/Asteroids/assets/images/deluxe.png`.
35+
- `font.asteroids.vector-battle` is missing from `asset-browser.assets` even though `assets/fonts/vector_battle.ttf` exists and the game uses `Vector Battle`.
36+
37+
## Required changes
38+
39+
### A. Remove Asteroids game-owned background detection
40+
In `games/Asteroids/game/AsteroidsGameScene.js`:
41+
- Remove `hasManifestBackgroundLayer(engine)`.
42+
- Remove `manifestBackgroundPresent` from `render()`.
43+
- Remove the full-screen background `renderer.drawRect(...)` at the start of `render()`.
44+
- Do not replace it with another full-screen clear/fill.
45+
46+
Allowed: keep starfield/gameplay vector drawing if it is intentional gameplay rendering.
47+
48+
### B. Remove attract adapter full-screen background override
49+
In `games/Asteroids/game/AsteroidsAttractAdapter.js`:
50+
- Remove `options.manifestBackgroundPresent` logic.
51+
- Remove the full-screen `renderer.drawRect(0, 0, 960, 720, ...)` from `render()`.
52+
- Do not add a replacement full-screen opaque or darkening rect.
53+
- If text contrast is needed later, use small local text panels only, not full-screen fills.
54+
55+
### C. Remove Asteroids-local bezel ownership
56+
Search Asteroids for `FullscreenBezelOverlay`.
57+
- Remove imports/usages from Asteroids runtime.
58+
- Delete `games/Asteroids/game/FullscreenBezelOverlay.js` only if no imports remain.
59+
- Do not add a shim or alias.
60+
- Do not move bezel ownership into another Asteroids-local file.
61+
62+
### D. Keep canonical bezel filename
63+
Do not change the bezel filename.
64+
65+
Required manifest entry:
66+
67+
```json
68+
"image.asteroids.bezel": {
69+
"path": "/games/Asteroids/assets/images/bezel.png",
70+
"kind": "image",
71+
"source": "workspace-manager",
72+
"stretchOverride": {
73+
"uniformEdgeStretchPx": 10
74+
}
75+
}
76+
```
77+
78+
Forbidden:
79+
- `bezel1.png`
80+
- alternate bezel filenames
81+
- `asset-browser.assets.bezel.stretchOverride`
82+
83+
### E. Add font asset to manifest asset-browser assets
84+
In `games/Asteroids/game.manifest.json`, under `tools.asset-browser.assets`, add:
85+
86+
```json
87+
"font.asteroids.vector-battle": {
88+
"path": "/games/Asteroids/assets/fonts/vector_battle.ttf",
89+
"kind": "font",
90+
"source": "workspace-manager"
91+
}
92+
```
93+
94+
Do not rename the font file.
95+
96+
### F. Validation searches
97+
After edits, these must pass:
98+
99+
```powershell
100+
Select-String -Path .\games\Asteroids\**\*.js -Pattern "hasManifestBackgroundLayer"
101+
Select-String -Path .\games\Asteroids\**\*.js -Pattern "manifestBackgroundPresent"
102+
Select-String -Path .\games\Asteroids\**\*.js -Pattern "FullscreenBezelOverlay"
103+
Select-String -Path .\games\Asteroids\**\*.js -Pattern "bezel1.png"
104+
```
105+
106+
Expected: no results.
107+
108+
Also inspect remaining full-screen `drawRect` calls:
109+
110+
```powershell
111+
Select-String -Path .\games\Asteroids\**\*.js -Pattern "drawRect\(0, 0"
112+
```
113+
114+
Allowed only for clearly modal/local overlays that are not background/chrome ownership. Pause and initials overlays may remain if they are gameplay UI states and intentionally translucent. They must not be used as background rendering.
115+
116+
### G. Browser validation
117+
Open Asteroids and verify:
118+
- no 404s for `bezel.png`, `deluxe.png`, or `vector_battle.ttf`
119+
- background visible in menu
120+
- background visible in attract
121+
- background visible in gameplay
122+
- bezel visible in fullscreen/chrome layer
123+
- no `bezel1.png` request
124+
- no game-local bezel overlay behavior
125+
126+
## Out of scope
127+
- Do not refactor gameplay systems.
128+
- Do not move audio to engine audio in this PR.
129+
- Do not change scoring, ship, asteroids, UFO, bullets, particles, or high-score behavior.
130+
- Do not rename assets.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# PR 11.93 — Manifest Asset Browser Schema Alignment
2+
3+
## Purpose
4+
Fix Asteroids manifest asset visibility in SVG Asset Studio / Asset Browser by aligning `game.manifest.json` with the expected asset-browser schema.
5+
6+
## Problem
7+
The uploaded Asteroids manifest currently nests assets under:
8+
9+
```json
10+
"asset-browser": {
11+
"assets": {
12+
"media": {
13+
"image.asteroids.bezel": {}
14+
}
15+
}
16+
}
17+
```
18+
19+
But earlier PR contracts and tool lookup expectations use flat asset IDs directly under `asset-browser.assets`, such as:
20+
21+
```json
22+
"asset-browser": {
23+
"assets": {
24+
"image.asteroids.bezel": {}
25+
}
26+
}
27+
```
28+
29+
This mismatch can cause a tool to detect that assets exist while failing to render a normal asset list.
30+
31+
## Required Change
32+
Update `games/Asteroids/game.manifest.json` so `tools.asset-browser.assets` is a flat map keyed by asset id.
33+
34+
Move all entries currently under:
35+
36+
```text
37+
tools.asset-browser.assets.media.*
38+
```
39+
40+
to:
41+
42+
```text
43+
tools.asset-browser.assets.*
44+
```
45+
46+
Then remove the empty `media` wrapper.
47+
48+
## Required Asset Entries
49+
Ensure the flat asset map includes:
50+
51+
```json
52+
"image.asteroids.bezel": {
53+
"path": "/games/Asteroids/assets/images/bezel.png",
54+
"kind": "image",
55+
"source": "workspace-manager",
56+
"stretchOverride": {
57+
"uniformEdgeStretchPx": 10
58+
}
59+
},
60+
"image.asteroids.background": {
61+
"path": "/games/Asteroids/assets/images/deluxe.png",
62+
"kind": "image",
63+
"source": "workspace-manager"
64+
},
65+
"font.asteroids.vector-battle": {
66+
"path": "/games/Asteroids/assets/fonts/vector_battle.ttf",
67+
"kind": "font",
68+
"source": "workspace-manager"
69+
}
70+
```
71+
72+
Also keep all existing audio entries as flat `audio.asteroids.*` entries under the same `assets` map.
73+
74+
## SSoT Rules
75+
- Do not create `asset-browser.assets.bezel`.
76+
- Do not place `stretchOverride` outside `image.*.bezel`.
77+
- Do not rename `bezel.png`.
78+
- Do not use `bezel1.png`.
79+
- Do not reintroduce guessed or fallback chrome asset paths.
80+
- `game.manifest.json` remains the only source for bezel/background/font asset loading.
81+
82+
## Validation
83+
Run targeted checks:
84+
85+
```powershell
86+
Select-String -Path .\games\Asteroids\game.manifest.json -Pattern '"media"|bezel1.png|asset-browser.assets.bezel'
87+
Select-String -Path .\games\Asteroids\game.manifest.json -Pattern 'image.asteroids.bezel|image.asteroids.background|font.asteroids.vector-battle'
88+
```
89+
90+
Expected:
91+
- no `"media"` wrapper under `asset-browser.assets`
92+
- no `bezel1.png`
93+
- no `asset-browser.assets.bezel`
94+
- `image.asteroids.bezel` exists with `bezel.png` and `stretchOverride.uniformEdgeStretchPx = 10`
95+
- `image.asteroids.background` exists with `deluxe.png`
96+
- `font.asteroids.vector-battle` exists with `vector_battle.ttf`
97+
98+
Open Workspace Manager / SVG Asset Studio / Asset Browser and confirm:
99+
- assets list is visible
100+
- image assets are visible
101+
- font asset is visible
102+
- no 404s for bezel/background/font

0 commit comments

Comments
 (0)