|
| 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