|
| 1 | +# PR_11_190 — V2 Re-engineer Naming + Header Guard |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Lock the Tool V2 migration lane so Codex cannot drift into legacy copy/paste, ambiguous tool naming, or custom header implementations. |
| 6 | + |
| 7 | +This PR is corrective enforcement for the current V2 lane: |
| 8 | + |
| 9 | +- Palette Manager V2 |
| 10 | +- SVG Asset Studio V2 |
| 11 | +- Future Vector Map Editor V2 |
| 12 | +- Future Tilemap Studio V2 |
| 13 | +- Future Asset Browser V2 |
| 14 | + |
| 15 | +## Non-negotiable Direction |
| 16 | + |
| 17 | +This is a re-engineer. |
| 18 | + |
| 19 | +This is not: |
| 20 | +- a copy/paste of v1 tools |
| 21 | +- a patch of legacy tools |
| 22 | +- a wrapper around Workspace Manager v1 |
| 23 | +- a platformShell migration |
| 24 | +- a shared/tools integration task |
| 25 | + |
| 26 | +## Required Naming Rule |
| 27 | + |
| 28 | +Every new Tool V2 visible name must end with `V2`. |
| 29 | + |
| 30 | +Correct names: |
| 31 | + |
| 32 | +- Palette Manager V2 |
| 33 | +- SVG Asset Studio V2 |
| 34 | +- Vector Map Editor V2 |
| 35 | +- Tilemap Studio V2 |
| 36 | +- Asset Browser V2 |
| 37 | + |
| 38 | +Ambiguous names are not allowed for V2 tools: |
| 39 | + |
| 40 | +- Palette Manager |
| 41 | +- Palette Browser |
| 42 | +- SVG Asset Studio |
| 43 | +- Vector Map Editor |
| 44 | +- Tilemap Studio |
| 45 | +- Asset Browser |
| 46 | + |
| 47 | +## Palette Naming Clarification |
| 48 | + |
| 49 | +Use: |
| 50 | + |
| 51 | +```text |
| 52 | +Palette Manager V2 |
| 53 | +``` |
| 54 | + |
| 55 | +Do not introduce or reuse: |
| 56 | + |
| 57 | +```text |
| 58 | +Palette Browser |
| 59 | +Palette Browser V2 |
| 60 | +Palette Manager |
| 61 | +``` |
| 62 | + |
| 63 | +Unless the repo already contains a distinct v1 route named Palette Browser, leave it untouched. The active V2 lane is `Palette Manager V2`. |
| 64 | + |
| 65 | +## Header Requirement |
| 66 | + |
| 67 | +Every V2 tool must use the same shared theme header mount used by `/index.html`: |
| 68 | + |
| 69 | +```html |
| 70 | +<div id="shared-theme-header"></div> |
| 71 | +``` |
| 72 | + |
| 73 | +Codex must re-engineer the V2 tool shell to use that mount. |
| 74 | + |
| 75 | +Codex must not: |
| 76 | +- create a new custom header |
| 77 | +- copy/paste old header markup from v1 tools |
| 78 | +- use `platformShell` |
| 79 | +- use `tools/shared/*` |
| 80 | +- create a fallback header |
| 81 | +- silently hide missing header state |
| 82 | + |
| 83 | +If the shared theme/header cannot mount, the tool must show an explicit visible error state. |
| 84 | + |
| 85 | +## Architecture Boundary |
| 86 | + |
| 87 | +Data entry paths only: |
| 88 | + |
| 89 | +1. Workspace writes session, tool reads session. |
| 90 | +2. Tool URL writes session, tool reads session. |
| 91 | +3. Tool direct reads session via `hostContextId`. |
| 92 | + |
| 93 | +Tool never: |
| 94 | +- fetches data |
| 95 | +- guesses data |
| 96 | +- uses fallback data |
| 97 | +- reaches into Workspace Manager v1 |
| 98 | +- relies on legacy aliases |
| 99 | + |
| 100 | +## Scope |
| 101 | + |
| 102 | +Allowed: |
| 103 | +- Update V2 tool visible names to end with `V2`. |
| 104 | +- Update V2 document titles, headings, aria labels, and menu labels to end with `V2`. |
| 105 | +- Ensure Palette Manager V2 and SVG Asset Studio V2 use `#shared-theme-header`. |
| 106 | +- Add explicit visible error if required session context/header data is missing. |
| 107 | +- Keep implementation in the V2 tool file only unless an existing V2 entry file already owns the header mount. |
| 108 | + |
| 109 | +Not allowed: |
| 110 | +- No schema changes. |
| 111 | +- No sample changes. |
| 112 | +- No game changes. |
| 113 | +- No Workspace Manager v1 changes. |
| 114 | +- No legacy tool patching. |
| 115 | +- No repo-wide fallback cleanup. |
| 116 | +- No helper classes. |
| 117 | +- No abstraction layers. |
| 118 | +- No alias variables. |
| 119 | +- No copy/paste from v1 tools. |
| 120 | + |
| 121 | +## Validation |
| 122 | + |
| 123 | +Run targeted validation only. |
| 124 | + |
| 125 | +Required checks: |
| 126 | + |
| 127 | +```powershell |
| 128 | +node --check tools/palette-manager-v2/index.js |
| 129 | +node --check tools/svg-asset-studio-v2/index.js |
| 130 | +``` |
| 131 | + |
| 132 | +If those exact files do not exist, Codex must locate the current V2 entry files by path/name and run `node --check` on the changed V2 entry files only. |
| 133 | + |
| 134 | +Manual verification: |
| 135 | + |
| 136 | +- Palette Manager V2 title/header shows `Palette Manager V2`. |
| 137 | +- SVG Asset Studio V2 title/header shows `SVG Asset Studio V2`. |
| 138 | +- Both tools contain and mount through `<div id="shared-theme-header"></div>`. |
| 139 | +- No `platformShell` dependency is introduced. |
| 140 | +- No `tools/shared/*` dependency is introduced. |
| 141 | +- Empty/error states are visible and actionable. |
| 142 | +- No fallback/default data is used. |
| 143 | + |
| 144 | +Full samples smoke test: |
| 145 | + |
| 146 | +Skipped. This PR targets V2 tool naming/header compliance only and does not change shared sample loader/framework. |
0 commit comments