|
| 1 | +# PR_26163_076-assets-upload-prod-alignment |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- PASS - Current branch: `main` |
| 5 | +- PASS - Expected branch: `main` |
| 6 | + |
| 7 | +## Requirement Checklist |
| 8 | +- PASS - Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before implementation. |
| 9 | +- PASS - `Add Data` remains visible and disabled with `title="Planned"`. |
| 10 | +- PASS - `Add Vector` remains visible and disabled with `title="Planned"`. |
| 11 | +- PASS - Images, Audio, and Fonts remain upload-capable. Evidence: targeted Playwright uploads one file for each type and sees catalog rows. |
| 12 | +- PASS - Sprites and Palette References remain reference-only. Evidence: targeted Playwright verifies no upload file input for those asset types. |
| 13 | +- PASS - Upload auto-starts after file selection; no separate Upload button is required. Evidence: targeted Playwright sets files and asserts rows/logs without clicking Save. |
| 14 | +- PASS - Guest upload/create action is not visually disabled but blocks on action. Evidence: `Add Images` stays enabled, file selection shows `Uploads require a Game Foundry account.` with `Sign In` and `Create Account`, and no row is created. |
| 15 | +- PASS - Centered Project Path display appears above asset accordions. Evidence: Playwright checks `Path: projects/01K8M3K0EX7V5A3W9Q2Y6R4T1B/`, computed center alignment, and placement above Images. |
| 16 | +- PASS - Preview column shows asset-type-relative paths only. Evidence: Playwright verifies uploaded image row contains `image/write-view-image.png`. |
| 17 | +- PASS - Stored record keeps the full project-relative path. Evidence: View metadata shows `Stored path: projects/01K8M3K0EX7V5A3W9Q2Y6R4T1B/image/write-view-image.png`. |
| 18 | +- PASS - View uses the stored full project-relative path. Evidence: Image View preview `src` resolves to `projects/<projectId>/image/write-view-image.png`. |
| 19 | +- PASS - Server/dev DB storage creates physical folder/file. Evidence: local-db Playwright lane removes `projects/<projectId>/image/`, uploads an image, then verifies the folder/file exists and bytes match. |
| 20 | +- PASS - Unsupported browser-style file writes fail visibly without false OK records. Evidence: `?uploadWrite=unsupported` shows FAIL/SKIP diagnostics and asset count remains `0`. |
| 21 | +- PASS - `codex_review.diff` is generated as readable UTF-8 text. Evidence: artifact writer uses Node UTF-8 output and the targeted Playwright UTF-8 check passes. |
| 22 | +- PASS - Owner-scoped records are preserved. Evidence: existing owner-scope Playwright verifies user2 cannot see user1-created assets. |
| 23 | + |
| 24 | +## Architecture Recommendation |
| 25 | +- Dev MEM is UI-only and cannot prove file storage. |
| 26 | +- Dev DB/server-side storage should be used for MVP/UAT-like upload validation. |
| 27 | +- MEM was not removed in this PR; the repo already supports an API-backed dev DB/server validation path, and this PR keeps MEM as a UI/runtime exercise mode. |
| 28 | + |
| 29 | +## Changed Files |
| 30 | +- `toolbox/assets/index.html` |
| 31 | +- `toolbox/assets/assets.js` |
| 32 | +- `tests/playwright/tools/AssetToolMockRepository.spec.mjs` |
| 33 | +- `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 34 | +- `docs_build/dev/reports/PR_26163_076-assets-upload-prod-alignment.md` |
| 35 | +- `docs_build/dev/reports/codex_review.diff` |
| 36 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 37 | + |
| 38 | +## Impacted Lanes |
| 39 | +- Assets tool runtime lane. |
| 40 | +- Assets upload/write/view behavior. |
| 41 | +- Assets owner-scoped catalog behavior. |
| 42 | +- Targeted Assets Playwright lane. |
| 43 | +- Workspace V2 contract lane. |
| 44 | + |
| 45 | +## Skipped Lanes |
| 46 | +- Full samples smoke: SKIP - explicitly out of scope and no sample runtime behavior changed. |
| 47 | +- Production auth/account system: SKIP - guest gating is UI/API-session behavior only; no production account system changes were made. |
| 48 | +- Unrelated toolbox tools: SKIP - scoped to Assets and its targeted Playwright coverage. |
| 49 | + |
| 50 | +## Validation Performed |
| 51 | +- PASS - `node --check toolbox/assets/assets.js` |
| 52 | +- PASS - `node --check tests/playwright/tools/AssetToolMockRepository.spec.mjs` |
| 53 | +- PASS - `git diff --check -- toolbox/assets/index.html toolbox/assets/assets.js tests/playwright/tools/AssetToolMockRepository.spec.mjs` |
| 54 | +- PASS - `npx playwright test tests/playwright/tools/AssetToolMockRepository.spec.mjs --workers=1 --reporter=list` -> 9 passed |
| 55 | +- PASS - `npm run test:workspace-v2` -> 5 passed in workspace-contract lane |
| 56 | + |
| 57 | +## Playwright Result |
| 58 | +- PASS - Targeted Assets Playwright: 9 passed. |
| 59 | +- PASS - Workspace V2: 5 passed. |
| 60 | + |
| 61 | +## V8 Coverage |
| 62 | +- PASS/WARN - `docs_build/dev/reports/playwright_v8_coverage_report.txt` refreshed from targeted Assets Playwright. |
| 63 | +- PASS - Browser runtime `toolbox/assets/assets.js`: 96% advisory V8 coverage. |
| 64 | +- WARN - Node-side/repository helper files listed by the shared coverage reporter are not collected by browser V8 coverage; behavior is covered by targeted Playwright and syntax/static checks. |
| 65 | + |
| 66 | +## Upload Write Evidence |
| 67 | +- PASS - Local DB/server-backed lane used `sessionModeId: local-db`. |
| 68 | +- PASS - Folder evidence: `projects/01K8M3K0EX7V5A3W9Q2Y6R4T1B/image/` is recreated during upload. |
| 69 | +- PASS - File evidence: `projects/01K8M3K0EX7V5A3W9Q2Y6R4T1B/image/write-view-image.png` exists after upload and matches selected bytes. |
| 70 | +- PASS - No false OK evidence: unsupported write mode shows visible FAIL/SKIP diagnostics and creates no asset record. |
| 71 | + |
| 72 | +## Guest Block Evidence |
| 73 | +- PASS - Guest Add Images button remains enabled. |
| 74 | +- PASS - Guest file selection shows `Uploads require a Game Foundry account.` |
| 75 | +- PASS - Guest prompt includes `Sign In` and `Create Account`. |
| 76 | +- PASS - Guest upload creates no `guest-upload.png` asset row. |
| 77 | + |
| 78 | +## Manual Validation Steps |
| 79 | +1. Open `toolbox/assets/index.html` through the local API-backed server. |
| 80 | +2. Confirm `Path: projects/<projectId>/` appears centered above the asset type accordions. |
| 81 | +3. Confirm `Add Data` and `Add Vector` are visible, disabled, and show Planned tooltip text. |
| 82 | +4. Add an Image file and confirm upload starts immediately after file selection. |
| 83 | +5. Confirm the row Preview value is `image/<filename>` and View metadata stores/uses `projects/<projectId>/image/<filename>`. |
| 84 | +6. Repeat auto-start file selection for Audio and Fonts. |
| 85 | +7. Open as a guest session, attempt an Image upload, and confirm the account-required prompt appears with no new record. |
| 86 | +8. Use server/dev DB validation mode for UAT-like storage proof and confirm the physical file exists under `projects/<projectId>/<asset-type>/`. |
| 87 | + |
| 88 | +## Samples Decision |
| 89 | +- SKIP - Full samples smoke was not run because the request explicitly said not to run it and this PR is scoped to Assets upload/catalog behavior. |
0 commit comments