You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Checked that no sample or game JSON files were modified.
17
+
-Kept sample JSON files unmodified; the old sample schema path is a compatibility pointer to the moved canonical schema.
14
18
15
19
## Results
16
20
17
21
-`npm run test:workspace-v2`: passed, 10 tests.
18
-
- Tool mode: passed. Asset Manager V2 shows the tool action nav, hides workspace action nav, loads `asset-browser.schema.json`, exposes all seven file picker controls, and validates selected files before Add Asset.
19
-
- Accept filters: passed. Playwright asserted kind-specific accept filters on image, audio, font, video, shader, data, and localization picker inputs.
20
-
- Selected file validation: passed. Image `nebula-backdrop.png` selected with the `background` role derived `image.assets.nebula-backdrop.background`, `assets/images/nebula-backdrop.png`, validated against the schema, and added successfully.
21
-
- Picker rejection: passed. `notes.txt` selected through the image picker was rejected and Add Asset stayed disabled.
22
+
- Tool mode: passed. Asset Manager V2 shows the tool action nav, hides workspace action nav, loads `asset-browser.schema.json`, exposes one picker, derives approved kind, and validates selected files before Add.
23
+
- Selected file validation: passed. `nebula-backdrop.png` selected from a project-root path derived `image`, required `background`, assigned `image.assets.nebula-backdrop.background`, normalized `assets/images/nebula-backdrop.png`, validated, and added successfully.
24
+
- Picker rejection: passed. `notes.exe` was rejected as an unapproved asset type and Add stayed disabled.
22
25
- Role validation: passed. A JSON payload with an audio asset using the image-only `background` role was rejected.
23
-
- Workspace mode: passed. Workspace V2 launched Asset Manager V2 with `launch=workspace`, inserted the selected audio asset into `tools.asset-browser.assets`, and did not create `asset-manager-v2` or `workspace-v2` manifest entries.
26
+
- Workspace mode: passed. Workspace V2 launched Asset Manager V2 with `launch=workspace`, inserted `audio.assets.fire.sound` into `tools.asset-browser.assets`, and did not create `asset-manager-v2` or `workspace-v2` manifest entries.
24
27
- Asset Browser reuse check: passed. No legacy Asset Browser implementation imports or app references were added.
25
-
- Sample JSON check: passed. No sample or game JSON files were modified.
Backslashes are converted to `/`, repeated separators are collapsed, and the `HTML-JavaScript-Gaming` project-root prefix is removed when present.
15
+
16
+
## Fallback
17
+
18
+
If the browser does not expose a project-root path, Asset Manager V2 falls back to the derived kind folder and sanitized filename, for example:
19
+
20
+
```text
21
+
assets/images/nebula-backdrop.png
22
+
assets/audio/fire.wav
23
+
```
24
+
25
+
## Validation
26
+
27
+
Playwright validated both a Windows absolute project path and a project-root-prefixed path through the single picker flow. Both resolved to Workspace V2-safe relative paths before schema validation and insertion.
Copy file name to clipboardExpand all lines: docs/dev/reports/PR_26126_084_asset_manager_v2_schema_validation_notes.md
+10-16Lines changed: 10 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,20 @@ Date: 2026-05-06
4
4
5
5
## Schema Changes
6
6
7
+
- Moved the canonical sample wrapper schema to `tools/schemas/samples/sample.tool-payload.schema.json`.
8
+
- Kept `tools/schemas/sample.tool-payload.schema.json` as a compatibility `$ref` pointer so existing sample JSON files remain unmodified.
7
9
- Expanded `tools/schemas/tools/asset-browser.schema.json` asset id patterns and `kind` enum to include `image`, `audio`, `font`, `video`, `shader`, `data`, and `localization`.
- Required `role` on asset entries and kept role validation schema-owned through `assetRolesByKind`.
11
+
- Kept `stretchOverride` optional and constrained to `image.*.bezel` assets only; generic asset records do not require Stretch.
17
12
18
13
## Runtime Validation
19
14
20
-
- Asset Manager V2 loads allowed kinds, roles, and role-by-kind rules from `asset-browser.schema.json`.
21
-
- File selection derives a path and asset id, then validates the selected file entry through `AssetSchemaValidator.validateFileSelection()`.
22
-
- The selected file entry is also validated as an `assets` payload before the Add Asset button can persist it.
23
-
- Invalid picker selections are blocked before insertion. Example covered by Playwright: `notes.txt` selected through the image picker is rejected by accept validation.
24
-
- Invalid role combinations are rejected by schema-backed validation. Example covered by Playwright: `role: "background"` on an audio asset is rejected.
25
-
- Image `bezel` role requires an `image.*.bezel` asset id.
26
-
-`stretchOverride` remains allowed only on `image.*.bezel` assets.
15
+
- Asset Manager V2 uses one `Pick Asset File` control for all asset types.
16
+
- File selection derives the approved kind from extension or MIME type before role selection.
17
+
- Role selection is required and limited to allowed roles for the derived kind.
18
+
- Asset IDs are auto-assigned from derived kind, filename, and selected role.
19
+
- Source is always written as `asset-manager-v2`.
20
+
- Invalid extensions, unsupported roles, duplicate asset IDs, and schema-invalid JSON are rejected before insertion.
0 commit comments