Skip to content

Commit fead9ab

Browse files
author
DavidQ
committed
BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY: narrow samples-system BUILD for index label cleanup, Sample 1303 local asteroid speed cap, and targeted preview SVG retry only where current SVG contains "Capture timeout".
1 parent fc77196 commit fead9ab

File tree

9 files changed

+269
-80
lines changed

9 files changed

+269
-80
lines changed

docs/dev/CODEX_COMMANDS.md

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
1-
# Codex Command
2-
3-
MODEL: GPT-5.4-codex
1+
MODEL: GPT-5.4
42
REASONING: high
53

6-
## COMMAND
7-
Execute `BUILD_PR_SAMPLES_RUNTIME_PREVIEW_SVG_CAPTURE` exactly as written.
4+
COMMAND:
5+
Execute BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY with the following exact scope only:
86

9-
## EXECUTION ENVIRONMENT (MANDATORY)
10-
- Target platform: Windows
11-
- Prefer Node.js or vanilla JS for any scripting or generation support
12-
- DO NOT run `npm install`
13-
- DO NOT create `package.json`
14-
- DO NOT create `package-lock.json`
15-
- DO NOT create or populate `node_modules/`
16-
- Do not depend on external screenshot tools or browser extensions
7+
1. Edit `samples/index.html`
8+
- remove header reference `(xxyy - xxzz)`
9+
- update phase dropdown labels to exactly `Phase xx - <phase name>`
10+
- no other layout or metadata/tag changes
1711

18-
## HARD CONSTRAINTS
19-
- Do not modify gameplay logic except for minimal non-behavioral hooks strictly required for automated preview capture
20-
- Do not modify engine core unless absolutely required for capture orchestration
21-
- Do not change sample page layout
22-
- Do not change tags, titles, related samples, or engine-classes-used presentation
23-
- Do not modify `samples/index.html` except if strictly required to consume existing preview asset paths already used by the system
24-
- Do not modify `docs/dev/start_of_day/chatGPT/`
25-
- Do not modify `docs/dev/start_of_day/codex/`
26-
- Do not perform more work on `1316`, `1317`, or `1318`; preserve them exactly as they are now
12+
2. Fix Sample 1303 (`samples/phase13/1303/*` and only sample-local supporting files if required)
13+
- asteroid velocity is exploding to extreme values
14+
- add a reasonable asteroid max-speed cap/clamp locally in the sample
15+
- preserve normal Asteroids-style feel
16+
- no engine/core changes
17+
- do not touch Samples 1316, 1317, 1318
2718

28-
## RUNTIME CAPTURE REQUIREMENT
29-
For each targeted sample:
30-
1. Load the actual runnable sample page
31-
2. Let the game/sample run for 3 seconds
32-
3. Capture the live canvas appearance at 3000 ms
33-
4. Generate/update the preview SVG asset from that runtime-derived canvas state
19+
3. Retry preview SVG generation only for this exact list:
20+
0102,0107,0110,0116,0117,0119,
21+
0206,0212,0218,0220,0221,0223,
22+
0305,0306,0307,0308,0311,0318,0320,0322,0324,
23+
0407,0409,0412,
24+
0508,
25+
0601,0603,0605,0607,0608,0612,
26+
0707,0709,0712,
27+
0801,0808,
28+
0904,
29+
1101,1102,1103,
30+
1201,1202,1203,1206,1207,
31+
1301,1302,1303,1305,1306,1307,1308,1309,1311,1313,1314,1315,
32+
1401,1404,1410,1418,
33+
1503,1506
3434

35-
## ZIP OUTPUT REQUIREMENT
36-
Must produce:
37-
`<project folder>/tmp/BUILD_PR_SAMPLES_RUNTIME_PREVIEW_SVG_CAPTURE.zip`
35+
Retry logic:
36+
- inspect current generated preview SVG for each listed sample
37+
- regenerate only if the SVG currently contains the literal text `Capture timeout`
38+
- do not retry any samples outside this list
39+
- do not use previous failed-detection logic
40+
- allow runtime to settle before capture with adaptive wait and a minimum of ~3 seconds
41+
- do not touch 1316, 1317, 1318
3842

39-
Task is not complete until that ZIP exists at the exact requested path.
43+
4. Validate and package
44+
- report exact files changed
45+
- confirm no engine files changed
46+
- report which listed samples were retried vs skipped
47+
- confirm no non-listed samples were touched
48+
- package repo-structured delta ZIP to:
49+
`<project folder>/tmp/BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY_delta.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_SAMPLES_RUNTIME_PREVIEW_SVG_CAPTURE: add 3-second runtime-derived preview SVG generation for samples, keep scope limited to preview capture, and leave 1316/1317/1318 untouched
1+
BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY: narrow samples-system BUILD for index label cleanup, Sample 1303 local asteroid speed cap, and targeted preview SVG retry only where current SVG contains "Capture timeout".

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
Next suggested command after this BUILD succeeds:
2-
3-
Create APPLY_PR_SAMPLES_RUNTIME_PREVIEW_SVG_CAPTURE docs-only acceptance bundle with exact files changed, exact validation performed, and explicit confirmation that 1316/1317/1318 were not modified.
1+
After Codex completes, produce APPLY_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY with acceptance docs only. Verify: samples/index.html header/dropdown text changes, Sample 1303 local-only fix with no engine edits, retry-only preview SVG replacements for the approved list, and explicit confirmation that 1316/1317/1318 were untouched.
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
Bundle type: BUILD
2-
PR purpose: Runtime-derived sample preview SVG capture after 3 seconds of gameplay/runtime
1+
PR: BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY
32

4-
What this bundle changes:
5-
- Replaces the earlier broader direction with a narrowed runtime-preview-only BUILD
6-
- Explicitly freezes samples 1316, 1317, and 1318 from further changes
7-
- Preserves layout/metadata normalization for a separate future PR if needed
3+
Bundle contents:
4+
- docs/pr/BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY.md
5+
- docs/dev/codex_commands.md
6+
- docs/dev/commit_comment.txt
7+
- docs/dev/next_command.txt
8+
- docs/dev/reports/change_summary.txt
9+
- docs/dev/reports/validation_checklist.txt
10+
- docs/dev/reports/file_tree.txt
811

9-
Non-goals:
10-
- No sample page layout work
11-
- No metadata/tag/title normalization
12-
- No Engine Classes Used formatting work
13-
- No further 1316/1317/1318 work
12+
Requested runtime/code scope for Codex:
13+
- samples/index.html label/header text correction only
14+
- Sample 1303 local asteroid speed cap only
15+
- targeted preview SVG retry only for the enumerated samples and only when SVG contains `Capture timeout`
16+
17+
Explicit exclusions:
18+
- no engine/core edits
19+
- no metadata/tag changes
20+
- no broad layout changes
21+
- no modifications to 1316, 1317, 1318
22+
- no protected start_of_day directory changes

docs/dev/reports/file_tree.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
docs/
2-
dev/
3-
codex_commands.md
4-
commit_comment.txt
5-
next_command.txt
6-
reports/
7-
change_summary.txt
8-
file_tree.txt
9-
validation_checklist.txt
10-
pr/
11-
BUILD_PR_SAMPLES_RUNTIME_PREVIEW_SVG_CAPTURE.md
1+
.
2+
./docs
3+
./docs/dev
4+
./docs/dev/codex_commands.md
5+
./docs/dev/commit_comment.txt
6+
./docs/dev/next_command.txt
7+
./docs/dev/reports
8+
./docs/dev/reports/change_summary.txt
9+
./docs/dev/reports/file_tree.txt
10+
./docs/dev/reports/validation_checklist.txt
11+
./docs/pr
12+
./docs/pr/BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY.md
Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
Session validation gate applied:
2-
- Single PR purpose: yes
3-
- BUILD specific enough for Codex: yes
4-
- Scope minimized: yes
5-
- No vague repo-wide refactor language: yes
6-
- No fake claim of code already written: yes
7-
- No start_of_day directories touched: yes
8-
- 1316/1317/1318 explicitly protected: yes
9-
- ZIP-required output specified: yes
1+
SESSION VALIDATION CHECK
102

11-
Codex validation to report:
12-
- representative runtime capture at 3000 ms confirmed
13-
- preview SVG assets created/updated for targeted samples
14-
- console clean for representative tested samples
15-
- exact changed files listed
16-
- exact validation listed
17-
- any uncaptured samples listed with exact reason
18-
- 1316/1317/1318 confirmed untouched
3+
- Bundle type: BUILD
4+
- Single PR purpose only: YES
5+
- BUILD explicit and executable: YES
6+
- Exact target files/scope named: YES
7+
- Non-goals named: YES
8+
- Validation steps named: YES
9+
- Retry narrowed from prior attempt: YES
10+
- Protected start_of_day directories untouched: YES
11+
- No fake code-completion claims: YES
12+
- Repo-structured ZIP prepared: YES
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY
2+
3+
## PR Purpose
4+
Apply one narrow samples-system fix bundle with three scoped actions only:
5+
1. update `samples/index.html` header/dropdown labeling
6+
2. fix the gameplay velocity explosion in Sample 1303 without engine changes
7+
3. retry runtime preview SVG generation only for the explicitly listed failed samples, and only when the generated SVG still contains the text `Capture timeout`
8+
9+
This BUILD is docs-only. Codex owns all runtime/code edits.
10+
11+
## Truth Boundary
12+
- ChatGPT created this BUILD bundle only.
13+
- Codex must write any code, runtime scripts, and regenerated SVG files.
14+
- Do not claim code completion unless Codex actually reports it.
15+
16+
## Locked / Protected Areas
17+
Do **not** create, modify, replace, rename, or delete anything in:
18+
- `docs/dev/start_of_day/chatGPT/`
19+
- `docs/dev/start_of_day/codex/`
20+
21+
## Hard Constraints
22+
- Single-purpose PR only
23+
- No engine-core changes
24+
- No layout changes outside `samples/index.html`
25+
- No metadata/tag system changes
26+
- Do not modify Samples `1316`, `1317`, or `1318`
27+
- Do not broaden scope to other samples
28+
- Do not re-run prior repo-wide failed-detection logic
29+
- Retry only the listed sample preview SVGs
30+
- Only regenerate a sample SVG when the current generated SVG contains the literal text `Capture timeout`
31+
- Let the runtime settle before capture with adaptive wait and a **minimum of ~3 seconds**
32+
33+
## Scope Details
34+
35+
### 1) `samples/index.html`
36+
Apply only these changes:
37+
- Remove the header reference text:
38+
- `(xxyy - xxzz)`
39+
- Update phase dropdown labels from the old format to exactly:
40+
- `Phase xx - <phase name>`
41+
42+
Notes:
43+
- Keep the rest of `samples/index.html` behavior/layout intact.
44+
- Do not modify per-sample metadata/tag rendering.
45+
46+
### 2) Gameplay Bug Fix — Sample 1303
47+
Target:
48+
- `samples/phase13/1303/*` only, plus any sample-local files required by that sample
49+
50+
Problem:
51+
- In **Sample 1303 - Asteroids World Systems**, asteroid velocity can explode to extreme values (example observed: `4336107765`), making asteroids unusably fast.
52+
53+
Required fix:
54+
- Add a **sample-local** cap/clamp on asteroid velocity so asteroid speed remains visible/playable.
55+
- Choose a reasonable maximum speed consistent with Asteroids-style gameplay.
56+
- Preserve normal movement feel.
57+
- Do not change engine code.
58+
- Do not alter other phase 13 samples.
59+
- Do not change 1316/1317/1318.
60+
61+
Acceptance for this bug:
62+
- Sample 1303 runs without runaway asteroid velocities.
63+
- Asteroids remain visible on screen and playable.
64+
- No engine files changed.
65+
66+
### 3) Targeted Runtime Preview SVG Retry
67+
Retry preview generation **only** for the following samples:
68+
69+
- `0102`,`0107`,`0110`,`0116`,`0117`,`0119`
70+
- `0206`,`0212`,`0218`,`0220`,`0221`,`0223`
71+
- `0305`,`0306`,`0307`,`0308`,`0311`,`0318`,`0320`,`0322`,`0324`
72+
- `0407`,`0409`,`0412`
73+
- `0508`
74+
- `0601`,`0603`,`0605`,`0607`,`0608`,`0612`
75+
- `0707`,`0709`,`0712`
76+
- `0801`,`0808`
77+
- `0904`
78+
- `1101`,`1102`,`1103`
79+
- `1201`,`1202`,`1203`,`1206`,`1207`
80+
- `1301`,`1302`,`1303`,`1305`,`1306`,`1307`,`1308`,`1309`,`1311`,`1313`,`1314`,`1315`
81+
- `1401`,`1404`,`1410`,`1418`
82+
- `1503`,`1506`
83+
84+
Preview retry rule:
85+
- For each listed sample only, inspect the existing generated preview SVG.
86+
- If and only if the SVG contains the text `Capture timeout`, regenerate that sample’s runtime preview SVG.
87+
- If the SVG does **not** contain `Capture timeout`, leave it untouched.
88+
- Do not retry any samples not listed above.
89+
- Do not modify `1316`, `1317`, or `1318` even if adjacent logic would normally include them.
90+
91+
Capture execution guidance:
92+
- Launch the sample runtime normally.
93+
- Wait adaptively before capture, with a hard minimum delay of ~3 seconds.
94+
- If a specific sample appears to need slightly longer stabilization, allow a slightly longer wait.
95+
- Capture the runtime canvas result.
96+
- Save back only the regenerated SVG for those samples that met the retry condition.
97+
98+
## Suggested Codex Execution Order
99+
1. Update `samples/index.html`
100+
2. Fix Sample 1303 velocity cap using sample-local code only
101+
3. Process the targeted preview SVG retry list
102+
4. Validate changed files and package output ZIP
103+
104+
## Validation Requirements
105+
Codex must report these validations explicitly:
106+
107+
### A. Index validation
108+
- Confirm the `(xxyy - xxzz)` text is removed from `samples/index.html`
109+
- Confirm phase dropdown labels use `Phase xx - <phase name>`
110+
- Confirm no other samples layout files were changed
111+
112+
### B. Sample 1303 validation
113+
- Identify the exact file(s) changed in Sample 1303
114+
- Confirm no engine files changed
115+
- Confirm asteroid velocity is clamped/capped locally
116+
- Confirm sample remains playable and asteroids no longer accelerate to runaway values
117+
118+
### C. Preview retry validation
119+
For the listed sample set only, report:
120+
- which samples had SVGs containing `Capture timeout`
121+
- which of those were retried/regenerated
122+
- which listed samples were skipped because their SVG did not contain `Capture timeout`
123+
- confirm no samples outside the list were retried
124+
- confirm `1316`, `1317`, `1318` were not touched
125+
126+
### D. Packaging validation
127+
Produce a repo-structured delta ZIP containing only files relevant to this PR, plus the docs in this BUILD bundle.
128+
Expected output location:
129+
- `<project folder>/tmp/BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY_delta.zip`
130+
131+
## Non-Goals
132+
- No engine cleanup/refactor
133+
- No repo-wide preview regeneration
134+
- No metadata/tag cleanup
135+
- No changes to sample page layouts beyond the requested `samples/index.html` text updates
136+
- No edits to 1316/1317/1318
137+
- No APPLY docs in this step
138+
139+
## Expected Codex Deliverable
140+
A repo-structured delta ZIP at:
141+
- `<project folder>/tmp/BUILD_PR_SAMPLES_INDEX_FIXES_AND_TARGETED_PREVIEW_RETRY_delta.zip`
142+
143+
with only the files changed for:
144+
- `samples/index.html`
145+
- Sample 1303 local gameplay fix files
146+
- regenerated preview SVG files for the listed retry set that actually contained `Capture timeout`
147+
- supporting BUILD/PR docs if Codex includes them in its packaging flow

samples/index.html

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,13 +576,34 @@ <h2>Phase 16 - 3D Games (160x-160x)</h2>
576576

577577
const modelsById = new Map(linkModels.map((model) => [model.sampleId, model]));
578578

579+
function parsePhaseName(sectionNode) {
580+
if (!sectionNode || typeof sectionNode.querySelector !== 'function') {
581+
return '';
582+
}
583+
const heading = sectionNode.querySelector('h2');
584+
const headingText = String(heading ? heading.textContent : '').trim();
585+
const match = headingText.match(/^Phase\s+(\d{2})\s*-\s*(.+?)(?:\s*\(|$)/i);
586+
return match ? String(match[2] || '').trim() : '';
587+
}
588+
579589
const phaseValues = Array.from(
580590
new Set(linkModels.map((model) => model.phase).filter(Boolean))
581591
).sort();
592+
const phaseNameByValue = new Map();
593+
for (const model of linkModels) {
594+
if (!model.phase || phaseNameByValue.has(model.phase)) {
595+
continue;
596+
}
597+
const phaseName = parsePhaseName(model.section);
598+
if (phaseName) {
599+
phaseNameByValue.set(model.phase, phaseName);
600+
}
601+
}
582602
for (const phase of phaseValues) {
583603
const option = document.createElement('option');
584604
option.value = phase;
585-
option.textContent = 'Phase ' + phase;
605+
const phaseName = phaseNameByValue.get(phase);
606+
option.textContent = phaseName ? 'Phase ' + phase + ' - ' + phaseName : 'Phase ' + phase;
586607
phaseFilter.appendChild(option);
587608
}
588609

@@ -953,4 +974,3 @@ <h2>Phase 16 - 3D Games (160x-160x)</h2>
953974
</script>
954975
</body>
955976
</html>
956-

0 commit comments

Comments
 (0)