|
| 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 |
0 commit comments