Skip to content

Commit a5138a5

Browse files
author
DavidQ
committed
PLAN_PR_SAMPLE_GAME_DEV_CONSOLE_TOGGLE_INTEGRATION
- Planned sample game integration for dev console and debug overlay - Locked toggle-key driven behavior and last-stage overlay render - Scoped implementation to sample-level wiring without engine pollution
1 parent 1096eed commit a5138a5

16 files changed

Lines changed: 741 additions & 170 deletions

README.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

dev_console_test.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

docs/dev/CODEX_COMMANDS.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1-
MODEL: GPT-5.3-codex
1+
Toolbox Aid
2+
David Quesenberry
3+
04/05/2026
4+
codex_commands.md
5+
6+
MODEL: GPT-5.4-codex
27
REASONING: high
3-
COMMAND: Apply dev console and debug overlay per PR.
8+
9+
COMMAND:
10+
Implement dev console integration into one sample using tools/dev/devConsoleIntegration.js
11+
12+
- follow BUILD PR
13+
- create file
14+
- wire sample
15+
- do not modify engine core

docs/dev/COMMIT_COMMENT.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
apply(debug): implement dev console and debug overlay contracts with deterministic ordering, validation isolation, and hot-reload-safe state handling
1+
BUILD_PR_SAMPLE_GAME_DEV_CONSOLE_TOGGLE_INTEGRATION
2+
3+
- Added dev console integration wrapper
4+
- Wired toggle keys (` and Shift+`)
5+
- Integrated into sample loop

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PLAN_PR_ASSET_PIPELINE_CACHING_AND_HASHING
1+
APPLY_PR_SAMPLE_GAME_DEV_CONSOLE_TOGGLE_INTEGRATION

docs/dev/change_summary.txt

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1 @@
1-
Toolbox Aid
2-
David Quesenberry
3-
04/05/2026
4-
change_summary.txt
5-
6-
APPLY_PR_DEV_CONSOLE_AND_DEBUG_OVERLAY summary
7-
8-
Implemented focused dev console and debug overlay runtime contracts:
9-
- Added `tools/shared/devConsoleDebugOverlay.js`
10-
- Preserved architecture boundaries by keeping orchestration in shared runtime tooling above engine core
11-
- Did not introduce tool-specific quirks into engine systems
12-
13-
Implemented diagnostics contract:
14-
- Added diagnostics envelope contract (`contractVersion`, deterministic `timestamp`, required/optional sections)
15-
- Added structured diagnostics error reporting (`level`, `stage`, `code`, `message`, `details`)
16-
- Added adapter failure isolation so one adapter failure does not break diagnostics collection
17-
18-
Implemented command registry contract:
19-
- Added command definition validation and deterministic registration behavior
20-
- Added no-eval command execution pathway
21-
- Added deterministic conflict handling (core wins, extension collisions rejected)
22-
- Added required core command families from the approved contract
23-
24-
Implemented overlay panel contract:
25-
- Added panel definition validation
26-
- Added deterministic panel ordering (priority then id)
27-
- Added panel-level render failure isolation
28-
- Added required core panel families from the approved contract
29-
30-
Implemented deterministic render ordering:
31-
- Added canonical ordering function with debug surfaces last
32-
- Enforced ordering tail: `debug-overlay`, then `dev-console-surface`
33-
34-
Implemented hot reload survival behavior:
35-
- Added reload application flow that preserves console history and panel registration state
36-
- Added structured fallback on reload failure (`RELOAD_REJECTED_KEEP_LAST_GOOD`)
37-
- Preserved last-known-good runtime state on reload rejection
38-
- Added repeated-reload stability behavior without duplicate command/panel registration
39-
40-
Automated tests added:
41-
- Added `tests/tools/DevConsoleDebugOverlay.test.mjs`
42-
- Covers diagnostics contract shaping and adapter failure isolation
43-
- Covers command registry validation/conflict/unknown-command behavior
44-
- Covers panel contract ordering and panel render failure isolation
45-
- Covers deterministic render ordering with debug overlay last
46-
- Covers hot reload success, failure fallback, repeated reload stability, and disposal behavior
47-
48-
Test harness integration:
49-
- Updated `tests/run-tests.mjs` with `DevConsoleDebugOverlay`
50-
51-
Validation evidence:
52-
- `node --check tools/shared/devConsoleDebugOverlay.js`
53-
- `node --check tests/tools/DevConsoleDebugOverlay.test.mjs`
54-
- `node --check tests/run-tests.mjs`
55-
- Targeted test run passed (`DevConsoleDebugOverlay targeted check passed`)
56-
- Full suite passed (`113/113 explicit run() tests passed`)
57-
58-
Scope guardrails honored:
59-
- No engine-core API rewrite
60-
- No unrelated sample/tool refactors
61-
- Changes kept surgical and contract-aligned
1+
Added dev console integration plan and execution instructions

docs/dev/file_tree.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
Toolbox Aid
2-
David Quesenberry
3-
04/05/2026
4-
file_tree.txt
5-
6-
tools/shared/devConsoleDebugOverlay.js
7-
tests/tools/DevConsoleDebugOverlay.test.mjs
8-
tests/run-tests.mjs
9-
docs/dev/change_summary.txt
10-
docs/dev/file_tree.txt
11-
docs/dev/validation_checklist.txt
12-
docs/dev/commit_comment.txt
1+
docs/pr/... docs/dev/... tools/dev/devConsoleIntegration.js

docs/dev/validation_checklist.txt

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1 @@
1-
Toolbox Aid
2-
David Quesenberry
3-
04/05/2026
4-
validation_checklist.txt
5-
6-
APPLY_PR_DEV_CONSOLE_AND_DEBUG_OVERLAY validation checklist
7-
8-
Contracts
9-
[x] Diagnostics contract implemented with required envelope fields
10-
[x] Command registry contract implemented and validated
11-
[x] Overlay panel contract implemented and validated
12-
[x] Structured error format used for validation/collection/render failures
13-
14-
Ordering and mappings
15-
[x] Deterministic render ordering implemented
16-
[x] Debug overlay renders after authored world stages
17-
[x] Dev console surface renders after debug overlay
18-
[x] Engine mapping constants defined through public adapter contract mapping
19-
20-
Hot reload survival
21-
[x] Hot reload success preserves diagnostics shell state
22-
[x] Hot reload failure preserves last-known-good runtime state
23-
[x] Repeated reloads do not duplicate commands or panels
24-
[x] Structured reload rejection reporting implemented
25-
26-
Automated tests
27-
[x] Diagnostics adapter failure isolation test passes
28-
[x] Command registry conflict/unknown command tests pass
29-
[x] Overlay panel ordering/failure isolation tests pass
30-
[x] Deterministic render ordering test passes
31-
[x] Hot reload success/failure/repeated-reload stability tests pass
32-
[x] Disposal behavior test passes
33-
[x] New test wired into `tests/run-tests.mjs`
34-
35-
Execution evidence
36-
[x] `node --check tools/shared/devConsoleDebugOverlay.js`
37-
[x] `node --check tests/tools/DevConsoleDebugOverlay.test.mjs`
38-
[x] `node --check tests/run-tests.mjs`
39-
[x] Targeted test run passed
40-
[x] Full suite run passed (`113/113 explicit run() tests passed`)
41-
42-
Scope safety
43-
[x] Orchestration remains above engine core
44-
[x] No destructive runtime-breaking changes introduced
45-
[x] No unrelated runtime/sample/tool areas modified
1+
Toggle keys work, overlay renders, sample runs
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/05/2026
4+
BUILD_PR_SAMPLE_GAME_DEV_CONSOLE_TOGGLE_INTEGRATION.md
5+
6+
# BUILD PR
7+
Dev Console + Debug Overlay Sample Integration
8+
9+
## Implementation Steps (Codex)
10+
11+
1. Create file:
12+
tools/dev/devConsoleIntegration.js
13+
14+
2. Implement:
15+
- import runtime from tools/shared/devConsoleDebugOverlay.js
16+
- key handling:
17+
` → toggleConsole()
18+
Shift + ` → toggleOverlay()
19+
- expose:
20+
init, dispose, updateDiagnostics, renderOverlay, executeCommand, getState
21+
22+
3. Modify ONE sample file:
23+
- import integration
24+
- initialize once
25+
- call updateDiagnostics() in loop
26+
- call renderOverlay() after render
27+
28+
## Constraints
29+
- no engine core changes
30+
- no duplicate runtime logic
31+
- sample-level only
32+
- overlay renders last
33+
34+
## Validation
35+
- ` toggles console
36+
- Shift + ` toggles overlay
37+
- no crashes
38+
- sample still runs
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/05/2026
4+
PLAN_PR_SAMPLE_GAME_DEV_CONSOLE_TOGGLE_INTEGRATION.md
5+
6+
# PLAN PR
7+
Sample Game Dev Console Toggle Integration
8+
9+
## Objective
10+
Integrate the existing dev console and debug overlay runtime into one sample game with a keyboard toggle,
11+
while keeping engine core contracts clean and avoiding engine pollution.
12+
13+
## Scope
14+
- Wire the existing `tools/shared/devConsoleDebugOverlay.js` runtime into a single sample/dev entry
15+
- Add a toggle key for console visibility
16+
- Add a toggle key for overlay visibility
17+
- Route collected diagnostics into the runtime once per frame
18+
- Render overlay text through the sample-facing surface only
19+
- Keep implementation isolated to sample/dev integration points and allowed debug surface hooks
20+
21+
## Non-Goals
22+
- No engine-wide debug framework rewrite
23+
- No new tool contract changes
24+
- No replacement of renderer core APIs
25+
- No hotkey manager redesign
26+
- No global debug behavior forced into production samples
27+
28+
## Required Constraints
29+
- Reuse the already-built runtime from `tools/shared/devConsoleDebugOverlay.js`
30+
- Do not duplicate console logic in the sample
31+
- Do not spread debug-specific conditionals across unrelated engine systems
32+
- Keep the feature disabled by default unless explicitly toggled
33+
- Preserve current render ordering; debug overlay renders last
34+
- Commit comment file must have NO header
35+
36+
## Candidate Target
37+
Use one representative sample game or dev sample entry that already exercises scene loading and rendering.
38+
39+
## Integration Design
40+
1. Import runtime from `tools/shared/devConsoleDebugOverlay.js`
41+
2. Create one runtime instance during sample init
42+
3. Register keyboard toggle(s):
43+
- backquote / tilde for console surface
44+
- F3 or similar for overlay visibility, if needed
45+
4. Per frame:
46+
- gather diagnostics
47+
- update runtime state
48+
- render overlay after world render
49+
5. On command submit:
50+
- execute console input through runtime
51+
- log or surface output through the sample debug layer
52+
53+
## Diagnostics Minimum Set
54+
- runtime summary
55+
- scene info
56+
- frame/fps
57+
- camera
58+
- entities
59+
- render stages
60+
- tilemap
61+
- input
62+
- hot reload
63+
- validation
64+
65+
## Acceptance Criteria
66+
- Sample launches with no regression
67+
- Toggle key opens/closes console deterministically
68+
- Overlay can be shown/hidden
69+
- Existing world rendering still works
70+
- Overlay renders after gameplay content
71+
- `help` command works in the wired sample
72+
- `status` and `scene.info` return meaningful output
73+
- Invalid command does not crash the sample
74+
- Feature can be disabled cleanly
75+
76+
## File Targets
77+
Expected implementation focus:
78+
- one sample entry file
79+
- optional sample-local debug helper
80+
- no broad engine churn
81+
82+
## Validation
83+
- Run sample manually
84+
- Press toggle key repeatedly
85+
- Confirm overlay ordering
86+
- Execute `help`
87+
- Execute `status`
88+
- Execute `scene.info`
89+
- Confirm no duplicate runtime instances
90+
- Confirm no memory leak or double-render on repeated toggle
91+
92+
## Risks
93+
- Input collision with existing sample controls
94+
- Overlay draw path mixed too deeply into renderer
95+
- Runtime instantiated more than once
96+
- Debug output coupled to production flow
97+
98+
## Deliverable
99+
Create BUILD_PR_SAMPLE_GAME_DEV_CONSOLE_TOGGLE_INTEGRATION as a docs-only, repo-structured delta.

0 commit comments

Comments
 (0)