Skip to content

Commit a57d255

Browse files
author
DavidQ
committed
Show tools surface on game-launched Workspace Manager open
PR Details: - Fixes Workspace Manager initial view for games/index.html Open with Workspace Manager. - Keeps explicit gameId context. - Keeps memory clear behavior. - Prevents mount=game from immediately showing the hosted game surface. - Does not restore fallback/default launch behavior. - Leaves sample Open <tool> behavior untouched.
1 parent c64249d commit a57d255

6 files changed

Lines changed: 339 additions & 64 deletions

File tree

docs/dev/codex_rules.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,56 @@ These rules OVERRIDE all other instructions.
44

55
## This PR
66

7+
Fix only the Workspace Manager initial view for game-launched context.
8+
79
Allowed:
8-
- targeted Workspace Manager fallback removal
9-
- restore missing docs/dev/specs/TOOL_LAUNCH_SSOT.md
10+
- targeted Workspace Manager launch/view selection edits
1011
- validation report
1112

1213
Forbidden:
1314
- broad cleanup
1415
- unrelated refactoring
16+
- changes to samples behavior
17+
- changes to required labels
1518
- new route systems
1619
- second SSoT
1720
- fallback/default behavior
1821
- start_of_day changes
1922
- roadmap text rewrite outside status markers
20-
- changing labels
2123

22-
## Exact Removals Required
24+
## Required UI Labels
25+
26+
Samples:
27+
- must remain `Open <tool>`
28+
29+
Games:
30+
- must remain `Open with Workspace Manager`
31+
32+
## Required Game Launch Behavior
33+
34+
For:
35+
36+
```text
37+
tools/Workspace Manager/index.html?gameId=<id>&mount=game
38+
```
39+
40+
`mount=game` means the source/context is a game.
41+
42+
It must not force the initial primary view to be the hosted game surface.
2343

24-
Remove Workspace Manager launch residues:
44+
Workspace Manager must show the tools/workspace surface for the explicit game context.
2545

26-
- `toolIds[0]` first-item/default tool selection in the launch path
27-
- `gameId || game` legacy query fallback in the launch path
46+
## Forbidden Restorations
2847

29-
## Required Failure Behavior
48+
Do not restore:
3049

31-
If `gameId` is missing or invalid:
32-
- fail visibly
33-
- report missing/invalid `gameId`
34-
- do not fallback to `game`
35-
- do not select first tool
36-
- do not reuse memory
37-
- do not silently redirect
50+
- `gameId || game`
51+
- `toolIds[0]`
52+
- first-item selection
53+
- default tool
54+
- default workspace
55+
- fallback route
56+
- stale memory reuse
3857

3958
## Anti-Patterns Forbidden
4059

@@ -47,7 +66,7 @@ If `gameId` is missing or invalid:
4766
- duplicated launch paths
4867
- silent redirects
4968
- broad truthy/falsy behavior changes
50-
- magic strings outside SSoT/config pattern
69+
- magic strings outside existing SSoT/config pattern
5170
- duplicate event listeners
5271
- globals
5372
- new managers/factories/service layers
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Workspace Manager Game Launch Tools View Validation
2+
3+
## Changed Files
4+
5+
- `tools/Workspace Manager/main.js`
6+
- `docs/dev/reports/workspace_manager_game_launch_tools_view_validation.md`
7+
8+
## Proof `Open with Workspace Manager` Still Routes To Workspace Manager
9+
10+
- Game card launch label remains exactly `Open with Workspace Manager` in `games/index.render.js:263`.
11+
- Games continue to launch via `launchWithExternalToolWorkspaceReset(workspaceHref)` in `games/index.render.js:419`.
12+
- `workspaceHref` is still produced by `resolveGameWorkspaceLaunchHref(..., { launchSource: "games", launchType: "game-to-workspace" })` in `games/index.render.js:150-152`.
13+
- `resolveGameWorkspaceLaunchHref` still resolves to Workspace Manager SSoT target path and appends `?gameId=<id>&mount=game` in `tools/shared/toolLaunchSSoT.js:95-118`.
14+
- Workspace Manager SSoT target path remains `/tools/Workspace%20Manager/index.html` in `tools/shared/toolLaunchSSoTData.js:63-70`.
15+
- Direct resolver check output:
16+
17+
```text
18+
{
19+
href: '/tools/Workspace%20Manager/index.html?gameId=2001&mount=game',
20+
error: ''
21+
}
22+
```
23+
24+
## Proof Explicit `gameId` Is Still Required
25+
26+
- Game-launch mode still requires `gameId` and fails visibly when missing:
27+
- `tools/Workspace Manager/main.js:573-576`
28+
- `tools/Workspace Manager/main.js:626-630`
29+
- Visible error message remains:
30+
31+
```text
32+
Workspace Manager game launch requires a valid gameId query parameter.
33+
```
34+
35+
## Proof `gameId || game` Fallback Is Not Restored
36+
37+
Command output:
38+
39+
```text
40+
gameIdOrGame 0
41+
legacyGameParamRead 0
42+
```
43+
44+
- `tools/Workspace Manager/main.js` contains no `gameId || game` and no legacy `searchParams.get("game")` query read.
45+
46+
## Proof `toolIds[0]` First-Tool Selection Is Not Restored
47+
48+
Command output:
49+
50+
```text
51+
toolIds0 0
52+
```
53+
54+
- `tools/Workspace Manager/main.js` contains no first-item `toolIds[0]` launch selection fallback.
55+
56+
## Proof External Launch Memory Clear Remains Intact
57+
58+
Runtime check output:
59+
60+
```text
61+
clearResult true
62+
localAfterClear [ [ 'keep.one', 'x' ] ]
63+
sessionAfterClear [ [ 'keep.two', 'y' ] ]
64+
launchResult true
65+
assignCalls [ '/tools/Workspace%20Manager/index.html?gameId=2001&mount=game' ]
66+
localAfterLaunch [ [ 'keep.one', 'x' ] ]
67+
sessionAfterLaunch [ [ 'keep.two', 'y' ] ]
68+
```
69+
70+
- Clearing still happens in `tools/shared/toolLaunchSSoT.js:121-136`.
71+
- External launch still clears first, then navigates via `window.location.assign(...)` in `tools/shared/toolLaunchSSoT.js:138-145`.
72+
73+
## Proof Initial Game-Launched Workspace Manager View Shows Tools/Workspace Surface (Not Game Surface)
74+
75+
- Removed auto hosted-game mount on initial game launch by deleting:
76+
- `await mountGameFrame(initialGameEntry)` branch from `init()` launch path.
77+
- `void mountGameFrame(gameEntry)` branch from game `popstate` path.
78+
- Current behavior with no explicit `tool` in game launch path:
79+
- `popstate` now unmounts any mounted content and returns with visible tool-selection status in `tools/Workspace Manager/main.js:590-595`.
80+
- `init()` now returns with visible tool-selection status in `tools/Workspace Manager/main.js:657-659`.
81+
- No direct runtime calls remain to auto-mount hosted game content during initialization/navigation:
82+
83+
```text
84+
awaitMountGameFrame 0
85+
voidMountGameFrame 0
86+
```
87+
88+
## Proof Sample `Open <tool>` Behavior Remains Untouched
89+
90+
- Sample label logic remains `Open <tool>` via:
91+
- `const label = \`Open ${normalize(tool.displayName) || normalize(tool.name) || toolId}\`` at `samples/index.render.js:104`.
92+
- Sample external launch path still routes through memory-clear helper via `launchWithExternalToolWorkspaceReset(launchHref)` at `samples/index.render.js:539`.
93+
- This BUILD made no edits to sample launch files.
94+
95+
## Static Validation
96+
97+
Commands run successfully:
98+
99+
```bash
100+
node --check tools/Workspace\ Manager/main.js
101+
node --check tools/shared/toolLaunchSSoT.js
102+
node --check tools/shared/toolLaunchSSoTData.js
103+
node --check games/index.render.js
104+
node --check samples/index.render.js
105+
```
106+
107+
## Anti-Pattern Self-Check
108+
109+
- No alias variables introduced.
110+
- No pass-through variables introduced.
111+
- No duplicate launch state introduced.
112+
- No duplicated launch paths introduced.
113+
- No fallback/default tool/workspace behavior introduced.
114+
- No stale memory reuse path introduced.
115+
- No label-text or DOM-order guessing introduced.
116+
- No sample/game label changes introduced.
117+
- Change remains scoped to the Workspace Manager initial game-launched view path.
Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Codex Commands — BUILD_PR_LEVEL_20_13_REMOVE_WORKSPACE_MANAGER_DEFAULT_AND_QUERY_FALLBACKS
1+
# Codex Commands — BUILD_PR_LEVEL_20_14_WORKSPACE_MANAGER_SHOW_TOOLS_ON_GAME_LAUNCH
22

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

1111
```text
1212
Read docs/dev/codex_rules.md first.
13-
Read docs/dev/reports/phase20_recovery_gate_decision.md.
14-
Read docs/dev/reports/phase20_recovery_uat_validation.md.
1513
Read docs/dev/specs/TOOL_LAUNCH_SSOT.md if present.
14+
Read docs/dev/reports/workspace_manager_default_query_fallback_removal_validation.md if present.
1615
17-
Execute BUILD_PR_LEVEL_20_13_REMOVE_WORKSPACE_MANAGER_DEFAULT_AND_QUERY_FALLBACKS.
16+
Execute BUILD_PR_LEVEL_20_14_WORKSPACE_MANAGER_SHOW_TOOLS_ON_GAME_LAUNCH.
17+
18+
User UAT finding:
19+
- Samples appear to work: Open <tool> opens tool and data appears.
20+
- Games path opens Workspace Manager, but Workspace Manager shows the game, not the tools.
1821
1922
Goal:
20-
Fix only the exact BLOCKED recovery gate issues:
21-
- tools/Workspace Manager/main.js uses default first-item tool selection via toolIds[0]
22-
- tools/Workspace Manager/main.js uses legacy query fallback gameId || game
23-
- docs/dev/specs/TOOL_LAUNCH_SSOT.md is missing
24-
25-
Required changes:
26-
1. In tools/Workspace Manager/main.js:
27-
- remove default first-item selection via toolIds[0] in the launch path
28-
- remove legacy query fallback gameId || game
29-
- require explicit gameId for game-launched Workspace Manager flow
30-
- missing/invalid gameId must fail visibly
31-
- no default/fallback tool/workspace selection
32-
- preserve external launch memory clearing
33-
34-
2. Ensure docs/dev/specs/TOOL_LAUNCH_SSOT.md exists.
35-
- If missing, restore it with the authoritative launch rules from this BUILD.
36-
- Do not create a second spec path.
23+
Fix only the Workspace Manager initial view for game-launched context.
24+
25+
Required behavior:
26+
- games/index.html -> Open with Workspace Manager -> tools/Workspace Manager/index.html?gameId=<id>&mount=game
27+
- Workspace Manager opens
28+
- explicit gameId context is loaded
29+
- external launch memory is cleared
30+
- initial primary view shows tools/workspace surface for that game context
31+
- it must not immediately show the hosted game surface
32+
- it must not auto-select the first tool
33+
- it must not fallback to game query param
34+
- it must not reuse stale memory
35+
36+
Clarification:
37+
`mount=game` means source/context is game-launched.
38+
It must not force the initial display to the hosted game surface.
39+
40+
Likely target:
41+
- tools/Workspace Manager/main.js
3742
3843
Forbidden:
39-
- broad cleanup
40-
- unrelated refactoring
41-
- changing sample launch labels
42-
- changing game launch labels
44+
- changing samples
45+
- changing labels
46+
- restoring gameId || game
47+
- restoring toolIds[0]
48+
- broad Workspace Manager refactor
4349
- second SSoT
50+
- fallback/default behavior
4451
- start_of_day changes
45-
- roadmap text rewrite outside status markers
4652
4753
Validation:
48-
Create docs/dev/reports/workspace_manager_default_query_fallback_removal_validation.md with:
54+
Create docs/dev/reports/workspace_manager_game_launch_tools_view_validation.md with:
4955
- changed files
50-
- exact removal proof for toolIds[0]
51-
- exact removal proof for gameId || game
52-
- proof gameId is required
53-
- proof missing gameId fails visibly
54-
- proof no first-tool selection remains in touched flow
55-
- proof memory clear remains intact
56-
- proof docs/dev/specs/TOOL_LAUNCH_SSOT.md exists
56+
- proof Open with Workspace Manager still routes to Workspace Manager
57+
- proof explicit gameId is still required
58+
- proof gameId || game fallback is not restored
59+
- proof toolIds[0] first-tool selection is not restored
60+
- proof external launch memory clear remains intact
61+
- proof initial game-launched Workspace Manager view shows tools/workspace surface, not game surface
62+
- proof sample Open <tool> behavior remains untouched
5763
- anti-pattern self-check
5864
5965
Return ZIP at:
60-
tmp/BUILD_PR_LEVEL_20_13_REMOVE_WORKSPACE_MANAGER_DEFAULT_AND_QUERY_FALLBACKS.zip
66+
tmp/BUILD_PR_LEVEL_20_14_WORKSPACE_MANAGER_SHOW_TOOLS_ON_GAME_LAUNCH.zip
6167
```
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Remove Workspace Manager default and query fallbacks
1+
Show tools surface on game-launched Workspace Manager open
22

33
PR Details:
4-
- Removes first-tool default selection from Workspace Manager launch flow.
5-
- Removes legacy gameId || game query fallback.
6-
- Requires explicit gameId for games/index.html Workspace Manager launch path.
7-
- Restores docs/dev/specs/TOOL_LAUNCH_SSOT.md if missing.
8-
- Adds validation report for the recovery gate blocker.
4+
- Fixes Workspace Manager initial view for games/index.html Open with Workspace Manager.
5+
- Keeps explicit gameId context.
6+
- Keeps memory clear behavior.
7+
- Prevents mount=game from immediately showing the hosted game surface.
8+
- Does not restore fallback/default launch behavior.
9+
- Leaves sample Open <tool> behavior untouched.

0 commit comments

Comments
 (0)