|
1 | 1 | # BUILD_PR_DEBUG_SURFACES_STANDARD_LIBRARY |
2 | 2 |
|
3 | | -## Purpose |
| 3 | +## Objective |
| 4 | +Create an authoritative docs-only BUILD bundle for the first shared debug surfaces standard library under `engine/debug/standard`. |
4 | 5 |
|
5 | | -Convert the approved standard library plan into an implementation-ready docs bundle for Codex. |
| 6 | +## Workflow |
| 7 | +PLAN_PR -> BUILD_PR -> APPLY_PR |
6 | 8 |
|
7 | | -## Authoritative Target Structure |
| 9 | +## Build Constraints |
| 10 | +- docs-first only |
| 11 | +- one PR purpose only |
| 12 | +- keep initial shared library small and opt-in |
| 13 | +- extraction/standardization only; no feature expansion |
| 14 | +- exclude 3D-specific, network-specific, deep-inspector, and project-specific logic |
8 | 15 |
|
| 16 | +## Authoritative Target Structure |
9 | 17 | ```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 |
| 18 | +engine/ |
| 19 | + debug/ |
| 20 | + standard/ |
| 21 | + panels/ |
| 22 | + system/ |
| 23 | + scene/ |
| 24 | + render/ |
| 25 | + input/ |
| 26 | + debug/ |
| 27 | + providers/ |
| 28 | + system/ |
| 29 | + scene/ |
| 30 | + render/ |
| 31 | + input/ |
| 32 | + debug/ |
| 33 | + commands/ |
| 34 | + registerStandardDebugCommands.js |
| 35 | + presets/ |
| 36 | + registerStandardDebugPreset.js |
33 | 37 | ``` |
34 | 38 |
|
35 | | -## Initial Inventory |
36 | | - |
| 39 | +## Initial Inventory (v1) |
37 | 40 | ### Shared Panels |
38 | 41 | - `system.fps` |
39 | 42 | - `system.timing` |
|
44 | 47 | - `debug.status` |
45 | 48 |
|
46 | 49 | ### Shared Providers |
47 | | -- `systemTiming` |
48 | | -- `sceneSummary` |
49 | | -- `entityCount` |
50 | | -- `renderLayerSummary` |
51 | | -- `inputSummary` |
52 | | -- `debugStatus` |
53 | | - |
54 | | -### Shared Commands |
| 50 | +- `system.timing` |
| 51 | +- `scene.summary` |
| 52 | +- `scene.entities` |
| 53 | +- `render.layers` |
| 54 | +- `input.summary` |
| 55 | +- `debug.status` |
| 56 | + |
| 57 | +### Shared Operator Commands |
55 | 58 | - `debug.help` |
56 | 59 | - `debug.status` |
57 | 60 | - `overlay.list` |
|
61 | 64 | - `overlay.toggle <panelId>` |
62 | 65 | - `overlay.showAll` |
63 | 66 | - `overlay.hideAll` |
| 67 | +- `overlay.order` |
64 | 68 |
|
65 | | -## Registration Pattern |
66 | | - |
67 | | -Use one shared registration entry point: |
68 | | - |
| 69 | +## Registration Pattern (Authoritative) |
| 70 | +Main shared adoption entry point: |
69 | 71 | - `registerStandardDebugPreset()` |
70 | 72 |
|
71 | | -This preset should: |
72 | | -1. register shared providers |
73 | | -2. register shared panels |
74 | | -3. register shared commands |
| 73 | +Expected registration sequence: |
| 74 | +1. register standard providers |
| 75 | +2. register standard panels |
| 76 | +3. register standard operator commands |
| 77 | +4. return a registration summary/report |
75 | 78 |
|
76 | | -This keeps adoption simple and consistent. |
| 79 | +Rules: |
| 80 | +- registration is opt-in |
| 81 | +- registration uses public contracts only |
| 82 | +- registration is deterministic and idempotent-safe where practical |
77 | 83 |
|
78 | 84 | ## Adoption Modes |
79 | | - |
80 | 85 | ### Minimal Adoption |
81 | | -Consumer registers: |
82 | | -- 1–2 standard providers |
83 | | -- 1–2 standard panels |
84 | | -- optional shared commands |
| 86 | +- register selected providers and 1-3 panels |
| 87 | +- optionally register shared commands |
85 | 88 |
|
86 | 89 | ### 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 |
| 90 | +- call `registerStandardDebugPreset()` to register the full baseline set |
94 | 91 |
|
95 | | -## Build Rules |
96 | | - |
97 | | -- one PR purpose only |
98 | | -- docs-first only |
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 |
| 92 | +### Hybrid Adoption |
| 93 | +- call `registerStandardDebugPreset()` then extend/override locally with project-owned panels/providers/commands |
107 | 94 |
|
108 | 95 | ## 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 |
| 96 | +- baseline preset registers successfully end-to-end |
| 97 | +- shared panels consume provider data only |
| 98 | +- shared commands operate through public overlay/debug APIs only |
| 99 | +- partial and full adoption modes both work |
| 100 | +- naming remains stable and deterministic |
| 101 | +- project-specific logic remains outside shared library |
117 | 102 |
|
118 | 103 | ## 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 |
| 104 | +If v1 library is too broad or unstable: |
| 105 | +1. keep target directory structure and preset entry point |
| 106 | +2. reduce initial inventory to highest-value subset |
| 107 | +3. preserve command/panel/provider naming contracts |
| 108 | +4. revalidate minimal adoption before re-expanding |
| 109 | + |
| 110 | +## Rollout Notes |
| 111 | +- BUILD bundle is docs-only and implementation-ready |
| 112 | +- APPLY should implement inventory incrementally (providers -> panels -> commands -> preset) |
| 113 | +- do not widen scope into excluded areas in this track |
| 114 | + |
| 115 | +## Deliverables |
| 116 | +- `docs/pr/PLAN_PR_DEBUG_SURFACES_STANDARD_LIBRARY.md` |
| 117 | +- `docs/pr/BUILD_PR_DEBUG_SURFACES_STANDARD_LIBRARY.md` |
| 118 | +- `docs/pr/APPLY_PR_DEBUG_SURFACES_STANDARD_LIBRARY.md` |
| 119 | +- `docs/dev/codex_commands.md` |
| 120 | +- `docs/dev/commit_comment.txt` |
| 121 | +- `docs/dev/reports/change_summary.txt` |
| 122 | +- `docs/dev/reports/validation_checklist.txt` |
| 123 | +- `docs/dev/reports/file_tree.txt` |
0 commit comments