Skip to content

Commit 43f2890

Browse files
committed
Continue DB migration and improve DB Viewer grouping - PR_26160_073-db-migration-and-viewer-grouping
1 parent ffa65b1 commit 43f2890

8 files changed

Lines changed: 275 additions & 88 deletions

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
119
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1211
(89%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 25/28
1312
(92%) admin/tool-votes.js - executed lines 378/378; executed functions 47/51
1413
(96%) toolbox/tools-page-accordions.js - executed lines 954/954; executed functions 109/113
1514

1615
Guardrail warnings:
17-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file missing from coverage; advisory only
18-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
1916
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
17+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file missing from coverage; advisory only
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# PR_26160_073 DB Migration And Viewer Grouping Report
2+
3+
Generated: 2026-06-09
4+
5+
## Branch Validation
6+
7+
| Check | Status | Evidence |
8+
| --- | --- | --- |
9+
| Current branch | PASS | `git branch --show-current` returned `main`. |
10+
| Expected branch | PASS | Required branch is `main`. |
11+
| Local branches found | PASS | `git branch --list` returned `* main`. |
12+
13+
## Requirement Checklist
14+
15+
| Requirement | Status | Evidence |
16+
| --- | --- | --- |
17+
| Continue Web -> API/Service Contract -> DB Adapter migration for remaining Toolbox/Admin product data. | PASS | DB Viewer table grouping moved from `src/engine/api/mock-db-viewer-ui.js` browser constants to server-provided `viewerGroups` in `/api/mock-db/snapshot`. |
18+
| Audit and migrate remaining page-local product arrays, hardcoded counts, duplicated metadata ownership, and direct UI-owned tool data. | PASS | Removed DB Viewer browser-owned `TOOL_GROUP_ORDER`, `TOOL_GROUP_LABELS`, `STANDALONE_TABLE_LABELS`, and `IDENTITY_TABLE_GROUP`; Toolbox/Admin Tool Votes status/group contracts remain API-backed from PR_072. |
19+
| Ensure Tool Metadata, Tool Planning, Tool Voting, and Tool Order are DB-owned and accessed through service contract only. | PASS | Tool Metadata and Tool Order are in `toolbox_tool_metadata`; Tool Planning is in `toolbox_tool_planning`; Tool Voting is in `toolbox_votes`; all are read through server API snapshots. |
20+
| Group `toolbox_votes` and `toolbox_vote_order` under a single logical DB Viewer section named `Toolbox Votes`. | PASS | `dbViewerGroupsForSnapshot()` creates `Toolbox Votes` and includes `toolbox_votes`; it also includes `toolbox_vote_order` if that underlying table exists in the active adapter. |
21+
| Preserve underlying tables. | PASS | No table names, schemas, or owners were changed. Active adapter currently has `toolbox_votes`; it does not have `toolbox_vote_order`, so no duplicate order table was invented. |
22+
| Improve DB Viewer organization without changing table ownership. | PASS | DB Viewer filter organization is now server-owned via `viewerGroups`; table `owners` are unchanged. |
23+
| Verify DB Viewer shows all tables from active DB adapter, including empty tables with schema visibility. | PASS | `AdminDbViewer.spec.mjs` verifies all visible tables, empty `toolbox_votes`, empty table headers after clear, and Local DB readonly schema headers. |
24+
| Do not migrate unrelated game/sample data. | PASS | Changes are limited to DB Viewer grouping contract, server snapshot metadata, and targeted DB Viewer tests/reports. |
25+
| Do not use inline script/style/event handlers. | PASS | Static changed-file scan found no inline script/style/event handler additions. |
26+
27+
## Remaining DB Migration Audit
28+
29+
| Area | Finding | Status | Action |
30+
| --- | --- | --- | --- |
31+
| DB Viewer tool/table grouping | Browser previously owned tool group order and labels. | PASS | Moved to `viewerGroups` from the server snapshot. |
32+
| DB Viewer identity grouping | Browser previously owned `users`, `user_roles`, `roles` grouping. | PASS | Moved to server `viewerGroups` as `User Roles`. |
33+
| DB Viewer standalone labels | Browser previously owned labels for `tool_state_samples` and `user_roles`. | PASS | Moved to server label map and added Tool Metadata, Tool Planning, Toolbox Votes labels. |
34+
| Toolbox metadata/status/group/page contracts | Already API-backed from current base. | PASS | Static audit shows active page constants now copy from `toolboxContract`, not page-owned arrays. |
35+
| Hardcoded counts | No active UI-owned Toolbox/Admin hardcoded counts found. | PASS | Playwright and static scans verify runtime computed counts. |
36+
| Browser storage as product SSoT | No active Toolbox/Admin DB product SSoT use of `localStorage`/`sessionStorage` found. | PASS | Static scan returned no matches. |
37+
| `toolbox_vote_order` table | Not present in active DB adapter/schema. | PASS | Did not create a duplicate table because Tool Order is currently DB-owned by `toolbox_tool_metadata.order`; the viewer group includes `toolbox_vote_order` automatically if a future adapter exposes it. |
38+
39+
## Validation
40+
41+
| Lane | Status | Command | Evidence |
42+
| --- | --- | --- | --- |
43+
| Branch guard | PASS | `git branch --show-current` | Returned `main`. |
44+
| Changed JS syntax | PASS | `node --check` on changed server/UI/spec files | All parsed. |
45+
| DB adapter validation | PASS | `node --test tests/dev-runtime/DbSeedIntegrity.test.mjs` | 2 passed. |
46+
| DB Viewer Playwright | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=line` | 7 passed. |
47+
| Toolbox/Admin Tool Votes Playwright | PASS | `npx playwright test tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs --reporter=line` | 4 passed. |
48+
| Toolbox route validation | PASS | `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --reporter=line` | 8 passed after rerun with longer timeout; first parallel attempt timed out before completion. |
49+
| API contract probe | PASS | Inline Node probe against `/api/mock-db/snapshot` | 27 tables; filter groups include All, tool groups, User Roles, Tool State Samples, Tool Metadata, Tool Planning, and Toolbox Votes. |
50+
| Static whitespace | PASS | `git diff --check` | No whitespace errors; Git printed line-ending warnings only. |
51+
| Inline/style/event scan | PASS | `rg --pcre2` on changed active files | No matches. |
52+
53+
## Impacted Lane
54+
55+
- DB adapter / DB Viewer / Toolbox / Admin Tool Votes.
56+
57+
## Skipped Lanes
58+
59+
| Lane | Reason |
60+
| --- | --- |
61+
| Full samples validation | This PR does not touch sample loaders, sample assets, playable game runtime, or sample framework behavior. |
62+
| Broad all-Playwright suite | Targeted DB Viewer, Toolbox, and Admin Tool Votes lanes cover the changed API contract and UI surfaces. |
63+
| Unrelated game/sample DB migration | Request explicitly excludes unrelated game/sample data migration. |
64+
65+
## Manual Test Notes
66+
67+
No extra manual browser walkthrough was required. Playwright directly covered DB Viewer table visibility, Toolbox Votes grouping, Local Mem/Local DB adapter behavior, 43-tool inventory, DB-backed metadata ownership, status/group/order reload behavior, and Toolbox route behavior.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# DB Viewer Table Inventory Report
2+
3+
Generated: 2026-06-09
4+
Source: `/api/mock-db/snapshot` from the active Local Mem DB adapter.
5+
6+
## Summary
7+
8+
| Check | Status | Evidence |
9+
| --- | --- | --- |
10+
| Active DB adapter tables are rendered through API snapshot. | PASS | Snapshot returned 27 tables. |
11+
| Empty tables keep schema visibility. | PASS | `AdminDbViewer.spec.mjs` verifies empty `toolbox_votes`, cleared tables, and Local DB readonly empty tables still show headers. |
12+
| Toolbox Votes logical grouping exists. | PASS | `viewerGroups` includes `Toolbox Votes` with `toolbox_votes`. |
13+
| `toolbox_vote_order` grouping support. | PASS | The grouping contract includes `toolbox_vote_order` when present; active adapter does not currently expose that table. |
14+
15+
## Viewer Groups
16+
17+
| Group | Tables |
18+
| --- | --- |
19+
| All | all 27 active adapter tables |
20+
| Workspace | `workspace_projects`, `workspace_progress` |
21+
| Game Design | `game_design_documents`, `game_design_validation_items` |
22+
| Game Configuration | `game_configuration_records`, `game_configuration_validation_items` |
23+
| Project Journey | `project_journey_note_types`, `project_journey_notes`, `project_journey_templates`, `project_journey_items`, `project_journey_activity` |
24+
| Palette | `palette_colors`, `palette_source_swatches`, `palette_swatch_usages`, `project_workspace_palette_globals` |
25+
| Asset | `asset_role_definitions`, `asset_library_items`, `asset_storage_objects`, `asset_import_events`, `asset_validation_items` |
26+
| User Roles | `users`, `user_roles`, `roles` |
27+
| Tool State Samples | `tool_state_samples` |
28+
| Tool Metadata | `toolbox_tool_metadata` |
29+
| Tool Planning | `toolbox_tool_planning` |
30+
| Toolbox Votes | `toolbox_votes` |
31+
32+
## Active Table Inventory
33+
34+
| Table | Owner / Logical Group |
35+
| --- | --- |
36+
| `asset_import_events` | Asset |
37+
| `asset_library_items` | Asset |
38+
| `asset_role_definitions` | Asset |
39+
| `asset_storage_objects` | Asset |
40+
| `asset_validation_items` | Asset |
41+
| `game_configuration_records` | Game Configuration |
42+
| `game_configuration_validation_items` | Game Configuration |
43+
| `game_design_documents` | Game Design |
44+
| `game_design_validation_items` | Game Design |
45+
| `palette_colors` | Palette |
46+
| `palette_source_swatches` | Palette |
47+
| `palette_swatch_usages` | Palette |
48+
| `project_journey_activity` | Project Journey |
49+
| `project_journey_items` | Project Journey |
50+
| `project_journey_note_types` | Project Journey |
51+
| `project_journey_notes` | Project Journey |
52+
| `project_journey_templates` | Project Journey |
53+
| `project_workspace_palette_globals` | Palette |
54+
| `roles` | User Roles |
55+
| `tool_state_samples` | Tool State Samples |
56+
| `toolbox_tool_metadata` | Tool Metadata |
57+
| `toolbox_tool_planning` | Tool Planning |
58+
| `toolbox_votes` | Toolbox Votes |
59+
| `user_roles` | User Roles |
60+
| `users` | User Roles |
61+
| `workspace_progress` | Workspace |
62+
| `workspace_projects` | Workspace |
63+
64+
## Notes
65+
66+
- `toolbox_vote_order` is not an active adapter table today. Tool order is DB-owned as `toolbox_tool_metadata.order`.
67+
- No underlying table ownership changed in this PR.

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ Exercised tool entry points detected:
1717
(74%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2220
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2322
(89%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 25/28
2423
(92%) admin/tool-votes.js - executed lines 378/378; executed functions 47/51
2524
(96%) toolbox/tools-page-accordions.js - executed lines 954/954; executed functions 109/113
@@ -42,14 +41,13 @@ Files with executed line/function counts where available:
4241
(100%) toolbox/project-workspace/project-workspace-api-client.js - executed lines 12/12; executed functions 2/2
4342

4443
Uncovered or low-coverage changed JS files:
45-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: uncovered changed runtime JS file; advisory only
46-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
4744
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
45+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: uncovered changed runtime JS file; advisory only
4846

4947
Changed JS files considered:
50-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - changed JS file not collected as browser runtime coverage
51-
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
5248
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
49+
(0%) src/engine/api/mock-db-viewer-ui.js - changed JS file not collected as browser runtime coverage
50+
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
5351
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
5452
(89%) toolbox/tool-registry-api-client.js - changed JS file with browser V8 coverage
5553
(92%) admin/tool-votes.js - changed JS file with browser V8 coverage
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Testing Lane Execution Report
22

3-
PR: PR_26160_072-toolbox-db-contract-enforcement
3+
PR: PR_26160_073-db-migration-and-viewer-grouping
44
Generated: 2026-06-09
55
Full samples validation: SKIPPED
66

77
## Summary
88

9-
PASS: 8
9+
PASS: 9
1010
WARN: 1
1111
FAIL: 0
1212
SKIP: 3
@@ -16,23 +16,25 @@ SKIP: 3
1616
| Lane | Status | Command | Evidence |
1717
| --- | --- | --- | --- |
1818
| Branch guard | PASS | `git branch --show-current` | Returned `main`. |
19-
| Changed JS syntax | PASS | `node --check admin/tool-votes.js`; `node --check toolbox/tool-registry-api-client.js`; `node --check toolbox/tools-page-accordions.js`; `node --check src/dev-runtime/server/mock-api-router.mjs`; `node --check tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs` | All changed JS/test files parsed. |
20-
| DB/API contract probe | PASS | Inline Node probe against `/api/toolbox/registry/snapshot`, `/api/toolbox/votes/snapshot`, and `/api/mock-db/snapshot` | Registry active tools 43; vote rows 43; metadata rows 43; planning rows 43; contract channels `planned,wireframe,beta,complete`. |
21-
| Toolbox/Admin SSoT Playwright | PASS | `npx playwright test tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs --reporter=line` | 4 passed. Verifies 43-tool DB-backed metadata/planning, Admin edit propagation, Toolbox reload behavior, no hardcoded count text, and no retired browser registry request. |
22-
| Toolbox route/display Playwright | PASS | `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --reporter=line` | 8 passed. Verifies Toolbox filters, voting controls, group colors/assignments, Build Path status rows, Colors route behavior, wireframe pages, and port guard. |
23-
| UI-owned product data audit | PASS | Static `rg` scans for old local arrays, hardcoded counts, storage SSoT, and contract endpoints | Active Toolbox/Admin local status/group arrays were replaced by API contract reads; no browser storage product SSoT found. |
24-
| Inline event/style constraint | PASS | Changed-file review plus static scan | No changed file adds inline script, inline style, or inline event handlers. |
19+
| Changed JS syntax | PASS | `node --check src/dev-runtime/server/mock-api-router.mjs`; `node --check src/engine/api/mock-db-viewer-ui.js`; `node --check tests/playwright/tools/AdminDbViewer.spec.mjs`; plus current Toolbox/Admin contract files | All changed JS/test files parsed. |
20+
| DB adapter seed/reseed validation | PASS | `node --test tests/dev-runtime/DbSeedIntegrity.test.mjs` | 2 passed. |
21+
| DB Viewer API contract probe | PASS | Inline Node probe against `/api/mock-db/snapshot` | Snapshot returned 27 tables and `viewerGroups` containing `Toolbox Votes`. |
22+
| Admin DB Viewer Playwright | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=line` | 7 passed. Covers table visibility, grouping, Local Mem, Local DB readonly, empty schema headers, and adapter diagnostics. |
23+
| Toolbox/Admin metadata SSoT Playwright | PASS | `npx playwright test tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs --reporter=line` | 4 passed. Covers 43-tool inventory, planning load, DB-backed metadata edits, order/status/group reload behavior. |
24+
| Toolbox route/page Playwright | PASS | `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --reporter=line` | 8 passed after rerun with longer timeout. |
25+
| Remaining UI-owned data audit | PASS | Static `rg` scans for old local DB Viewer groups, page-local status/group arrays, hardcoded counts, and browser storage SSoT | DB Viewer grouping is server-provided; active Toolbox/Admin copies are API-contract reads; no product SSoT browser storage found. |
2526
| Static whitespace validation | PASS | `git diff --check` | No whitespace errors; Git printed line-ending warnings only. |
26-
| V8 coverage artifact refresh | WARN | Playwright coverage reporter after targeted lanes | `playwright_v8_coverage_report.txt` and `coverage_changed_js_guardrail.txt` were refreshed. Server/dev-runtime files remain advisory 0% browser coverage because they are not browser runtime files. |
27+
| Inline script/style/event scan | PASS | `rg --pcre2` on changed active files | No inline script/style/event handler additions found. |
28+
| V8 coverage artifact refresh | WARN | Playwright coverage reporter after targeted lanes | `playwright_v8_coverage_report.txt` and `coverage_changed_js_guardrail.txt` refreshed. Server/dev-runtime files remain advisory 0% browser coverage because they are not browser runtime files. |
2729

2830
## Skipped Lanes
2931

3032
| Lane | Status | Reason |
3133
| --- | --- | --- |
32-
| Full samples validation | SKIP | This PR does not touch samples, sample loaders, sample assets, playable runtime, or sample framework behavior. |
33-
| Broad all-Playwright suite | SKIP | Targeted Toolbox/Admin lanes cover the impacted API contract and UI surfaces. |
34-
| Unrelated game/sample DB migration validation | SKIP | The request explicitly scoped migration to Toolbox/Admin tool metadata, planning, voting, and order. |
34+
| Full samples validation | SKIP | This PR does not touch sample loaders, sample assets, playable game runtime, or shared sample framework behavior. |
35+
| Broad all-Playwright suite | SKIP | Targeted DB Viewer, Toolbox, and Admin Tool Votes lanes cover the impacted UI/API contracts. |
36+
| Unrelated game/sample DB migration validation | SKIP | The request explicitly scoped migration to Toolbox/Admin product data and DB Viewer organization. |
3537

3638
## Manual Test Notes
3739

38-
No additional manual walkthrough was needed. The targeted Playwright lanes exercised Toolbox Build Path, Admin Tool Votes, 43-tool inventory parity, tool planning load, votes, order/status/group metadata, Admin edits reflected in Toolbox after reload, and active-page guardrails against retired browser registry use.
40+
No extra manual browser walkthrough was needed. The targeted Playwright lanes exercised DB Viewer table visibility, Toolbox Votes grouping, 43-tool inventory, DB-backed metadata ownership, planning load, voting/order/status/group reload behavior, and active Toolbox routes.

0 commit comments

Comments
 (0)