Skip to content

Commit 3e0d24f

Browse files
author
DavidQ
committed
Force-fix literal Asset none renderer path for SVG Asset Studio - PR 11.158. Fix active shared asset tile renderer for SVG Asset Studio - PR 11.159. and Fix shared shell SVG Asset Studio asset badge compatibility - PR 11.160. Wire SVG direct payload metadata into shared asset badge - PR 11.161. Wire SVG payload asset label into shared shell badge and track dead badge wiring - PR 11.162. Trace SVG badge handoff ownership before further changes - PR 11.163. Create dead-code ledger and revert map for badge-fix churn since 11.159 - PR 11.164. Audit failed SVG tile fix lane from PR 11.154 and create dead code revert map - PR 11.164. Run Codex for PR_11_165 - enforce badge ownership model. Fix hosted SVG badge clear-order so Workspace Manager handoff survives iframe shell init - PR 11.166. Use hosted session context as SVG badge source of truth instead of shared handoff - PR 11.167. Introduce contract-first workspace shell for hosted SVG asset state - PR 11.169. Create independent contract-first workspace shell for hosted SVG asset state - PR 11.169. Wire Workspace Manager SVG tile to workspace shell normalized state - PR 11.170. Add full trace logging for SVG tile write paths to identify overwrite source - PR 11.171. Disable platform badge writer for hosted SVG and update tile from workspace shell state - PR 11.172. Wire SVG hosted entry directly to workspace shell state - PR 11.174. Force SVG hosted entry to bypass platformShell via early-exit execution control - PR 11.175. Remove legacy platformShell badge row for hosted Workspace tools - PR 11.176. Remove shared dependency model; enforce SVG contract-first loading - PR 11.177. Disable assetUsageIntegration in hosted mode to remove global overwrite path - PR 11.178. Write hosted SVG tile state from workspace shell contract only - PR 11.179.
1 parent 4e309c2 commit 3e0d24f

52 files changed

Lines changed: 3667 additions & 180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/dev/codex_commands.md

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,13 @@
1-
# CODEX COMMANDS
21

3-
Model: GPT-5.3-codex
2+
Model: GPT-5.4
43
Reasoning: high
54

6-
STRICT SCOPE MODE
5+
Disable assetUsageIntegration in hosted mode.
76

8-
ALLOWED FILES:
9-
- tools/workspace-manager/main.js
10-
- docs/dev/reports/literal_asset_none_renderer_11_158.txt
7+
Modify:
8+
tools/shared/assetUsageIntegration.js
119

12-
TASK:
10+
- Add hosted guard to ALL read/write functions
11+
- No fallback logic
1312

14-
1. Open:
15-
tools/workspace-manager/main.js
16-
17-
2. Search for every occurrence of:
18-
- Asset:
19-
- none
20-
- textContent
21-
- innerHTML
22-
- appendChild
23-
- assetLabel
24-
- assetStatus
25-
- assetSummary
26-
- svg-asset-studio
27-
28-
3. Identify the exact active branch that creates the visible line:
29-
Asset: none
30-
31-
4. Patch that branch so when:
32-
workspaceManifest.tools["svg-asset-studio"].vectorAssetDocument.svgText
33-
exists, the visible output is:
34-
Asset: sample-0901-ship.svg
35-
or:
36-
Asset: Inline SVG
37-
38-
5. If the active branch cannot be proven statically, add a temporary diagnostic that fires ONLY when:
39-
svg-asset-studio renders Asset: none
40-
41-
6. DO NOT:
42-
- modify schemas
43-
- modify samples
44-
- modify SVG Asset Studio
45-
- modify runtime host
46-
- modify unrelated tools
47-
- add fallback/default/demo data
48-
- transform/wrap/normalize payload
49-
50-
7. Validate:
51-
- node --check tools/workspace-manager/main.js
52-
- git diff --name-only contains only ALLOWED FILES
53-
54-
8. Write:
55-
docs/dev/reports/literal_asset_none_renderer_11_158.txt
56-
57-
Report MUST include:
58-
- exact occurrences searched
59-
- exact old branch
60-
- exact new branch
61-
- expected visible output
62-
- diagnostic status
63-
- why prior PRs missed it
64-
- validation result
65-
66-
9. Package Codex output ZIP at:
67-
tmp/PR_11_158_FORCE_FIX_LITERAL_ASSET_NONE_RENDERER.zip
13+
Validate with node --check

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Force-fix literal Asset none renderer path for SVG Asset Studio - PR 11.158
1+
Disable assetUsageIntegration in hosted mode to remove global overwrite path - PR 11.178
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Task: active_asset_tile_renderer_11_159
2+
Date: 2026-04-30
3+
4+
Files searched (inspect-only set):
5+
- tools/Workspace Manager/main.js (searched)
6+
- tools/workspace-manager/main.js (no match)
7+
- tools/shared/platformShell.js (searched)
8+
- tools/shared/toolRegistry.js (no match)
9+
- tools/shared/toolLaunchState.js (no match)
10+
- tools/shared/toolCard*.js (no match)
11+
- tools/shared/*card*.js (no match)
12+
- tools/shared/*tile*.js (no match)
13+
- tools/index*.js (no match)
14+
- tools/index.html (inspected target context)
15+
16+
Active renderer file/function:
17+
- File: tools/shared/platformShell.js
18+
- Function: renderToolAssetBadge(toolId)
19+
- Render line source:
20+
`<span ...>${escapeHtml(`Asset: ${assetLabel}`)}</span>`
21+
22+
Exact old value source (causing visible `Asset: none`):
23+
- In renderToolAssetBadge:
24+
- `const missingAssetLabel = normalizedToolId === "skin-editor" ? "select skin in Asset Browser" : "none";`
25+
- `const assetLabelBasis = embeddedPayloadSummary || missingAssetLabel;`
26+
- `const assetLabel = compatibleAsset?.displayName || assetLabelBasis;`
27+
- For svg-asset-studio, when shared handoff and embedded summary were both unavailable, branch fell through to `missingAssetLabel` => `none`.
28+
29+
Exact new value source (patched):
30+
- Added helper in same renderer file:
31+
- `readSvgAssetLabelFromManifestPayload(manifestPayload)`
32+
- Reads direct data path:
33+
`manifestPayload.tools["svg-asset-studio"].vectorAssetDocument.sourceName`
34+
- If sourceName missing but svgText exists:
35+
`Inline SVG`
36+
- Updated renderToolAssetBadge (svg-only):
37+
- `const manifestSvgLabel = normalizedToolId === "svg-asset-studio" ? readSvgAssetLabelFromManifestPayload(getManifest()) : "";`
38+
- `const assetLabelBasis = embeddedPayloadSummary || manifestSvgLabel || missingAssetLabel;`
39+
40+
Why PR 11.158 missed it:
41+
- PR 11.158 patched Workspace Manager-side status plumbing.
42+
- The literal visible text `Asset: ...` is actually rendered in shared renderer `tools/shared/platformShell.js`.
43+
- Without patching this renderer fallback chain, it could still select `missingAssetLabel` (`none`) even when direct SVG manifest data existed.
44+
45+
Expected visible text:
46+
- `Asset: sample-0901-ship.svg` when sourceName exists.
47+
- `Asset: Inline SVG` when svgText exists but sourceName is missing.
48+
49+
Diagnostic status:
50+
- Temporary diagnostic not added.
51+
- Active renderer branch was proven statically and patched directly.
52+
53+
Validation result:
54+
- node --check tools/shared/platformShell.js -> PASS
55+
- Static trace confirms active renderer maps direct manifest SVG fields into asset label -> PASS
56+
- Sample 1902 static payload projection -> PASS
57+
- has svgText: true
58+
- sourceName: sample-0901-ship.svg
59+
- projected visible line: Asset: sample-0901-ship.svg
60+
- git diff --name-only -- tools/shared/platformShell.js docs/dev/reports/active_asset_tile_renderer_11_159.txt -> PASS
61+
- Note: repo has unrelated pre-existing dirty files outside this task scope.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
PR 11.162 Dead Wiring Report
2+
3+
Scope
4+
- File inspected/updated: tools/shared/platformShell.js
5+
- Path focus: shared shell asset badge derivation for svg-asset-studio (`renderToolAssetBadge`)
6+
7+
Dead/Unused Branches Found In Touched Path
8+
1) Branch: SVG badge label from workspace manifest payload (`readSvgAssetLabelFromManifestPayload` + `manifestSvgLabel` usage)
9+
- Status: Removed
10+
- Reason: Badge derivation is constrained to launch-time SVG payload fields, not legacy manifest-fallback wiring.
11+
12+
2) Branch: SVG badge fallback to generic embedded summary text (`embeddedPayloadSummary` for svg-asset-studio)
13+
- Status: Removed for svg-asset-studio path, retained for non-SVG tools
14+
- Reason: Produced summary-form labels instead of direct SVG payload-derived labels.
15+
16+
3) Branch: SVG badge title source "Resolved from workspace manifest payload" (legacy branch)
17+
- Status: Removed
18+
- Reason: Depended on removed legacy manifest label wiring.
19+
20+
Retained Branches In Touched Path
21+
1) Branch: Hosted shared-context SVG derivation
22+
- Status: Left in place
23+
- Reason: Uses real launch payload fields (`sharedContext.payloadJson.vectorAssetDocument.sourceName` / `svgText`).
24+
25+
2) Branch: Workspace-scoped preset SVG derivation
26+
- Status: Left in place
27+
- Reason: Covers scoped preset payload flow when `workspaceScopedToolPresetForStatus` is available.
28+
29+
3) Branch: Direct workspace manifest preset SVG derivation (`tools["svg-asset-studio"].vectorAssetDocument`)
30+
- Status: Left in place
31+
- Reason: Required for Sample 1902 shape where the tool entry does not carry a `tool` wrapper field and would otherwise be rejected by scoped-preset selection.
32+
33+
4) Branch: Missing asset label fallback (`none`)
34+
- Status: Left in place
35+
- Reason: Required missing-data behavior for generic badge rendering.
36+
37+
Implementation Summary
38+
- SVG badge derivation now resolves in this order:
39+
1) compatible shared asset handoff label (existing behavior)
40+
2) hosted shared-context SVG payload label
41+
3) workspace-scoped preset SVG payload label
42+
4) direct workspace manifest preset SVG payload label
43+
5) `none`
44+
- Source field used for expected result: `vectorAssetDocument.sourceName`.
45+
- If `sourceName` is absent but `svgText` exists, label resolves to `Inline SVG`.
46+
- No schema/sample/payload-contract changes were made.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR 11.162 Evidence Template
2+
3+
Codex must replace this template with execution evidence.
4+
5+
Required results:
6+
- node --check tools/shared/platformShell.js: PASS/FAIL
7+
- sample 1902 Workspace Manager launch: PASS/FAIL
8+
- SVG Asset Studio badge text: expected `Asset: sample-0901-ship.svg`
9+
- schema files changed: expected NO
10+
- sample JSON changed: expected NO
11+
- dead/unused badge wiring tracked: expected YES
12+
13+
Full samples smoke test:
14+
- skipped unless shared loader behavior changed beyond asset badge derivation
15+
- reason required
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# PR 11.163 Delivery Manifest
2+
3+
## Files
4+
- docs/pr/PR_11_163_FREEZE_BADGE_CHURN_AND_TRACE_HANDOFF.md
5+
- docs/dev/codex_commands.md
6+
- docs/dev/commit_comment.txt
7+
- docs/dev/reports/pr_11_163_delivery_manifest.md
8+
9+
## Full Samples Smoke
10+
Skipped. This PR is a trace/freeze bundle and must use targeted inspection only.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# PR 11.163 Handoff Trace Report
2+
3+
## Scope And Freeze Outcome
4+
- Freeze mode respected.
5+
- No implementation behavior changed in this pass.
6+
- No schema/sample/SVG Asset Studio/fallback-path edits were made for PR 11.163.
7+
8+
## Validation Commands Run
9+
- `git status --short`
10+
- `git diff --name-only HEAD`
11+
- targeted `rg` on: `Asset: none`, `Asset:`, `sourceName`, `vectorAssetDocument`, badge renderers
12+
13+
## Changed Files Since Last Commit
14+
From `git diff --name-only HEAD` (tracked changes):
15+
- `docs/dev/codex_commands.md`
16+
- `docs/dev/commit_comment.txt`
17+
- `docs/dev/reports/active_asset_tile_renderer_11_159.txt`
18+
- `docs/dev/reports/pr_11_162_dead_wiring_report.txt`
19+
- `docs/dev/reports/pr_11_162_evidence_template.txt`
20+
- `docs/dev/reports/shared_shell_svg_asset_badge_11_160.txt`
21+
- `docs/dev/reports/svg_payload_to_shared_asset_badge_11_161.txt`
22+
- `docs/pr/BUILD_PR_LEVEL_11_159_FIX_ACTIVE_SHARED_ASSET_TILE_RENDERER.md`
23+
- `docs/pr/BUILD_PR_LEVEL_11_160_FIX_SHARED_SHELL_SVG_ASSET_BADGE_COMPATIBILITY.md`
24+
- `docs/pr/BUILD_PR_LEVEL_11_161_WIRE_SVG_PAYLOAD_TO_SHARED_ASSET_BADGE.md`
25+
- `docs/pr/PR_11_162.md`
26+
- `tools/shared/platformShell.js`
27+
28+
Additional untracked files from `git status --short`:
29+
- `docs/dev/reports/pr_11_163_delivery_manifest.md`
30+
- `docs/pr/PR_11_163_FREEZE_BADGE_CHURN_AND_TRACE_HANDOFF.md`
31+
32+
## Exact Renderer Emitting Visible `Asset: none`
33+
Primary owner path is shared shell (not SVG tool UI, not Workspace Manager tile component):
34+
- File: `tools/shared/platformShell.js`
35+
- Function: `renderToolAssetBadge(toolId)`
36+
- Template emission:
37+
- Non-asset tools branch: ``Asset: ${nonAssetLabel}`` (line region ~1449)
38+
- Main branch: ``Asset: ${assetLabel}`` (line region ~1483)
39+
- Call site used in visible tool rows/tiles:
40+
- `renderToolLinks(currentToolId)` maps tool rows and calls `renderToolAssetBadge(tool.id)` (line regions ~1581-1584 and ~1644-1646)
41+
42+
Conclusion: the displayed `Asset: none` text is emitted by shared shell tool-row markup in `platformShell.js`.
43+
44+
## Input Contract Read By That Renderer
45+
`renderToolAssetBadge(toolId)` reads these contracts, in order:
46+
1. Shared asset handoff from storage:
47+
- API: `readSharedAssetHandoff()` from `tools/shared/assetUsageIntegration.js`
48+
- Storage key: `toolboxaid.shared.assetHandoff`
49+
- Normalized required fields: `assetId`, `sourcePath`
50+
- Normalized optional fields used by badge logic: `assetType`, `displayName`, `selectedAt`
51+
- Compatibility check fields in shell: `asset.assetType || asset.kind || asset.type`
52+
53+
2. SVG-specific hosted payload label path:
54+
- `readToolHostSharedContextFromLocation(window.location)`
55+
- `hostContext.sharedContext.payloadJson.vectorAssetDocument.sourceName` (or `svgText` => `Inline SVG`)
56+
57+
3. SVG-specific workspace preset label paths currently present in shell:
58+
- `workspaceScopedToolPresetForStatus.payload.vectorAssetDocument.sourceName` (or `svgText`)
59+
- direct manifest preset read: `rawPreset.tools["svg-asset-studio"].vectorAssetDocument.sourceName` (or `svgText`)
60+
61+
## Ownership Finding (Who Actually Owns The Badge)
62+
- Badge/tile text owner: `tools/shared/platformShell.js` shared shell renderer.
63+
- Workspace Manager role: writes shared handoff (`writeSharedAssetHandoff`) when launching/mounting payloads.
64+
- SVG Asset Studio role: consumes payload and renders editor/status internally; it does not render the shared shell `Asset:` tile text.
65+
66+
## Why Churn Happened (Observed Contract Mismatch)
67+
The visible row/tile badge is rendered for many tools via `renderToolLinks(...tool.id...)`, but SVG fallback label sources in shell are page-context globals (`workspaceScopedToolPresetForStatus`, hosted context on current URL), not guaranteed per-row/per-tool inputs.
68+
69+
Net effect:
70+
- Tool content can load correctly in SVG Asset Studio.
71+
- Shared shell row badge can still resolve to `none` when row-level renderer does not have a matching per-tool contract instance at render time.
72+
73+
## Smallest Next Recommendation
74+
Recommended smallest next PR (fix, not rollback):
75+
1. Keep owner in shared shell.
76+
2. In `renderToolAssetBadge(toolId)`, for `toolId === "svg-asset-studio"` when shared handoff is absent/incompatible, derive the label from the active workspace manifest per-tool node (row-scoped):
77+
- `getManifest()?.tools?.[toolId]?.vectorAssetDocument?.sourceName`
78+
- fallback only to `Inline SVG` when that same node has `svgText`.
79+
3. Do not alter schemas/samples/SVG tool behavior.
80+
81+
Why this is smallest:
82+
- Single-file, owner-correct wiring in `tools/shared/platformShell.js`.
83+
- No contract shape changes.
84+
- Aligns row renderer input with the same per-tool manifest object already present in workspace state.
85+
86+
## Smallest Rollback Alternative (If Fix Is Deferred)
87+
If immediate fix is deferred, rollback only the SVG-specific badge derivation additions in `tools/shared/platformShell.js` introduced across PR 11.160-11.162 attempts, while keeping baseline shared handoff behavior intact. Do not perform a broad reset.
88+
89+
## Targeted Validation For Next PR
90+
- `node --check tools/shared/platformShell.js`
91+
- launch Sample 1902 -> Workspace Manager path
92+
- verify `renderToolAssetBadge("svg-asset-studio")` displays `Asset: sample-0901-ship.svg`
93+
- no full samples smoke
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# PR 11.164 Badge Ownership Map
2+
3+
## Question
4+
Who owns the visible `Asset: none` text: Workspace Manager tile state, shared shell badge rendering, or SVG Asset Studio state export?
5+
6+
## Ownership Verdict
7+
- Primary owner: `tools/shared/platformShell.js`
8+
- Owner function: `renderToolAssetBadge(toolId)`
9+
- Owner call sites: `renderToolLinks(currentToolId)` row templates that call `renderToolAssetBadge(tool.id)`
10+
11+
## Exact Emit Path
12+
1. `renderToolLinks(...)` builds visible tool rows/cards.
13+
2. Each row calls `renderToolAssetBadge(tool.id)`.
14+
3. `renderToolAssetBadge` emits template text:
15+
- `Asset: ${nonAssetLabel}` for non-asset branch.
16+
- `Asset: ${assetLabel}` for main branch.
17+
4. When no compatible label resolves, branch fallback becomes `none`, producing visible `Asset: none`.
18+
19+
## Input Contract Consumed By Emitter
20+
### Contract A: shared handoff storage
21+
- Reader: `readSharedAssetHandoff()` from `tools/shared/assetUsageIntegration.js`
22+
- Backing key: `toolboxaid.shared.assetHandoff`
23+
- Normalized mandatory fields: `assetId`, `sourcePath`
24+
- Label fields considered by shell: `displayName`, `sourceName`, `name`, `label`, `path`, `sourcePath`
25+
- Compatibility fields considered: `assetType`, `kind`, `type`
26+
27+
### Contract B: hosted context payload (SVG-specific)
28+
- Reader: `readToolHostSharedContextFromLocation(window.location)`
29+
- Path: `sharedContext.payloadJson.vectorAssetDocument.sourceName`
30+
- Fallback within same payload path: `vectorAssetDocument.svgText -> Inline SVG`
31+
32+
### Contract C: workspace preset-derived SVG label caches (shell-local)
33+
- Scoped preset path (when available): `workspaceScopedToolPresetForStatus[...].vectorAssetDocument.sourceName`
34+
- Manifest preset path (shell-local cache): `tools["svg-asset-studio"].vectorAssetDocument.sourceName`
35+
36+
## Responsibility Split
37+
- Workspace Manager responsibility: write handoff payloads and launch hosted tool context.
38+
- SVG Asset Studio responsibility: consume SVG payload and render tool UI/status.
39+
- Shared shell responsibility: render visible tool-row `Asset:` badge text.
40+
41+
## Practical Conclusion
42+
- The visible `Asset: none` symptom is owned at the shared-shell renderer boundary.
43+
- Workspace Manager and SVG Asset Studio can both succeed while badge text remains `none` if shared-shell row resolution does not map the active label contract at render time.
44+
45+
## Smallest Next Fix Candidate
46+
- Restrict next change to `tools/shared/platformShell.js`.
47+
- For `toolId === "svg-asset-studio"`, resolve label from the active workspace manifest node (`getManifest()?.tools?.[toolId]?.vectorAssetDocument.sourceName`) before generic `none` fallback.
48+
- Keep contracts unchanged; no schema/sample/SVG payload rewrites.
49+
50+
## Smallest Rollback Candidate
51+
- If fixing is deferred, rollback only SVG-specific shell label branches added after PR 11.158 while preserving baseline handoff rendering path.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# PR 11.164 Build Notes
2+
3+
This corrected bundle changes the audit baseline from PR 11.159 to PR 11.154.
4+
5+
No implementation code is included. Codex must generate the actual ledger from the local repository history and working tree.

0 commit comments

Comments
 (0)