|
| 1 | +# PLAN_PR_DEBUG_SURFACES_PROMOTION |
| 2 | + |
| 3 | +## Objective |
| 4 | +Plan a docs-first promotion path for proven debug surfaces from `tools/dev` into shared layers while minimizing engine-core changes. |
| 5 | + |
| 6 | +## Workflow |
| 7 | +PLAN_PR -> BUILD_PR -> APPLY_PR |
| 8 | + |
| 9 | +## PR Purpose |
| 10 | +Promote proven debug systems with clear ownership boundaries. |
| 11 | + |
| 12 | +## Scope |
| 13 | +In scope: |
| 14 | +- ownership model for `engine-core`, `engine-debug`, and `project/sample/tool` layers |
| 15 | +- target folder structure for promoted debug systems |
| 16 | +- phased migration plan |
| 17 | +- validation strategy |
| 18 | +- risk controls |
| 19 | +- rollout notes |
| 20 | + |
| 21 | +Out of scope: |
| 22 | +- implementation migration in this PR |
| 23 | +- engine-core rewrite |
| 24 | +- promotion of sample-specific panels/providers/commands |
| 25 | + |
| 26 | +## Current Proven Surface Set |
| 27 | +- Dev Console host |
| 28 | +- Debug Overlay host |
| 29 | +- Overlay panel registry |
| 30 | +- Overlay data providers |
| 31 | +- Overlay operator commands |
| 32 | +- Overlay panel persistence |
| 33 | + |
| 34 | +## Target Ownership |
| 35 | +### Engine Core (minimal contracts only) |
| 36 | +Own only stable contracts and gates: |
| 37 | +- debug surface interfaces |
| 38 | +- registration hooks |
| 39 | +- environment/debug gates |
| 40 | + |
| 41 | +Engine core must not own: |
| 42 | +- console UI details |
| 43 | +- overlay UI policy |
| 44 | +- provider implementation details |
| 45 | +- persistence policy/storage specifics |
| 46 | +- sample-specific debug assets |
| 47 | + |
| 48 | +### Engine Debug (primary promoted implementation) |
| 49 | +Own shared reusable debug implementations: |
| 50 | +- console runtime host and command bridge |
| 51 | +- overlay runtime host |
| 52 | +- panel registry |
| 53 | +- provider registry/plumbing |
| 54 | +- operator command adapters |
| 55 | +- persistence adapter boundary and wiring |
| 56 | +- debug bootstrap/composition |
| 57 | + |
| 58 | +### Project/Sample/Tool Layers |
| 59 | +Remain local and non-promoted: |
| 60 | +- sample-specific panels |
| 61 | +- sample-specific providers |
| 62 | +- sample-specific operator commands |
| 63 | +- scene-level wiring and defaults |
| 64 | +- tool-specific debug adapters |
| 65 | + |
| 66 | +## Target Folder Structure |
| 67 | +```text |
| 68 | +engine/ |
| 69 | + core/ |
| 70 | + debug/ |
| 71 | + DebugSurfaceContracts.js |
| 72 | + DebugRegistrationHooks.js |
| 73 | + DebugEnvironmentGate.js |
| 74 | + debug/ |
| 75 | + console/ |
| 76 | + DevConsoleHost.js |
| 77 | + DevConsoleCommandBridge.js |
| 78 | + overlay/ |
| 79 | + DebugOverlayHost.js |
| 80 | + OverlayPanelRegistry.js |
| 81 | + OverlayPersistenceAdapter.js |
| 82 | + providers/ |
| 83 | + OverlayProviderRegistry.js |
| 84 | + bootstrap/ |
| 85 | + DebugSurfacesBootstrap.js |
| 86 | +
|
| 87 | +samples/ |
| 88 | + Phase 12 - Demo Games/ |
| 89 | + Demo 1205 - Multi-System Demo/ |
| 90 | + MultiSystemDemoScene.js (integration reference) |
| 91 | +``` |
| 92 | + |
| 93 | +## Migration Phases |
| 94 | +### Phase 1: Ownership Lock |
| 95 | +- freeze boundary rules and ownership matrix |
| 96 | +- confirm sample-owned items remain local |
| 97 | + |
| 98 | +### Phase 2: Contract Extraction |
| 99 | +- define minimal core contracts/hooks |
| 100 | +- keep core surface narrow and stable |
| 101 | + |
| 102 | +### Phase 3: Engine-Debug Assembly |
| 103 | +- move reusable debug implementations into `engine/debug` |
| 104 | +- preserve existing public API seams |
| 105 | + |
| 106 | +### Phase 4: Sample Rewire |
| 107 | +- keep `MultiSystemDemoScene.js` as proving target |
| 108 | +- verify sample-specific panel/provider/command ownership remains local |
| 109 | + |
| 110 | +### Phase 5: Stabilization |
| 111 | +- validate behavior parity and rollback readiness |
| 112 | +- document promotion-ready state for BUILD/APPLY |
| 113 | + |
| 114 | +## Validation Strategy |
| 115 | +- contract validation: boundary and ownership checks pass |
| 116 | +- behavior validation: console and overlay continue to operate through public APIs |
| 117 | +- regression validation: sample commands, panel visibility, provider snapshots, and persistence remain stable |
| 118 | +- safety validation: unknown panel IDs and degraded states fail safely |
| 119 | + |
| 120 | +## Risk Controls |
| 121 | +- minimize engine-core changes by promoting implementation to `engine/debug` |
| 122 | +- reject direct console-overlay private coupling |
| 123 | +- block promotion of sample-specific panels/providers/commands |
| 124 | +- preserve phased rollback points at each migration stage |
| 125 | + |
| 126 | +## Rollout Notes |
| 127 | +- start with docs-only plan (this PR) |
| 128 | +- BUILD PR should define surgical implementation mapping and test/validation execution |
| 129 | +- APPLY PR should execute migration incrementally with sample-level validation first |
| 130 | +- no broad refactors outside this purpose |
| 131 | + |
| 132 | +## Integration Reference |
| 133 | +- `samples/Phase 12 - Demo Games/Demo 1205 - Multi-System Demo/MultiSystemDemoScene.js` |
| 134 | + |
| 135 | +## Next Commands |
| 136 | +1. `BUILD_PR_DEBUG_SURFACES_PROMOTION` |
| 137 | +2. `APPLY_PR_DEBUG_SURFACES_PROMOTION` |
0 commit comments