Skip to content

Commit 32979aa

Browse files
author
DavidQ
committed
Fix SVG payload detection (not label) in Workspace Manager - PR 11.154
1 parent e9ea07c commit 32979aa

5 files changed

Lines changed: 118 additions & 40 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,30 @@
11
# CODEX COMMANDS
22

33
Model: GPT-5.3-codex
4-
Reasoning: medium
4+
Reasoning: high
55

66
STRICT SCOPE MODE
77

88
ALLOWED FILES:
99
- tools/workspace-manager/main.js
10-
- docs/dev/reports/workspace_svg_asset_status_label_11_153.txt
11-
12-
ALLOWED CHANGES:
13-
- fix only SVG Asset Studio Workspace Manager card/status label
14-
- create/update report
1510

1611
TASK:
1712

18-
1. Open:
19-
tools/workspace-manager/main.js
20-
21-
2. Find card/status label logic for:
22-
svg-asset-studio
13+
1. Find detection logic for svg-asset-studio
2314

24-
3. Update it to read direct payload:
25-
workspaceManifest.tools["svg-asset-studio"].vectorAssetDocument.sourceName
15+
2. Replace detection with:
2616

27-
4. Display a useful label:
28-
Asset: sample-0901-ship.svg
17+
if (tools["svg-asset-studio"]?.vectorAssetDocument?.svgText)
2918

30-
5. Do NOT:
31-
- modify schemas
32-
- modify samples
33-
- modify SVG Asset Studio
34-
- modify runtime
35-
- transform/wrap/normalize payload
36-
- broaden unrelated tool logic
19+
3. Use sourceName for label
3720

38-
6. Validate:
39-
- JS syntax for tools/workspace-manager/main.js
40-
- Sample 1902 Workspace Manager card for SVG Asset Studio does not show Asset: none
41-
- git diff --name-only contains only ALLOWED FILES
21+
4. DO NOT change other tools
4222

43-
7. Write:
44-
docs/dev/reports/workspace_svg_asset_status_label_11_153.txt
23+
5. VERIFY:
24+
- detection works
25+
- no "none"
4526

46-
Report must include:
47-
- changed file
48-
- old/new label behavior
49-
- validation result
50-
- strict scope confirmation
27+
REPORT:
28+
docs/dev/reports/svg_payload_detection_fix_11_154.txt
5129

52-
8. Package Codex output ZIP at:
53-
tmp/PR_11_153_FIX_WORKSPACE_SVG_ASSET_STATUS_LABEL.zip
30+
FAIL if still not detected

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Show SVG Asset Studio loaded asset label in Workspace Manager - PR 11.153
1+
Fix SVG payload detection (not label) in Workspace Manager - PR 11.154
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Task: svg_payload_detection_fix_11_154
2+
Date: 2026-04-30
3+
4+
Files changed:
5+
- tools/Workspace Manager/main.js
6+
7+
Update made:
8+
- Replaced SVG Asset Studio detection with direct check:
9+
if (tools["svg-asset-studio"]?.vectorAssetDocument?.svgText)
10+
- Label source is direct payload sourceName:
11+
tools["svg-asset-studio"]?.vectorAssetDocument?.sourceName
12+
13+
Verification:
14+
- node --check "tools/Workspace Manager/main.js" -> PASS
15+
- Code check confirms new detection and sourceName label path -> PASS
16+
- Sample 1902 payload check -> detected=true, label=sample-0901-ship.svg, asset label "Asset: sample-0901-ship.svg"
17+
18+
Result:
19+
- SVG payload detection works with direct payload.
20+
- Label resolves from sourceName (no "none" for valid Sample 1902 payload).
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# BUILD_PR_LEVEL_11_154_FIX_SVG_PAYLOAD_DETECTION_NOT_LABEL
2+
3+
## Purpose
4+
Fix the root issue: Workspace Manager is NOT detecting the SVG payload at all, not just labeling it.
5+
6+
## Problem
7+
SVG Asset Studio still shows:
8+
9+
Asset: none
10+
11+
This means:
12+
Workspace Manager does NOT see `vectorAssetDocument` as valid data.
13+
14+
This is NOT just a label issue — detection logic is wrong.
15+
16+
## STRICT SCOPE
17+
18+
ALLOWED FILES:
19+
- tools/workspace-manager/main.js
20+
21+
ALLOWED CHANGES:
22+
- fix payload detection for svg-asset-studio ONLY
23+
24+
## ROOT CAUSE
25+
26+
Workspace Manager likely checks wrong keys such as:
27+
- payload.*
28+
- asset.*
29+
- wrong casing
30+
- wrong nesting
31+
32+
But actual data is:
33+
34+
tools["svg-asset-studio"].vectorAssetDocument
35+
36+
## REQUIRED FIX
37+
38+
Detection logic must:
39+
40+
1. Check:
41+
workspaceManifest.tools["svg-asset-studio"].vectorAssetDocument
42+
43+
2. Confirm existence of:
44+
- svgText OR sourceName
45+
46+
3. Mark tool as populated if present
47+
48+
## DO NOT
49+
50+
- modify schema
51+
- modify sample
52+
- modify svg tool
53+
- add fallback
54+
- transform payload
55+
- generalize logic for all tools
56+
57+
ONLY fix SVG detection path
58+
59+
## VALIDATION
60+
61+
Must verify:
62+
63+
- vectorAssetDocument exists
64+
- svgText exists
65+
- Workspace Manager detects it
66+
- card is no longer "none"
67+
68+
## REPORT
69+
70+
docs/dev/reports/svg_payload_detection_fix_11_154.txt
71+
72+
Include:
73+
- detection logic before
74+
- detection logic after
75+
- verification result
76+
77+
## FAILURE
78+
79+
FAIL if still shows "Asset: none"

tools/Workspace Manager/main.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,14 @@ function primeSvgAssetStatusLabelFromWorkspaceDiagnostics(diagnostics = null) {
328328
if (!explicitToolPayloadById) {
329329
return false;
330330
}
331-
const svgPayload = explicitToolPayloadById.get("svg-asset-studio");
332-
if (!isPlainObject(svgPayload)) {
331+
const tools = {};
332+
explicitToolPayloadById.forEach((payload, toolId) => {
333+
tools[toolId] = payload;
334+
});
335+
if (!tools["svg-asset-studio"]?.vectorAssetDocument?.svgText) {
333336
return false;
334337
}
335-
const vectorAssetDocument = readDirectPayloadDocument(svgPayload, "vectorAssetDocument");
336-
const sourceName = normalizeTextParam(vectorAssetDocument?.sourceName);
338+
const sourceName = normalizeTextParam(tools["svg-asset-studio"]?.vectorAssetDocument?.sourceName);
337339
if (!sourceName) {
338340
return false;
339341
}

0 commit comments

Comments
 (0)