Skip to content

Commit 2f2b0b9

Browse files
committed
Add shared project system across active tools with manifest, save/load flows, validation, migration hooks, dirty-state tracking, and shared asset/palette references while keeping Sprite Editor first-class and legacy hidden.
1 parent dd4c021 commit 2f2b0b9

21 files changed

Lines changed: 1637 additions & 115 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,40 @@
11
MODEL: GPT-5.4
22
REASONING: high
33

4-
TASK:
5-
Create BUILD_PR_ASSET_USAGE_INTEGRATION.
6-
7-
OBJECTIVE:
8-
Wire the shared asset system into all active first-class tools, using the latest uploaded GitHub repo state.
9-
10-
IN SCOPE:
4+
COMMAND:
5+
Create BUILD_PR_PROJECT_SYSTEM as a docs-first but implementation-ready platform slice.
6+
7+
GOALS:
8+
1. Add a shared project system for all active first-class tools.
9+
2. Keep Sprite Editor first-class.
10+
3. Keep SpriteEditor_old_keep hidden legacy.
11+
4. Keep tools/index.html tool-only.
12+
5. Persist assets and palettes by shared references, not tool-local duplication.
13+
14+
IMPLEMENT:
15+
- shared project service/context
16+
- project manifest contract
17+
- serializer + validator + migration entry points
18+
- new/open/save/save-as/close flows in the shared shell
19+
- dirty-state tracking
20+
- project name in header
21+
- per-tool persistence adapters for active tools only
22+
23+
ACTIVE TOOLS:
1124
- Vector Map Editor
1225
- Vector Asset Studio
1326
- Tilemap Studio
1427
- Parallax Scene Studio
1528
- Sprite Editor
16-
- shared Asset Browser / Import Hub integration
17-
- shared Palette Browser / Manager integration
18-
- registry-safe tool surfacing
19-
- engine theme consistency
20-
- contract documentation
21-
22-
OUT OF SCOPE:
23-
- SpriteEditor_old_keep
24-
- restoring samples to tools/index.html
25-
- showcase game content
26-
- unrelated refactors
27-
28-
REQUIREMENTS:
29-
1. Sprite Editor must remain first-class and visible.
30-
2. SpriteEditor_old_keep must remain hidden legacy.
31-
3. tools/index.html must stay tool-only.
32-
4. Tools consume shared assets/palettes; they do not own duplicated private copies by default.
33-
5. Normalize shared action labels:
34-
- Browse Assets
35-
- Import Assets
36-
- Browse Palettes
37-
- Manage Palettes
38-
6. Preserve engine theme and shared shell consistency.
39-
7. Update/extend the registry validator if needed so surfacing remains correct.
40-
41-
IMPLEMENTATION TARGETS:
42-
- add shared launch hooks/actions in each active tool
43-
- connect each tool to Asset Browser / Import Hub
44-
- connect each tool to Palette Browser / Manager
45-
- document the asset and palette handoff contracts
46-
- avoid structural churn unless required for the integration
29+
- Asset Browser / Import Hub
30+
- Palette Browser / Manager
4731

48-
VALIDATE:
49-
- all active tools can launch asset/palette flows
50-
- no samples reappear on tools/index.html
51-
- no legacy leakage
52-
- no broken paths
53-
- action labels consistent
54-
- engine theme consistent
32+
RULES:
33+
- no samples added back
34+
- no legacy tooling on active surface
35+
- no per-tool independent project roots
36+
- use engine theme for all project UI
37+
- preserve registry-driven tool surfacing
5538

5639
OUTPUT:
57-
<project folder>/tmp/BUILD_PR_ASSET_USAGE_INTEGRATION.zip
40+
<project folder>/tmp/BUILD_PR_PROJECT_SYSTEM.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Wire shared asset usage into all active first-class tools through the shared shell, normalize shared asset/palette handoff contracts, keep Sprite Editor first-class, keep SpriteEditor_old_keep hidden legacy, and preserve a tool-only tools/index surface.
1+
Add shared project system across active tools with manifest, shell flows, adapter-based persistence, dirty-state tracking, and shared asset/palette references while keeping Sprite Editor first-class and legacy hidden.
Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
CHANGE SUMMARY
1+
BUILD_PR_PROJECT_SYSTEM change summary
22

3-
PR:
4-
BUILD_PR_ASSET_USAGE_INTEGRATION
5-
6-
SUMMARY:
7-
Wire shared asset and palette systems into all active first-class tools through the shared platform shell and documented handoff contracts.
8-
9-
INCLUDED:
10-
- shared shell action hooks for every active first-class tool
11-
- normalized action labels:
12-
- Browse Assets
13-
- Import Assets
14-
- Browse Palettes
15-
- Manage Palettes
16-
- documented shared asset/palette handoff contract
17-
- Asset Browser launch-context and asset handoff publishing
18-
- Palette Browser launch-context and palette handoff publishing
19-
- Sprite Editor remains first-class
20-
- SpriteEditor_old_keep remains hidden legacy
21-
- tools/index.html remains tool-only
22-
23-
EXCLUDED:
24-
- samples on tools/index.html
25-
- showcase game/sample content
26-
- legacy revival
27-
- unrelated platform restructuring
3+
- Added shared project manifest/version/migration contract under `tools/shared/`
4+
- Added project controller wiring to the shared engine-themed shell
5+
- Added shell actions:
6+
- New Project
7+
- Open Project
8+
- Save Project
9+
- Save Project As
10+
- Close Project
11+
- Added project name + dirty-state header/status rendering
12+
- Added active-tool adapters for:
13+
- Vector Map Editor
14+
- Vector Asset Studio
15+
- Tilemap Studio
16+
- Parallax Scene Studio
17+
- Sprite Editor
18+
- Asset Browser / Import Hub
19+
- Palette Browser / Manager
20+
- Added active-tool bootstrap globals needed by the shared adapter layer
21+
- Added project-system validator/report output
22+
- Preserved current platform rules:
23+
- Sprite Editor first-class and visible
24+
- SpriteEditor_old_keep hidden legacy
25+
- tools/index remains tool-only and sample-free

docs/dev/reports/file_tree.txt

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
BUILD_PR_ASSET_USAGE_INTEGRATION/
2-
└── docs/
3-
├── pr/
4-
│ └── BUILD_PR_ASSET_USAGE_INTEGRATION.md
5-
└── dev/
6-
├── codex_commands.md
7-
├── commit_comment.txt
8-
└── reports/
9-
├── change_summary.txt
10-
├── validation_checklist.txt
11-
└── file_tree.txt
1+
docs/
2+
pr/
3+
BUILD_PR_PROJECT_SYSTEM.md
4+
specs/
5+
project_manifest_contract.md
6+
dev/
7+
COMMIT_COMMENT.txt
8+
reports/
9+
change_summary.txt
10+
file_tree.txt
11+
project_system_validation.txt
12+
validation_checklist.txt
13+
scripts/
14+
validate-project-system.mjs
15+
tools/
16+
shared/
17+
projectManifestContract.js
18+
projectSystem.js
19+
projectSystemAdapters.js
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
BUILD_PR_PROJECT_SYSTEM validation report
2+
3+
STATUS: PASS
4+
5+
Checks:
6+
- found tools/shared/projectManifestContract.js
7+
- found tools/shared/projectSystem.js
8+
- found tools/shared/projectSystemAdapters.js
9+
- found docs/specs/project_manifest_contract.md
10+
- active tools match expected first-class list (7)
11+
- Sprite Editor remains first-class and visible
12+
- SpriteEditor_old_keep remains hidden legacy
13+
- shared shell is wired to project system controller
14+
- tools/index.html remains tool-only
15+
16+
Issues:
17+
- none
Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
VALIDATION CHECKLIST
1+
BUILD_PR_PROJECT_SYSTEM validation checklist
22

3-
[x] Sprite Editor is still first-class and visible
4-
[x] SpriteEditor_old_keep is hidden legacy
5-
[x] tools/index.html remains tool-only
6-
[x] Vector Map Editor can launch Browse Assets
7-
[x] Vector Map Editor can launch Import Assets
8-
[x] Vector Map Editor can launch Browse Palettes / Manage Palettes
9-
[x] Vector Asset Studio can launch Browse Assets
10-
[x] Vector Asset Studio can launch Import Assets
11-
[x] Vector Asset Studio can launch Browse Palettes / Manage Palettes
12-
[x] Tilemap Studio can launch Browse Assets
13-
[x] Tilemap Studio can launch Import Assets
14-
[x] Tilemap Studio can launch Browse Palettes / Manage Palettes
15-
[x] Parallax Scene Studio can launch Browse Assets
16-
[x] Parallax Scene Studio can launch Import Assets
17-
[x] Parallax Scene Studio can launch Browse Palettes / Manage Palettes
18-
[x] Sprite Editor can launch Browse Assets
19-
[x] Sprite Editor can launch Import Assets
20-
[x] Sprite Editor can launch Browse Palettes / Manage Palettes
21-
[x] Shared asset references are used instead of tool-private duplication by default
22-
[x] Shared palettes remain the single source of truth
23-
[x] Shared contract doc exists at docs/specs/asset_usage_contract.md
24-
[x] No broken paths or dead launchers
25-
[x] Engine theme is consistent across the integrated flows
3+
[x] Project system lives in shared platform layer, not scattered across tools
4+
[x] New/Open/Save/Save As/Close flows exist in shared shell
5+
[x] Active project name is visible in header
6+
[x] Dirty-state indicator is visible in shared project chrome
7+
[x] Dirty-state prompt is wired for tool navigation, new/open, and close
8+
[x] Asset references are captured through shared project references
9+
[x] Palette references are captured through shared project references
10+
[x] Vector Map Editor has a shared project adapter
11+
[x] Vector Asset Studio has a shared project adapter
12+
[x] Tilemap Studio has a shared project adapter
13+
[x] Parallax Scene Studio has a shared project adapter
14+
[x] Sprite Editor has a shared project adapter
15+
[x] Asset Browser / Import Hub has a shared project adapter
16+
[x] Palette Browser / Manager has a shared project adapter
17+
[x] Project schema version is validated
18+
[x] Migration entry point exists for future versions
19+
[x] Sprite Editor remains first-class in registry/UI
20+
[x] SpriteEditor_old_keep remains hidden and excluded from active surface
21+
[x] tools/index.html remains tool-only and sample-free
22+
[x] Validation report emitted at docs/dev/reports/project_system_validation.txt

docs/pr/BUILD_PR_PROJECT_SYSTEM.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# BUILD_PR_PROJECT_SYSTEM
2+
3+
## Runtime scope
4+
- Shared project manifest contract for active first-class tools
5+
- Shared project controller in the engine-themed shell
6+
- Serializer, validator, and migration entry points
7+
- Dirty-state tracking, prompts, and project header status
8+
- Per-tool persistence adapters for active tools only
9+
10+
## Modules created
11+
- `tools/shared/projectManifestContract.js`
12+
- `tools/shared/projectSystem.js`
13+
- `tools/shared/projectSystemAdapters.js`
14+
- `docs/specs/project_manifest_contract.md`
15+
- `scripts/validate-project-system.mjs`
16+
17+
## Modules changed
18+
- `tools/shared/platformShell.js`
19+
- `tools/shared/platformShell.css`
20+
- `tools/Tilemap Studio/main.js`
21+
- `tools/Parallax Scene Studio/main.js`
22+
- `tools/Sprite Editor/main.js`
23+
- `tools/Sprite Editor/modules/spriteEditorApp.js`
24+
- `tools/Vector Asset Studio/main.js`
25+
- `tools/Asset Browser/main.js`
26+
- `tools/Palette Browser/main.js`
27+
28+
## Public/runtime boundaries
29+
- The shell owns project actions: New, Open, Save, Save As, Close
30+
- The manifest contract owns schema/version/validation/migration rules
31+
- Adapters own tool-specific capture/apply behavior
32+
- Shared asset/palette references stay rooted in manifest `sharedReferences`
33+
- `tools/index.html` remains tool-only
34+
- `Sprite Editor` remains first-class
35+
- `SpriteEditor_old_keep` remains hidden legacy and excluded
36+
37+
## Implementation summary
38+
- Added `html-js-gaming.project` as the shared project root with `version: 1`
39+
- Added migration and validation entry points before manifest use
40+
- Added shell project controls and project-name/dirty-state chrome in the shared header
41+
- Added unsaved-change prompts for tool navigation, new/open, and close flows
42+
- Added per-tool adapters for:
43+
- Vector Map Editor
44+
- Vector Asset Studio
45+
- Tilemap Studio
46+
- Parallax Scene Studio
47+
- Sprite Editor
48+
- Asset Browser / Import Hub
49+
- Palette Browser / Manager
50+
- Persisted shared asset/palette handoffs through manifest references instead of duplicating them in shell state
51+
52+
## Validation performed
53+
- `node --check tools/shared/projectManifestContract.js`
54+
- `node --check tools/shared/projectSystem.js`
55+
- `node --check tools/shared/projectSystemAdapters.js`
56+
- `node --check tools/shared/platformShell.js`
57+
- `node --check tools/Tilemap Studio/main.js`
58+
- `node --check tools/Parallax Scene Studio/main.js`
59+
- `node --check tools/Sprite Editor/main.js`
60+
- `node --check tools/Sprite Editor/modules/spriteEditorApp.js`
61+
- `node --check tools/Vector Asset Studio/main.js`
62+
- `node --check tools/Asset Browser/main.js`
63+
- `node --check tools/Palette Browser/main.js`
64+
- `node scripts/validate-tool-registry.mjs`
65+
- `node scripts/validate-active-tools-surface.mjs`
66+
- `node scripts/validate-project-system.mjs`
67+
68+
## Follow-up recommendations
69+
- Add focused browser/manual QA for cross-tool open/save navigation flows
70+
- Add explicit automated round-trip tests for each adapter
71+
- Add future manifest migrations through `migrateProjectManifest()` only
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Project Manifest Contract
2+
3+
## Purpose and scope
4+
`html-js-gaming.project` is the shared project root for active first-class tools under `tools/`. It gives the platform one save/open/close contract, one migration entry point, and one place to carry shared asset and palette references across tools.
5+
6+
## Version
7+
- Schema: `html-js-gaming.project`
8+
- Initial version: `1`
9+
- Migration rule: future versions must load through explicit migration functions, not ad hoc tool-local mutation
10+
11+
## Canonical shape
12+
```json
13+
{
14+
"schema": "html-js-gaming.project",
15+
"version": 1,
16+
"id": "project-20260405-abcdef",
17+
"name": "Untitled Project",
18+
"createdAt": "2026-04-05T12:00:00.000Z",
19+
"updatedAt": "2026-04-05T12:00:00.000Z",
20+
"activeToolId": "vector-map-editor",
21+
"dirty": false,
22+
"sharedReferences": {
23+
"asset": null,
24+
"palette": null
25+
},
26+
"tools": {
27+
"vector-map-editor": {},
28+
"vector-asset-studio": {},
29+
"tile-map-editor": {},
30+
"parallax-editor": {},
31+
"sprite-editor": {},
32+
"asset-browser": {},
33+
"palette-browser": {}
34+
},
35+
"workspace": {
36+
"lastOpenTool": "vector-map-editor",
37+
"notes": ""
38+
},
39+
"migration": {
40+
"sourceVersion": 1,
41+
"applied": []
42+
}
43+
}
44+
```
45+
46+
## Shared reference rules
47+
- Shared assets and shared palettes live in `sharedReferences`
48+
- Tools consume those references and may mirror ids inside their own documents, but the manifest stays the canonical cross-tool handoff root
49+
- Consumers should prefer ids and source paths over duplicating shared asset or palette payloads
50+
51+
## Tool-state rules
52+
- `tools.<toolId>` stores only that tool's persistence payload
53+
- Tool payloads may include tool-native document state
54+
- Tool payloads must be serializable JSON
55+
- Unknown tool keys are tolerated for forward compatibility
56+
57+
## Serializer requirements
58+
- Produce stable pretty-printed JSON
59+
- Preserve `id`, `createdAt`, and supported tool payloads
60+
- Update `updatedAt` on capture/save
61+
- Keep `sharedReferences` synchronized with the latest shared asset/palette handoff state
62+
63+
## Validator requirements
64+
- Confirm schema id
65+
- Confirm supported or migratable version
66+
- Confirm required root fields exist
67+
- Confirm `tools` is an object
68+
- Emit warnings, not silent drops, for incomplete shared references
69+
70+
## Migration entry point
71+
- `migrateProjectManifest(rawManifest)` is the only accepted migration entry
72+
- Migration must preserve data when safe
73+
- Migration metadata must record source version and applied migration labels
74+
75+
## Active tool coverage
76+
- Vector Map Editor
77+
- Vector Asset Studio
78+
- Tilemap Studio
79+
- Parallax Scene Studio
80+
- Sprite Editor
81+
- Asset Browser / Import Hub
82+
- Palette Browser / Manager
83+
84+
## Explicit non-goals
85+
- No legacy `SpriteEditor_old_keep` participation
86+
- No samples or showcase content embedded in manifest roots
87+
- No per-tool isolated project roots as the primary save format

0 commit comments

Comments
 (0)