Skip to content

Commit 26224da

Browse files
committed
Audit Colors DB table ownership - PR_26160_078-colors-db-table-ownership
1 parent d745a38 commit 26224da

5 files changed

Lines changed: 90 additions & 15 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# PR_26160_078 Colors DB Table Ownership 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 `palette_colors` | PASS | Active Colors Project Swatches DB table. |
16+
| Audit `palette_swatch_usages` | PASS | Active usage tracking DB table; empty in baseline until usage records are written. |
17+
| Audit `project_workspace_palette_globals` | PASS | Active per-project Colors workspace metadata table. |
18+
| Audit deprecated `palette_source_swatches` | PASS | Deprecated/history DB Viewer table only; no active Colors runtime/repository dependency remains. |
19+
| Confirm active Colors runtime tables | PASS | `PALETTE_TOOL_TABLES` contains `palette_colors`, `project_workspace_palette_globals`, and `palette_swatch_usages` only. |
20+
| Remove active dependency on deprecated `palette_source_swatches` if any remains | PASS | Static audit found no active Colors page/repository source-table dependency; removed the final unused Colors display-name fallback for `palette_source_swatches`. |
21+
| Do not delete tables unless proven safe | PASS | No table was deleted; `palette_source_swatches` remains deprecated/history data. |
22+
23+
## Palette Table Ownership
24+
25+
| Table | Ownership | Active Runtime Use | Reader Evidence | Writer Evidence | Recommendation |
26+
| --- | --- | --- | --- | --- | --- |
27+
| `palette_colors` | Colors Project Swatches | Active | Repository loads `loadedMockDbTables.palette_colors`; `getTables()` emits current project swatches; Colors UI renders Project Swatches from repository snapshot data. | `replaceSwatches()`, `addSwatch()`, `updateSelectedSwatch()`, `removeSwatch()`, and `loadActiveProjectPalettePayload()` update swatch rows. | KEEP |
28+
| `palette_swatch_usages` | Colors usage tracking | Active service/runtime table, empty by default | Repository loads `loadedMockDbTables.palette_swatch_usages`; `getSwatchUsage()` reads usage rows; DB Viewer validates usage links. | `recordSwatchUsage()` writes usage rows; clear/reset flows clear usage rows. | KEEP |
29+
| `project_workspace_palette_globals` | Colors workspace metadata | Active | Repository loads globals into `workspaceRecords`; `syncWorkspaceRecordFromColors()` maintains active project palette metadata and swatch counts. | `replaceSwatches()`, `loadActiveProjectPalettePayload()`, seed/reset flows, and `getTables()` emit/update global rows. | KEEP |
30+
| `palette_source_swatches` | Deprecated migration/history | Not active Colors runtime data | DB Viewer/server snapshot only; PR_078 static audit found no active Colors page/repository dependency. | Seed/history rows from `src/dev-runtime/guest-seeds/palette-source-mock-db.js`; no active user write path. | DEPRECATE |
31+
32+
## Static Audit Evidence
33+
34+
Command:
35+
36+
```text
37+
rg -n "palette_source_swatches|sourcePalette|listSourceSwatches|sourcePaletteOptions|sourcePaletteRecordCount|data-palette-source" toolbox/colors src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js
38+
```
39+
40+
Result: no active Colors page or Colors repository hits after removing the final dead display fallback.
41+
42+
Remaining `palette_source_swatches` references are outside active Colors runtime ownership:
43+
44+
- DB Viewer deprecation note and relationship/reporting display.
45+
- Server DB snapshot seeding for deprecated history/reference inspection.
46+
- Mock DB table schema/group registration.
47+
- Tests asserting the table is absent from active Colors repository tables and deprecated in DB Viewer.
48+
49+
## Validation Evidence
50+
51+
| Lane | Status | Evidence |
52+
| --- | --- | --- |
53+
| Branch guard | PASS | `git branch --show-current` returned `main`. |
54+
| Syntax check | PASS | `node --check toolbox/colors/colors.js`. |
55+
| Static source-table audit | PASS | `rg` command above returned no active Colors page/repository hits. |
56+
| Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --reporter=line` -> 9 passed. |
57+
| Static validation | PASS | `git diff --check` passed. |
58+
59+
## Impacted Lanes
60+
61+
- Colors runtime/UI validation lane.
62+
- Changed-file syntax/static lane.
63+
64+
## Skipped Lanes
65+
66+
| Lane | Reason |
67+
| --- | --- |
68+
| Full samples validation | Samples and sample loaders were not touched. |
69+
| DB Viewer Playwright | DB Viewer runtime/UI was not changed in PR_078. |
70+
| Unrelated Toolbox/Admin migration | Out of scope for Colors palette table ownership. |
71+
72+
## Manual Test Notes
73+
74+
No manual browser walkthrough was required. Colors Playwright covered grid rendering, editing, save/load behavior, and source-browser absence.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
99
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10+
(89%) toolbox/colors/colors.js - executed lines 2161/2161; executed functions 190/213
1011

1112
Guardrail warnings:
1213
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file missing from coverage; advisory only

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ Exercised tool entry points detected:
1818

1919
Changed runtime JS files covered:
2020
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21+
(89%) toolbox/colors/colors.js - executed lines 2161/2161; executed functions 190/213
2122

2223
Files with executed line/function counts where available:
2324
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
2425
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
2526
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
2627
(77%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 548/548; executed functions 37/48
27-
(89%) toolbox/colors/colors.js - executed lines 2162/2162; executed functions 190/213
28+
(89%) toolbox/colors/colors.js - executed lines 2161/2161; executed functions 190/213
2829
(92%) assets/theme-v2/js/account-controls.js - executed lines 47/47; executed functions 12/13
2930
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
3031

@@ -34,3 +35,4 @@ Uncovered or low-coverage changed JS files:
3435
Changed JS files considered:
3536
(0%) src/engine/api/mock-db-viewer-ui.js - changed JS file not collected as browser runtime coverage
3637
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
38+
(89%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
# Testing Lane Execution Report
22

3-
PR: PR_26160_077-db-viewer-table-classification
3+
PR: PR_26160_078-colors-db-table-ownership
44
Generated: 2026-06-09
55
Full samples validation: SKIPPED
66

77
## Summary
88

9-
PASS: 6
10-
WARN: 2
9+
PASS: 5
10+
WARN: 1
1111
FAIL: 0
12-
SKIP: 2
12+
SKIP: 3
1313

1414
## Executed Lanes
1515

1616
| Lane | Status | Command | Evidence |
1717
| --- | --- | --- | --- |
1818
| Branch guard | PASS | `git branch --show-current` | Returned `main`. |
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`. |
19+
| Changed-file syntax check | PASS | `node --check toolbox/colors/colors.js` | Exited 0. |
20+
| Colors source-table static audit | PASS | `rg -n "palette_source_swatches\|sourcePalette\|listSourceSwatches\|sourcePaletteOptions\|sourcePaletteRecordCount\|data-palette-source" toolbox/colors src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js` | No active Colors page/repository hits. |
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 absence of active source-browser controls. |
2322
| 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. |
23+
| V8 coverage report | WARN | Generated by targeted Colors Playwright run | Advisory report updated; changed browser JS collected for Colors. |
2624

2725
## Skipped Lanes
2826

2927
| Lane | Status | Reason |
3028
| --- | --- | --- |
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. |
29+
| Full samples validation | SKIP | The PR changes Colors table-display ownership cleanup and reports only; samples and sample loaders are unchanged. |
30+
| DB Viewer Playwright | SKIP | PR_078 does not change DB Viewer UI/runtime; PR_077 covered table classification display. |
31+
| Unrelated Toolbox/Admin migration | SKIP | Out of scope for Colors palette table ownership. |
3332

3433
## Manual Test Notes
3534

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.
35+
No additional manual walkthrough was required. Static audit found no active Colors dependency on `palette_source_swatches`; targeted Colors Playwright confirmed grid/edit/save behavior remains intact.

toolbox/colors/colors.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,6 @@ function renderTables(snapshot) {
19561956
function displayColorsTableName(tableName) {
19571957
const names = {
19581958
palette_colors: "Project Swatches",
1959-
palette_source_swatches: "Deprecated Source Swatches",
19601959
palette_swatch_usages: "Swatch Usage",
19611960
project_workspace_palette_globals: "Project Swatch Settings"
19621961
};

0 commit comments

Comments
 (0)