|
| 1 | +Toolbox Aid |
| 2 | +David Quesenberry |
| 3 | +04/05/2026 |
| 4 | +BUILD_PR_OVERLAY_PANEL_REGISTRY.md |
| 5 | + |
| 6 | +# BUILD PR |
| 7 | +## Overlay Panel Registry |
| 8 | + |
| 9 | +## Build Objective |
| 10 | +Translate the approved panel registry plan into an execution-ready build package that Codex can implement without widening scope beyond sample-level overlay integration. |
| 11 | + |
| 12 | +## Build Summary |
| 13 | +This BUILD_PR defines the implementation path for: |
| 14 | +- `OverlayPanelRegistry` |
| 15 | +- panel descriptor validation |
| 16 | +- overlay host consumption of registry snapshots |
| 17 | +- sample-level panel registration in `MultiSystemDemoScene.js` |
| 18 | +- optional console-facing visibility commands through approved public calls only |
| 19 | + |
| 20 | +No implementation code is included in this docs bundle. |
| 21 | + |
| 22 | +## Build Constraints |
| 23 | +- follow PLAN_PR -> BUILD_PR -> APPLY_PR |
| 24 | +- docs-first package only |
| 25 | +- no engine-core breakage |
| 26 | +- no console/overlay merger |
| 27 | +- sample-level integration only |
| 28 | +- public contract driven |
| 29 | + |
| 30 | +## Proposed File Touch Targets |
| 31 | +Expected implementation touch points should stay as small and surgical as possible. Final file names may vary slightly if Codex finds existing equivalent locations. |
| 32 | + |
| 33 | +Likely targets: |
| 34 | +- `engine/debug/` overlay registry module |
| 35 | +- `engine/debug/` overlay host / panel consumption module |
| 36 | +- `tools/dev/devConsoleIntegration.js` only if public registry commands already belong there and can remain isolated |
| 37 | +- `samples/.../MultiSystemDemoScene.js` for sample registration and validation wiring |
| 38 | +- docs under `docs/pr/` and `docs/dev/reports/` |
| 39 | + |
| 40 | +## Build Workstreams |
| 41 | +### 1. Registry Module |
| 42 | +Codex should implement a lightweight registry with: |
| 43 | +- register |
| 44 | +- unregister if already approved by current debug lifecycle, otherwise defer |
| 45 | +- get ordered list |
| 46 | +- get by id |
| 47 | +- set enabled state |
| 48 | +- snapshot export |
| 49 | + |
| 50 | +Acceptance goals: |
| 51 | +- stable deterministic ordering |
| 52 | +- duplicate rejection |
| 53 | +- no overlay host mutation leaks |
| 54 | + |
| 55 | +### 2. Descriptor Validation |
| 56 | +Codex should validate required descriptor fields at registration time. |
| 57 | + |
| 58 | +Validation checks: |
| 59 | +- `id` exists and is string |
| 60 | +- `title` exists and is string |
| 61 | +- `order` is finite numeric value |
| 62 | +- `readModel` is function |
| 63 | +- `render` is function |
| 64 | +- optional hooks are type-checked when present |
| 65 | + |
| 66 | +Failure mode: |
| 67 | +- reject invalid descriptor |
| 68 | +- preserve existing registry state |
| 69 | +- emit clear debug error |
| 70 | + |
| 71 | +### 3. Overlay Host Consumption |
| 72 | +Codex should update the overlay host so that it: |
| 73 | +- requests a registry snapshot each frame or approved update point |
| 74 | +- filters visible/enabled panels |
| 75 | +- reads model first, then renders |
| 76 | +- lays out panels in deterministic order |
| 77 | +- does not know about panel-specific runtime internals |
| 78 | + |
| 79 | +### 4. Approved Context Adapter |
| 80 | +Codex should introduce or formalize a narrow panel context object. |
| 81 | + |
| 82 | +Suggested contents: |
| 83 | +- frame timing snapshot |
| 84 | +- scene summary |
| 85 | +- approved debug selectors |
| 86 | +- draw helpers |
| 87 | +- feature flags |
| 88 | +- panel bounds/layout helpers |
| 89 | + |
| 90 | +Suggested exclusions: |
| 91 | +- unrestricted engine mutation methods |
| 92 | +- raw console state/history |
| 93 | +- arbitrary scene object mutation handles |
| 94 | + |
| 95 | +### 5. Sample Registration Path |
| 96 | +Codex should register a minimal first-pass panel set in `MultiSystemDemoScene.js` or approved sample bootstrap helper. |
| 97 | + |
| 98 | +Suggested initial sample panels: |
| 99 | +- FPS/runtime frame panel |
| 100 | +- scene identity/status panel |
| 101 | +- render layers/status panel |
| 102 | +- entity count panel |
| 103 | + |
| 104 | +### 6. Console Surface Integration |
| 105 | +Only if already aligned with existing command architecture, Codex may add public command hooks that: |
| 106 | +- list panel ids |
| 107 | +- toggle a panel by id |
| 108 | +- show current enabled state |
| 109 | + |
| 110 | +The console must remain a caller of the registry contract, not a co-owner of panel rendering. |
| 111 | + |
| 112 | +## Build Validation Matrix |
| 113 | +### Contract Validation |
| 114 | +- valid panel descriptor registers successfully |
| 115 | +- invalid descriptor is rejected cleanly |
| 116 | +- duplicate id is rejected |
| 117 | + |
| 118 | +### Behavior Validation |
| 119 | +- ordered snapshot is stable |
| 120 | +- disabled panels do not render |
| 121 | +- conditional visibility works independently of enabled state |
| 122 | +- render call order matches contract sort rules |
| 123 | + |
| 124 | +### Isolation Validation |
| 125 | +- panel renderers do not access console internals |
| 126 | +- overlay host does not contain panel-specific logic branches |
| 127 | +- sample-specific panel removal does not break host |
| 128 | + |
| 129 | +### Sample Validation |
| 130 | +- `MultiSystemDemoScene.js` demonstrates registry-based panel registration |
| 131 | +- overlay still draws with no registered sample panel failures |
| 132 | +- console autocomplete/interaction remains intact |
| 133 | + |
| 134 | +## Contract Test Suggestions |
| 135 | +Codex should include lightweight tests or validations for: |
| 136 | +- registration order |
| 137 | +- duplicate rejection |
| 138 | +- enable/disable state transition |
| 139 | +- visibility gate behavior |
| 140 | +- snapshot immutability expectations if implemented |
| 141 | + |
| 142 | +## Risks |
| 143 | +- leaking runtime internals through panel context |
| 144 | +- allowing console-specific logic into panel descriptors |
| 145 | +- tying ordering to registration sequence |
| 146 | +- over-designing the registry before minimal validation |
| 147 | + |
| 148 | +## Risk Controls |
| 149 | +- keep context narrow |
| 150 | +- reject descriptors that violate contract shape |
| 151 | +- validate through sample integration only first |
| 152 | +- favor immutable or read-only snapshots where practical |
| 153 | + |
| 154 | +## Rollback Strategy |
| 155 | +If implementation becomes noisy or starts expanding scope: |
| 156 | +- keep registry internal behind one public module |
| 157 | +- disable console toggle hooks first |
| 158 | +- retain sample registration only |
| 159 | +- leave presets and persistence for later PRs |
| 160 | + |
| 161 | +## Deliverables |
| 162 | +Codex should produce: |
| 163 | +- updated docs in `docs/pr/` |
| 164 | +- `docs/dev/codex_commands.md` |
| 165 | +- `docs/dev/commit_comment.txt` |
| 166 | +- `docs/dev/next_command.txt` |
| 167 | +- `docs/dev/reports/change_summary.txt` |
| 168 | +- `docs/dev/reports/validation_checklist.txt` |
| 169 | +- `docs/dev/reports/file_tree.txt` |
| 170 | +- implementation changes only if this BUILD_PR is executed outside the docs-only planning workflow |
0 commit comments