|
2 | 2 |
|
3 | 3 | ## Purpose |
4 | 4 |
|
5 | | -Turn the standard library plan into a docs-only build bundle for Codex. |
| 5 | +Convert the approved standard library plan into an implementation-ready docs bundle for Codex. |
6 | 6 |
|
7 | | -## Build Scope |
| 7 | +## Authoritative Target Structure |
8 | 8 |
|
9 | | -Define: |
| 9 | +```text |
| 10 | +src/ |
| 11 | + engine/ |
| 12 | + debug/ |
| 13 | + standard/ |
| 14 | + panels/ |
| 15 | + SystemFpsPanel.js |
| 16 | + SystemTimingPanel.js |
| 17 | + SceneSummaryPanel.js |
| 18 | + SceneEntitiesPanel.js |
| 19 | + RenderLayersPanel.js |
| 20 | + InputSummaryPanel.js |
| 21 | + DebugStatusPanel.js |
| 22 | + providers/ |
| 23 | + SystemTimingProvider.js |
| 24 | + SceneSummaryProvider.js |
| 25 | + EntityCountProvider.js |
| 26 | + RenderLayerSummaryProvider.js |
| 27 | + InputSummaryProvider.js |
| 28 | + DebugStatusProvider.js |
| 29 | + commands/ |
| 30 | + registerStandardDebugCommands.js |
| 31 | + presets/ |
| 32 | + registerStandardDebugPreset.js |
| 33 | +``` |
10 | 34 |
|
11 | | -- the first shared library contents |
12 | | -- exact ownership |
13 | | -- target structure |
14 | | -- registration patterns |
15 | | -- adoption presets |
16 | | -- validation rules |
| 35 | +## Initial Inventory |
17 | 36 |
|
18 | | -## Required Deliverables |
| 37 | +### Shared Panels |
| 38 | +- `system.fps` |
| 39 | +- `system.timing` |
| 40 | +- `scene.summary` |
| 41 | +- `scene.entities` |
| 42 | +- `render.layers` |
| 43 | +- `input.summary` |
| 44 | +- `debug.status` |
19 | 45 |
|
20 | | -- authoritative target tree |
21 | | -- shared component inventory |
22 | | -- adoption models |
23 | | -- validation checklist |
24 | | -- rollback notes |
25 | | -- codex command |
26 | | -- commit comment |
27 | | -- next command |
| 46 | +### Shared Providers |
| 47 | +- `systemTiming` |
| 48 | +- `sceneSummary` |
| 49 | +- `entityCount` |
| 50 | +- `renderLayerSummary` |
| 51 | +- `inputSummary` |
| 52 | +- `debugStatus` |
| 53 | + |
| 54 | +### Shared Commands |
| 55 | +- `debug.help` |
| 56 | +- `debug.status` |
| 57 | +- `overlay.list` |
| 58 | +- `overlay.status` |
| 59 | +- `overlay.show <panelId>` |
| 60 | +- `overlay.hide <panelId>` |
| 61 | +- `overlay.toggle <panelId>` |
| 62 | +- `overlay.showAll` |
| 63 | +- `overlay.hideAll` |
| 64 | + |
| 65 | +## Registration Pattern |
| 66 | + |
| 67 | +Use one shared registration entry point: |
| 68 | + |
| 69 | +- `registerStandardDebugPreset()` |
| 70 | + |
| 71 | +This preset should: |
| 72 | +1. register shared providers |
| 73 | +2. register shared panels |
| 74 | +3. register shared commands |
| 75 | + |
| 76 | +This keeps adoption simple and consistent. |
| 77 | + |
| 78 | +## Adoption Modes |
| 79 | + |
| 80 | +### Minimal Adoption |
| 81 | +Consumer registers: |
| 82 | +- 1–2 standard providers |
| 83 | +- 1–2 standard panels |
| 84 | +- optional shared commands |
| 85 | + |
| 86 | +### Standard Adoption |
| 87 | +Consumer registers: |
| 88 | +- full `registerStandardDebugPreset()` |
| 89 | + |
| 90 | +### Custom Adoption |
| 91 | +Consumer registers: |
| 92 | +- selected shared providers/panels/commands |
| 93 | +- local project-specific additions |
28 | 94 |
|
29 | 95 | ## Build Rules |
30 | 96 |
|
31 | 97 | - one PR purpose only |
32 | 98 | - docs-first only |
33 | | -- keep the initial shared library small |
34 | | -- no 3D/network-specific features in this PR |
35 | | -- no deep inspectors in this PR |
36 | | -- preserve opt-in adoption |
| 99 | +- keep the initial library small |
| 100 | +- no 3D-specific diagnostics |
| 101 | +- no network-specific diagnostics |
| 102 | +- no deep inspectors |
| 103 | +- no game-specific logic in shared panels |
| 104 | +- no direct runtime access from shared panels |
| 105 | +- shared panels consume shared/public providers only |
| 106 | +- shared commands act through public APIs only |
| 107 | + |
| 108 | +## Validation Goals |
| 109 | + |
| 110 | +- shared preset registers end-to-end |
| 111 | +- panels render from provider data only |
| 112 | +- commands operate through public overlay/debug APIs |
| 113 | +- partial adoption works |
| 114 | +- full adoption works |
| 115 | +- local project extensions remain possible |
| 116 | +- no project-specific logic leaks into the shared library |
| 117 | + |
| 118 | +## Rollback Strategy |
| 119 | + |
| 120 | +If the initial library is too broad or unstable: |
| 121 | +- keep the directory structure |
| 122 | +- reduce the initial inventory |
| 123 | +- preserve preset entry point |
| 124 | +- revalidate minimal adoption before re-expanding |
0 commit comments