|
| 1 | +# BUILD PR — Games Breakout Full Folder Migration |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Execute the full validated game-folder migration pipeline for `games/Breakout/**` in one testable BUILD, while keeping scope limited to this single game. |
| 5 | + |
| 6 | +## Single PR Purpose |
| 7 | +Migrate the Breakout game folder end-to-end using the established template contract and migration workflow: |
| 8 | +- create `_next` from template |
| 9 | +- migrate gameplay into `_next` |
| 10 | +- validate `_next` |
| 11 | +- clear canonical destination |
| 12 | +- copy `_next` into canonical |
| 13 | +- validate canonical |
| 14 | +- remove `_next` |
| 15 | + |
| 16 | +## Why This Is Allowed Now |
| 17 | +This repo now has: |
| 18 | +- an accepted reusable `games/_template` |
| 19 | +- enforced template contract rules |
| 20 | +- multiple validated migrations proving the workflow |
| 21 | + |
| 22 | +This BUILD bundles the already-proven steps for one game folder only. |
| 23 | + |
| 24 | +## Source / Destination |
| 25 | +Canonical source game: |
| 26 | +- `games/Breakout/**` |
| 27 | + |
| 28 | +Template source: |
| 29 | +- `games/_template/**` |
| 30 | + |
| 31 | +Temporary migration target: |
| 32 | +- `games/Breakout_next/**` |
| 33 | + |
| 34 | +Canonical destination after promotion: |
| 35 | +- `games/Breakout/**` |
| 36 | + |
| 37 | +## Scope (STRICT) |
| 38 | +Perform the following steps in order: |
| 39 | + |
| 40 | +### Step 1 — Create `_next` baseline from template |
| 41 | +- create `games/Breakout_next/**` from `games/_template/**` |
| 42 | +- keep baseline non-playable only until gameplay migration is wired |
| 43 | +- preserve required shell/theme baseline |
| 44 | +- ensure canvas is visible during baseline |
| 45 | + |
| 46 | +Required baseline text before gameplay wiring: |
| 47 | +- `HTML Says` |
| 48 | +- `Template Status` |
| 49 | +- `This template intentionally does not boot gameplay.` |
| 50 | + |
| 51 | +### Step 2 — Migrate Breakout gameplay into `_next` |
| 52 | +- read gameplay from `games/Breakout/**` |
| 53 | +- write gameplay into correct responsibility-based destinations under `games/Breakout_next/**` |
| 54 | +- adapt relative paths/imports only as required by the new destination |
| 55 | +- wire `games/Breakout_next/index.html` so `_next` boots gameplay |
| 56 | +- preserve debug integration if present in source |
| 57 | + |
| 58 | +### Step 3 — Validate `_next` |
| 59 | +- open `games/Breakout_next/index.html` |
| 60 | +- confirm gameplay starts |
| 61 | +- confirm canvas visible |
| 62 | +- confirm no console errors |
| 63 | +- confirm source `games/Breakout/**` was not modified during `_next` creation/migration |
| 64 | + |
| 65 | +### Step 4 — Clear canonical destination |
| 66 | +- delete all contents under `games/Breakout/**` |
| 67 | +- leave `games/Breakout/` folder itself present and empty |
| 68 | + |
| 69 | +### Step 5 — Copy `_next` into canonical |
| 70 | +- copy all files/folders from `games/Breakout_next/**` into `games/Breakout/**` |
| 71 | +- preserve exact structure |
| 72 | +- ensure canonical path boots gameplay correctly |
| 73 | + |
| 74 | +### Step 6 — Validate canonical |
| 75 | +- open `games/Breakout/index.html` |
| 76 | +- confirm gameplay starts from canonical path |
| 77 | +- confirm canvas visible |
| 78 | +- confirm no console errors |
| 79 | +- confirm structure matches `_next` |
| 80 | + |
| 81 | +### Step 7 — Remove `_next` |
| 82 | +- delete `games/Breakout_next/**` |
| 83 | +- remove `games/Breakout_next/` folder once empty |
| 84 | + |
| 85 | +## Allowed Destination Areas During Migration |
| 86 | +Place migrated files only into the correct corresponding areas under `games/Breakout_next/**`, including as applicable: |
| 87 | +- `games/Breakout_next/assets/**` |
| 88 | +- `games/Breakout_next/config/**` |
| 89 | +- `games/Breakout_next/debug/**` |
| 90 | +- `games/Breakout_next/entities/**` |
| 91 | +- `games/Breakout_next/flow/**` |
| 92 | +- `games/Breakout_next/game/**` |
| 93 | +- `games/Breakout_next/levels/**` |
| 94 | +- `games/Breakout_next/platform/**` |
| 95 | +- `games/Breakout_next/systems/**` |
| 96 | +- `games/Breakout_next/ui/**` |
| 97 | +- `games/Breakout_next/utils/**` |
| 98 | + |
| 99 | +## Required Mapping Rule |
| 100 | +- Put each migrated file into the correct destination by responsibility |
| 101 | +- Do NOT dump unrelated files into the wrong folder just to make runtime work |
| 102 | +- Preserve reasonable structure parity between the original game and `_next` |
| 103 | +- If a source file has no clear destination inside `_next`, STOP rather than guessing |
| 104 | + |
| 105 | +## Explicit Non-Goals |
| 106 | +- DO NOT modify any game other than Breakout |
| 107 | +- DO NOT refactor engine/shared broadly |
| 108 | +- DO NOT redesign `games/_template` |
| 109 | +- DO NOT change contract rules in this PR |
| 110 | +- DO NOT perform repo-wide cleanup |
| 111 | +- DO NOT invent missing files |
| 112 | +- DO NOT guess ambiguous destinations |
| 113 | +- DO NOT mix in unrelated fixes |
| 114 | + |
| 115 | +## Fail-Fast Conditions |
| 116 | +STOP with no changes if any of the following are true: |
| 117 | +- a required source file has no clear destination inside `games/Breakout_next/**` |
| 118 | +- migration would require broad engine/shared refactor beyond strict path adjustments |
| 119 | +- canonical runtime cannot be made to work without structural guessing |
| 120 | +- any unrelated game folder must be changed |
| 121 | +- required runtime files are missing and would need invented content |
| 122 | + |
| 123 | +## Acceptance Criteria |
| 124 | +- `games/Breakout/**` is the canonical running version after copy-back |
| 125 | +- `games/Breakout_next/**` is removed at the end |
| 126 | +- gameplay runs from canonical path |
| 127 | +- canvas is visible |
| 128 | +- no console errors |
| 129 | +- no unrelated games changed |
| 130 | +- no broad engine/shared refactor occurred |
| 131 | + |
| 132 | +## Validation Steps |
| 133 | +1. Create and inspect `games/Breakout_next/**` |
| 134 | +2. Open `games/Breakout_next/index.html` |
| 135 | +3. Confirm: |
| 136 | + - gameplay starts |
| 137 | + - canvas visible |
| 138 | + - no console errors |
| 139 | +4. Confirm original `games/Breakout/**` was unchanged before clear step |
| 140 | +5. Clear canonical destination |
| 141 | +6. Copy `_next` back into canonical |
| 142 | +7. Open `games/Breakout/index.html` |
| 143 | +8. Confirm: |
| 144 | + - gameplay starts from canonical |
| 145 | + - canvas visible |
| 146 | + - no console errors |
| 147 | +9. Remove `_next` |
| 148 | +10. Confirm no unrelated game folders changed |
| 149 | + |
| 150 | +## Output Requirement |
| 151 | +Codex must package: |
| 152 | +`<project folder>/tmp/BUILD_PR_GAMES_BREAKOUT_FULL_FOLDER_MIGRATION_delta.zip` |
0 commit comments