|
| 1 | +# PLAN_PR: Samples Directory Normalization |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Define a docs-only, repo-wide normalization plan for sample paths using this exact contract: |
| 5 | + |
| 6 | +`samples/phasexx/xxyy/index.html` |
| 7 | + |
| 8 | +Where: |
| 9 | +- `xx` = phase number |
| 10 | +- `yy` = sample number |
| 11 | + |
| 12 | +## Scope |
| 13 | +Planning docs only. |
| 14 | +No implementation code, no folder moves, no path rewrites, no runtime edits. |
| 15 | + |
| 16 | +## Required Contract |
| 17 | +- All sample entrypoints must normalize to `samples/phasexx/xxyy/index.html`. |
| 18 | +- Remove spaces from directory names. |
| 19 | +- Remove descriptive text from directory names. |
| 20 | +- Preserve human-readable phase/sample text in index tiles and sample headers. |
| 21 | +- Preserve behavior. |
| 22 | + |
| 23 | +## Directory Rules |
| 24 | +- Phase folder format: `phasexx` |
| 25 | +- Sample folder format: `xxyy` |
| 26 | +- No phase titles or descriptive labels in directory names. |
| 27 | +- Human-readable names remain in UI text only. |
| 28 | + |
| 29 | +## Deliverables in This Planning PR |
| 30 | +1. PR plan (this file) |
| 31 | +2. Mapping/report expectations |
| 32 | +3. Validation checklist |
| 33 | +4. Commit comment |
| 34 | + |
| 35 | +## Future BUILD Strategy (No Execution Here) |
| 36 | +1. Inventory all current sample entrypoints. |
| 37 | +2. Generate one mapping table: old path -> normalized path. |
| 38 | +3. Update `samples/index.html` links to normalized paths while preserving tile text. |
| 39 | +4. Update sample headers so titles remain human-readable and independent of folder names. |
| 40 | +5. Validate all normalized entrypoints and relative references. |
| 41 | +6. Remove obsolete path exposure only after successful path validation. |
| 42 | + |
| 43 | +## Mapping Requirements for BUILD |
| 44 | +Each mapped row must include: |
| 45 | +- old directory path |
| 46 | +- new normalized path (`samples/phasexx/xxyy/`) |
| 47 | +- phase number (`xx`) |
| 48 | +- sample id (`xxyy`) |
| 49 | +- index tile reference status |
| 50 | +- header text preservation status |
| 51 | +- validation status (pass/fail) |
| 52 | + |
| 53 | +## Validation Requirements for BUILD |
| 54 | +- Every sample launches from normalized path. |
| 55 | +- No duplicate exposure between old and new links. |
| 56 | +- No broken relative imports/assets from renamed paths. |
| 57 | +- Human-readable phase/sample text remains visible in index tiles and sample headers. |
| 58 | +- Behavior parity preserved. |
| 59 | + |
| 60 | +## Out of Scope |
| 61 | +- Gameplay changes |
| 62 | +- Engine/shared refactors |
| 63 | +- Tooling refactors unrelated to path normalization |
| 64 | +- Any non-samples directory restructuring |
| 65 | + |
| 66 | +## Fail-Fast Conditions |
| 67 | +Stop the BUILD if any of the following occur: |
| 68 | +- ambiguous phase/sample id mapping |
| 69 | +- conflicting entrypoint ownership for the same `xxyy` |
| 70 | +- unresolved relative-path breakage with no safe deterministic fix |
| 71 | +- scope expansion beyond sample path normalization |
| 72 | + |
| 73 | +## Acceptance Criteria for This PLAN |
| 74 | +- Contract is explicit and unambiguous. |
| 75 | +- Mapping/report expectations are documented. |
| 76 | +- Validation checklist is documented. |
| 77 | +- Commit comment is prepared. |
| 78 | +- No implementation code changes were made. |
0 commit comments