Skip to content

Commit 2c992b8

Browse files
author
DavidQ
committed
PLAN_PR: Define normalized sample directory contract
- Standardize samples to `samples/phasexx/xxyy/index.html` - Remove spaces and descriptive text from sample directories - Preserve phase/sample labels in headers and index tiles - Keep scope limited to samples structure and wiring only & BUILD_PR: normalize sample directories to phasexx/xxyy structure
1 parent 95a6415 commit 2c992b8

794 files changed

Lines changed: 349 additions & 296 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/dev/CODEX_COMMANDS.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,11 @@
1-
MODEL: GPT-5.4
1+
MODEL: GPT-5.4-codex
22
REASONING: high
33

44
COMMAND:
5+
Execute BUILD_PR_SAMPLES_DIRECTORY_NORMALIZATION
56

6-
Create APPLY_PR_NETWORK_SAMPLES_RELOCATION_FROM_GAMES_TO_SAMPLES
7+
OUTPUT REQUIREMENT:
8+
- Produce ZIP at:
9+
<project folder>/tmp/BUILD_PR_SAMPLES_DIRECTORY_NORMALIZATION.zip
710

8-
Apply the approved relocation exactly as documented in BUILD_PR_NETWORK_SAMPLES_RELOCATION_FROM_GAMES_TO_SAMPLES (v3).
9-
10-
Execution rules:
11-
- Move only:
12-
- games/network_sample_a
13-
- games/network_sample_b
14-
- games/network_sample_c
15-
- Destination only:
16-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1316_network_sample_a
17-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1317_network_sample_b
18-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1318_network_sample_c
19-
- Remove corresponding entries from games/index.html
20-
- Add corresponding entries to samples/index.html
21-
- Preserve behavior and folder contents
22-
- Do not change gameplay, engine code, assets, or unrelated indexes
23-
24-
Validation:
25-
- Confirm samples launch from new locations
26-
- Confirm no duplicate index exposure
27-
- Confirm no broken relative paths
28-
- Confirm tests remain green
29-
- Package only the required apply-ready delta
30-
31-
Output:
32-
- Commit-ready apply bundle
33-
- Keep docs under docs/pr and docs/dev
34-
- Keep reports under docs/dev/reports
35-
- Target zip path:
36-
HTML-JavaScript-Gaming/tmp/APPLY_PR_NETWORK_SAMPLES_RELOCATION_FROM_GAMES_TO_SAMPLES.zip
11+
FAIL IF ZIP NOT PRODUCED

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
APPLY_PR: network samples Phase 13 destination normalization to underscore paths
2-
3-
- Normalized Phase 13 sample folders:
4-
1316-network-sample-a -> 1316_network_sample_a
5-
1317-network-sample-b -> 1317_network_sample_b
6-
1318-network-sample-c -> 1318_network_sample_c
7-
- Updated samples/index.html links for 1316/1317/1318
8-
- Fixed one cross-sample import path in 1317_network_sample_b to the renamed 1316 path
9-
- Kept games/index.html unchanged (network entries were already removed)
10-
- Updated shared extraction guard baseline path entries to keep pretest green
11-
- No gameplay/engine logic changes
1+
BUILD_PR: normalize sample directories to phasexx/xxyy structure
Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,2 @@
1-
TYPE: APPLY / STRUCTURAL
2-
3-
Applied relocation finalization for Network Sample A/B/C in Phase 13 with required underscore destinations.
4-
5-
Changed:
6-
- Renamed folder: 1316-network-sample-a -> 1316_network_sample_a
7-
- Renamed folder: 1317-network-sample-b -> 1317_network_sample_b
8-
- Renamed folder: 1318-network-sample-c -> 1318_network_sample_c
9-
- Updated links in samples/index.html for 1316/1317/1318
10-
- Fixed one cross-sample import path to the renamed 1316 destination
11-
- Updated shared extraction guard baseline paths for renamed folders
12-
13-
Verified no additional canonical cleanup was needed:
14-
- games/index.html already had network sample entries removed
15-
16-
Not changed:
17-
- Gameplay logic
18-
- Engine/shared runtime logic
19-
- Asset contents
20-
- Unrelated indexes
1+
TYPE: STRUCTURE ONLY
2+
Normalize samples directories and paths
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
APPLY DELTA
2-
3-
RENAMED (Phase 13 destination normalization):
4-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1316-network-sample-a
5-
-> samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1316_network_sample_a
6-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1317-network-sample-b
7-
-> samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1317_network_sample_b
8-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1318-network-sample-c
9-
-> samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1318_network_sample_c
10-
11-
MODIFIED:
12-
- samples/index.html
13-
- samples/Phase 13 - Network Concepts, Latency & Simulation (1301-1315)/1317_network_sample_b/game/FakeHostClientNetworkModel.js
14-
- tools/dev/checkSharedExtractionGuard.baseline.json
1+
All samples directories will be renamed to phasexx/xxyy
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
SAMPLES DIRECTORY NORMALIZATION - MAPPING/REPORT EXPECTATIONS
2+
3+
Contract:
4+
- samples/phasexx/xxyy/index.html
5+
- xx = phase number
6+
- yy = sample number
7+
8+
Mapping table requirements (mandatory columns):
9+
1) old_path
10+
2) new_path
11+
3) phase_xx
12+
4) sample_xxyy
13+
5) index_tile_updated (yes/no)
14+
6) sample_header_preserved (yes/no)
15+
7) relative_paths_validated (yes/no)
16+
8) behavior_check (pass/fail)
17+
9) notes
18+
19+
Report outputs expected from BUILD/APPLY:
20+
- docs/dev/reports/change_summary.txt
21+
- docs/dev/reports/file_tree_delta.txt
22+
- docs/dev/reports/validation_checklist.txt
23+
- optional: docs/dev/reports/samples_directory_normalization_mapping.csv
24+
25+
Reporting rules:
26+
- Report only normalization-related files.
27+
- Distinguish renamed paths from edited files.
28+
- Include explicit old->new mapping lines.
29+
- Record unresolved or deferred items separately.
30+
- Do not include unrelated repo edits.
31+
32+
Index/report expectations:
33+
- samples/index links must target normalized paths.
34+
- Any previous non-normalized path exposure must be listed and removed in report.
35+
- Human-readable titles must be preserved in UI text and called out as validated.
36+
37+
Completion signal:
38+
- Mapping table complete for all samples.
39+
- Validation checklist all green.
40+
- Scope clean (samples normalization only).
Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
[x] network_sample_a launches from Phase 13 / 1316 (folder + entrypoint present)
2-
[x] network_sample_b launches from Phase 13 / 1317 (folder + entrypoint present)
3-
[x] network_sample_c launches from Phase 13 / 1318 (folder + entrypoint present)
4-
[x] games/index.html no longer lists network_sample_a
5-
[x] games/index.html no longer lists network_sample_b
6-
[x] games/index.html no longer lists network_sample_c
7-
[x] samples/index.html lists 1316, 1317, 1318 correctly
8-
[x] No duplicate entries across indexes
9-
[x] Relative asset/script paths resolve
10-
[!] Existing tests remain green (blocked by runtime environment)
11-
12-
Notes:
13-
- pretest (`node tools/dev/checkSharedExtractionGuard.mjs`) passes after baseline update.
14-
- full `npm test` fails in this environment on Node v20.8.1 because
15-
`scripts/run-node-tests.mjs` imports `registerHooks` from `node:module`,
16-
which is unavailable in this Node version.
1+
[ ] All samples map to /samples/phasexx/xxyy/index.html
2+
[ ] No spaces in directories
3+
[ ] Links updated
4+
[ ] No broken paths
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BUILD_PR_SAMPLES_DIRECTORY_NORMALIZATION
2+
3+
Objective:
4+
Normalize samples directory to canonical structure:
5+
samples/phasexx/xxyy/index.html
6+
7+
Scope:
8+
- Rename phase folders → phasexx
9+
- Rename sample folders → xxyy
10+
- Update index wiring
11+
- Preserve behavior
12+
13+
No gameplay or engine changes.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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

Comments
 (0)