Skip to content

Commit d745a38

Browse files
committed
Classify DB Viewer table runtime states - PR_26160_077-db-viewer-table-classification
1 parent ace3d15 commit d745a38

6 files changed

Lines changed: 143 additions & 50 deletions

File tree

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ 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/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
11-
(66%) toolbox/colors/colors.js - executed lines 2162/2162; executed functions 138/209
12-
(97%) src/engine/api/mock-db-viewer-ui.js - executed lines 484/484; executed functions 88/91
9+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1310

1411
Guardrail warnings:
15-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
16-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
12+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file missing from coverage; advisory only
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# PR_26160_077 DB Viewer Table Classification Report
2+
3+
Generated: 2026-06-09
4+
5+
## Branch Validation
6+
7+
| Check | Status | Evidence |
8+
| --- | --- | --- |
9+
| Current branch is `main` | PASS | `git branch --show-current` returned `main`. |
10+
11+
## Requirement Checklist
12+
13+
| Requirement | Status | Evidence |
14+
| --- | --- | --- |
15+
| Audit every DB Viewer table | PASS | See Full DB Viewer Table Classification. |
16+
| Classify each table as active runtime, deprecated/history, empty schema-only, or remove candidate | PASS | Every table from `/api/mock-db/snapshot` is listed with row count and classification. |
17+
| Ensure DB Viewer visually separates categories | PASS | `src/engine/api/mock-db-viewer-ui.js` table summaries now include `Active runtime data`, `Deprecated/history`, or `Empty schema-only`, with visible notes in each table body. |
18+
| Run targeted DB Viewer and Colors validation only | PASS | DB Viewer and Colors Playwright lanes passed; no full samples lane was run. |
19+
| Do not use inline script/style/event handlers | PASS | Changes are external JS/test/report only. |
20+
21+
## Classification Rules
22+
23+
| Classification | Rule |
24+
| --- | --- |
25+
| Active runtime data | Non-deprecated table with one or more records in the active DB adapter snapshot. |
26+
| Deprecated/history | Table listed in DB Viewer `DEPRECATED_TABLE_NOTES`. Currently only `palette_source_swatches`. |
27+
| Empty schema-only | Non-deprecated table with zero records; DB Viewer still shows headers for schema/readiness. |
28+
| Remove candidate | No table currently qualifies. Removal requires a later proof-only audit showing no runtime, migration, or history dependency. |
29+
30+
## Full DB Viewer Table Classification
31+
32+
| Table | Row Count | Classification | Notes |
33+
| --- | ---: | --- | --- |
34+
| `asset_import_events` | 0 | Empty schema-only | Asset import event schema is visible, but no baseline records exist. |
35+
| `asset_library_items` | 0 | Empty schema-only | Asset library schema is visible, but no baseline uploaded assets exist. |
36+
| `asset_role_definitions` | 8 | Active runtime data | Asset tool role definitions. |
37+
| `asset_storage_objects` | 0 | Empty schema-only | Asset storage schema is visible, but no baseline storage records exist. |
38+
| `asset_validation_items` | 1 | Active runtime data | Asset validation/checklist data. |
39+
| `game_configuration_records` | 0 | Empty schema-only | Game Configuration schema is visible, but no baseline configuration record exists. |
40+
| `game_configuration_validation_items` | 1 | Active runtime data | Game Configuration validation/checklist data. |
41+
| `game_design_documents` | 3 | Active runtime data | Game Design document records. |
42+
| `game_design_validation_items` | 0 | Empty schema-only | Game Design validation schema is visible, but no baseline rows exist. |
43+
| `palette_colors` | 0 | Empty schema-only | Active Colors table, empty until Project Swatches are added. |
44+
| `palette_source_swatches` | 838 | Deprecated/history | Deprecated source history/reference data only; not active Colors runtime data. |
45+
| `palette_swatch_usages` | 0 | Empty schema-only | Active usage-tracking table, empty until usage records are written. |
46+
| `project_journey_activity` | 2 | Active runtime data | Project Journey activity records. |
47+
| `project_journey_items` | 9 | Active runtime data | Project Journey note item records. |
48+
| `project_journey_note_types` | 7 | Active runtime data | Project Journey note type records. |
49+
| `project_journey_notes` | 4 | Active runtime data | Project Journey note records. |
50+
| `project_journey_templates` | 9 | Active runtime data | Project Journey template SSoT records. |
51+
| `project_workspace_palette_globals` | 1 | Active runtime data | Active Colors workspace metadata/global row. |
52+
| `roles` | 4 | Active runtime data | Users/roles model data. |
53+
| `tool_state_samples` | 47 | Active runtime data | Local/dev sample/tool state rows. |
54+
| `toolbox_tool_metadata` | 43 | Active runtime data | Tool metadata SSoT rows. |
55+
| `toolbox_tool_planning` | 43 | Active runtime data | Tool planning SSoT rows. |
56+
| `toolbox_votes` | 0 | Empty schema-only | Vote schema is visible, but no baseline user votes exist. |
57+
| `user_roles` | 7 | Active runtime data | Users/roles join rows. |
58+
| `users` | 5 | Active runtime data | User rows; Guest remains unauthenticated state only. |
59+
| `workspace_progress` | 1 | Active runtime data | Workspace progress record. |
60+
| `workspace_projects` | 4 | Active runtime data | Workspace project records. |
61+
62+
## Remove Candidate Findings
63+
64+
No table is currently recommended for removal. `palette_source_swatches` remains deprecated/history because PR_076 intentionally kept it for migration/reference inspection in DB Viewer.
65+
66+
## Validation Evidence
67+
68+
| Lane | Status | Evidence |
69+
| --- | --- | --- |
70+
| Branch guard | PASS | `git branch --show-current` returned `main`. |
71+
| Syntax checks | PASS | `node --check src/engine/api/mock-db-viewer-ui.js`; `node --check tests/playwright/tools/AdminDbViewer.spec.mjs`. |
72+
| DB snapshot audit | PASS | Inline Node/server probe listed every table, row count, and classification from `/api/mock-db/snapshot`. |
73+
| DB Viewer Playwright | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=line` -> 7 passed. |
74+
| Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --reporter=line` -> 9 passed. |
75+
| Static validation | PASS | `git diff --check` passed with line-ending warnings only. |
76+
77+
## Impacted Lanes
78+
79+
- Admin DB Viewer runtime/UI lane.
80+
- Colors runtime/UI validation lane.
81+
- Changed-file syntax/static lane.
82+
83+
## Skipped Lanes
84+
85+
| Lane | Reason |
86+
| --- | --- |
87+
| Full samples validation | Samples and sample loaders were not touched. |
88+
| Unrelated Toolbox/Admin metadata migration | Out of scope for this DB Viewer table classification PR. |
89+
90+
## Manual Test Notes
91+
92+
No manual browser walkthrough was required. The targeted DB Viewer Playwright assertions prove visible category separation, and the Colors lane verifies grid behavior remains unchanged.

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,25 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(73%) Toolbox Index - exercised 7 runtime JS files
15+
(88%) Toolbox Index - exercised 3 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(74%) Theme V2 Shared JS - exercised 2 runtime JS files
17+
(77%) Theme V2 Shared JS - exercised 3 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(66%) toolbox/colors/colors.js - executed lines 2162/2162; executed functions 138/209
23-
(97%) src/engine/api/mock-db-viewer-ui.js - executed lines 484/484; executed functions 88/91
20+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2421

2522
Files with executed line/function counts where available:
26-
(63%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 12/19
23+
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
2724
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
28-
(66%) toolbox/colors/colors.js - executed lines 2162/2162; executed functions 138/209
29-
(67%) admin/db-viewer.js - executed lines 53/53; executed functions 4/6
30-
(75%) toolbox/project-journey/project-journey.js - executed lines 1003/1003; executed functions 74/99
25+
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
3126
(77%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 548/548; executed functions 37/48
32-
(79%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 22/28
33-
(88%) toolbox/assets/assets.js - executed lines 519/519; executed functions 53/60
34-
(97%) src/engine/api/mock-db-viewer-ui.js - executed lines 484/484; executed functions 88/91
35-
(100%) src/engine/api/mock-db-api-client.js - executed lines 19/19; executed functions 5/5
36-
(100%) toolbox/assets/assets-api-client.js - executed lines 17/17; executed functions 3/3
27+
(89%) toolbox/colors/colors.js - executed lines 2162/2162; executed functions 190/213
28+
(92%) assets/theme-v2/js/account-controls.js - executed lines 47/47; executed functions 12/13
3729
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
38-
(100%) toolbox/project-journey/project-journey-api-client.js - executed lines 12/12; executed functions 2/2
3930

4031
Uncovered or low-coverage changed JS files:
41-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: uncovered changed runtime JS file; advisory only
42-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
32+
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: uncovered changed runtime JS file; advisory only
4333

4434
Changed JS files considered:
45-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - changed JS file not collected as browser runtime coverage
46-
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
35+
(0%) src/engine/api/mock-db-viewer-ui.js - changed JS file not collected as browser runtime coverage
4736
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
48-
(0%) tests/playwright/tools/PaletteToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
49-
(66%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
50-
(97%) src/engine/api/mock-db-viewer-ui.js - changed JS file with browser V8 coverage
Lines changed: 12 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_076-palette-source-swatches-deprecation
3+
PR: PR_26160_077-db-viewer-table-classification
44
Generated: 2026-06-09
55
Full samples validation: SKIPPED
66

77
## Summary
88

9-
PASS: 7
9+
PASS: 6
1010
WARN: 2
1111
FAIL: 0
1212
SKIP: 2
@@ -16,22 +16,21 @@ SKIP: 2
1616
| Lane | Status | Command | Evidence |
1717
| --- | --- | --- | --- |
1818
| Branch guard | PASS | `git branch --show-current` | Returned `main`. |
19-
| Changed-file syntax checks | PASS | `node --check toolbox/colors/colors.js`; `node --check src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js`; `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/PaletteToolMockRepository.spec.mjs`; `node --check tests/playwright/tools/AdminDbViewer.spec.mjs` | All commands exited 0. |
20-
| Colors runtime/UI Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --reporter=line` | 9 passed. Covers Colors grid rendering, editing, selection/pinning, reload/save behavior, tag behavior, symbol-free validation, and no source-browser controls. |
21-
| DB Viewer Playwright | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=line` | 7 passed. Covers Palette DB grouping, deprecated `palette_source_swatches` display, Local Mem/Local DB table visibility, schema headers, diagnostics, and read-only behavior. |
22-
| Colors + DB Viewer runtime trace | PASS | Inline Playwright/Chromium trace | `sourceControlCount=0`; Colors Repository Tables omit source rows; picker grid rendered 24 swatches; edit/reload kept `Trace Blue`; import/export UI text absent; DB Viewer showed `palette_source_swatches (deprecated) (838 records)` with the deprecation note. |
23-
| Static source audit | PASS | `rg -n "sourcePalette\|listSourceSwatches\|sourceSwatchRows\|selectedSourceSwatch\|data-palette-source\|sourcePin\|sourceSort\|sourceSize\|sourceMode\|Current Source\|All Sources" ...` | Only test assertions that source controls are absent remain; no active Colors/server source-browser path remains. |
24-
| Whitespace/static diff validation | PASS | `git diff --check` | No whitespace errors. Line-ending warnings only. |
25-
| V8 coverage report | WARN | Generated by targeted Playwright runs | `toolbox/colors/colors.js` and `src/engine/api/mock-db-viewer-ui.js` were collected. Server-side changed JS is listed as advisory WARN because browser V8 coverage does not collect Node server modules. |
26-
| Changed JS coverage guardrail | WARN | Generated by targeted Playwright runs | Advisory-only warnings for server-side changed JS not collected by browser V8 coverage. |
19+
| Changed-file syntax checks | PASS | `node --check src/engine/api/mock-db-viewer-ui.js`; `node --check tests/playwright/tools/AdminDbViewer.spec.mjs` | Both commands exited 0. |
20+
| DB Viewer Playwright | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=line` | 7 passed. Covers DB Viewer filters, table schema display, deprecated `palette_source_swatches`, active runtime table labeling, empty schema-only labeling, Local Mem, and Local DB inspection. |
21+
| Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --reporter=line` | 9 passed. Covers Colors grid rendering, editing, selection/pinning, reload/save behavior, tag behavior, symbol-free validation, and continued absence of active source-browser controls. |
22+
| DB snapshot audit | PASS | Inline Node/server snapshot probe | Palette row counts: `palette_colors=0`, `palette_source_swatches=838`, `palette_swatch_usages=0`, `project_workspace_palette_globals=1`. Suspicious/deprecated table scan found only `palette_source_swatches`. |
23+
| Static diff validation | PASS | `git diff --check` | No whitespace errors. |
24+
| V8 coverage report | WARN | Generated by targeted Playwright runs | Changed browser JS collected for DB Viewer. Server/dev repository modules are not browser-collected and remain advisory WARN where listed. |
25+
| Changed JS coverage guardrail | WARN | Generated by targeted Playwright runs | Advisory-only coverage warning behavior preserved. |
2726

2827
## Skipped Lanes
2928

3029
| Lane | Status | Reason |
3130
| --- | --- | --- |
32-
| Full samples validation | SKIP | The PR touches Colors repository/runtime and DB Viewer reporting only; samples and sample loaders are unchanged. |
33-
| Unrelated Toolbox/Admin metadata migration | SKIP | The PR explicitly excludes unrelated Toolbox/Admin data migration. |
31+
| Full samples validation | SKIP | The PR touches DB Viewer table classification display and tests only; samples and sample loaders are unchanged. |
32+
| Unrelated Toolbox/Admin metadata migration | SKIP | The PR explicitly excludes unrelated Toolbox/Admin data migration and table deletion. |
3433

3534
## Manual Test Notes
3635

37-
No separate manual walkthrough was needed beyond targeted Playwright and the inline runtime trace. The trace confirmed the deprecated source table is inspectable in DB Viewer but no longer participates in Colors runtime table counts, source controls, grid rendering, editing, save/load, or import/export UI.
36+
No additional manual walkthrough was required. The targeted Playwright lanes and DB snapshot probe covered DB Viewer table classification/status display and Colors grid behavior. No table was deleted.

src/engine/api/mock-db-viewer-ui.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ class AdminDbViewer {
141141
return tableName;
142142
}
143143

144+
tableRuntimeState(tableName, records) {
145+
if (Object.hasOwn(DEPRECATED_TABLE_NOTES, tableName)) {
146+
return {
147+
label: "Deprecated/history",
148+
note: DEPRECATED_TABLE_NOTES[tableName],
149+
};
150+
}
151+
if (!records.length) {
152+
return {
153+
label: "Empty schema-only",
154+
note: `Empty schema-only table. ${this.modeLabel} shows headers so missing records and future writes are inspectable.`,
155+
};
156+
}
157+
return {
158+
label: "Active runtime data",
159+
note: `Active runtime table data from the current ${this.modeLabel} adapter snapshot.`,
160+
};
161+
}
162+
144163
collectSnapshot() {
145164
const snapshot = getMockDbSnapshot();
146165
const tables = snapshot.tables;
@@ -168,9 +187,10 @@ class AdminDbViewer {
168187
details.open = true;
169188
details.dataset.adminDbTable = tableName;
170189
const tableDisplayName = this.tableDisplayName(tableName);
190+
const tableRuntimeState = this.tableRuntimeState(tableName, records);
171191

172192
const summary = this.createElement("summary", {
173-
text: `${tableDisplayName} (${records.length} records)`,
193+
text: `${tableDisplayName} - ${tableRuntimeState.label} (${records.length} records)`,
174194
});
175195
const body = this.createElement("div", {
176196
className: "accordion-body",
@@ -232,12 +252,10 @@ class AdminDbViewer {
232252

233253
table.append(head, tableBody);
234254
wrapper.append(table);
235-
if (DEPRECATED_TABLE_NOTES[tableName]) {
236-
body.append(this.createElement("p", {
237-
className: "status",
238-
text: DEPRECATED_TABLE_NOTES[tableName],
239-
}));
240-
}
255+
body.append(this.createElement("p", {
256+
className: "status",
257+
text: tableRuntimeState.note,
258+
}));
241259
body.append(wrapper);
242260
details.append(summary, body);
243261
return details;

tests/playwright/tools/AdminDbViewer.spec.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,15 +402,17 @@ test("Admin DB Viewer shows current read-only Local Mem DB tables, filters, user
402402
await page.getByRole("button", { name: "Project Journey" }).click();
403403
await expect(page.locator("[data-admin-db-status]")).toHaveText(/for Project Journey\./);
404404
await expect(page.locator("[data-admin-db-table='project_journey_items']")).toBeVisible();
405+
await expect(page.locator("[data-admin-db-table='project_journey_items'] > summary")).toContainText("Active runtime data");
405406
await expect(page.locator("[data-admin-db-table='palette_colors']")).toHaveCount(0);
406407
await expect(page.locator("[data-admin-db-table='asset_library_items']")).toHaveCount(0);
407408
await expect(page.locator("[data-admin-db-table='users']")).toHaveCount(0);
408409

409410
await page.getByRole("button", { name: "Palette" }).click();
410411
await expect(page.locator("[data-admin-db-status]")).toHaveText(/for Palette\./);
411412
await expect(page.locator("[data-admin-db-table='palette_colors']")).toBeVisible();
413+
await expect(page.locator("[data-admin-db-table='palette_colors'] > summary")).toContainText("Empty schema-only");
412414
await expect(page.locator("[data-admin-db-table='palette_source_swatches']")).toBeVisible();
413-
await expect(page.locator("[data-admin-db-table='palette_source_swatches'] > summary")).toContainText("deprecated");
415+
await expect(page.locator("[data-admin-db-table='palette_source_swatches'] > summary")).toContainText("Deprecated/history");
414416
await expect(page.locator("[data-admin-db-table='palette_source_swatches']")).toContainText(
415417
"Current Colors grid rendering, editing, save/load, and import/export do not read this table."
416418
);

0 commit comments

Comments
 (0)