Skip to content

Commit 5e5e5f1

Browse files
author
DavidQ
committed
Normalize tool and workspace tile launch routing through SSoT
- Route sample tool tiles to tools/<tool>/index.html - Route game tiles through tools/Workspace Manager/index.html - Clear external launch memory before loading tool/workspace - Remove default/fallback tool launch behavior - Add validation report for UAT launch flow
1 parent a2b3677 commit 5e5e5f1

10 files changed

Lines changed: 515 additions & 206 deletions

docs/dev/codex_rules.md

Lines changed: 87 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,94 @@
1-
21
# Codex Rules (MANDATORY — HARD CONSTRAINTS)
32

4-
These rules OVERRIDE all other instructions.
3+
These rules OVERRIDE all other task instructions except correctness and explicit user safety constraints.
54
If any rule is violated, the output is incorrect.
65

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

9-
---
10-
11-
## CORE PRINCIPLES
12-
- Follow the requested task EXACTLY. Do not expand scope.
13-
- Produce the smallest valid change required.
14-
- Prefer clarity, simplicity, and determinism.
8+
## Core Principles
9+
- Follow the requested task exactly.
10+
- One PR purpose only.
11+
- Smallest scoped valid change.
12+
- No repo-wide rewrites unless explicitly required by the task.
1513
- Do not introduce behavior that was not explicitly requested.
16-
17-
---
18-
19-
## NAMING
20-
- One concept = one name
21-
- Do NOT create alias variables
22-
- Do NOT copy variables without transformation
23-
- Do NOT rename variables unless required and consistent
24-
25-
---
26-
27-
## VARIABLES
28-
- No temporary pass-through variables
29-
- No a → b → c chains
30-
- Only create variables for transformation, clarity, or control flow
31-
32-
---
33-
34-
## FUNCTION DESIGN
35-
- Keep functions small and single-purpose
36-
- Do NOT create helper functions unless reused or required
37-
- No unnecessary abstraction
38-
39-
---
40-
41-
## REFACTORING
42-
- Do NOT refactor unrelated code
43-
- Do NOT restructure files unless instructed
44-
- Do NOT rename files/folders unless required
45-
46-
---
47-
48-
## CONSISTENCY
49-
- Use existing naming patterns
50-
- Do NOT introduce new conventions
51-
- Do NOT mix styles
52-
53-
---
54-
55-
## SCOPE CONTROL
56-
- Do exactly what is requested — nothing more
57-
- No feature creep, optimizations, or extras
58-
59-
---
60-
61-
## COMMENTS
62-
- Only add when necessary or requested
63-
64-
---
65-
66-
## FILE CHANGES
67-
- Modify ONLY specified files
68-
- Do NOT create new files unless required
69-
70-
---
71-
72-
## OUTPUT
73-
- Clean, usable code only
74-
- No explanations unless requested
75-
76-
---
77-
78-
## ADDITIONAL ANTI-PATTERNS (STRICTLY FORBIDDEN)
79-
80-
### Naming / Data Flow
81-
- No vague names (data, temp, obj, item, thing, value)
82-
- No renaming same concept across files
83-
- No adapter names unless required
84-
- No duplicate state
85-
- No stored derived state
86-
87-
### Scope Creep
88-
- Do not fix unrelated bugs
89-
- Do not clean unrelated files
90-
- Do not modernize code unless asked
91-
- Do not change APIs
92-
- Do not change folder structure
93-
94-
### Control Flow
95-
- No hidden fallbacks
96-
- No silent error swallowing
97-
- No broad truthy/falsy replacements
98-
- No global flags for local behavior
99-
- No magic strings/numbers
100-
101-
### Architecture
102-
- No new frameworks/libraries
103-
- No service layers/managers/factories unless asked
104-
- No future-proofing abstractions
105-
- No splitting files for style only
106-
107-
### UI / Navigation
108-
- Do not change tile behavior unless requested
109-
- Do not change routes/labels/IDs
110-
- No duplicate launch paths
111-
- Do not bypass navigation conventions
112-
113-
### Testing / Validation
114-
- Must have concrete test path
115-
- No fake validation claims
116-
- Do not remove tests
117-
- Do not weaken tests
118-
119-
### Repo Safety
120-
- Do not modify start_of_day
121-
- Do not delete legacy folders
122-
- Do not change roadmap except status markers
123-
124-
### JavaScript
125-
- No var
126-
- No globals
127-
- No mutation of shared config
128-
- No implicit coercion
129-
- No == or !=
130-
- No unnecessary async
131-
- No mixing DOM/business logic if separated
132-
- No duplicate event listeners
133-
- No attaching handlers in loops
134-
135-
---
136-
137-
## VALIDATION
138-
- No alias variables
139-
- No unnecessary variables
140-
- No scope expansion
141-
- Matches repo patterns
142-
- Only requested changes made
143-
144-
Fix violations before output.
145-
146-
---
147-
148-
## PRIORITY
149-
1. Correctness
150-
2. These rules
151-
3. Task instructions
152-
4. Style
153-
154-
---
155-
156-
## FAILURE
157-
If task requires breaking rules:
158-
STOP and explain minimally
14+
- Do not modify `start_of_day` folders.
15+
16+
## Naming / Data Flow
17+
- One concept = one name.
18+
- Do not create alias variables or name remapping chains.
19+
- Do not copy variables into new variables unless data is transformed.
20+
- Do not rename the same concept across files.
21+
- Do not use vague names such as `data`, `temp`, `obj`, `item`, `thing`, `value`, or `result` unless the scope is tiny and obvious.
22+
- Do not introduce adapter names unless the PR explicitly requires adapters.
23+
- Do not create duplicate state for the same value.
24+
- Do not store derived state when it can be computed directly.
25+
26+
## Variables
27+
- No temporary pass-through variables.
28+
- No `a -> b -> c` assignment chains.
29+
- Only introduce variables when they transform data, clarify a complex expression, or are required for control flow.
30+
31+
## Scope Creep
32+
- Do not fix unrelated bugs.
33+
- Do not clean up unrelated files.
34+
- Do not modernize code unless requested.
35+
- Do not change public APIs unless the PR explicitly requires it.
36+
- Do not change folder structure unless the PR explicitly requires it.
37+
38+
## Control Flow
39+
- Do not add hidden fallback behavior.
40+
- Do not swallow errors silently.
41+
- Do not replace explicit checks with broad truthy/falsy checks when behavior could change.
42+
- Do not add global flags to control local behavior.
43+
- Do not introduce magic strings or magic numbers.
44+
- Do not add defaults/fallbacks for tool launch data; missing required SSoT data must fail validation visibly.
45+
46+
## Architecture
47+
- Do not add a new framework, library, dependency, build tool, or pattern.
48+
- Do not introduce service layers, registries, managers, factories, or abstractions unless explicitly requested.
49+
- Do not create future-proof extension points.
50+
- Do not split files only for style.
51+
52+
## UI / Navigation
53+
- Do not change existing tile behavior unless the PR is specifically about that tile.
54+
- Do not change route names, URLs, IDs, labels, or menu text unless requested.
55+
- Do not create duplicate launch paths for the same tool.
56+
- Do not bypass existing navigation conventions.
57+
- Samples must launch tools through `tools/<tool>/index.html`.
58+
- Games must launch Workspace Manager through `tools/Workspace Manager/index.html`.
59+
- External launches from samples or games must clear prior tool/workspace memory before loading the requested tool or workspace.
60+
61+
## Testing / Validation
62+
- Do not mark work complete without a concrete test path.
63+
- Do not claim browser-tested behavior unless actually tested.
64+
- Do not remove existing tests or validation hooks.
65+
- Do not weaken tests to make changes pass.
66+
67+
## Repo Safety
68+
- Do not modify `start_of_day` folders.
69+
- Do not delete legacy folders unless explicitly instructed.
70+
- Do not touch roadmap text except status markers `[ ]`, `[.]`, `[x]`.
71+
- Do not rewrite documentation outside the PR scope.
72+
73+
## JavaScript-Specific
74+
- Do not use `var`.
75+
- Do not create globals.
76+
- Do not mutate imported/shared config objects.
77+
- Do not rely on implicit type coercion.
78+
- Do not use loose equality `==` or `!=`.
79+
- Do not add async behavior unless needed.
80+
- Do not mix DOM querying and business logic if existing code separates them.
81+
- Do not duplicate event listeners.
82+
- Do not attach handlers repeatedly inside render/update loops.
83+
84+
## Validation Required Before Finish
85+
Before completing, verify:
86+
- No alias variables exist.
87+
- No unnecessary variables were introduced.
88+
- No scope expansion occurred.
89+
- Code matches existing repo patterns.
90+
- Only requested changes were made.
91+
- Launch data comes from a single source of truth.
92+
- No default/fallback launch entries remain for tools.
93+
94+
If any violation exists, fix it before returning output.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This bundle is docs-first. Codex writes implementation code.
2+
Validation report must be created by Codex after implementation at:
3+
docs/dev/reports/tool_launch_ssot_external_memory_reset_validation.md
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# BUILD_PR_LEVEL_20_4_TOOL_LAUNCH_SSOT_AND_EXTERNAL_MEMORY_RESET Validation
2+
3+
## Scope Executed
4+
5+
- Updated sample external tool launch routing to use a single launch SSoT helper.
6+
- Updated game workspace launch routing to use the same launch SSoT helper.
7+
- Added external-launch memory reset before navigation for sample and game launch paths.
8+
- Added visible launch validation surfacing for missing tool launch metadata.
9+
10+
## Files Changed
11+
12+
- `tools/shared/toolLaunchSSoT.js`
13+
- `samples/index.render.js`
14+
- `games/index.render.js`
15+
16+
## SSoT Change Summary
17+
18+
- Added `tools/shared/toolLaunchSSoT.js` as the launch SSoT for:
19+
- sample tool routes: `tools/<tool>/index.html`
20+
- game workspace route: `tools/Workspace Manager/index.html?game=<gameId>`
21+
- Removed per-page direct route construction for game workspace links.
22+
- Sample launch links now resolve through registry-backed tool lookup and explicit launch validation.
23+
24+
## External Memory Reset Summary
25+
26+
- Added `clearExternalToolWorkspaceMemory()` and `launchWithExternalToolWorkspaceReset()` in the SSoT helper.
27+
- All hub-driven external launches in changed paths now clear `toolboxaid.*` keys from:
28+
- `localStorage`
29+
- `sessionStorage`
30+
- Navigation then proceeds to the requested route without fallback routing.
31+
32+
## Validation Run
33+
34+
### Static validation performed
35+
36+
1. `node --check tools/shared/toolLaunchSSoT.js`
37+
2. `node --check samples/index.render.js`
38+
3. `node --check games/index.render.js`
39+
40+
### Anti-pattern checks performed
41+
42+
- No alias variable chains introduced.
43+
- No pass-through variable chains introduced.
44+
- No duplicate event listeners attached inside render loops.
45+
- No fallback tool-routing behavior added.
46+
47+
## Required UAT Path Checklist
48+
49+
1. Open `samples/index.html`.
50+
2. Click at least one tool tile.
51+
3. Confirm browser opens `tools/<tool>/index.html`.
52+
4. Confirm previous tool/workspace launch memory is cleared first.
53+
5. Return to `games/index.html`.
54+
6. Click a game tile.
55+
7. Confirm browser opens `tools/Workspace Manager/index.html`.
56+
8. Confirm previous workspace memory is cleared first.
57+
9. Confirm the requested game/workspace then loads from SSoT data.
58+
10. Confirm no tool silently loads through a default/fallback.
59+
60+
## Manual Browser UAT Execution Status
61+
62+
- Manual browser UAT was not executed in this CLI run.
63+
- This report includes the exact required UAT checklist for manual verification.
64+
65+
## Roadmap
66+
67+
- `docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md` was not modified in this build.
68+
- No directly mapped status marker update was required for this scoped routing/reset recovery change.
69+
Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
# Codex Commands - BUILD_PR_LEVEL_20_2_WORKSPACE_MANAGER_GAMES_TILE_UAT_RECOVERY
1+
# Codex Command — BUILD_PR_LEVEL_20_4_TOOL_LAUNCH_SSOT_AND_EXTERNAL_MEMORY_RESET
22

3-
## Model
4-
5-
GPT-5.4
6-
7-
## Reasoning
8-
9-
High
10-
11-
## Command
12-
13-
Run from the repo root after applying this bundle:
3+
Run Codex with injected rules and build doc. Do not run Codex free-form.
144

155
```powershell
166
$rules = Get-Content "docs/dev/codex_rules.md" -Raw
17-
$build = Get-Content "docs/pr/BUILD_PR_LEVEL_20_2_WORKSPACE_MANAGER_GAMES_TILE_UAT_RECOVERY.md" -Raw
7+
$build = Get-Content "docs/pr/BUILD_PR_LEVEL_20_4_TOOL_LAUNCH_SSOT_AND_EXTERNAL_MEMORY_RESET.md" -Raw
188
codex run "$rules`n`n$build"
199
```
2010

21-
## Required Codex Behavior
22-
23-
- Read `PROJECT_INSTRUCTIONS.md` before editing.
24-
- Follow `docs/dev/codex_rules.md` exactly.
25-
- Keep the change limited to the Workspace Manager launch UAT path from `games/index.html`.
26-
- Produce `tmp/BUILD_PR_LEVEL_20_2_WORKSPACE_MANAGER_GAMES_TILE_UAT_RECOVERY.zip` after implementation.
11+
Expected artifact:
12+
`tmp/BUILD_PR_LEVEL_20_4_TOOL_LAUNCH_SSOT_AND_EXTERNAL_MEMORY_RESET.zip`
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Recover Workspace Manager games tile UAT path
1+
Normalize tool and workspace tile launch routing through SSoT
22

3-
PR Details:
4-
- Uses PROJECT_INSTRUCTIONS.md as the active workflow contract.
5-
- Adds mandatory Codex anti-pattern guard rules.
6-
- Directs a smallest-scoped BUILD for opening Workspace Manager from games/index.html.
7-
- Requires UAT report and repo-structured Codex ZIP output.
3+
- Route sample tool tiles to tools/<tool>/index.html
4+
- Route game tiles through tools/Workspace Manager/index.html
5+
- Clear external launch memory before loading tool/workspace
6+
- Remove default/fallback tool launch behavior
7+
- Add validation report for UAT launch flow

0 commit comments

Comments
 (0)