Skip to content

Commit f855626

Browse files
author
DavidQ
committed
Enforce engine-owned game chrome and manifest-only background/bezel loading - PR 11.88
1 parent caabb84 commit f855626

5 files changed

Lines changed: 229 additions & 3 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
# Codex Commands — PR 11.87
1+
# Codex Commands — PR 11.88
22

33
Model: GPT-5.4
44
Reasoning: high
55

66
```powershell
7-
codex exec --model gpt-5.4 --reasoning high "Run BUILD_PR_11_87_MANIFEST_BACKGROUND_ALWAYS_VISIBLE. Make manifest-declared image.*.background draw in all render states, prevent opaque clears/fills from hiding a present background, preserve manifest-only chrome asset loading, and write targeted validation evidence to docs/dev/reports/PR_11_87_validation.md. Do not run the full sample suite. Return a repo-structured ZIP at tmp/PR_11_87_MANIFEST_BACKGROUND_ALWAYS_VISIBLE.zip."
7+
codex --model gpt-5.4 --reasoning high "Apply PR 11.88 from docs/pr/PR_11_88_ENGINE_OWNED_GAME_CHROME_AND_LAYERING.md. Fix all listed engine-owned chrome/layering issues in one pass. Keep scope targeted. Do not add wrappers, aliases, fallback assets, or guessed chrome paths. Update Asteroids manifest assets, enforce manifest-only bezel/background loading, ensure manifest backgrounds draw in all states, remove opaque game-level fills that hide engine backgrounds, preserve gameplay rendering, and write validation notes to docs/dev/reports/pr_11_88_validation.md."
88
```
9+
10+
## Required report
11+
Codex must create:
12+
13+
```text
14+
docs/dev/reports/pr_11_88_validation.md
15+
```
16+
17+
Report must include:
18+
19+
- files changed
20+
- manifest chrome asset declarations verified
21+
- guessed chrome path search results
22+
- background visible states checked
23+
- console 404 check result
24+
- `src/engine/utils/` search result
25+
- whether full sample suite was skipped and why

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Draw manifest-declared game backgrounds across all render states without opaque suppression - PR 11.87
1+
Enforce engine-owned game chrome and manifest-only background/bezel loading - PR 11.88
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# PR 11.88 Expected Validation
2+
3+
Codex must replace this with execution-backed validation after applying the PR.
4+
5+
Expected checks:
6+
7+
- Asteroids manifest declares image.asteroids.bezel path /games/Asteroids/assets/images/bezel1.png.
8+
- Asteroids manifest declares image.asteroids.background path /games/Asteroids/assets/images/deluxe.png.
9+
- image.*.bezel entries carry stretchOverride.uniformEdgeStretchPx where required.
10+
- asset-browser.assets.bezel does not carry stretchOverride.
11+
- Manifest background draws in non-gameplay states.
12+
- SolarSystem does not request guessed bezel.png/background.png.
13+
- No active source references remain to src/engine/utils/.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# PR 11.88 Validation
2+
3+
## Files Changed
4+
- `games/Asteroids/game.manifest.json`
5+
- `games/Asteroids/assets/images/bezel1.png` (renamed from `bezel.png`)
6+
- `games/Asteroids/assets/images/bezel.png` (removed via rename)
7+
- `docs/dev/reports/pr_11_88_validation.md`
8+
9+
## Manifest Chrome Asset Declarations Verified
10+
Verified in `games/Asteroids/game.manifest.json`:
11+
- `image.asteroids.bezel.path = /games/Asteroids/assets/images/bezel1.png`
12+
- `image.asteroids.bezel.kind = image`
13+
- `image.asteroids.bezel.source = workspace-manager`
14+
- `image.asteroids.bezel.stretchOverride.uniformEdgeStretchPx = 10`
15+
- `image.asteroids.background.path = /games/Asteroids/assets/images/deluxe.png`
16+
- `image.asteroids.background.kind = image`
17+
- `image.asteroids.background.source = workspace-manager`
18+
19+
Confirmed no `asset-browser.assets.bezel.stretchOverride` block remains.
20+
21+
## Guessed Chrome Path Search Results
22+
Command (runtime/source scope):
23+
- `rg -n "assets/images/bezel\\.png|assets/images/background\\.png|bezel1\\.png|deluxe\\.png" src games tools -g "*.js" -g "*.mjs" -g "*.json" -g "*.html"`
24+
25+
Result:
26+
- Only manifest-declared assets found in `games/Asteroids/game.manifest.json`.
27+
- No guessed/fallback chrome path construction added in `src/`, `games/`, or `tools/` runtime code.
28+
29+
Broader scan including tests:
30+
- `rg -n "assets/images/bezel\\.png|assets/images/background\\.png" src games tools tests -g "*.js" -g "*.mjs" -g "*.json" -g "*.html"`
31+
- Legacy hardcoded values remain in test assertions only (not runtime/source loading logic).
32+
33+
## Background Visible States Checked
34+
Code-path verification:
35+
- `src/engine/runtime/backgroundImage.js` draws manifest backgrounds in all states (no gameplay-only gate).
36+
- `games/Asteroids/game/AsteroidsGameScene.js` uses translucent base fill when manifest background exists.
37+
- `games/Asteroids/game/AsteroidsAttractAdapter.js` uses translucent attract overlay when manifest background exists.
38+
39+
Targeted runtime validation:
40+
- `node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --games`
41+
- Result: PASS (12/12), including Asteroids and SolarSystem.
42+
43+
## Console 404 Check Result
44+
From targeted launch smoke output:
45+
- No failed entries.
46+
- No bezel/background 404 failures reported during game launch sweep.
47+
48+
## `src/engine/utils/` Search Result
49+
Command:
50+
- `rg -n "/src/engine/utils/|src/engine/utils/" src games tools tests samples -g "*.js" -g "*.mjs" -g "*.json" -g "*.html"`
51+
52+
Result:
53+
- No active source/runtime references found.
54+
55+
## Targeted Validation Commands
56+
- `node --check src/engine/runtime/backgroundImage.js` -> PASS
57+
- `node --check games/Asteroids/game/AsteroidsGameScene.js` -> PASS
58+
- `node --check games/Asteroids/game/AsteroidsAttractAdapter.js` -> PASS
59+
- `node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --games` -> PASS (12/12)
60+
61+
## Full Sample Suite
62+
Skipped intentionally.
63+
Reason: PR 11.88 scope is targeted to engine-owned chrome/layering and Asteroids manifest/background behavior; targeted game launch validation is sufficient per PR instructions.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# PR 11.88 — Engine-Owned Game Chrome and Layering Fix
2+
3+
## Purpose
4+
Fix the Asteroids/engine boundary so engine-provided systems are not bypassed by game-specific rendering.
5+
6+
## Scope
7+
This PR fixes all currently identified issues in one targeted pass:
8+
9+
1. `game.manifest.json` is the only source of truth for bezel/background chrome assets.
10+
2. `image.*.bezel` entries own bezel-specific `stretchOverride.uniformEdgeStretchPx`.
11+
3. `asset-browser.assets.bezel` must not contain bezel stretch metadata.
12+
4. Manifest-declared background images draw in every game state, including menu, attract, title, pause, and gameplay.
13+
5. If a manifest background exists, game/scene code must not perform an opaque clear/fill that hides it.
14+
6. Asteroids must stop suppressing or visually covering engine-managed background/chrome layers.
15+
7. Any remaining hardcoded `/assets/images/bezel.png`, `/assets/images/background.png`, `bezel1.png`, or `deluxe.png` loading outside the manifest path must be removed or routed through manifest lookup.
16+
17+
## Architecture Rule
18+
Engine owns environment/chrome:
19+
20+
- render loop
21+
- scene lifecycle
22+
- manifest asset loading
23+
- background layer
24+
- bezel/chrome layer
25+
- canvas clear policy for manifest backgrounds
26+
27+
Game owns gameplay:
28+
29+
- player objects
30+
- enemies/asteroids
31+
- bullets/projectiles
32+
- scoring/HUD text
33+
- gameplay-specific overlays that do not hide engine background
34+
35+
## Required Changes
36+
37+
### 1. Asteroids manifest
38+
Update `games/Asteroids/game.manifest.json` so Asteroids declares:
39+
40+
```json
41+
"image.asteroids.bezel": {
42+
"path": "/games/Asteroids/assets/images/bezel1.png",
43+
"kind": "image",
44+
"source": "workspace-manager",
45+
"stretchOverride": {
46+
"uniformEdgeStretchPx": 10
47+
}
48+
}
49+
```
50+
51+
Also ensure Asteroids background is declared as:
52+
53+
```json
54+
"image.asteroids.background": {
55+
"path": "/games/Asteroids/assets/images/deluxe.png",
56+
"kind": "image",
57+
"source": "workspace-manager"
58+
}
59+
```
60+
61+
Do not add this stretch override under `asset-browser.assets.bezel`.
62+
63+
### 2. Manifest-only chrome loading
64+
Find and remove/deprecate any code that guesses these paths:
65+
66+
- `/games/<Game>/assets/images/bezel.png`
67+
- `/games/<Game>/assets/images/background.png`
68+
- `/assets/images/bezel.png`
69+
- `/assets/images/background.png`
70+
71+
The loader may only request background or bezel images if a matching manifest image asset exists.
72+
73+
### 3. Background rendering
74+
Update the background layer so a manifest-declared background is drawn regardless of game/session mode.
75+
76+
Do not gate background drawing to gameplay-only states.
77+
78+
The background layer should safely no-op only when no manifest background asset exists.
79+
80+
### 4. Clear/fill policy
81+
When a manifest background exists and is loaded:
82+
83+
- do not clear with an opaque color that hides the background
84+
- do not draw an opaque full-screen game fill before the background is visible
85+
- if a game wants mood/dimming, use transparent or semi-transparent overlays only after the engine background draw
86+
87+
### 5. Asteroids attract/menu overlay
88+
Review `games/Asteroids` rendering paths, especially:
89+
90+
- `AsteroidsGameScene.js`
91+
- `AsteroidsAttractAdapter.js`
92+
- any background image helper/layer such as `backgroundImage.js`
93+
94+
Remove full-screen opaque fills that hide manifest background in menu/attract/pause/title states.
95+
Replace them with transparent or semi-transparent overlays only where visually required.
96+
97+
### 6. Regression scan
98+
After changes, run a literal search for guessed chrome paths and stale engine-utils references:
99+
100+
- `assets/images/bezel.png`
101+
- `assets/images/background.png`
102+
- `/src/engine/utils/`
103+
- `src/engine/utils/`
104+
105+
Fix any active source references found. Do not modify reports or generated output unless the PR regenerates them intentionally.
106+
107+
## Acceptance Criteria
108+
109+
- Asteroids loads bezel from `bezel1.png` via `game.manifest.json` only.
110+
- Asteroids loads background from `deluxe.png` via `game.manifest.json` only.
111+
- `image.asteroids.bezel` contains `stretchOverride.uniformEdgeStretchPx = 10`.
112+
- No `asset-browser.assets.bezel.stretchOverride` remains.
113+
- SolarSystem and other games with no declared background/bezel do not 404 guessed chrome paths.
114+
- Manifest-declared background is visible in menu, attract, pause, title, and gameplay states.
115+
- Asteroids does not opaque-fill over the engine background.
116+
- No active source reference remains to `src/engine/utils/`.
117+
118+
## Testing
119+
Targeted only. Do not run the full sample suite.
120+
121+
Run:
122+
123+
1. Open Workspace Manager.
124+
2. Launch Asteroids.
125+
3. Verify background visible on menu/attract and gameplay.
126+
4. Verify bezel uses `bezel1.png` and edge stretch applies.
127+
5. Launch SolarSystem.
128+
6. Verify no 404 for `bezel.png` or `background.png`.
129+
7. Check browser console for missing module/asset errors.
130+
8. Run literal source searches listed above.
131+
132+
## Full sample suite
133+
Skipped. This PR touches game chrome/render layering and manifest loading only. Targeted game launch validation is sufficient.

0 commit comments

Comments
 (0)