Skip to content

Commit 49af3ae

Browse files
author
DavidQ
committed
# Codex Commands — BUILD_PR_LEVEL_20_8_IMPLEMENT_TOOL_LAUNCH_SSOT_ROUTING
## Model GPT-5.4 or GPT-5.3-codex ## Reasoning High ## Command ```text Read docs/dev/codex_rules.md first. Read docs/dev/specs/TOOL_LAUNCH_SSOT.md second. Execute BUILD_PR_LEVEL_20_8_IMPLEMENT_TOOL_LAUNCH_SSOT_ROUTING. Goal: Implement the first runtime slice of TOOL_LAUNCH_SSOT. Required behavior: - samples launch tools through tools/<tool>/index.html - games launch workspace flows through tools/Workspace Manager/index.html - external launches from samples/games clear launch memory before loading - launch data comes from the existing single source of truth - no default/fallback route/tool/workspace behavior in touched launch flow - invalid or missing launch context fails visibly Hard constraints: - smallest valid change - no unrelated cleanup - no repo-wide rewrite - no start_of_day changes - no roadmap text rewrite except status markers - no anti-patterns listed in docs/dev/codex_rules.md Validation: Create docs/dev/reports/tool_launch_ssot_routing_validation.md with: - changed files - tested UAT paths - proof samples route to tools/<tool>/index.html - proof games route to tools/Workspace Manager/index.html - proof external launch memory is cleared - proof missing context does not fallback - anti-pattern self-check Return ZIP at: tmp/BUILD_PR_LEVEL_20_8_IMPLEMENT_TOOL_LAUNCH_SSOT_ROUTING.zip ```
1 parent e6f7ac4 commit 49af3ae

7 files changed

Lines changed: 305 additions & 96 deletions

File tree

docs/dev/codex_rules.md

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
11
# Codex Rules (MANDATORY — HARD CONSTRAINTS)
22

33
These rules OVERRIDE all other instructions.
4-
If any rule is violated, the output is incorrect.
54

65
Codex must prefer the existing repo pattern over any new pattern, unless the PR explicitly says otherwise.
76

8-
## Baseline
7+
## Required Spec
98

10-
The last known assistant-produced baseline is:
9+
Read and obey:
1110

12-
- commit: `3f7e9df`
13-
- PR: `BUILD_PR_LEVEL_20_1_PHASE20_TOOL_PRESET_INTEGRATION`
11+
- docs/dev/specs/TOOL_LAUNCH_SSOT.md
1412

15-
All recovery analysis must compare current repo state against this baseline.
13+
## This PR
1614

17-
## Recovery Safety
15+
Allowed:
16+
- smallest implementation changes needed for launch routing SSoT
17+
- validation report
18+
- roadmap status marker update only if execution-backed
1819

19-
- Do NOT run destructive git commands.
20-
- Do NOT run `git reset --hard`.
21-
- Do NOT delete files.
22-
- Do NOT modify implementation files in this PR.
23-
- Do NOT rewrite roadmap text.
24-
- Do NOT modify `start_of_day` folders.
25-
- Do NOT invent fallback/default behavior.
26-
- Do NOT preserve junk code silently.
20+
Forbidden:
21+
- broad cleanup
22+
- unrelated refactoring
23+
- new route systems
24+
- fallback/default behavior
25+
- implementation outside touched launch path
26+
- start_of_day changes
27+
- roadmap text rewrite
2728

28-
## Anti-Patterns Strictly Forbidden
29+
## Anti-Patterns Forbidden
2930

30-
- variable aliasing: one concept renamed into another variable
31+
- variable aliasing
3132
- pass-through variables
3233
- duplicate state
3334
- stored derived state
34-
- vague names such as data, temp, obj, item, thing, value
35+
- vague names
3536
- hidden fallback behavior
36-
- default behavior where explicit routing is required
37-
- broad truthy/falsy checks that alter behavior
38-
- magic strings or magic numbers
37+
- duplicated launch paths
38+
- silent redirects
39+
- broad truthy/falsy behavior changes
40+
- magic strings or magic numbers outside existing SSoT/config pattern
3941
- duplicate event listeners
4042
- globals
41-
- new managers/factories/service layers unless explicitly requested
42-
- route/URL/ID/label changes unless explicitly requested
43-
- public API changes unless explicitly requested
44-
- unrelated cleanup
45-
- unrelated refactoring
43+
- new managers/factories/service layers unless already required by existing pattern
44+
- public API changes unless required by this PR
4645
- scope expansion
47-
- duplicated launch paths
48-
- sample/game launch bypasses
49-
- workspace launch memory carryover from external entry
50-
51-
## Validation
5246

53-
Before completing, verify:
47+
## Required Failure Behavior
5448

55-
- no implementation files changed
56-
- no destructive command used
57-
- all required reports exist
58-
- reset recommendation is explicit
59-
- all identified anti-patterns include file paths
49+
If launch context is missing or invalid:
50+
- fail visibly
51+
- report the missing field
52+
- do not guess
53+
- do not select the first item
54+
- do not reuse memory
55+
- do not silently redirect
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Tool Launch SSoT Routing Validation
2+
3+
## Changed Files
4+
5+
- `tools/shared/toolLaunchSSoT.js`
6+
- `games/index.render.js`
7+
- `docs/dev/reports/tool_launch_ssot_routing_validation.md`
8+
9+
## Tested UAT Paths
10+
11+
1. Samples hub roundtrip launch href resolution via `resolveSampleToolLaunchHref(...)`.
12+
2. Games hub workspace launch href resolution via `resolveGameWorkspaceLaunchHref(...)`.
13+
3. External launch memory clearing via `clearExternalToolWorkspaceMemory()` and `launchWithExternalToolWorkspaceReset(...)`.
14+
4. Missing launch context handling for:
15+
- sample launch missing `sampleId`
16+
- games metadata entries missing valid `href`
17+
18+
## Proof: Samples Route To `tools/<tool>/index.html`
19+
20+
Command run:
21+
22+
```bash
23+
node --input-type=module -
24+
```
25+
26+
Script output:
27+
28+
```text
29+
sampleLaunch {
30+
href: '/tools/Sprite%20Editor/index.html?sampleId=1208&sampleTitle=Tool+Formatted+Tiles+Parallax',
31+
error: ''
32+
}
33+
```
34+
35+
Implementation references:
36+
37+
- `tools/shared/toolLaunchSSoT.js:75`
38+
- `tools/shared/toolLaunchSSoT.js:91`
39+
- `samples/index.render.js:92`
40+
41+
## Proof: Games Route To `tools/Workspace Manager/index.html`
42+
43+
Command run:
44+
45+
```bash
46+
node --input-type=module -
47+
```
48+
49+
Script output:
50+
51+
```text
52+
gameLaunch {
53+
href: '/tools/Workspace%20Manager/index.html?gameId=2001&mount=game',
54+
error: ''
55+
}
56+
```
57+
58+
Implementation references:
59+
60+
- `tools/shared/toolLaunchSSoT.js:105`
61+
- `tools/shared/toolLaunchSSoT.js:117`
62+
- `tools/shared/toolLaunchSSoT.js:118`
63+
- `games/index.render.js:147`
64+
65+
## Proof: External Launch Memory Is Cleared
66+
67+
Command run:
68+
69+
```bash
70+
node --input-type=module -
71+
```
72+
73+
Script output:
74+
75+
```text
76+
clearResult true
77+
localAfterClear [ [ 'keep.one', 'x' ] ]
78+
sessionAfterClear [ [ 'keep.two', 'y' ] ]
79+
launchResult true
80+
assignCalls [ '/tools/Sprite%20Editor/index.html?sampleId=1208' ]
81+
localAfterLaunch [ [ 'keep.one', 'x' ] ]
82+
sessionAfterLaunch [ [ 'keep.two', 'y' ] ]
83+
```
84+
85+
Implementation references:
86+
87+
- `tools/shared/toolLaunchSSoT.js:123`
88+
- `tools/shared/toolLaunchSSoT.js:140`
89+
- `samples/index.render.js:537`
90+
- `games/index.render.js:424`
91+
- `games/index.render.js:444`
92+
93+
## Proof: Missing Context Does Not Fallback
94+
95+
1. Sample launch now requires `sampleId`; missing context returns explicit error and empty href:
96+
97+
```text
98+
missingSampleContext { href: '', error: 'Tool "sprite-editor" launch is missing sampleId.' }
99+
```
100+
101+
2. Games rows missing valid game `href` now emit explicit visible launch errors instead of silent empty launch state:
102+
103+
- `games/index.render.js:147`
104+
- `games/index.render.js:271`
105+
- `games/index.render.js:336`
106+
107+
3. Workspace launch links are only bound when explicit `workspaceHref` exists, so missing context cannot route through a fallback launcher:
108+
109+
- `games/index.render.js:266`
110+
- `games/index.render.js:416`
111+
112+
## Static Validation
113+
114+
Commands run:
115+
116+
```bash
117+
node --check tools/shared/toolLaunchSSoT.js
118+
node --check games/index.render.js
119+
node --check samples/index.render.js
120+
```
121+
122+
All commands exited successfully.
123+
124+
## Anti-Pattern Self-Check
125+
126+
- No new duplicate launch state introduced.
127+
- No new hidden/default/fallback launch route added in touched flow.
128+
- No duplicate event listeners added.
129+
- No new globals/managers/factories introduced.
130+
- No unrelated files changed for behavior.
Lines changed: 31 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Codex Commands — BUILD_PR_LEVEL_20_5_RECOVERY_AUDIT_FROM_20_1_BASELINE
1+
# Codex Commands — BUILD_PR_LEVEL_20_8_IMPLEMENT_TOOL_LAUNCH_SSOT_ROUTING
22

33
## Model
44
GPT-5.4 or GPT-5.3-codex
@@ -10,57 +10,39 @@ High
1010

1111
```text
1212
Read docs/dev/codex_rules.md first.
13+
Read docs/dev/specs/TOOL_LAUNCH_SSOT.md second.
1314
14-
Execute BUILD_PR_LEVEL_20_5_RECOVERY_AUDIT_FROM_20_1_BASELINE.
15-
16-
Baseline:
17-
- commit: 3f7e9df
18-
- PR: BUILD_PR_LEVEL_20_1_PHASE20_TOOL_PRESET_INTEGRATION
19-
- commit message: Add Phase 20 numbered tool presets and sample-to-tool launch integration
15+
Execute BUILD_PR_LEVEL_20_8_IMPLEMENT_TOOL_LAUNCH_SSOT_ROUTING.
2016
2117
Goal:
22-
Audit every change after 3f7e9df and recommend whether to reset to 3f7e9df or clean surgically.
23-
24-
Hard constraints:
25-
- No implementation code changes.
26-
- No git reset.
27-
- No file deletion.
28-
- No roadmap rewrite.
29-
- No start_of_day changes.
30-
- Create reports only.
31-
32-
Run and capture these inspections:
33-
- git status --short
34-
- git branch --show-current
35-
- git rev-parse HEAD
36-
- git log 3f7e9df..HEAD --oneline --decorate --name-status
37-
- git diff --stat 3f7e9df..HEAD
38-
- git diff --name-status 3f7e9df..HEAD
39-
- git diff --check 3f7e9df..HEAD
40-
- git ls-files --others --exclude-standard
18+
Implement the first runtime slice of TOOL_LAUNCH_SSOT.
4119
42-
Also inspect current UAT-relevant files if present:
43-
- games/index.html
44-
- samples/index.html
45-
- tools/Workspace Manager/index.html
46-
- tools/*/index.html
47-
- docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md
20+
Required behavior:
21+
- samples launch tools through tools/<tool>/index.html
22+
- games launch workspace flows through tools/Workspace Manager/index.html
23+
- external launches from samples/games clear launch memory before loading
24+
- launch data comes from the existing single source of truth
25+
- no default/fallback route/tool/workspace behavior in touched launch flow
26+
- invalid or missing launch context fails visibly
4827
49-
Required outputs:
50-
- docs/dev/reports/recovery_change_audit_from_20_1.md
51-
- docs/dev/reports/recovery_antipattern_audit_from_20_1.md
52-
- docs/dev/reports/recovery_reset_decision_from_20_1.md
53-
- docs/dev/reports/recovery_file_risk_list_from_20_1.md
54-
55-
In recovery_reset_decision_from_20_1.md include:
56-
- recommended path
57-
- whether reset to 3f7e9df is safer than surgical cleanup
58-
- files to preserve
59-
- files to discard
60-
- files requiring manual review
61-
- exact next APPLY_PR name
62-
- exact reason for the recommendation
63-
64-
Return a ZIP artifact at:
65-
tmp/BUILD_PR_LEVEL_20_5_RECOVERY_AUDIT_FROM_20_1_BASELINE.zip
28+
Hard constraints:
29+
- smallest valid change
30+
- no unrelated cleanup
31+
- no repo-wide rewrite
32+
- no start_of_day changes
33+
- no roadmap text rewrite except status markers
34+
- no anti-patterns listed in docs/dev/codex_rules.md
35+
36+
Validation:
37+
Create docs/dev/reports/tool_launch_ssot_routing_validation.md with:
38+
- changed files
39+
- tested UAT paths
40+
- proof samples route to tools/<tool>/index.html
41+
- proof games route to tools/Workspace Manager/index.html
42+
- proof external launch memory is cleared
43+
- proof missing context does not fallback
44+
- anti-pattern self-check
45+
46+
Return ZIP at:
47+
tmp/BUILD_PR_LEVEL_20_8_IMPLEMENT_TOOL_LAUNCH_SSOT_ROUTING.zip
6648
```
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Recovery audit from 20.1 baseline
1+
Implement tool launch SSoT routing
22

33
PR Details:
4-
- Uses 3f7e9df / BUILD_PR_LEVEL_20_1_PHASE20_TOOL_PRESET_INTEGRATION as the last known assistant-produced baseline.
5-
- Audits all later changes.
6-
- Documents anti-patterns and junk code.
7-
- Produces reset-vs-surgical-cleanup decision.
8-
- Forbids destructive reset in this PR.
4+
- Routes sample-launched tools through explicit tools/<tool>/index.html targets.
5+
- Routes game workspace flows through tools/Workspace Manager/index.html.
6+
- Clears launch memory for external sample/game launches.
7+
- Removes default/fallback behavior from touched launch flow.
8+
- Adds validation report for SSoT routing.

0 commit comments

Comments
 (0)