|
| 1 | +# BUILD_PR_LEVEL_18_19_TRACK_G_REPO_HYGIENE_COMPLETION |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Complete Track G (Repo Hygiene) with one execution-backed PR that performs real repository cleanup work and updates roadmap status only after validation. |
| 5 | + |
| 6 | +## Roadmap intent |
| 7 | +This PR may advance only the following Track G items if fully executed and validated: |
| 8 | +- `Remove imports to export (should not be import x, export x)` `[ ] -> [x]` |
| 9 | +- `Other than templates (games/samples/tools), remove the .keep file, if the folder is empty, delete` `[ ] -> [x]` |
| 10 | +- `remove unnecessary .keep files` `[ ] -> [x]` |
| 11 | +- `remove empty folders` `[ ] -> [x]` |
| 12 | +- `validate folder ownership rules` `[ ] -> [x]` |
| 13 | +- `enforce clean repo structure` `[ ] -> [x]` |
| 14 | + |
| 15 | +If the repo also uses a parent Track G status marker in the working roadmap, update that marker from `[ ] -> [x]` only after all Track G items above are complete and validated. |
| 16 | + |
| 17 | +## Scope |
| 18 | +Included: |
| 19 | +- remove import/export anti-patterns of the form `import x ...; export x` |
| 20 | +- replace those patterns with direct exports or locally valid equivalent cleanup |
| 21 | +- remove unnecessary `.keep` files |
| 22 | +- delete empty folders except protected template keepers under `games/`, `samples/`, and `tools/` |
| 23 | +- validate folder ownership against current repo structure rules |
| 24 | +- enforce clean repo structure within the scope of hygiene cleanup |
| 25 | +- update affected references only where needed by the cleanup |
| 26 | +- produce explicit validation reports |
| 27 | +- preserve unrelated working-tree changes |
| 28 | + |
| 29 | +Excluded: |
| 30 | +- no feature implementation |
| 31 | +- no engine/shared/game/tool behavior changes |
| 32 | +- no broad refactor beyond the anti-pattern cleanup required here |
| 33 | +- no Track H work |
| 34 | +- no roadmap text rewrites |
| 35 | +- no `start_of_day` modifications |
| 36 | +- no deletion of non-empty folders |
| 37 | +- no template-folder deletion |
| 38 | +- no speculative folder moves without execution need |
| 39 | + |
| 40 | +## Hard guards |
| 41 | +- one PR purpose only: complete Track G repo hygiene |
| 42 | +- all changes must be validation-backed |
| 43 | +- additive reasoning, not blind churn |
| 44 | +- no repo-wide scanning beyond what Track G requires |
| 45 | +- preserve wording in roadmap; status-only updates only |
| 46 | +- remove `.keep` only when safe under the rules above |
| 47 | +- if an empty folder is intentionally required outside templates, keep it only with explicit validation note |
| 48 | + |
| 49 | +## Required outputs |
| 50 | +Codex must create/update: |
| 51 | +- `docs/dev/reports/BUILD_PR_LEVEL_18_19_TRACK_G_REPO_HYGIENE_COMPLETION_IMPORT_EXPORT_CLEANUP.md` |
| 52 | +- `docs/dev/reports/BUILD_PR_LEVEL_18_19_TRACK_G_REPO_HYGIENE_COMPLETION_KEEP_FILE_AUDIT.md` |
| 53 | +- `docs/dev/reports/BUILD_PR_LEVEL_18_19_TRACK_G_REPO_HYGIENE_COMPLETION_EMPTY_FOLDER_REMOVAL.md` |
| 54 | +- `docs/dev/reports/BUILD_PR_LEVEL_18_19_TRACK_G_REPO_HYGIENE_COMPLETION_FOLDER_OWNERSHIP_VALIDATION.md` |
| 55 | +- `docs/dev/reports/BUILD_PR_LEVEL_18_19_TRACK_G_REPO_HYGIENE_COMPLETION_VALIDATION.md` |
| 56 | + |
| 57 | +## Execution details |
| 58 | + |
| 59 | +### 1) Import/export anti-pattern cleanup |
| 60 | +Find and fix patterns where a module imports a symbol only to immediately re-export it. |
| 61 | +Examples in scope: |
| 62 | +- `import Foo from './Foo.js'; export default Foo;` |
| 63 | +- `import { foo } from './foo.js'; export { foo };` |
| 64 | + |
| 65 | +For each changed file, record: |
| 66 | +- path |
| 67 | +- pattern found |
| 68 | +- replacement used |
| 69 | +- whether any import path consumers required follow-up |
| 70 | + |
| 71 | +### 2) `.keep` cleanup |
| 72 | +Remove unnecessary `.keep` files. |
| 73 | +Protected exception: |
| 74 | +- template-preservation keepers under `games/`, `samples/`, and `tools/` may remain if needed |
| 75 | + |
| 76 | +For each removed or retained `.keep`, record: |
| 77 | +- path |
| 78 | +- removed/retained |
| 79 | +- reason |
| 80 | + |
| 81 | +### 3) Empty folder cleanup |
| 82 | +Delete empty folders that remain after `.keep` cleanup. |
| 83 | +Do not delete: |
| 84 | +- template folders intentionally preserved under `games/`, `samples/`, or `tools/` |
| 85 | +- any folder proven necessary for workflow preservation with explicit report note |
| 86 | + |
| 87 | +### 4) Folder ownership validation |
| 88 | +Validate that remaining folders align to current ownership rules: |
| 89 | +- engine/runtime folders hold runtime code |
| 90 | +- shared holds cross-domain reusable helpers |
| 91 | +- games hold game-specific implementation |
| 92 | +- samples hold learning/demo content |
| 93 | +- tools hold editor/pipeline/debug-authoring content |
| 94 | +- docs remains organized per prior Track F cleanup |
| 95 | + |
| 96 | +### 5) Clean structure enforcement |
| 97 | +Resolve hygiene-only leftovers revealed by the above work, but do not expand into new structural refactors. |
| 98 | + |
| 99 | +## Acceptance |
| 100 | +- in-scope import/export anti-patterns removed |
| 101 | +- unnecessary `.keep` files removed |
| 102 | +- eligible empty folders removed |
| 103 | +- protected template keepers preserved where required |
| 104 | +- folder ownership validation completed |
| 105 | +- clean repo structure enforced within hygiene scope |
| 106 | +- no non-hygiene behavior changes introduced |
| 107 | +- unrelated working-tree changes preserved |
| 108 | +- roadmap updates are status-only and execution-backed |
| 109 | + |
| 110 | +## Validation requirements |
| 111 | +Validation must include: |
| 112 | +- count of import/export anti-patterns found and fixed |
| 113 | +- count of `.keep` files removed and retained with reasons |
| 114 | +- count of empty folders removed |
| 115 | +- list of protected template keepers left in place |
| 116 | +- confirmation that no non-empty folders were deleted |
| 117 | +- confirmation that no `start_of_day` files changed |
| 118 | +- confirmation that unrelated working-tree changes were preserved |
| 119 | +- confirmation that roadmap changes are status-only and limited to Track G items completed here |
| 120 | + |
| 121 | +## Roadmap update rules |
| 122 | +Only update status markers in the current repo roadmap file. |
| 123 | + |
| 124 | +Allowed transitions only if fully executed and validated: |
| 125 | +- each listed Track G item `[ ] -> [x]` |
| 126 | +- parent `Track G - Repo Hygiene` `[ ] -> [x]` only if all Track G sub-items are complete |
| 127 | + |
| 128 | +Do not change Track H in this PR. |
0 commit comments