Skip to content

Commit 4975fc2

Browse files
author
DavidQ
committed
PR 8.10: Sample multi-file tool payload alignment
- Converted samples to one-file-per-tool model - Removed tools arrays from sample files - Aligned sample payloads with workspace tool payload structure - Standardized naming convention
1 parent e6dae94 commit 4975fc2

94 files changed

Lines changed: 850 additions & 1369 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: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@ MODEL: GPT-5.3-codex
22
REASONING: medium
33

44
TASK:
5-
- Update workspace.schema.json:
6-
- Add phase and level fields
7-
- Add conditional rules:
8-
- sample → phase required, level forbidden
9-
- game → level required, phase forbidden
10-
- Validate manifest against schema
11-
- Do NOT modify runtime
12-
- Do NOT add validators
13-
- Do NOT modify start_of_day
5+
Refactor samples to multi-file tool payload model.
6+
7+
STEPS:
8+
1. Remove any "tools" arrays inside sample JSON files.
9+
2. For each tool used in a sample:
10+
- Create file: sample.<id>.<tool>.json
11+
3. Ensure each file:
12+
- references tool schema via $schema
13+
- matches EXACT structure of workspace manifest tool payload
14+
4. Remove wrapper fields:
15+
- documentKind
16+
- id
17+
- type
18+
5. Keep palette as separate file if exists.
19+
6. Do NOT modify runtime.
20+
7. Do NOT add validators.
21+
8. Do NOT modify start_of_day.
22+
23+
ACCEPTANCE:
24+
- Each sample tool is its own file
25+
- File format matches workspace tool payload
26+
- No arrays or wrappers remain

docs/dev/commit_comment.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
PR 8.8: Entity progression dimension (phase vs level)
1+
PR 8.10: Sample multi-file tool payload alignment
22

3-
- Added phase and level fields
4-
- Enforced type-based conditional requirements
3+
- Converted samples to one-file-per-tool model
4+
- Removed tools arrays from sample files
5+
- Aligned sample payloads with workspace tool payload structure
6+
- Standardized naming convention
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# PR 8.10 — Sample Multi-File Tool Payload Alignment
2+
3+
## Purpose
4+
Clarify that "multiple tools" in samples means multiple files, not arrays inside a single file.
5+
6+
Each file represents a single tool payload and matches the exact format used in workspace/game manifest tool entries.
7+
8+
## Key Correction
9+
10+
### ❌ WRONG (array inside one file)
11+
```json
12+
{
13+
"tools": [ ... ]
14+
}
15+
```
16+
17+
### ✅ CORRECT (multiple files)
18+
```
19+
sample.0305.vector-map-editor.json
20+
sample.0305.vector-asset-studio.json
21+
```
22+
23+
Each file:
24+
- references ONE tool schema
25+
- contains ONE tool payload
26+
- is identical in shape to what goes inside:
27+
workspace.manifest.json → games[].tools[]
28+
29+
## File Naming Standard
30+
31+
```
32+
sample.<id>.<tool>.json
33+
```
34+
35+
Examples:
36+
- sample.0305.vector-map-editor.json
37+
- sample.0305.palette-editor.json
38+
- sample.0101.sprite-editor.json
39+
40+
## Payload Rule
41+
42+
Each sample tool file MUST match EXACTLY the structure used in game/workspace manifests.
43+
44+
Example:
45+
46+
```json
47+
{
48+
"$schema": "../../../tools/vector-map-editor/tool.schema.json",
49+
"tool": "vector-map-editor",
50+
"config": {}
51+
}
52+
```
53+
54+
This is identical to:
55+
56+
```json
57+
{
58+
"tools": [
59+
{
60+
"tool": "vector-map-editor",
61+
"config": {}
62+
}
63+
]
64+
}
65+
```
66+
67+
## Rules
68+
69+
- One file = one tool
70+
- No arrays inside sample files
71+
- File = tool payload
72+
- Same structure as workspace manifest tool entry
73+
- $schema must point to tool schema
74+
- Naming must be deterministic
75+
- No wrapper objects (no documentKind, no sample envelope)
76+
77+
## Palette
78+
79+
If needed:
80+
```
81+
sample.palette.json
82+
```
83+
84+
Referenced by convention, not embedded.
85+
86+
## Non-Goals
87+
88+
- No runtime logic
89+
- No validators
90+
- No workspace schema changes
91+
92+
## Acceptance
93+
94+
- No sample files contain tools arrays
95+
- All sample tool files match workspace tool payload shape
96+
- Naming convention enforced
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Sample File Naming Rules
2+
3+
## Format
4+
sample.<id>.<tool>.json
5+
6+
## Constraints
7+
- id matches sample folder
8+
- tool matches tool name exactly
9+
- lowercase kebab-case
10+
- no spaces
11+
12+
## Examples
13+
sample.0101.palette-editor.json
14+
sample.0305.vector-map-editor.json
15+
sample.0305.vector-asset-studio.json

samples/phase-02/0201/sample-0201-3d-camera-path-editor.json renamed to samples/phase-02/0201/sample.0201.3d-camera-path-editor.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"$schema": "../../../tools/schemas/sample.tool-payload.schema.json",
3-
"sampleId": "0201",
4-
"phase": "02",
5-
"title": "Camera Follow",
6-
"description": "Shared sample preset for Sample 0201 and 3D Camera Path Editor preload.",
7-
"toolHints": [
8-
"3d-camera-path-editor"
9-
],
10-
"payload": {
2+
"$schema": "../../../tools/schemas/tools/3d-camera-path-editor.schema.json",
3+
"tool": "3d-camera-path-editor",
4+
"version": "1",
5+
"config": {
116
"cameraPath": {
127
"schema": "tools.3d-camera-path.path/1",
138
"pathId": "sample-0201-follow-orbit",
@@ -53,16 +48,5 @@
5348
}
5449
]
5550
}
56-
},
57-
"runtime": {
58-
"sampleEntryPoint": "/samples/phase-02/0201/index.html"
59-
},
60-
"toolState": {
61-
"preferredToolId": "3d-camera-path-editor"
62-
},
63-
"provenance": {
64-
"path": "/samples/phase-02/0201/sample-0201-3d-camera-path-editor.json",
65-
"createdAt": "2026-04-24T00:00:00.000Z",
66-
"version": 1
6751
}
6852
}

samples/phase-02/0202/sample-0202-3d-camera-path-editor.json renamed to samples/phase-02/0202/sample.0202.3d-camera-path-editor.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"$schema": "../../../tools/schemas/sample.tool-payload.schema.json",
3-
"sampleId": "0202",
4-
"phase": "02",
5-
"title": "Camera Bounds",
6-
"description": "Shared sample preset for Sample 0202 and 3D Camera Path Editor preload.",
7-
"toolHints": [
8-
"3d-camera-path-editor"
9-
],
10-
"payload": {
2+
"$schema": "../../../tools/schemas/tools/3d-camera-path-editor.schema.json",
3+
"tool": "3d-camera-path-editor",
4+
"version": "1",
5+
"config": {
116
"cameraPath": {
127
"schema": "tools.3d-camera-path.path/1",
138
"pathId": "sample-0202-camera-bounds-tour",
@@ -53,16 +48,5 @@
5348
}
5449
]
5550
}
56-
},
57-
"runtime": {
58-
"sampleEntryPoint": "/samples/phase-02/0202/index.html"
59-
},
60-
"toolState": {
61-
"preferredToolId": "3d-camera-path-editor"
62-
},
63-
"provenance": {
64-
"path": "/samples/phase-02/0202/sample-0202-3d-camera-path-editor.json",
65-
"createdAt": "2026-04-24T00:00:00.000Z",
66-
"version": 1
6751
}
6852
}

samples/phase-02/0204/sample-0204-asset-browser.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

samples/phase-02/0204/sample-0204-3d-asset-viewer.json renamed to samples/phase-02/0204/sample.0204.3d-asset-viewer.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"$schema": "../../../tools/schemas/sample.tool-payload.schema.json",
3-
"sampleId": "0204",
4-
"phase": "02",
5-
"title": "Asset Registry",
6-
"description": "Shared sample preset for Sample 0204 and 3D Asset Viewer preload.",
7-
"toolHints": [
8-
"3d-asset-viewer"
9-
],
10-
"payload": {
2+
"$schema": "../../../tools/schemas/tools/3d-asset-viewer.schema.json",
3+
"tool": "3d-asset-viewer",
4+
"version": "1",
5+
"config": {
116
"asset3d": {
127
"schema": "tools.3d-asset-viewer.asset/1",
138
"assetId": "sample-0204-registry-node",
@@ -43,16 +38,5 @@
4338
"sourceToolId": "asset-browser"
4439
}
4540
}
46-
},
47-
"runtime": {
48-
"sampleEntryPoint": "/samples/phase-02/0204/index.html"
49-
},
50-
"toolState": {
51-
"preferredToolId": "3d-asset-viewer"
52-
},
53-
"provenance": {
54-
"path": "/samples/phase-02/0204/sample-0204-3d-asset-viewer.json",
55-
"createdAt": "2026-04-24T00:00:00.000Z",
56-
"version": 1
5741
}
5842
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "../../../tools/schemas/tools/asset-browser.schema.json",
3+
"tool": "asset-browser",
4+
"version": "1",
5+
"config": {
6+
"assetBrowserPreset": {
7+
"selectedCategory": "Vector Assets",
8+
"selectedAssetId": "asset-vector-player",
9+
"search": "vector",
10+
"importCategory": "Vector Assets",
11+
"importDestination": "games/<project>/assets/vectors/",
12+
"importName": "sample-0204-import.vector.json"
13+
}
14+
}
15+
}

samples/phase-02/0205/sample-0205-state-inspector.json renamed to samples/phase-02/0205/sample.0205.state-inspector.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"$schema": "../../../tools/schemas/sample.tool-payload.schema.json",
3-
"sampleId": "0205",
4-
"phase": "02",
5-
"title": "Save Load State",
6-
"description": "Shared sample preset for Sample 0205 and State Inspector preload.",
7-
"toolHints": [
8-
"state-inspector"
9-
],
10-
"payload": {
2+
"$schema": "../../../tools/schemas/tools/state-inspector.schema.json",
3+
"tool": "state-inspector",
4+
"version": "1",
5+
"config": {
116
"snapshot": {
127
"schema": "tools.debug-state-inspector.snapshot/1",
138
"capturedAt": "2026-04-24T00:00:00.000Z",
@@ -50,16 +45,5 @@
5045
},
5146
"notes": "Sample snapshot payload for State Inspector launch validation."
5247
}
53-
},
54-
"runtime": {
55-
"sampleEntryPoint": "/samples/phase-02/0205/index.html"
56-
},
57-
"toolState": {
58-
"preferredToolId": "state-inspector"
59-
},
60-
"provenance": {
61-
"path": "/samples/phase-02/0205/sample-0205-state-inspector.json",
62-
"createdAt": "2026-04-24T00:00:00.000Z",
63-
"version": 1
6448
}
6549
}

0 commit comments

Comments
 (0)