Skip to content

Commit e494ace

Browse files
author
DavidQ
committed
Replace SVG Asset Studio with session-backed v2 entry and hard legacy separation - PR 11.189.
1 parent 1ca285a commit e494ace

6 files changed

Lines changed: 481 additions & 45 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,21 @@
1-
MODEL: gpt-5.5
2-
REASONING: high
1+
# Codex Commands — PR_11_189 SVG Asset Studio v2
32

4-
COMMAND:
3+
## Model
4+
GPT-5.5 high
55

6-
Rebuild "Palette Manager" as a Tool v2:
6+
## Command
7+
Run Codex on this BUILD file:
78

8-
LOCATION:
9-
tools/Palette Manager/
9+
`docs/pr/BUILD_PR_11_189_SVG_ASSET_STUDIO_V2.md`
1010

11-
RULES:
12-
- Single file: main.js
13-
- Single class only
14-
- No helper classes
15-
- No abstraction layers
16-
- No alias variables
17-
- No pass-through variables
11+
## Execution Notes
12+
- Implement exactly one PR purpose: SVG Asset Studio v2.
13+
- Do not modify schemas, samples, games, Workspace Manager v1, legacy tools, or shared v1 systems.
14+
- Do not import `platformShell`, `assetUsageIntegration`, or `tools/shared/*`.
15+
- Do not add fallback/default/demo data.
16+
- Produce the repo ZIP at `tmp/PR_11_189.zip`.
1817

19-
REQUIREMENTS:
18+
## Required Evidence
19+
Write validation evidence to:
2020

21-
1. ENTRY
22-
- console.log("[PALETTE_V2_ENTRY]")
23-
24-
2. SESSION READ
25-
- read session using hostContextId
26-
- console.log("[SESSION_CONTEXT_READ]")
27-
28-
3. CONTRACT
29-
- load paletteJson only
30-
- console.log("[PALETTE_V2_CONTRACT_LOADED]")
31-
32-
4. RENDER
33-
- show palette name
34-
- render swatches
35-
- show count
36-
37-
5. STATES
38-
- empty state
39-
- error state
40-
41-
6. UI
42-
- reuse src/engine/theme styles
43-
- reuse existing accordion CSS
44-
- header must match /index.html
45-
- include accordion hide/show
46-
47-
7. HARD BLOCKS
48-
- no platformShell
49-
- no workspace v1
50-
- no fallback data
21+
`docs/dev/reports/PR_11_189_validation_report.md`

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Rebuild Palette Manager as Tool v2 with session-only contract, single-class architecture, and no legacy coupling - PR 11.188
1+
Replace SVG Asset Studio with session-backed v2 entry and hard legacy separation - PR 11.189
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# PR_11_189 Validation Report
2+
3+
## Purpose
4+
Implemented one isolated SVG Asset Studio v2 entry as a session-backed Tool v2 replacement.
5+
6+
## Changed Files
7+
- `tools/SVG Asset Studio v2/main.js`
8+
- `docs/dev/reports/PR_11_189_validation_report.md`
9+
10+
Existing PR source docs were present in the worktree and included in the ZIP:
11+
- `docs/pr/BUILD_PR_11_189_SVG_ASSET_STUDIO_V2.md`
12+
- `docs/pr/PLAN_PR_11_189_SVG_ASSET_STUDIO_V2.md`
13+
14+
## Scope Guard
15+
No changes were made to:
16+
- schemas
17+
- samples
18+
- games
19+
- `start_of_day/**`
20+
- Workspace Manager v1
21+
- legacy `tools/SVG Asset Studio/**`
22+
- `tools/shared/**`
23+
24+
## Implementation Evidence
25+
`tools/SVG Asset Studio v2/main.js` is a single-file, single-class implementation.
26+
27+
It emits required logs:
28+
- `[SVG_V2_ENTRY]`
29+
- `[SESSION_CONTEXT_READ]`
30+
- `[SVG_V2_CONTRACT_LOADED]`
31+
32+
It reads operational SVG data only from session-backed context:
33+
- direct session read via `hostContextId`
34+
- Workspace-written session context with `payloadJson`
35+
- Tool URL `payloadJson` is first written to session, then read through the same session path
36+
37+
Valid contract:
38+
```text
39+
payloadJson.vectorAssetDocument.svgText
40+
```
41+
42+
Optional visible label:
43+
```text
44+
payloadJson.vectorAssetDocument.sourceName
45+
```
46+
47+
## Syntax Check
48+
Command:
49+
```powershell
50+
node --check "tools/SVG Asset Studio v2/main.js"
51+
```
52+
53+
Result: passed.
54+
55+
## Banned Import / Reference Check
56+
Command:
57+
```powershell
58+
rg -n "platformShell|assetUsageIntegration|tools/shared|Workspace Manager|tool alias|handoff|fallback|demo data|^import |^export " "tools/SVG Asset Studio v2/main.js"
59+
```
60+
61+
Result: passed. No matches.
62+
63+
## Single-Class Check
64+
Command:
65+
```powershell
66+
rg -n "^class " "tools/SVG Asset Studio v2/main.js"
67+
```
68+
69+
Result:
70+
```text
71+
1:class SvgAssetStudioV2 {
72+
```
73+
74+
## Scripted Launch Check
75+
A targeted Node VM harness executed the v2 file with minimal browser mocks for four cases.
76+
77+
### Valid Session Result
78+
Input session:
79+
```text
80+
hostContextId=valid-svg
81+
sessionStorage[toolboxaid.toolHost.context.valid-svg].payloadJson.vectorAssetDocument.svgText=<svg ...>
82+
```
83+
84+
Observed logs:
85+
```text
86+
[SVG_V2_ENTRY]
87+
[SESSION_CONTEXT_READ]
88+
[SVG_V2_CONTRACT_LOADED]
89+
```
90+
91+
Observed render evidence:
92+
```text
93+
assetName: test-ship.svg
94+
badge: 108 bytes
95+
state: SVG Asset Studio v2 loaded the session SVG asset.
96+
frame: <img alt="test-ship.svg" src="blob:svg-v2-test" />
97+
contract: payloadJson loaded / vectorAssetDocument valid / svgText valid
98+
```
99+
100+
### Missing Session Empty-State Result
101+
Input:
102+
```text
103+
no hostContextId
104+
```
105+
106+
Observed logs:
107+
```text
108+
[SVG_V2_ENTRY]
109+
[SESSION_CONTEXT_READ]
110+
```
111+
112+
Observed render evidence:
113+
```text
114+
assetName: No SVG loaded
115+
badge: 0 bytes
116+
state: No hostContextId was provided. Open SVG Asset Studio v2 with a valid Tool v2 session URL.
117+
frame: empty
118+
contract: payloadJson not loaded
119+
```
120+
121+
### Invalid Session Error-State Result
122+
Input session:
123+
```text
124+
hostContextId=invalid-svg
125+
payloadJson.vectorAssetDocument.svgText=""
126+
```
127+
128+
Observed logs:
129+
```text
130+
[SVG_V2_ENTRY]
131+
[SESSION_CONTEXT_READ]
132+
[SVG_V2_CONTRACT_LOADED]
133+
```
134+
135+
Observed render evidence:
136+
```text
137+
assetName: SVG Asset Studio v2 error
138+
badge: 0 bytes
139+
state: SVG session data is invalid. Expected payloadJson.vectorAssetDocument.svgText.
140+
frame: empty
141+
contract: payloadJson invalid
142+
```
143+
144+
### Tool URL Writes Session Then Reads Session
145+
Input URL:
146+
```text
147+
?sessionId=url-svg&payloadJson=<encoded valid payloadJson>
148+
```
149+
150+
Observed logs:
151+
```text
152+
[SVG_V2_ENTRY]
153+
[SESSION_CONTEXT_READ]
154+
[SVG_V2_CONTRACT_LOADED]
155+
```
156+
157+
Observed render evidence:
158+
```text
159+
assetName: test-ship.svg
160+
badge: 108 bytes
161+
state: SVG Asset Studio v2 loaded the session SVG asset.
162+
frame: <img alt="test-ship.svg" src="blob:svg-v2-test" />
163+
contract: payloadJson loaded / vectorAssetDocument valid / svgText valid
164+
```
165+
166+
## Roadmap Decision
167+
Command:
168+
```powershell
169+
rg -n "SVG Asset Studio v2|SVG v2|Tool v2|svg-asset-studio-v2|SVG Asset Studio" "docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md"
170+
```
171+
172+
Result: no exact execution-backed roadmap marker was found. Roadmap was left untouched.
173+
174+
## Full Samples Smoke Decision
175+
Full samples smoke test skipped.
176+
177+
Reason: PR 11.189 is one isolated v2 tool entry and does not change shared loaders, samples, schemas, games, Workspace Manager v1, legacy tools, or broad framework code.
178+
179+
## ZIP Artifact
180+
Expected artifact:
181+
```text
182+
tmp/PR_11_189.zip
183+
```
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# BUILD_PR_11_189 — SVG Asset Studio v2
2+
3+
## Codex Objective
4+
Implement the smallest valid SVG Asset Studio v2 replacement that satisfies PLAN_PR_11_189.
5+
6+
## Absolute Constraints
7+
Do not edit schemas, samples, games, Workspace Manager v1, legacy tools, or shared v1 systems.
8+
9+
Banned imports/references:
10+
- `platformShell`
11+
- `assetUsageIntegration`
12+
- `tools/shared/`
13+
- Workspace Manager v1 wiring
14+
- tool aliases
15+
- fallback/default/demo data logic
16+
17+
Implementation constraints:
18+
- one tool at a time,
19+
- single file,
20+
- single class,
21+
- no helper classes,
22+
- no alias variables,
23+
- no pass-through variable chains,
24+
- no abstraction layers,
25+
- no unrelated file edits.
26+
27+
## Required Work
28+
1. Create or replace the SVG Asset Studio v2 entry as a single-file, single-class implementation.
29+
2. Read all operational data from session-backed context only.
30+
3. Support these paths:
31+
- Workspace writes session, tool reads session.
32+
- Tool URL writes session, tool reads session.
33+
- Tool direct reads session via `hostContextId`.
34+
4. Render SVG only after a valid v2 session contract is loaded.
35+
5. Show an actionable empty state when session context is missing.
36+
6. Show an actionable error state when session context is invalid.
37+
7. Add required logs:
38+
- `[SVG_V2_ENTRY]`
39+
- `[SESSION_CONTEXT_READ]`
40+
- `[SVG_V2_CONTRACT_LOADED]`
41+
8. Reuse `/index.html` header pattern and the existing accordion.
42+
9. Reuse `src/engine/theme` only as needed.
43+
10. Keep `menuTool` and `menuWorkspace` separate.
44+
11. Update the master roadmap status only if there is an execution-backed marker transition. Do not rewrite roadmap text.
45+
12. Write validation findings to `docs/dev/reports/PR_11_189_validation_report.md`.
46+
47+
## Validation Required
48+
Run targeted validation only. Do not run the full samples smoke test.
49+
50+
Required checks:
51+
- Syntax check for the changed SVG v2 file.
52+
- Banned import/reference grep for the changed SVG v2 file.
53+
- Manual or scripted launch check confirming expected logs.
54+
- Manual validation of valid, empty, and invalid session states.
55+
56+
Full samples smoke test:
57+
- Skip by default.
58+
- Reason: scope is one isolated v2 tool entry and does not change shared loaders, samples, schemas, games, or broad framework code.
59+
60+
## Output Required From Codex
61+
Create repo ZIP at:
62+
`C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\tmp\PR_11_189.zip`
63+
64+
The ZIP must preserve repo-relative paths and include:
65+
- implementation changes,
66+
- `docs/dev/reports/PR_11_189_validation_report.md`,
67+
- any status-only roadmap marker update if execution-backed.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# PLAN_PR_11_189 — SVG Asset Studio v2
2+
3+
## Purpose
4+
Replace SVG Asset Studio with a v2-only, session-backed tool entry that is hard-separated from legacy v1 systems.
5+
6+
## Scope
7+
- Tool: SVG Asset Studio v2 only.
8+
- Single implementation file.
9+
- Single class.
10+
- No helper classes.
11+
- No alias/pass-through variable chains.
12+
- No abstraction layers.
13+
- No schema changes.
14+
- No sample changes.
15+
- No game changes.
16+
- No Workspace Manager v1 work.
17+
- No legacy tool patching.
18+
- No copying old code.
19+
20+
## Required Architecture
21+
Data entry paths:
22+
1. Workspace writes session; tool reads session.
23+
2. Tool URL writes session; tool reads session.
24+
3. Tool direct reads session via `hostContextId`.
25+
26+
The tool must never:
27+
- fetch data directly,
28+
- guess data,
29+
- use fallback/default/demo data,
30+
- wire into Workspace Manager v1,
31+
- import `platformShell`, `assetUsageIntegration`, or anything under `tools/shared/*`.
32+
33+
## UI Requirements
34+
- Header must match `/index.html`.
35+
- Use the existing accordion system.
36+
- Reuse `src/engine/theme` without creating a new theme system.
37+
- Provide two separate menus:
38+
- `menuTool` for SVG Asset Studio actions only.
39+
- `menuWorkspace` for workspace-only actions only.
40+
- Do not mix tool and workspace responsibilities.
41+
42+
## Expected Logs
43+
- `[SVG_V2_ENTRY]`
44+
- `[SESSION_CONTEXT_READ]`
45+
- `[SVG_V2_CONTRACT_LOADED]`
46+
47+
## Acceptance
48+
- SVG Asset Studio v2 loads SVG data only from session-backed context.
49+
- Valid SVG contract renders correctly.
50+
- Empty state is visible and actionable when no session context exists.
51+
- Error state is visible and actionable when session data is invalid.
52+
- No legacy coupling remains in the SVG v2 entry.
53+
- No banned imports or legacy v1 references are introduced.
54+
- Targeted validation is documented in `docs/dev/reports/PR_11_189_validation_report.md`.

0 commit comments

Comments
 (0)