Skip to content

Commit d03149c

Browse files
committed
Audit tool planning fields and verify Admin inventory - PR_26160_070-tool-planning-field-audit
1 parent 512860c commit d03149c

3 files changed

Lines changed: 145 additions & 11 deletions

File tree

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Changed runtime JS files considered:
1212
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1313
(0%) src/shared/toolbox/platformShell.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1414
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
15-
(62%) admin/tool-votes.js - executed lines 383/383; executed functions 29/47
16-
(88%) toolbox/tools-page-accordions.js - executed lines 997/997; executed functions 94/107
15+
(92%) admin/tool-votes.js - executed lines 383/383; executed functions 46/50
1716

1817
Guardrail warnings:
1918
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: changed runtime JS file missing from coverage; advisory only

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ 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-
(68%) Toolbox Index - exercised 5 runtime JS files
15+
(69%) Toolbox Index - exercised 9 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
1717
(74%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

@@ -23,20 +23,23 @@ Changed runtime JS files covered:
2323
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2424
(0%) src/shared/toolbox/platformShell.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2525
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
26-
(62%) admin/tool-votes.js - executed lines 383/383; executed functions 29/47
27-
(88%) toolbox/tools-page-accordions.js - executed lines 997/997; executed functions 94/107
26+
(92%) admin/tool-votes.js - executed lines 383/383; executed functions 46/50
2827

2928
Files with executed line/function counts where available:
30-
(33%) src/engine/api/toolbox-votes-api-client.js - executed lines 46/46; executed functions 2/6
3129
(38%) src/engine/api/session-api-client.js - executed lines 34/34; executed functions 3/8
32-
(55%) toolbox/colors/colors.js - executed lines 2289/2289; executed functions 119/216
30+
(55%) toolbox/project-journey/project-journey.js - executed lines 1003/1003; executed functions 54/99
31+
(57%) toolbox/colors/colors.js - executed lines 2289/2289; executed functions 123/216
3332
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
34-
(62%) admin/tool-votes.js - executed lines 383/383; executed functions 29/47
3533
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
34+
(71%) toolbox/assets/assets.js - executed lines 519/519; executed functions 42/59
3635
(77%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 548/548; executed functions 37/48
37-
(88%) toolbox/tools-page-accordions.js - executed lines 997/997; executed functions 94/107
36+
(83%) src/engine/api/toolbox-votes-api-client.js - executed lines 46/46; executed functions 5/6
3837
(89%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 24/27
38+
(92%) admin/tool-votes.js - executed lines 383/383; executed functions 46/50
39+
(96%) toolbox/tools-page-accordions.js - executed lines 997/997; executed functions 108/112
40+
(100%) toolbox/assets/assets-api-client.js - executed lines 17/17; executed functions 3/3
3941
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
42+
(100%) toolbox/project-journey/project-journey-api-client.js - executed lines 12/12; executed functions 2/2
4043
(100%) toolbox/project-workspace/project-workspace-api-client.js - executed lines 12/12; executed functions 2/2
4144

4245
Uncovered or low-coverage changed JS files:
@@ -57,5 +60,4 @@ Changed JS files considered:
5760
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
5861
(0%) tests/playwright/tools/ToolboxRoutePages.spec.mjs - changed JS file not collected as browser runtime coverage
5962
(0%) toolbox/toolRegistry.js - changed JS file not collected as browser runtime coverage
60-
(62%) admin/tool-votes.js - changed JS file with browser V8 coverage
61-
(88%) toolbox/tools-page-accordions.js - changed JS file with browser V8 coverage
63+
(92%) admin/tool-votes.js - changed JS file with browser V8 coverage
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# PR_26160_070 Tool Planning Field Audit Report
2+
3+
## Branch Validation
4+
5+
| Check | Expected | Actual | Status |
6+
| --- | --- | --- | --- |
7+
| Current git branch | `main` | `main` | PASS |
8+
9+
## Executive Summary
10+
11+
This PR is an audit/report-only pass. No runtime code was changed and no planning fields were removed.
12+
13+
The audited fields are still used as seed/schema/API/UI payload data, so removal is not safe in this PR. They are conceptually mis-owned in the current DB shape: `requiredForTestable`, `requiredForPublish`, `requires`, `progressChecklist`, and related `readiness` data belong in Tool Planning, not long-term Tool Metadata.
14+
15+
## One-Concept Ownership Recommendation
16+
17+
| Domain | Owns |
18+
| --- | --- |
19+
| Tool metadata | Identity, display, routing, grouping, state, and order. Examples: `toolKey`, `toolName`, `shortLabel`, `description`, `group`, `category`, `colorGroup`, `toolboxGroup`, `path`, `order`, `status`, `badge`, `toolImage`, visibility flags. |
20+
| Tool planning | Readiness, dependencies, and checklist. Examples: `readiness`, `requiredForTestable`, `requiredForPublish`, `requires`, `progressChecklist`. |
21+
| Tool voting | Vote totals and current user vote state. Examples: `toolId`, `userKey`, `direction`, computed up/down/total/percent/current vote. |
22+
23+
Recommended follow-up: introduce a DB-backed `toolbox_tool_planning` table keyed by `toolKey`, move planning fields there, and keep Toolbox/Admin reading through the same API/service contract so tool pages do not change when ownership moves.
24+
25+
## Field Audit
26+
27+
### `requiredForTestable`
28+
29+
| Audit Item | Finding |
30+
| --- | --- |
31+
| Current status | Used, duplicated between dev seed inventory and DB-backed metadata rows, should move to Tool Planning. |
32+
| Where it is written | Per-tool seed records in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; DB seed rows in `src/dev-runtime/guest-seeds/tool-state-samples.js`; schema field in `src/dev-runtime/persistence/mock-db-store.js`; normalized/synced in `src/dev-runtime/server/mock-api-router.mjs`. |
33+
| Where it is read | `getMissingToolRegistryFields()` and `applyToolRegistryMetadata()` in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; `defaultToolboxMetadata()` and `ensureToolboxToolMetadataRows()` in `src/dev-runtime/server/mock-api-router.mjs`; `enrichTool()` and `createToolValues()` in `toolbox/tools-page-accordions.js`. |
34+
| Runtime behavior impact | Does not currently gate launching, filtering, voting, or Build Path ordering. It can indirectly affect seed inventory validity because missing required metadata marks records as incomplete/hidden in the dev seed inventory path. |
35+
| UI display impact | `createToolValues()` has display text for testable/publish requirements, but the active Toolbox card render path does not currently pass `showReadiness`, so the value is not visibly displayed in normal Toolbox tiles today. |
36+
| Ownership recommendation | Move to Tool Planning. Keep until a planning table/API exists. |
37+
38+
### `requiredForPublish`
39+
40+
| Audit Item | Finding |
41+
| --- | --- |
42+
| Current status | Used, duplicated between dev seed inventory and DB-backed metadata rows, should move to Tool Planning. |
43+
| Where it is written | Per-tool seed records in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; DB seed rows in `src/dev-runtime/guest-seeds/tool-state-samples.js`; schema field in `src/dev-runtime/persistence/mock-db-store.js`; normalized/synced in `src/dev-runtime/server/mock-api-router.mjs`. |
44+
| Where it is read | `getMissingToolRegistryFields()` and `applyToolRegistryMetadata()` in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; `defaultToolboxMetadata()` and `ensureToolboxToolMetadataRows()` in `src/dev-runtime/server/mock-api-router.mjs`; `enrichTool()` and `createToolValues()` in `toolbox/tools-page-accordions.js`. |
45+
| Runtime behavior impact | Does not currently gate publishing, launching, filtering, voting, or Build Path ordering. It only participates in metadata completeness normalization. |
46+
| UI display impact | Same dormant `createToolValues()` readiness display path as `requiredForTestable`; not visibly displayed in default Toolbox tiles today. |
47+
| Ownership recommendation | Move to Tool Planning. Keep until a planning table/API exists. |
48+
49+
### `requires`
50+
51+
| Audit Item | Finding |
52+
| --- | --- |
53+
| Current status | Used, duplicated between dev seed inventory and DB-backed metadata rows, should move to Tool Planning. |
54+
| Where it is written | Per-tool seed records in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; DB seed rows in `src/dev-runtime/guest-seeds/tool-state-samples.js`; schema field in `src/dev-runtime/persistence/mock-db-store.js`; normalized/synced in `src/dev-runtime/server/mock-api-router.mjs`. |
55+
| Where it is read | `cloneToolRegistryEntry()`, `getMissingToolRegistryFields()`, and `applyToolRegistryMetadata()` in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; `defaultToolboxMetadata()` and `ensureToolboxToolMetadataRows()` in `src/dev-runtime/server/mock-api-router.mjs`; `enrichTool()` and `createToolValues()` in `toolbox/tools-page-accordions.js`. |
56+
| Runtime behavior impact | Does not currently enforce dependency readiness, launch blocking, filter eligibility, voting, or ordering. It is carried as dependency/planning payload and used for completeness validation. |
57+
| UI display impact | `createToolValues()` can display `Requires: ...`, but no active default Toolbox render path enables that readiness block today. |
58+
| Ownership recommendation | Move to Tool Planning as dependency data. Keep until a planning table/API exists. |
59+
60+
### `progressChecklist`
61+
62+
| Audit Item | Finding |
63+
| --- | --- |
64+
| Current status | Used, duplicated between dev seed inventory and DB-backed metadata rows, should move to Tool Planning. |
65+
| Where it is written | Per-tool seed records in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; DB seed rows in `src/dev-runtime/guest-seeds/tool-state-samples.js`; schema field in `src/dev-runtime/persistence/mock-db-store.js`; normalized/synced in `src/dev-runtime/server/mock-api-router.mjs`. |
66+
| Where it is read | `cloneToolRegistryEntry()`, `getMissingToolRegistryFields()`, and `applyToolRegistryMetadata()` in `src/dev-runtime/guest-seeds/tool-metadata-inventory.js`; `defaultToolboxMetadata()` and `ensureToolboxToolMetadataRows()` in `src/dev-runtime/server/mock-api-router.mjs`; `enrichTool()` and `createToolValues()` in `toolbox/tools-page-accordions.js`. |
67+
| Runtime behavior impact | Does not currently affect launch, filtering, voting, order, status, or Build Path calculations. It is carried as planning/checklist payload and used for completeness validation. |
68+
| UI display impact | `createToolValues()` can display checklist text, but no active default Toolbox card path enables that readiness block today. |
69+
| Ownership recommendation | Move to Tool Planning as checklist/readiness data. Keep until a planning table/API exists. |
70+
71+
## Platform Settings / Inventory Verification
72+
73+
API probe evidence:
74+
75+
```json
76+
{
77+
"activeTools": 43,
78+
"voteRows": 43,
79+
"hasMidi": true,
80+
"hasMusic": true,
81+
"platformSettings": {
82+
"adminOnly": true,
83+
"category": "Platform",
84+
"id": "platform-settings",
85+
"toolboxGroup": "Admin",
86+
"visibleInToolsList": false
87+
},
88+
"platformVoteRow": {
89+
"group": "Platform",
90+
"order": 43,
91+
"path": "toolbox/platform-settings/index.html",
92+
"status": "planned",
93+
"toolKey": "platform-settings",
94+
"toolName": "Platform Settings"
95+
}
96+
}
97+
```
98+
99+
| Requirement | Status | Evidence |
100+
| --- | --- | --- |
101+
| Preserve 43-tool inventory target. | PASS | API probe and `ToolboxAdminMetadataSsot.spec.mjs` show 43 registry tools and 43 vote rows. |
102+
| Preserve MIDI and Music as separate tools. | PASS | API probe reports `hasMidi: true` and `hasMusic: true`. |
103+
| Platform Settings present in DB-backed tool list. | PASS | API probe returned `platform-settings`; Tool Votes snapshot includes Platform Settings. |
104+
| Platform Settings under Admin and not My Stuff. | PASS | API probe reports `toolboxGroup: "Admin"` and `adminOnly: true`; `ToolboxRoutePages.spec.mjs` validates the Admin menu list includes Platform Settings. |
105+
106+
## Validation
107+
108+
| Lane | Command | Result |
109+
| --- | --- | --- |
110+
| Branch guard | `git branch --show-current` | PASS: `main` |
111+
| Static diff whitespace | `git diff --check` | PASS |
112+
| API inventory probe | Node probe against `/api/toolbox/registry/snapshot` and `/api/toolbox/votes/snapshot` | PASS |
113+
| Admin Tool Votes / Toolbox metadata Playwright | `npx playwright test tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs --reporter=line` | PASS: 4/4 |
114+
| Toolbox route/Admin menu Playwright | `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --reporter=line` | PASS: 8/8 on rerun |
115+
116+
Validation note: the first `ToolboxRoutePages.spec.mjs` attempt had one Playwright artifact/trace filesystem failure under `tmp/test-results` (`ENOENT` while opening a trace network artifact) and 7/8 tests passed. The clean rerun passed 8/8 with no product-code changes.
117+
118+
## Impacted Lane
119+
120+
Toolbox/Admin Tool Votes validation only.
121+
122+
## Skipped Lanes
123+
124+
| Lane | Reason |
125+
| --- | --- |
126+
| Full samples validation | Safe to skip per request; this audit did not touch samples or shared sample loader/framework code. |
127+
| Unrelated tool runtime lanes | Safe to skip; this PR is an audit of Toolbox planning fields plus DB-backed inventory verification. |
128+
129+
## Manual Test Notes
130+
131+
- No runtime code was changed.
132+
- No inline script, inline style, or inline event handlers were added.
133+
- No audited fields were removed because each is still present in seed/schema/API/UI payload paths.

0 commit comments

Comments
 (0)