|
| 1 | +# PLAN_PR_DEBUG_SURFACES_STANDARD_LIBRARY |
| 2 | + |
| 3 | +## Objective |
| 4 | +Plan the first reusable, opt-in standard library for promoted debug surfaces so projects can adopt a consistent baseline without pulling project-specific logic into shared layers. |
| 5 | + |
| 6 | +## Workflow |
| 7 | +PLAN_PR -> BUILD_PR -> APPLY_PR |
| 8 | + |
| 9 | +## PR Purpose |
| 10 | +One PR purpose only: define the standard library plan. |
| 11 | + |
| 12 | +## Scope |
| 13 | +In scope: |
| 14 | +- shared panel candidates |
| 15 | +- shared provider candidates |
| 16 | +- shared operator command candidates |
| 17 | +- adoption models |
| 18 | +- naming conventions |
| 19 | +- target structure and ownership boundaries |
| 20 | +- validation strategy, risk controls, and rollout notes |
| 21 | + |
| 22 | +Out of scope: |
| 23 | +- implementation in this PR |
| 24 | +- 3D-specific diagnostics |
| 25 | +- network-specific diagnostics |
| 26 | +- deep-inspector features |
| 27 | +- promotion of project-specific debug artifacts into shared library |
| 28 | + |
| 29 | +## Design Constraints |
| 30 | +- docs-first only |
| 31 | +- keep initial library small |
| 32 | +- keep adoption opt-in |
| 33 | +- preserve Dev Console (command/control) vs Debug Overlay (telemetry/visual) separation |
| 34 | +- keep project-specific panels/providers/commands outside shared library |
| 35 | + |
| 36 | +## Ownership Model |
| 37 | +### Engine Core (minimal) |
| 38 | +- contracts/hooks only when required |
| 39 | +- no shared panel/provider/command implementations |
| 40 | + |
| 41 | +### Engine Debug (shared implementation) |
| 42 | +- standard library shared panels/providers/commands |
| 43 | +- shared registration helpers and small presets |
| 44 | + |
| 45 | +### Project/Sample/Tool Layers (local) |
| 46 | +- project-specific panels/providers/commands |
| 47 | +- scene/tool adapters and defaults |
| 48 | +- custom local presets |
| 49 | + |
| 50 | +## Initial Standard Library (Small Baseline) |
| 51 | +### Shared Panels (initial) |
| 52 | +- `system.fps` |
| 53 | +- `system.timing` |
| 54 | +- `scene.summary` |
| 55 | +- `scene.entities` |
| 56 | +- `render.layers` |
| 57 | +- `input.summary` |
| 58 | +- `debug.status` |
| 59 | + |
| 60 | +### Shared Providers (initial) |
| 61 | +- `system.timing` |
| 62 | +- `scene.summary` |
| 63 | +- `scene.entities` |
| 64 | +- `render.layers` |
| 65 | +- `input.summary` |
| 66 | +- `debug.status` |
| 67 | + |
| 68 | +### Shared Operator Commands (initial) |
| 69 | +- `debug.help` |
| 70 | +- `debug.status` |
| 71 | +- `overlay.list` |
| 72 | +- `overlay.status` |
| 73 | +- `overlay.show <panelId>` |
| 74 | +- `overlay.hide <panelId>` |
| 75 | +- `overlay.toggle <panelId>` |
| 76 | +- `overlay.showAll` |
| 77 | +- `overlay.hideAll` |
| 78 | +- `overlay.order` |
| 79 | + |
| 80 | +## Naming Conventions |
| 81 | +### Panel IDs |
| 82 | +- dot notation, stable and human-readable |
| 83 | +- examples: `system.fps`, `scene.summary`, `render.layers` |
| 84 | + |
| 85 | +### Provider IDs |
| 86 | +- align with panel domain IDs where practical |
| 87 | +- examples: `system.timing`, `scene.entities`, `debug.status` |
| 88 | + |
| 89 | +### Command Namespaces |
| 90 | +- `debug.*` for console-level status/help |
| 91 | +- `overlay.*` for overlay operator controls |
| 92 | + |
| 93 | +## Target Structure |
| 94 | +```text |
| 95 | +engine/ |
| 96 | + debug/ |
| 97 | + standard/ |
| 98 | + panels/ |
| 99 | + system/ |
| 100 | + scene/ |
| 101 | + render/ |
| 102 | + input/ |
| 103 | + debug/ |
| 104 | + providers/ |
| 105 | + system/ |
| 106 | + scene/ |
| 107 | + render/ |
| 108 | + input/ |
| 109 | + debug/ |
| 110 | + commands/ |
| 111 | + registerStandardDebugCommands.js |
| 112 | + presets/ |
| 113 | + registerStandardDebugPreset.js |
| 114 | +``` |
| 115 | + |
| 116 | +Project/sample/tool-owned custom debug artifacts remain outside this shared tree. |
| 117 | + |
| 118 | +## Adoption Models |
| 119 | +### Minimal Adoption |
| 120 | +- register shared commands |
| 121 | +- register 1-3 providers |
| 122 | +- register 1-3 panels |
| 123 | + |
| 124 | +### Preset Adoption |
| 125 | +- register standard preset bundle |
| 126 | +- override with local excludes/includes |
| 127 | + |
| 128 | +### Hybrid Adoption |
| 129 | +- use shared commands/providers |
| 130 | +- replace or extend panel set locally |
| 131 | + |
| 132 | +## Validation Strategy |
| 133 | +- contract validation: shared IDs follow naming conventions and remain stable |
| 134 | +- behavior validation: shared commands operate through public APIs only |
| 135 | +- integration validation: sample/tool can adopt minimal set without custom refactors |
| 136 | +- boundary validation: no project-specific panels/providers/commands promoted into shared library |
| 137 | + |
| 138 | +## Risk Controls |
| 139 | +- keep initial baseline small to prevent scope creep |
| 140 | +- reject runtime-specific leakage into shared providers/panels |
| 141 | +- require opt-in registration (no forced defaults) |
| 142 | +- keep advanced inspections deferred to future PRs |
| 143 | + |
| 144 | +## Rollout Notes |
| 145 | +1. This PLAN PR is docs-only. |
| 146 | +2. BUILD PR defines authoritative inventory and implementation map. |
| 147 | +3. APPLY PR implements initial library incrementally with sample-level proving. |
| 148 | +4. Expansion (3D, network, deep inspector) requires separate PRs. |
| 149 | + |
| 150 | +## Next Commands |
| 151 | +1. `BUILD_PR_DEBUG_SURFACES_STANDARD_LIBRARY` |
| 152 | +2. `APPLY_PR_DEBUG_SURFACES_STANDARD_LIBRARY` |
0 commit comments