|
| 1 | +# PR 11.34 - Vector Tool Comparison (Analysis Only) |
| 2 | + |
| 3 | +## Scope |
| 4 | +- Compared `vector-map-editor` and `vector-asset-studio` using current repo implementation files only. |
| 5 | +- No implementation/runtime/schema/manifest changes were made for this PR. |
| 6 | + |
| 7 | +## Files Reviewed |
| 8 | +- `tools/toolRegistry.js` |
| 9 | +- `tools/Vector Map Editor/index.html` |
| 10 | +- `tools/Vector Map Editor/main.js` |
| 11 | +- `tools/Vector Map Editor/editor/VectorMapEditorApp.js` |
| 12 | +- `tools/Vector Map Editor/editor/VectorMapDocument.js` |
| 13 | +- `tools/Vector Map Editor/editor/VectorMapSerializer.js` |
| 14 | +- `tools/Vector Map Editor/editor/VectorMapRuntimeExporter.js` |
| 15 | +- `tools/Vector Asset Studio/index.html` |
| 16 | +- `tools/Vector Asset Studio/main.js` |
| 17 | +- `tools/schemas/tools/vector-map-editor.schema.json` |
| 18 | +- `tools/schemas/tools/vector-asset-studio.schema.json` |
| 19 | +- `tools/schemas/workspace.manifest.schema.json` |
| 20 | +- `samples/phase-09/0901/sample.0901.vector-map-editor.json` |
| 21 | +- `samples/phase-09/0901/sample.0901.vector-asset-studio.json` |
| 22 | +- `samples/phase-12/1204/sample.1204.vector-map-editor.json` |
| 23 | +- `samples/phase-12/1204/sample.1204.vector-asset-studio.json` |
| 24 | +- `samples/phase-19/1902/sample.1902.workspace-all-tools.json` |
| 25 | +- `tools/shared/platformShell.js` |
| 26 | +- `tools/Workspace Manager/main.js` |
| 27 | +- `tests/tools/ToolLocalSampleMigration.test.mjs` |
| 28 | +- `tests/tools/ToolBoundaryEnforcement.test.mjs` |
| 29 | +- `tests/tools/ToolEntryLaunchContract.test.mjs` |
| 30 | +- `tests/tools/ToolSchemaStrictModeValidation.test.mjs` |
| 31 | + |
| 32 | +## Direct Answers |
| 33 | +### 1) Do they do the same thing? |
| 34 | +- No. |
| 35 | +- `vector-map-editor` is map/spatial geometry editing with collision flags and map-runtime export. |
| 36 | +- `vector-asset-studio` is SVG asset authoring/editing/export with palette-driven paint/stroke workflows. |
| 37 | + |
| 38 | +### 2) What does each tool own today? |
| 39 | +- `vector-map-editor` owns `vectorMapDocument` editing state and map object operations (points, object flags, object transform/rotation/center, collision-vector testing), plus editor/runtime JSON exports. |
| 40 | +- `vector-asset-studio` owns `vectorAssetDocument` editing state and SVG element operations (shape creation, element selection/order/visibility, palette target paint/stroke/gradient, SVG serialization). |
| 41 | + |
| 42 | +### 3) What data format does each tool read/write? |
| 43 | +- `vector-map-editor`: |
| 44 | +- Reads JSON preset payload containing `vectorMapDocument` (currently accepted from `payload`, `config`, or root during extraction). |
| 45 | +- Imports `.json` files via file input. |
| 46 | +- Writes `.editor.json` via `VectorMapSerializer`. |
| 47 | +- Writes `.runtime.json` via `VectorMapRuntimeExporter`. |
| 48 | +- `vector-asset-studio`: |
| 49 | +- Reads JSON preset payload containing `vectorAssetDocument`. |
| 50 | +- `vectorAssetDocument` can include inline `svgText` or `svgPath` fetched as SVG text. |
| 51 | +- Imports `.svg` via file input. |
| 52 | +- Writes `.svg` via `serializeCurrentSvg()` + download flow. |
| 53 | +- Persists editor metadata as SVG attributes (`data-editor-*`) for palette/style restoration. |
| 54 | + |
| 55 | +### 4) What user workflows does each tool support? |
| 56 | +- `vector-map-editor` workflows: |
| 57 | +- Build/edit 2D or 3D-wireframe map objects. |
| 58 | +- Define map gameplay semantics via object flags (`collidable`, `deadly`, `trigger`, etc.). |
| 59 | +- Inspect collision hits via collision vector tool. |
| 60 | +- Manual JSON dock validate/apply/revert. |
| 61 | +- Save authoring JSON and export runtime JSON. |
| 62 | +- `vector-asset-studio` workflows: |
| 63 | +- Draw/edit SVG shapes and paths. |
| 64 | +- Apply palette-driven fill/stroke/gradient and stroke width. |
| 65 | +- Select/reorder/hide/show elements. |
| 66 | +- Canvas zoom/pan and selection overlays. |
| 67 | +- Save canonical SVG output for downstream usage. |
| 68 | + |
| 69 | +### 5) Are there duplicated functions or concepts? |
| 70 | +- Yes, but mostly infrastructure-level duplication: |
| 71 | +- Both support `samplePresetPath` query loading and diagnostics (`logToolLoad*` + `logToolUi*`). |
| 72 | +- Both have selection state, enable/disable gating, and shared platform shell lifecycle patterns. |
| 73 | +- Domain-level overlap exists only at a high level ("vector editing"), not in artifact ownership: |
| 74 | +- Map editor edits structured map geometry documents. |
| 75 | +- Asset studio edits SVG documents. |
| 76 | + |
| 77 | +### 6) Which one should be canonical for SVG/vector asset authoring? |
| 78 | +- `vector-asset-studio` should remain canonical. |
| 79 | +- Evidence: |
| 80 | +- Registry description explicitly says SVG asset authoring/export. |
| 81 | +- Implementation contains SVG parser/sanitizer/serializer and SVG save/load controls. |
| 82 | +- Sample payload uses `vectorAssetDocument` with `svgText/svgPath`. |
| 83 | + |
| 84 | +### 7) Which one should be canonical for vector map/spatial/layout editing? |
| 85 | +- `vector-map-editor` should remain canonical. |
| 86 | +- Evidence: |
| 87 | +- Registry description explicitly says map layout/collision authoring. |
| 88 | +- Data model includes map object flags and spatial object schema. |
| 89 | +- Runtime export path (`*.runtime.json`) is map-structured, not SVG-structured. |
| 90 | + |
| 91 | +### 8) Should either tool be renamed, merged, retired, or kept separate? |
| 92 | +- Recommendation: keep separate. |
| 93 | +- Optional future naming polish only (not required): clarify that Vector Map Editor is map/collision-oriented to reduce user confusion with SVG editing. |
| 94 | +- Merge/retire is not recommended right now because contracts, payloads, and workflows are materially different. |
| 95 | + |
| 96 | +### 9) What would break if one was removed? |
| 97 | +- If `vector-map-editor` were removed: |
| 98 | +- Sample bindings and preset launch rows for map samples (for example 1212/1213/1214) would fail. |
| 99 | +- Workspace sample 1902 tool manifest coverage and schema/test expectations would fail. |
| 100 | +- Map authoring and runtime map export workflow would be lost. |
| 101 | +- If `vector-asset-studio` were removed: |
| 102 | +- Sample bindings and preset launch rows for vector asset samples (for example 1215/1216/1217) would fail. |
| 103 | +- Any tool/game contracts expecting vector/SVG asset payload ownership from this tool would fail. |
| 104 | +- Workspace sample 1902 full-tool coverage and related strict checks would fail. |
| 105 | + |
| 106 | +### 10) What is the recommended next PR? |
| 107 | +- Recommended next PR: contract-boundary hardening and clarity (docs + tests first, minimal code only if needed). |
| 108 | +- Proposed scope: |
| 109 | +- Document and enforce that `vector-map-editor` canonical input/output is `vectorMapDocument` + map runtime JSON. |
| 110 | +- Document and enforce that `vector-asset-studio` canonical input/output is `vectorAssetDocument` + SVG. |
| 111 | +- Add explicit no-cross-ownership assertions in tests (map tool should not become canonical SVG authoring path; asset studio should not become canonical collision/map runtime path). |
| 112 | +- Keep shared shell/workspace integration untouched unless a specific defect is reproduced. |
| 113 | + |
| 114 | +## Recommendation Summary |
| 115 | +- Keep both tools. |
| 116 | +- Keep `vector-asset-studio` as canonical SVG/vector-asset authoring tool. |
| 117 | +- Keep `vector-map-editor` as canonical map/spatial/collision authoring tool. |
| 118 | +- Avoid merge/retire now; focus next on boundary clarity and contract tests. |
0 commit comments