|
1 | 1 | # BUILD_PR_DEBUG_SURFACES_PROMOTION |
2 | 2 |
|
3 | | -## Purpose |
| 3 | +## Objective |
| 4 | +Create an authoritative docs-only BUILD bundle for extraction/relocation of proven debug surfaces from `tools/dev` into shared layers, with no feature expansion. |
4 | 5 |
|
5 | | -Turn the promotion plan into a docs-only extraction bundle that is ready for Codex implementation. |
| 6 | +## Workflow |
| 7 | +PLAN_PR -> BUILD_PR -> APPLY_PR |
6 | 8 |
|
7 | | -## Build Scope |
| 9 | +## Build Constraints |
| 10 | +- docs-first only |
| 11 | +- one PR purpose only |
| 12 | +- extraction/relocation only |
| 13 | +- no feature expansion |
| 14 | +- minimize engine-core changes |
| 15 | +- preserve `MultiSystemDemoScene.js` as proving integration |
8 | 16 |
|
9 | | -Produce docs that define: |
| 17 | +## Authoritative Target Structure |
| 18 | +```text |
| 19 | +engine/ |
| 20 | + core/ |
| 21 | + debug/ |
| 22 | + DebugSurfaceContracts.js |
| 23 | + DebugRegistrationHooks.js |
| 24 | + DebugEnvironmentGate.js |
| 25 | + debug/ |
| 26 | + console/ |
| 27 | + DevConsoleHost.js |
| 28 | + DevConsoleCommandBridge.js |
| 29 | + overlay/ |
| 30 | + DebugOverlayHost.js |
| 31 | + OverlayPanelRegistry.js |
| 32 | + OverlayPersistenceAdapter.js |
| 33 | + providers/ |
| 34 | + OverlayProviderRegistry.js |
| 35 | + bootstrap/ |
| 36 | + DebugSurfacesBootstrap.js |
10 | 37 |
|
11 | | -- final target folder structure |
12 | | -- exact ownership mapping |
13 | | -- migration sequence |
14 | | -- implementation boundaries |
15 | | -- validation and rollback strategy |
| 38 | +project|sample|tool/ |
| 39 | + debug/ |
| 40 | + panels/ (local only) |
| 41 | + providers/ (local only) |
| 42 | + commands/ (local only) |
| 43 | +``` |
16 | 44 |
|
17 | | -## Required Deliverables |
| 45 | +## Ownership Matrix |
| 46 | +| Capability | Engine Core | Engine Debug | Project/Sample/Tool | |
| 47 | +|---|---|---|---| |
| 48 | +| Debug contracts/hooks | Owns | Consumes | Consumes | |
| 49 | +| Console host runtime | No | Owns | Integrates | |
| 50 | +| Overlay host runtime | No | Owns | Integrates | |
| 51 | +| Panel registry | No | Owns | Extends via public registration | |
| 52 | +| Provider registry/plumbing | No | Owns | Extends via local providers | |
| 53 | +| Operator command wiring | No | Owns | May register local commands | |
| 54 | +| Persistence adapter boundary | No | Owns | May provide local storage key/config | |
| 55 | +| Sample-specific panels/providers/commands | No | No | Owns | |
18 | 56 |
|
19 | | -- ownership matrix |
20 | | -- target tree |
21 | | -- migration checklist |
22 | | -- validation checklist |
23 | | -- change summary |
24 | | -- Codex command |
25 | | -- commit comment |
26 | | -- next command |
| 57 | +## Ordered Migration Steps |
| 58 | +1. Freeze ownership boundaries and no-go rules. |
| 59 | +2. Extract minimal core contracts/hooks into `engine/core/debug`. |
| 60 | +3. Relocate console host/bridge to `engine/debug/console`. |
| 61 | +4. Relocate overlay host/registry/persistence adapter to `engine/debug/overlay`. |
| 62 | +5. Relocate provider registry/plumbing to `engine/debug/providers`. |
| 63 | +6. Add shared bootstrap/composition in `engine/debug/bootstrap`. |
| 64 | +7. Rewire `MultiSystemDemoScene.js` through public bootstrap/registration APIs. |
| 65 | +8. Validate parity and boundary compliance. |
27 | 66 |
|
28 | | -## Build Rules |
| 67 | +## Validation Goals |
| 68 | +- no feature expansion introduced |
| 69 | +- console commands still function through public command registry |
| 70 | +- overlay still renders deterministically |
| 71 | +- provider reads remain read-only |
| 72 | +- panel persistence behavior remains stable |
| 73 | +- sample-specific artifacts remain outside shared layers |
| 74 | +- engine-core remains contract-only |
| 75 | +- `MultiSystemDemoScene.js` continues as proving integration |
29 | 76 |
|
30 | | -- one PR purpose only |
31 | | -- docs-first only |
32 | | -- no direct runtime implementation in this bundle |
33 | | -- keep engine-core changes minimal |
34 | | -- assume `engine-debug` is the primary target |
35 | | -- preserve sample-level proving path through `MultiSystemDemoScene.js` |
| 77 | +## Rollback Strategy |
| 78 | +If migration is unstable: |
| 79 | +1. keep extracted core contracts/hooks unchanged |
| 80 | +2. revert relocation stages in reverse order (bootstrap -> providers -> overlay -> console) |
| 81 | +3. restore prior sample wiring |
| 82 | +4. re-run parity checks before retry |
36 | 83 |
|
37 | | -## Expected Build Output |
| 84 | +## Rollout Notes |
| 85 | +- BUILD bundle remains docs-only and implementation-ready |
| 86 | +- APPLY should execute incremental relocation with validation after each stage |
| 87 | +- stop and split scope if migration requires non-minimal core changes |
38 | 88 |
|
| 89 | +## Deliverables |
39 | 90 | - `docs/pr/PLAN_PR_DEBUG_SURFACES_PROMOTION.md` |
40 | 91 | - `docs/pr/BUILD_PR_DEBUG_SURFACES_PROMOTION.md` |
41 | 92 | - `docs/pr/APPLY_PR_DEBUG_SURFACES_PROMOTION.md` |
42 | 93 | - `docs/dev/codex_commands.md` |
43 | 94 | - `docs/dev/commit_comment.txt` |
44 | | -- `docs/dev/next_command.txt` |
45 | 95 | - `docs/dev/reports/change_summary.txt` |
46 | 96 | - `docs/dev/reports/validation_checklist.txt` |
47 | 97 | - `docs/dev/reports/file_tree.txt` |
0 commit comments