Skip to content

Commit 0efdf62

Browse files
author
DavidQ
committed
Add no-imageDataUrl policy and queue Samples2Tools cleanup steps
- AGENTS: forbid `imageDataUrl` in persisted project/runtime/workspace JSON; require path-based image refs. - Roadmap: add next-execution `imageDataUrl` elimination plan (remove dependency, remove fallback, migrate legacy + remove legacy dependency).
1 parent c6cb8f5 commit 0efdf62

23 files changed

Lines changed: 357 additions & 114 deletions

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Stop and report on ambiguity
1414
- Do not modify engine core unless explicitly in scope
1515
- Do not modify start_of_day folders unless explicitly requested
16+
- Never use `imageDataUrl` in project/runtime/workspace JSON contracts; use file/path fields (for example `imageName` or equivalent) as the only persisted source of truth
1617

1718
## Windows Execution
1819
- Prefer Node.js or Python for file operations, rename work, path handling, and ZIP work

docs/dev/roadmaps/MASTER_ROADMAP_SAMPLES2TOOLS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020
- [.] Roadmap kickoff started
2121
- [.] Phase 1 vertical slice target selected: `Parallax Scene Studio`
2222
- [.] Batch 1 implementation start
23+
- [ ] Next execution queued: remove all `imageDataUrl` usage/dependency across Samples2Tools lane
24+
25+
## Next Execution - imageDataUrl Elimination
26+
- [ ] 1) Remove dependency
27+
- [ ] Remove all code paths that require or rely on `imageDataUrl` for normal sample/tool/workspace flow.
28+
- [ ] Persist and pass only file/path-based image references (`imageName` or equivalent canonical path fields).
29+
- [ ] 2) Remove fallback
30+
- [ ] Remove `imageDataUrl` fallback reads (`imageDataUrl || imageSource`) after path-based flow is fully validated.
31+
- [ ] Remove temporary/in-memory-only fallback logic once equivalent preview behavior exists without `imageDataUrl`.
32+
- [ ] 3) Legacy needs to be updated and remove any dependency
33+
- [ ] Update legacy sample/tool payloads to canonical path-based image references.
34+
- [ ] Remove any remaining legacy compatibility branches tied to `imageDataUrl`.
35+
- [ ] Validate that older payloads in active lanes are migrated and no active launcher depends on `imageDataUrl`.
2336

2437
## Canonical Data Contract
2538
- [.] File naming standard: `samples/phase-xx/xxxx/sample-xxxx.json`

samples/phase-03/0306/parallax-editor-sample-0306.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"name": "Zone Band Far",
2626
"drawOrder": 0,
2727
"imageSource": "/samples/phase-03/0306/assets/data/parallax/sample-0306-far.svg",
28-
"imageDataUrl": "",
2928
"scrollFactorX": 0.2,
3029
"scrollFactorY": 0,
3130
"offsetX": 0,
@@ -41,7 +40,6 @@
4140
"name": "Zone Band Near",
4241
"drawOrder": 1,
4342
"imageSource": "/samples/phase-03/0306/assets/data/parallax/sample-0306-near.svg",
44-
"imageDataUrl": "",
4543
"scrollFactorX": 0.45,
4644
"scrollFactorY": 0,
4745
"offsetX": 0,

samples/phase-12/1204/parallax-editor-sample-1204.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"name": "Hero Band Far",
2626
"drawOrder": 0,
2727
"imageSource": "/samples/phase-12/1204/assets/data/parallax/sample-1204-far.svg",
28-
"imageDataUrl": "",
2928
"scrollFactorX": 0.16,
3029
"scrollFactorY": 0,
3130
"offsetX": 0,
@@ -41,7 +40,6 @@
4140
"name": "Hero Band Mid",
4241
"drawOrder": 1,
4342
"imageSource": "/samples/phase-12/1204/assets/data/parallax/sample-1204-mid.svg",
44-
"imageDataUrl": "",
4543
"scrollFactorX": 0.3,
4644
"scrollFactorY": 0,
4745
"offsetX": 0,
@@ -57,7 +55,6 @@
5755
"name": "Hero Band Near",
5856
"drawOrder": 2,
5957
"imageSource": "/samples/phase-12/1204/assets/data/parallax/sample-1204-near.svg",
60-
"imageDataUrl": "",
6158
"scrollFactorX": 0.52,
6259
"scrollFactorY": 0,
6360
"offsetX": 0,

samples/phase-12/1205/parallax-editor-sample-1205.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"name": "Multi Band Far",
2626
"drawOrder": 0,
2727
"imageSource": "/samples/phase-12/1205/assets/data/parallax/sample-1205-far.svg",
28-
"imageDataUrl": "",
2928
"scrollFactorX": 0.16,
3029
"scrollFactorY": 0,
3130
"offsetX": 0,
@@ -41,7 +40,6 @@
4140
"name": "Multi Band Mid",
4241
"drawOrder": 1,
4342
"imageSource": "/samples/phase-12/1205/assets/data/parallax/sample-1205-mid.svg",
44-
"imageDataUrl": "",
4543
"scrollFactorX": 0.3,
4644
"scrollFactorY": 0,
4745
"offsetX": 0,
@@ -57,7 +55,6 @@
5755
"name": "Multi Band Near",
5856
"drawOrder": 2,
5957
"imageSource": "/samples/phase-12/1205/assets/data/parallax/sample-1205-near.svg",
60-
"imageDataUrl": "",
6158
"scrollFactorX": 0.52,
6259
"scrollFactorY": 0,
6360
"offsetX": 0,

samples/phase-12/1208/ToolFormattedTilesParallaxScene.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ export default class ToolFormattedTilesParallaxScene extends Scene {
214214

215215
const loadOperations = layerDefinitions.map(async (layerDefinition, index) => {
216216
const assetPath = layerDefinition.asset
217-
|| layerDefinition.imageDataUrl
218217
|| layerDefinition.imageSource;
219218
if (!assetPath) {
220219
throw new Error(`Parallax layer ${layerDefinition.id || index} missing image source.`);
@@ -637,7 +636,6 @@ function extractParallaxLayers(parallaxExport) {
637636
.map((layer) => ({
638637
id: layer.id,
639638
imageSource: layer.imageSource,
640-
imageDataUrl: layer.imageDataUrl,
641639
scrollFactorX: Number(layer.scrollFactorX),
642640
offsetY: Number(layer.offsetY) || 0,
643641
opacity: Number(layer.opacity),
@@ -717,9 +715,6 @@ function extractTilesetImagePath(tileExport, atlas) {
717715
if (typeof atlas?.imageName === 'string' && atlas.imageName) {
718716
return atlas.imageName;
719717
}
720-
if (typeof atlas?.imageDataUrl === 'string' && atlas.imageDataUrl) {
721-
return atlas.imageDataUrl;
722-
}
723718
return '';
724719
}
725720

@@ -739,7 +734,6 @@ function extractTilesetImageCandidates(tileExport, atlas) {
739734
if (typeof atlas?.imageName === 'string' && atlas.imageName.includes('/assets/tileset/')) {
740735
add(atlas.imageName.replace('/assets/tileset/', '/assets/images/tileset/'));
741736
}
742-
add(atlas?.imageDataUrl);
743737

744738
return candidates;
745739
}

samples/phase-12/1208/data/toolFormattedParallax.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export default {
1616
"name": "Far Mountains",
1717
"drawOrder": 0,
1818
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-far-mountains.svg",
19-
"imageDataUrl": "",
2019
"scrollFactorX": 0.2,
2120
"scrollFactorY": 0.05,
2221
"offsetX": 0,
@@ -32,7 +31,6 @@ export default {
3231
"name": "Mid Cliffs",
3332
"drawOrder": 1,
3433
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-mid-cliffs.svg",
35-
"imageDataUrl": "",
3634
"scrollFactorX": 0.45,
3735
"scrollFactorY": 0.16,
3836
"offsetX": 0,
@@ -48,7 +46,6 @@ export default {
4846
"name": "Near Forest",
4947
"drawOrder": 2,
5048
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-near-forest.svg",
51-
"imageDataUrl": "",
5249
"scrollFactorX": 0.7,
5350
"scrollFactorY": 0.28,
5451
"offsetX": 0,

samples/phase-12/1208/data/toolFormattedParallax.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"name": "Far Mountains",
1717
"drawOrder": 0,
1818
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-far-mountains.svg",
19-
"imageDataUrl": "",
2019
"scrollFactorX": 0.2,
2120
"scrollFactorY": 0.05,
2221
"offsetX": 0,
@@ -32,7 +31,6 @@
3231
"name": "Mid Cliffs",
3332
"drawOrder": 1,
3433
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-mid-cliffs.svg",
35-
"imageDataUrl": "",
3634
"scrollFactorX": 0.45,
3735
"scrollFactorY": 0.16,
3836
"offsetX": 0,
@@ -48,7 +46,6 @@
4846
"name": "Near Forest",
4947
"drawOrder": 2,
5048
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-near-forest.svg",
51-
"imageDataUrl": "",
5249
"scrollFactorX": 0.7,
5350
"scrollFactorY": 0.28,
5451
"offsetX": 0,

samples/phase-12/1208/data/toolFormattedTileMap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ export default {
5454
],
5555
"tilesetAtlas": {
5656
"schema": "toolbox.tileset-atlas/1",
57-
"imageDataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAAAwCAYAAAD+WvNWAAAB60lEQVR4AeyWMU7DMBiFrUychYlDcAJ2DoCEQIIrMCKkIiFugdhYWGFm4gJcgq0oQ6KmNnbbyPn97K+SVcV2/L//vS9pu6fV/XpzfPzcTa6HNZX5Qa/K9+vb51p5dI4PDsxwYALQydmv+3o58o5TmfeEM5HdgQlA2atRoDoHRoBU3jL/6awuGZGGRoBCP119DyrzvVbG8g6MAC1fmoo1OHAwQDU0Tw/zHQCg+R42fYI8QA+Pz0553F6eO+UhD1DTj38BzXfKT2+vvQAPm5bAG6jp+Oc3Lw/Q6vTYKY/5EdqesDxAtv1KVr+5unDbo5RGAMg4iW0wQtchiaF9FnMAFEqHuZ0dAKCdrWJjyAEPoM0/pKEbrNdDmpizc8ADyE4KlRUdACDF1ArS7AF0/f7thhHSOaz138uuh6oxZ+2AB5C1IOprOQBAWnkVpxaAiotESxAAaeVVnFoAKi4SLUEApJVXcWpbAKg402sSBEA1pWnQCwAZmF5TSQCqKU2DXgDIwPSaSgJQTWka9AJABqbXVBKAImmylHYAgNIesSPiAABFzGEp7QAApT1iR8QBAIqYw1LaAQBKe8SOiAMAFDGHpbQDAJT2aP8dDd0BQA2FnaNVAMrhakNnAlBDYedoFYByuNrQmQDUUNg5Wv0DAAD//6PRWCUAAAAGSURBVAMAfqRVji4/TksAAAAASUVORK5CYII=",
58-
"imageName": "./assets/images/tileset/demo1208-terrain-tileset-orig.png",
57+
"imageName": "/samples/phase-12/1208/assets/images/tileset/demo1208-terrain-tileset-orig.png",
5958
"imageWidth": 144,
6059
"imageHeight": 48,
6160
"tileWidth": 48,
@@ -4114,3 +4113,4 @@ export default {
41144113
"notes": "Tile Map Editor toolbox.tilemap/1 format for Sample 1208 runtime import."
41154114
}
41164115
};
4116+

samples/phase-12/1208/parallax-editor-sample-1208.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"name": "Far Mountains",
2828
"drawOrder": 0,
2929
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-far-mountains.svg",
30-
"imageDataUrl": "",
3130
"scrollFactorX": 0.2,
3231
"scrollFactorY": 0.05,
3332
"offsetX": 0,
@@ -43,7 +42,6 @@
4342
"name": "Mid Cliffs",
4443
"drawOrder": 1,
4544
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-mid-cliffs.svg",
46-
"imageDataUrl": "",
4745
"scrollFactorX": 0.45,
4846
"scrollFactorY": 0.16,
4947
"offsetX": 0,
@@ -59,7 +57,6 @@
5957
"name": "Near Forest",
6058
"drawOrder": 2,
6159
"imageSource": "/samples/phase-12/1208/assets/data/parallax/layer-near-forest.svg",
62-
"imageDataUrl": "",
6360
"scrollFactorX": 0.7,
6461
"scrollFactorY": 0.28,
6562
"offsetX": 0,

0 commit comments

Comments
 (0)