|
1 | 1 | # BUILD_PR_DEBUG_SURFACES_PRESETS |
2 | 2 |
|
3 | | -## Purpose |
| 3 | +## Objective |
| 4 | +Build an authoritative docs-only bundle for the first reusable presets system for promoted debug surfaces. |
4 | 5 |
|
5 | | -Turn the presets plan into a docs-only build bundle for Codex. |
| 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 | +- first version is small and opt-in |
| 13 | +- visibility + optional ordering only |
| 14 | +- no feature expansion beyond preset infrastructure and baseline presets |
8 | 15 |
|
9 | | -Define: |
| 16 | +## Required Shared Components |
| 17 | +- `DebugPresetRegistry` |
| 18 | +- `DebugPresetApplier` |
| 19 | +- `registerStandardDebugPresets()` |
| 20 | +- `registerPresetCommands()` |
10 | 21 |
|
11 | | -- preset registry structure |
12 | | -- preset application flow |
13 | | -- initial shared preset inventory |
14 | | -- preset commands |
15 | | -- precedence rules with persistence |
16 | | -- adoption patterns |
17 | | -- validation rules |
| 22 | +## Authoritative Target Structure |
| 23 | +```text |
| 24 | +engine/ |
| 25 | + debug/ |
| 26 | + presets/ |
| 27 | + DebugPresetRegistry.js |
| 28 | + DebugPresetApplier.js |
| 29 | + standard/ |
| 30 | + presets/ |
| 31 | + registerStandardDebugPresets.js |
| 32 | + preset.minimal.js |
| 33 | + preset.gameplay.js |
| 34 | + preset.rendering.js |
| 35 | + preset.systems.js |
| 36 | + preset.qa.js |
| 37 | + commands/ |
| 38 | + registerPresetCommands.js |
| 39 | +``` |
18 | 40 |
|
19 | | -## Required Deliverables |
| 41 | +## Shared Preset Inventory (v1) |
| 42 | +- `preset.minimal` |
| 43 | +- `preset.gameplay` |
| 44 | +- `preset.rendering` |
| 45 | +- `preset.systems` |
| 46 | +- `preset.qa` |
20 | 47 |
|
21 | | -- authoritative target tree |
22 | | -- preset inventory |
23 | | -- command inventory |
24 | | -- precedence rules |
25 | | -- adoption models |
26 | | -- validation checklist |
27 | | -- rollback notes |
28 | | -- codex command |
29 | | -- commit comment |
30 | | -- next command |
| 48 | +Preset content scope: |
| 49 | +- `panels.enabled[]` |
| 50 | +- `panels.disabled[]` |
| 51 | +- `panels.order[]` (optional) |
31 | 52 |
|
32 | | -## Build Rules |
| 53 | +## Preset Commands (v1) |
| 54 | +- `preset.help` |
| 55 | +- `preset.list` |
| 56 | +- `preset.current` |
| 57 | +- `preset.apply <presetId>` |
| 58 | +- `preset.reset` |
33 | 59 |
|
34 | | -- one PR purpose only |
35 | | -- docs-first only |
36 | | -- keep the initial preset system small |
37 | | -- start with panel visibility and optional ordering only |
38 | | -- no docking/layout editor features |
39 | | -- no project-specific presets in shared layer |
| 60 | +## Registration Pattern |
| 61 | +1. `registerStandardDebugPresets()` registers shared preset descriptors. |
| 62 | +2. `registerPresetCommands()` registers shared `preset.*` commands. |
| 63 | +3. Commands resolve presets via `DebugPresetRegistry`. |
| 64 | +4. Apply flows execute via `DebugPresetApplier` only. |
| 65 | + |
| 66 | +Rules: |
| 67 | +- deterministic registration and lookup |
| 68 | +- public APIs only |
| 69 | +- no direct panel object mutation from command handlers |
| 70 | + |
| 71 | +## Precedence Rules with Persistence (authoritative) |
| 72 | +1. Base registry panel defaults. |
| 73 | +2. Persisted panel state restore. |
| 74 | +3. Explicit `preset.apply` override. |
| 75 | +4. Subsequent explicit operator panel commands. |
| 76 | + |
| 77 | +Save behavior: |
| 78 | +- after successful `preset.apply`, persist resulting panel state snapshot. |
| 79 | + |
| 80 | +## Adoption Modes |
| 81 | +- Minimal: registry + applier + 1 shared preset (+ optional commands) |
| 82 | +- Standard: full shared preset set + shared preset commands |
| 83 | +- Hybrid: shared presets plus project-local presets outside shared layer |
| 84 | + |
| 85 | +## Exclusions (hard) |
| 86 | +- layout editors |
| 87 | +- docking systems |
| 88 | +- role permissions |
| 89 | +- 3D-specific preset content |
| 90 | +- network-specific preset content |
| 91 | +- project-specific preset implementations in shared layer |
| 92 | + |
| 93 | +## Validation Goals |
| 94 | +- registry accepts and lists shared presets deterministically |
| 95 | +- applier applies visibility/ordering deterministically |
| 96 | +- unknown panel IDs are ignored safely |
| 97 | +- commands route through registry/applier only |
| 98 | +- persistence precedence behaves as defined |
| 99 | +- minimal and standard adoption both validate |
| 100 | + |
| 101 | +## Rollback Strategy |
| 102 | +If v1 is unstable or too broad: |
| 103 | +1. keep structure and core component names intact |
| 104 | +2. reduce preset inventory to `preset.minimal` + one focused preset |
| 105 | +3. preserve command surface and precedence rules |
| 106 | +4. revalidate minimal adoption before expansion |
| 107 | + |
| 108 | +## Rollout Notes |
| 109 | +- BUILD bundle is docs-only and implementation-ready |
| 110 | +- APPLY should proceed incrementally: registry -> applier -> shared presets -> preset commands |
| 111 | +- do not expand scope into excluded areas in this track |
| 112 | + |
| 113 | +## Deliverables |
| 114 | +- `docs/pr/PLAN_PR_DEBUG_SURFACES_PRESETS.md` |
| 115 | +- `docs/pr/BUILD_PR_DEBUG_SURFACES_PRESETS.md` |
| 116 | +- `docs/pr/APPLY_PR_DEBUG_SURFACES_PRESETS.md` |
| 117 | +- `docs/dev/codex_commands.md` |
| 118 | +- `docs/dev/commit_comment.txt` |
| 119 | +- `docs/dev/reports/change_summary.txt` |
| 120 | +- `docs/dev/reports/validation_checklist.txt` |
| 121 | +- `docs/dev/reports/file_tree.txt` |
0 commit comments