Skip to content

Commit e4f7d4f

Browse files
author
DavidQ
committed
Add explicit boot-entry visibility to asteroids_new so execution or silent failure can be confirmed immediately.
1 parent 7910d93 commit e4f7d4f

11 files changed

Lines changed: 223 additions & 73 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ MODEL: GPT-5.4-codex
22
REASONING: high
33

44
COMMAND:
5-
Execute exactly docs/pr/BUILD_PR_GAMES_98A_ASTEROIDS_NEW_GAMEPLAY_SLICE_COMPLETION.md.
5+
Execute exactly docs/pr/BUILD_PR_GAMES_99A_ASTEROIDS_NEW_BOOT_ENTRY_VISIBILITY_AND_EXECUTION_CHECK.md.
66
Modify only the exact target files listed in the PR doc.
77
Do not expand scope.
88
Package the delta zip to:
9-
<project folder>/tmp/BUILD_PR_GAMES_98A_ASTEROIDS_NEW_GAMEPLAY_SLICE_COMPLETION_delta.zip
9+
<project folder>/tmp/BUILD_PR_GAMES_99A_ASTEROIDS_NEW_BOOT_ENTRY_VISIBILITY_AND_EXECUTION_CHECK_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Complete the minimum gameplay slice in asteroids_new so the parallel lane is meaningfully testable, not just bootable.
1+
Add explicit boot-entry visibility to asteroids_new so execution or silent failure can be confirmed immediately.

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
After commit, report visible gameplay behavior and decide whether the next slice should be scoring/audio/input polish or one targeted stabilization PR.
1+
After commit, report exactly what becomes visible at boot; use that result to choose either boot-fix or gameplay continuation.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- advance asteroids_new from smoke-stable boot to a meaningfully testable gameplay slice
2-
- keep scope limited to current runtime/gameplay files already in the parallel lane
3-
- preserve original Asteroids files untouched
1+
- narrow the next PR to boot-entry visibility only
2+
- expose whether asteroids_new index is executing at all
3+
- expose the first reached or failing stage in the runtime path

docs/dev/reports/file_tree.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
docs/pr/BUILD_PR_GAMES_98A_ASTEROIDS_NEW_GAMEPLAY_SLICE_COMPLETION.md
1+
docs/pr/BUILD_PR_GAMES_99A_ASTEROIDS_NEW_BOOT_ENTRY_VISIBILITY_AND_EXECUTION_CHECK.md
22
docs/dev/codex_commands.md
33
docs/dev/commit_comment.txt
44
docs/dev/next_command.txt
@@ -8,10 +8,4 @@ docs/dev/reports/validation_checklist.txt
88
games/asteroids_new/index.js
99
games/asteroids_new/game/AsteroidsGameScene.js
1010
games/asteroids_new/game/AsteroidsSession.js
11-
games/asteroids_new/game/AsteroidsWorld.js
12-
games/asteroids_new/entities/Asteroid.js
13-
games/asteroids_new/entities/Bullet.js
14-
games/asteroids_new/entities/Ship.js
15-
games/asteroids_new/entities/Ufo.js
16-
games/asteroids_new/systems/ShipDebrisSystem.js
17-
games/asteroids_new/debug/asteroidsShowcaseDebug.js
11+
games/asteroids_new/game/AsteroidsWorld.js
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
- single PR purpose only
22
- exact target files only
33
- no original Asteroids file changes
4-
- no new files
5-
- no assets/platform/config/levels widening
6-
- asteroids_new remains runnable from its own index entry
7-
- gameplay slice is meaningfully testable
4+
- visible execution proof added
5+
- silent failure point exposed if boot still fails
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# BUILD PR — Asteroids New Boot Entry Visibility And Execution Check
2+
3+
## Purpose
4+
The current problem is not gameplay yet — the parallel lane appears not to execute at all, and there are no console messages.
5+
This PR is strictly for boot-entry visibility and execution proof so the game can be confirmed as actually starting.
6+
7+
## Exact Target Files
8+
- `games/asteroids_new/index.js`
9+
- `games/asteroids_new/game/AsteroidsGameScene.js`
10+
- `games/asteroids_new/game/AsteroidsSession.js`
11+
- `games/asteroids_new/game/AsteroidsWorld.js`
12+
13+
## Required Code Changes
14+
1. Add explicit, minimal boot visibility so execution can be confirmed immediately.
15+
2. Ensure `games/asteroids_new/index.js`:
16+
- visibly proves it is being executed
17+
- reports the first boot stage reached
18+
3. Ensure the listed downstream files report the first successful construction/entry stage reached.
19+
4. If boot currently exits silently, expose the failure point clearly.
20+
5. Keep all visibility additions minimal and temporary-style in spirit, but committed in code for this PR so the result is testable.
21+
22+
## Hard Constraints
23+
- exact files only
24+
- do not modify any original `games/Asteroids/*` files
25+
- do not widen into assets, debug panels, config, or unrelated systems
26+
- do not redesign runtime flow
27+
- do not fix unrelated gameplay behavior in this PR
28+
- focus only on proving execution path and exposing silent failure points
29+
30+
## Validation Steps
31+
- syntax-check all touched files
32+
- run from `games/asteroids_new/index.js`
33+
- confirm there is now visible proof of execution or a visible failure point
34+
- confirm no original `games/Asteroids/*` files changed
35+
36+
## Acceptance Criteria
37+
- launching `games/asteroids_new/index.js` produces visible execution proof
38+
- if boot fails, the failure point is exposed instead of silent
39+
- original Asteroids files remain untouched

games/asteroids_new/game/AsteroidsGameScene.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ const ATTRACT_INPUT_CODES = [
3838
'Enter',
3939
'KeyP',
4040
];
41+
let hasLoggedSceneConstruction = false;
42+
let hasLoggedSceneEnter = false;
43+
44+
function logSceneBootStage(stage, details = null) {
45+
if (details === null) {
46+
console.info(`[AsteroidsNewBoot] scene:${stage}`);
47+
} else {
48+
console.info(`[AsteroidsNewBoot] scene:${stage}`, details);
49+
}
50+
}
4151

4252
function getBeatInterval(asteroidCount) {
4353
if (asteroidCount <= 1) {
@@ -84,6 +94,10 @@ function drawLives(renderer, centerX, y, lives) {
8494
export default class AsteroidsGameScene extends Scene {
8595
constructor(options = {}) {
8696
super();
97+
if (!hasLoggedSceneConstruction) {
98+
hasLoggedSceneConstruction = true;
99+
logSceneBootStage('constructed');
100+
}
87101
this.devConsoleIntegration = options.devConsoleIntegration || null;
88102
this.debugConfig = options.debugConfig || {
89103
debugMode: 'prod',
@@ -179,6 +193,10 @@ export default class AsteroidsGameScene extends Scene {
179193
}
180194

181195
enter(engine) {
196+
if (!hasLoggedSceneEnter) {
197+
hasLoggedSceneEnter = true;
198+
logSceneBootStage('enter');
199+
}
182200
if (engine?.canvas) {
183201
engine.canvas.style.cursor = this.session.mode === 'playing' && !this.isPaused
184202
? 'none'

games/asteroids_new/game/AsteroidsSession.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,23 @@ function createSilentEvents() {
3535
sfx: [],
3636
};
3737
}
38+
let hasLoggedSessionConstruction = false;
39+
let hasLoggedSessionStart = false;
40+
41+
function logSessionBootStage(stage, details = null) {
42+
if (details === null) {
43+
console.info(`[AsteroidsNewBoot] session:${stage}`);
44+
} else {
45+
console.info(`[AsteroidsNewBoot] session:${stage}`, details);
46+
}
47+
}
3848

3949
export default class AsteroidsSession {
4050
constructor(world, highScoreStore) {
51+
if (!hasLoggedSessionConstruction) {
52+
hasLoggedSessionConstruction = true;
53+
logSessionBootStage('constructed');
54+
}
4155
this.turnIntroTotalFlashes = 10;
4256
this.turnIntroInterval = 0.2;
4357
this.world = world;
@@ -63,6 +77,10 @@ export default class AsteroidsSession {
6377
}
6478

6579
start(playerCount) {
80+
if (!hasLoggedSessionStart) {
81+
hasLoggedSessionStart = true;
82+
logSessionBootStage('start-called', { playerCount });
83+
}
6684
const safePlayerCount = sanitizePlayerCount(Number(playerCount));
6785
this.players = Array.from({ length: safePlayerCount }, (_, index) => ({
6886
id: index + 1,

games/asteroids_new/game/AsteroidsWorld.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ const WAVE_SPAWN_MARGIN_Y = 120;
3131
const WAVE_SPAWN_ATTEMPTS = 60;
3232
const ASTEROID_SPAWN_SAFE_PADDING = 24;
3333
const MAX_UPDATE_STEP_SECONDS = 1 / 60;
34+
let hasLoggedWorldConstruction = false;
35+
let hasLoggedWorldStartGame = false;
36+
37+
function logWorldBootStage(stage, details = null) {
38+
if (details === null) {
39+
console.info(`[AsteroidsNewBoot] world:${stage}`);
40+
} else {
41+
console.info(`[AsteroidsNewBoot] world:${stage}`, details);
42+
}
43+
}
3444

3545
function sanitizeBoolean(value, fallback = false) {
3646
return typeof value === 'boolean' ? value : fallback;
@@ -127,6 +137,10 @@ function getRectOverlapDepth(x, y, radius, rect) {
127137

128138
export default class AsteroidsWorld {
129139
constructor(bounds, { rng = Math.random } = {}) {
140+
if (!hasLoggedWorldConstruction) {
141+
hasLoggedWorldConstruction = true;
142+
logWorldBootStage('constructed', bounds);
143+
}
130144
this.rng = typeof rng === 'function' ? rng : Math.random;
131145
this.bounds = sanitizeBounds(bounds);
132146
this.starfield = Array.from({ length: 70 }, () => ({
@@ -232,6 +246,10 @@ export default class AsteroidsWorld {
232246
}
233247

234248
startGame() {
249+
if (!hasLoggedWorldStartGame) {
250+
hasLoggedWorldStartGame = true;
251+
logWorldBootStage('start-game');
252+
}
235253
this.wave = 1;
236254
this.shipActive = true;
237255
this.respawnDelay = 0;

0 commit comments

Comments
 (0)