Skip to content

Commit 9a1c7bc

Browse files
author
DavidQ
committed
BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION: add templates usage inventory, conservative policy baseline, and future cleanup validation guards without moving or rewriting templates.
1 parent 7abb289 commit 9a1c7bc

10 files changed

Lines changed: 453 additions & 59 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,4 @@
11
MODEL: GPT-5.4
22
REASONING: high
3-
4-
PRIMARY COMMAND:
5-
Create BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE exactly as specified in `docs/pr/BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE.md`.
6-
7-
Required actions:
8-
1. Update `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md` using bracket-only state changes where exact roadmap text matches planned deltas.
9-
2. Create cleanup evidence reports:
10-
- `docs/dev/reports/cleanup_live_reference_inventory.txt`
11-
- `docs/dev/reports/cleanup_keep_move_future_delete_matrix.md`
12-
- `docs/dev/reports/BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE_report.md`
13-
- `docs/dev/reports/validation_checklist.txt`
14-
3. Optionally refresh only if needed for accuracy:
15-
- `docs/dev/reports/repo_cleanup_targets.txt`
16-
- `docs/dev/reports/roadmap_status_delta.txt`
17-
4. Do not delete, move, rename, or modify `templates/`.
18-
5. Do not touch `docs/dev/start_of_day/chatGPT/` or `docs/dev/start_of_day/codex/`.
19-
6. Package the resulting repo-structured ZIP to:
20-
- `<project folder>/tmp/BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE.zip`
21-
22-
Validation requirements:
23-
- prove roadmap edits were bracket-only
24-
- prove no protected start_of_day files changed
25-
- prove no delete/move/rename happened
26-
- prove `templates/` remained untouched
27-
- record unmatched roadmap deltas in the BUILD report instead of rewriting wording
3+
COMMAND:
4+
Create BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION as a single execution-ready, testable BUILD lane. Work only within the exact scope in `docs/pr/BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION.md`. Produce the required reports, keep the lane non-destructive, do not move/rename/delete `templates/`, do not rewrite runtime imports, do not touch protected start_of_day directories, and package the repo-structured ZIP to `<project folder>/tmp/BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION.zip`.

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE: apply conservative roadmap bracket-state updates and generate reference-safe cleanup evidence reports without deleting, moving, renaming, or touching templates/.
1+
BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION: add templates usage inventory, conservative policy baseline, and future cleanup validation guards without moving or rewriting templates.

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
After Codex completes and validation is clean, the next recommended lane is:
2-
APPLY_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE
3-
4-
Only do that if this BUILD reports:
5-
- bracket-only roadmap changes
6-
- no protected directory edits
7-
- no deletion/move/rename
8-
- templates/ untouched
9-
- cleanup evidence reports complete
1+
After this BUILD completes, create the next exact-scope cleanup BUILD from the resulting templates policy: either a templates-retain-and-guard lane or a tightly scoped templates-migration lane, whichever the evidence supports.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION Report
2+
3+
Generated: 2026-04-12
4+
Bundle type: execution-ready BUILD docs (non-destructive templates policy lane)
5+
6+
## Exact Files Created
7+
- `docs/dev/reports/templates_live_usage_inventory.md`
8+
- `docs/dev/reports/templates_policy_decision.md`
9+
- `docs/dev/reports/templates_validation_guard.md`
10+
- `docs/dev/reports/BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION_report.md`
11+
12+
## Exact Files Changed
13+
- `docs/dev/reports/validation_checklist.txt`
14+
- `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md` (single bracket-only state change)
15+
16+
## Template Inventory Findings (Evidence Summary)
17+
- `templates/` currently contains 17 files (starter-project-template + vector-native-arcade trees).
18+
- Active code/test/docs consumers were found for `templates/` path references.
19+
- Direct module import/require/export references to `templates/` were not found in `tools/`, `src/`, `games/`, `samples/`, `tests/`.
20+
- Runtime coupling remains path-string based, centered on:
21+
- `tools/shared/vectorNativeTemplate.js`
22+
- `tools/shared/vectorTemplateSampleGame.js`
23+
- `tests/tools/VectorNativeTemplate.test.mjs`
24+
- `games/vector-arcade-sample/README.md`
25+
26+
## Chosen Policy Classification
27+
- Classification options considered: `keep-in-place-for-now`, `migrate-later`, `needs-manual-review`.
28+
- Chosen for this BUILD: `keep-in-place-for-now`.
29+
- Rationale: live runtime/test/docs path coupling makes move/delete unsafe without synchronized migration work.
30+
31+
## Roadmap Bracket Changes Applied
32+
- Applied exactly one bracket-state update in `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`:
33+
- `- [ ] templates/ folder evaluated for keep vs move vs future-delete ...`
34+
- `+ [.] templates/ folder evaluated for keep vs move vs future-delete ...`
35+
- No wording rewrite and no item reordering.
36+
37+
## Unapplied Planned Delta
38+
- None.
39+
- The targeted roadmap line existed as exact wording, so bracket-only update was applied directly.
40+
41+
## Non-Destructive Statement
42+
- `templates/` was not moved, renamed, deleted, or modified in this BUILD.
43+
- No runtime import rewrites were performed in this BUILD.
44+
- Protected directories were untouched:
45+
- `docs/dev/start_of_day/chatGPT/`
46+
- `docs/dev/start_of_day/codex/`
47+
48+
## Validation Results (Command-Backed)
49+
1. Search all `templates/` references and list consumer files:
50+
- `rg -n "templates/" tools src games samples tests --glob "!**/node_modules/**"`
51+
- Consumers found: `tools/shared/vectorNativeTemplate.js`, `tools/shared/vectorTemplateSampleGame.js`, `tests/tools/VectorNativeTemplate.test.mjs`, `games/vector-arcade-sample/README.md`.
52+
53+
2. Confirm no move/rename/delete under `templates/`:
54+
- `git diff --name-status -- templates`
55+
- Result: no entries.
56+
57+
3. Confirm protected start_of_day directories unchanged:
58+
- `git status --short -- docs/dev/start_of_day/chatGPT docs/dev/start_of_day/codex`
59+
- Result: no entries.
60+
61+
4. If roadmap changed, verify bracket-only:
62+
- `git diff --unified=0 -- docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`
63+
- Result: one checkbox state change only.
64+
- Automated guard result: `BRACKET_ONLY_CHECK: PASS`.
65+
66+
5. Confirm no delete/move/rename happened in working-tree diff:
67+
- `git diff --name-status`
68+
- Guard result: `DELETE_MOVE_RENAME_CHECK: PASS`.
69+
70+
## Notes
71+
- This BUILD lane intentionally stays docs-only and policy/guard focused.
72+
- Runtime consumer migration is deferred to a future exact-scope migration lane.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# templates/ Live Usage Inventory
2+
3+
Generated: 2026-04-12
4+
Scope: `templates/` only (non-archive evidence for active docs; code/tests from active runtime surfaces)
5+
6+
## 1) Exact Files Under templates/
7+
Observed files:
8+
1. `templates/starter-project-template/README.md`
9+
2. `templates/starter-project-template/config/starter.project.json`
10+
3. `templates/vector-native-arcade/README.md`
11+
4. `templates/vector-native-arcade/assets/palettes/vector-native-primary.palette.json`
12+
5. `templates/vector-native-arcade/assets/parallax/template-backdrop.parallax.json`
13+
6. `templates/vector-native-arcade/assets/parallax/template-backdrop.svg`
14+
7. `templates/vector-native-arcade/assets/tilemaps/template-arena.tilemap.json`
15+
8. `templates/vector-native-arcade/assets/tilemaps/template-ui.tileset.json`
16+
9. `templates/vector-native-arcade/assets/vectors/template-hud.vector.json`
17+
10. `templates/vector-native-arcade/assets/vectors/template-obstacle-large.vector.json`
18+
11. `templates/vector-native-arcade/assets/vectors/template-obstacle-small.vector.json`
19+
12. `templates/vector-native-arcade/assets/vectors/template-player.vector.json`
20+
13. `templates/vector-native-arcade/assets/vectors/template-title.vector.json`
21+
14. `templates/vector-native-arcade/config/template.project.json`
22+
15. `templates/vector-native-arcade/docs/ROLLBACK_NOTES.md`
23+
16. `templates/vector-native-arcade/docs/STARTER_GUIDE.md`
24+
17. `templates/vector-native-arcade/runtime/bootstrap.runtime.json`
25+
26+
## 2) Direct imports / requires
27+
Command pattern used:
28+
- `^\s*import .*templates/`
29+
- `^\s*.*require\(.*templates/`
30+
- `^\s*export .* from .*templates/`
31+
32+
Result:
33+
- No direct JS import/require/export module references to `templates/` in `tools/`, `src/`, `games/`, `samples/`, `tests/`.
34+
35+
Assessment:
36+
- Consumer coupling is path-string based, not module-import based.
37+
38+
## 3) String Path References (Code + Tests + Runtime-Adjacent)
39+
40+
| Consumer File | Evidence Shape | Consumer Type | Classification | Notes |
41+
| --- | --- | --- | --- | --- |
42+
| `tools/shared/vectorNativeTemplate.js` | Hard-coded `templates/vector-native-arcade/...` paths for asset/config/runtime/docs references | runtime | canonical | Primary active template contract surface; high coupling to exact folder structure. |
43+
| `tools/shared/vectorTemplateSampleGame.js` | String replace from `templates/vector-native-arcade/` -> `games/vector-arcade-sample/` | runtime | transitional | Explicit migration bridge assumption on exact prefix. |
44+
| `tests/tools/VectorNativeTemplate.test.mjs` | Assertions against `templatePath === "templates/vector-native-arcade/"` and report text | test-only | canonical | Tests lock the current template root and report formatting. |
45+
| `games/vector-arcade-sample/README.md` | Documentation string references source template path | docs-only (game doc) | transitional | Human-facing provenance reference to template origin. |
46+
47+
## 4) Docs / Planning References (Non-Archive)
48+
49+
Active docs with `templates/` references:
50+
- `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`
51+
- `docs/dev/reports/repo_cleanup_targets.txt`
52+
- `docs/dev/reports/roadmap_status_delta.txt`
53+
- `docs/pr/BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION.md`
54+
- `docs/pr/BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE.md`
55+
- `docs/pr/PLAN_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE.md`
56+
- Additional active report/planning docs under `docs/dev/reports/` and `docs/pr/` that cite template cleanup constraints.
57+
58+
Classification:
59+
- docs-only and planning-oriented; primarily transitional governance references.
60+
61+
## 5) Coupling / Path Assumptions Blocking Safe Move
62+
63+
Blocking assumptions identified:
64+
1. Exact hard-coded prefix `templates/vector-native-arcade/` in runtime helper surfaces (`vectorNativeTemplate.js`, `vectorTemplateSampleGame.js`).
65+
2. Template contract tests assert exact path strings, so directory relocation would fail tests without synchronized updates.
66+
3. Runtime bootstrap/config/docs path strings are part of generated/report output contracts from `vectorNativeTemplate.js`.
67+
4. Cleanup planning docs currently encode explicit deferment rules; moving now would violate active planning constraints.
68+
69+
## 6) Legacy/Transitional/Cleanliness Assessment
70+
- `templates/` is not an orphaned legacy surface.
71+
- It has live runtime + test + docs references.
72+
- Current usage indicates **active canonical template source with transitional migration coupling**.
73+
74+
## 7) Inventory Conclusion
75+
- `templates/` currently has live references and coupling that block safe move/delete in this lane.
76+
- Any future migration must update runtime helpers, tests, and synchronized docs/contracts in one controlled PR sequence.
77+
- No destructive action is warranted in this BUILD.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# templates/ Policy Decision
2+
3+
Generated: 2026-04-12
4+
Scope: Policy classification for `templates/` only.
5+
6+
## Current Classification Options
7+
- `keep-in-place-for-now`
8+
- `migrate-later`
9+
- `needs-manual-review`
10+
11+
## Chosen Classification (This PR)
12+
- `keep-in-place-for-now`
13+
14+
## Rationale (Evidence-Grounded)
15+
From `templates_live_usage_inventory.md`:
16+
- `templates/` has live code + test + docs references.
17+
- Runtime helpers (`tools/shared/vectorNativeTemplate.js`, `tools/shared/vectorTemplateSampleGame.js`) rely on exact path strings.
18+
- Tests (`tests/tools/VectorNativeTemplate.test.mjs`) assert exact template path values.
19+
- Active planning/docs currently enforce deferment and non-destructive cleanup sequencing.
20+
21+
Given this coupling, move/delete/repath actions are unsafe without coordinated multi-surface updates.
22+
23+
## Allowed Now
24+
- Document inventory and policy.
25+
- Add validation guards for future cleanup lanes.
26+
- Keep roadmap/docs tracking in sync without rewriting runtime/template consumers.
27+
28+
## Forbidden Now
29+
- Move, rename, or delete `templates/` or any file under it.
30+
- Rewrite runtime imports/paths to remove `templates/` references.
31+
- Mix template migration with unrelated cleanup targets or feature work.
32+
33+
## Exact Prerequisites For Future Migration/Removal Lane
34+
1. Full reference inventory refreshed and confirmed (code/tests/docs).
35+
2. Runtime helper path abstraction plan approved (remove hard-coded template-root coupling).
36+
3. Test suite updates prepared to align with new canonical template location.
37+
4. Docs/contracts synchronized in same PR (roadmap + cleanup targets + template guidance docs).
38+
5. Pre/post validation checklist executed (search + tests + smoke surfaces).
39+
6. Explicit rollback plan and path map included in the migration PR.
40+
41+
## Reclassification Signals (When Policy Can Change)
42+
Policy may move from `keep-in-place-for-now` to `migrate-later` only when:
43+
- hard-coded runtime path assumptions are abstracted or isolated,
44+
- template path assertions in tests are intentionally updated with equivalent coverage,
45+
- docs/contracts are prepared for synchronized path changes,
46+
- migration can be executed as one exact-scope, test-backed lane.
47+
48+
Policy may move to `future-delete-candidate` only when:
49+
- no live runtime/test/docs dependencies remain,
50+
- replacement source-of-truth exists and is validated,
51+
- delete decision is proven by zero-reference scans and acceptance checks.
52+
53+
## Decision Summary
54+
- `templates/` remains intentionally retained in place for now.
55+
- This BUILD records policy and guards only; no structural repo change is executed.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# templates/ Validation Guard
2+
3+
Generated: 2026-04-12
4+
Purpose: Define mandatory checks that must pass before any future PR can move/rename/delete `templates/`.
5+
6+
## A) Reference Scan Commands (Pre + Post)
7+
Run from repo root.
8+
9+
1. Code/tests template path usage:
10+
```powershell
11+
rg -n "templates/" tools src games samples tests
12+
```
13+
14+
2. Active docs/planning usage (exclude archives):
15+
```powershell
16+
rg -n "templates/" docs --glob "!docs/archive/**"
17+
```
18+
19+
3. Direct module import/require guard:
20+
```powershell
21+
rg -n "^\s*import .*templates/|^\s*.*require\(.*templates/|^\s*export .* from .*templates/" tools src games samples tests
22+
```
23+
24+
4. Old/legacy path regression guard:
25+
```powershell
26+
rg -n -F "from '/engine/" tools src games samples
27+
rg -n -F "from '../engine/" tools src games samples
28+
rg -n -F "from './engine/" tools src games samples
29+
```
30+
31+
## B) templates/ Structural Integrity Checks
32+
1. Confirm no accidental template edits in docs-only lanes:
33+
```powershell
34+
git status --short -- templates
35+
```
36+
37+
2. Confirm no template move/rename/delete in PR scope:
38+
```powershell
39+
git diff --name-status -- templates
40+
```
41+
42+
## C) Smoke Validation Surfaces (When Migration Is Attempted)
43+
Run both before and after migration:
44+
```powershell
45+
npm run test:launch-smoke -- --tools
46+
```
47+
48+
Recommended follow-up smoke (if migration touches game/sample references):
49+
```powershell
50+
npm run test:launch-smoke -- --games --samples
51+
```
52+
53+
## D) Test Surfaces To Re-run
54+
1. Template contract tests:
55+
```powershell
56+
node -e "import('./tests/tools/VectorNativeTemplate.test.mjs').then(m=>m.run())"
57+
node -e "import('./tests/tools/GameTemplates.test.mjs').then(m=>m.run())"
58+
```
59+
60+
2. Any test suite asserting template path text/contract output must be updated and rerun in the same PR.
61+
62+
## E) Docs/Contracts Requiring Synchronized Updates (If Path Changes)
63+
- `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`
64+
- `docs/dev/reports/repo_cleanup_targets.txt`
65+
- `docs/dev/reports/roadmap_status_delta.txt`
66+
- `docs/dev/reports/templates_live_usage_inventory.md`
67+
- `docs/dev/reports/templates_policy_decision.md`
68+
- `docs/dev/reports/validation_checklist.txt`
69+
- Any active `docs/pr/*` build/plan spec that references template path policy
70+
- Consumer docs such as `games/vector-arcade-sample/README.md` if provenance path changes
71+
72+
## F) Blocking Failure Conditions
73+
Stop migration execution if any of the following occur:
74+
- unresolved `templates/` references remain without explicit path-map coverage;
75+
- runtime helper paths are rewritten without synchronized tests;
76+
- tests/smoke regress after path changes;
77+
- docs/contracts are out of sync with actual template location;
78+
- `templates/` was moved/deleted without validated rollback and evidence report;
79+
- unrelated cleanup targets are mixed into the same migration lane.
80+
81+
## Guard Summary
82+
No future `templates/` cleanup lane should execute structural changes unless all reference scans, test/smoke checks, and doc-sync requirements pass as a single exact-scope bundle.
Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
1-
BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE
1+
BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION
22
Validation Checklist
33
Generated: 2026-04-12
44

5-
[PASS] roadmap wording preserved
6-
- Evidence: roadmap diff shows only one checkbox marker transition line and no non-bracket content edits.
5+
[PASS] protected start_of_day directories untouched
6+
Evidence: `git status --short -- docs/dev/start_of_day/chatGPT docs/dev/start_of_day/codex` -> no entries
77

8-
[PASS] roadmap changes bracket-only
9-
- Evidence:
10-
- changed: "- [.] smoke validation aligned to samples/tools/games"
11-
- to: "- [x] smoke validation aligned to samples/tools/games"
12-
- non-bracket changed lines: none
8+
[PASS] `templates/` not moved/renamed/deleted
9+
Evidence: `git diff --name-status -- templates` -> no entries
1310

14-
[PASS] no protected start_of_day directories touched
15-
- Evidence: `git status --short -- docs/dev/start_of_day/chatGPT docs/dev/start_of_day/codex` returned no entries.
11+
[PASS] no runtime import rewrites performed
12+
Evidence: working-tree changes are docs-only (`git diff --name-only`); import/require guard scan shows no direct module imports from `templates/`
1613

17-
[PASS] no deletion/move/rename executed
18-
- Evidence: `git diff --name-status -- <PR target files>` returned only `M` statuses for tracked files and no `D`/`R` entries.
14+
[PASS] templates evidence reports created
15+
Evidence:
16+
- `docs/dev/reports/templates_live_usage_inventory.md`
17+
- `docs/dev/reports/templates_policy_decision.md`
18+
- `docs/dev/reports/templates_validation_guard.md`
19+
- `docs/dev/reports/BUILD_PR_TEMPLATES_POLICY_CLASSIFICATION_report.md`
1920

20-
[PASS] templates/ untouched
21-
- Evidence: `git status --short -- templates` returned no entries.
21+
[PASS] no unrelated cleanup targets changed
22+
Evidence: no changes under `SpriteEditor_old_keep` or `classes_old_keep`; no unrelated cleanup-matrix/inventory files modified in this lane
2223

23-
[PASS] evidence reports created
24-
- Evidence:
25-
- docs/dev/reports/cleanup_live_reference_inventory.txt
26-
- docs/dev/reports/cleanup_keep_move_future_delete_matrix.md
27-
- docs/dev/reports/BUILD_PR_REPO_CLEANUP_AND_ROADMAP_UPDATE_report.md
28-
- docs/dev/reports/validation_checklist.txt
24+
[PASS] roadmap wording preserved if roadmap changed
25+
Evidence: `git diff --unified=0 -- docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md` shows only checkbox state update on existing line
2926

30-
[PASS] no unrelated repo files changed (bundle-scoped)
31-
- Evidence: this BUILD bundle modifies/creates only roadmap + cleanup evidence report files listed in the BUILD report.
32-
- Note: unrelated pre-existing workspace changes outside this bundle were preserved and not altered by this BUILD.
27+
[PASS] roadmap changes bracket-only if roadmap changed
28+
Evidence: automated check -> `BRACKET_ONLY_CHECK: PASS`

docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
- [ ] archived notes policy defined
565565
- [ ] imports pointing to legacy paths reduced
566566
- [.] roadmap for eventual legacy retirement defined
567-
- [ ] `templates/` folder evaluated for keep vs move vs future-delete during cleanup phase (explicitly deferred in this docs-only bundle)
567+
- [.] `templates/` folder evaluated for keep vs move vs future-delete during cleanup phase (explicitly deferred in this docs-only bundle)
568568

569569
---
570570

0 commit comments

Comments
 (0)