|
| 1 | +# PR_26161_025-controls-authoritative-ownership |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | + |
| 5 | +- Current branch: `main` |
| 6 | +- Expected branch: `main` |
| 7 | +- Result: PASS |
| 8 | + |
| 9 | +## Scope |
| 10 | + |
| 11 | +- Audited `toolbox/controls/index.html`. |
| 12 | +- Audited `toolbox/input-mapping-v2/index.html`. |
| 13 | +- Authoritative tool: `Controls` at `toolbox/controls/index.html`. |
| 14 | +- Deprecated tool: `Input Mapping V2` at `toolbox/input-mapping-v2/index.html`. |
| 15 | +- Impacted lane: Controls/Input Mapping tool, Tool metadata registry, Admin DB viewer ownership display. |
| 16 | +- Playwright impacted: Yes. |
| 17 | + |
| 18 | +## Requirement Checklist |
| 19 | + |
| 20 | +- PASS - Controls is the user-facing tool for input mappings. |
| 21 | +- PASS - Controls is the single source of truth for input mappings. |
| 22 | +- PASS - Controls is the single source of truth for controller profiles. |
| 23 | +- PASS - Controls is the single source of truth for device detection UI. |
| 24 | +- PASS - Controls is the single source of truth for mapping persistence. |
| 25 | +- PASS - `input-mapping-v2` is marked deprecated in tool metadata. |
| 26 | +- PASS - `input-mapping-v2` route provides redirect/launch guidance to Controls. |
| 27 | +- PASS - Duplicate UI ownership removed from `input-mapping-v2`. |
| 28 | +- PASS - Duplicate DB ownership removed from `input-mapping-v2`. |
| 29 | +- PASS - Duplicate mapping persistence ownership removed from `input-mapping-v2`. |
| 30 | +- PASS - Duplicate controller profile ownership removed from `input-mapping-v2`. |
| 31 | +- PASS - Tool metadata identifies Controls as authoritative and Input Mapping V2 as deprecated. |
| 32 | +- PASS - No engine runtime behavior changed. |
| 33 | + |
| 34 | +## Implementation Notes |
| 35 | + |
| 36 | +- Moved the active input mapping runtime modules into `toolbox/controls/`. |
| 37 | +- Updated Controls to load `toolbox/controls/controls.js`. |
| 38 | +- Updated the Controls API client to request the `controls` server tool constants and repository. |
| 39 | +- Changed shared mock DB ownership from `input-mapping-v2` to `controls` while preserving existing table names: |
| 40 | + - `input_mapping_records` |
| 41 | + - `input_controller_profile_records` |
| 42 | +- Updated the mock API router to expose mapping/profile repository ownership through `controls`. |
| 43 | +- Replaced the old `input-mapping-v2` page with a deprecated guidance page linking to Controls. |
| 44 | +- Updated tool metadata so Controls points to `toolbox/controls/index.html` and Input Mapping V2 is hidden/deprecated. |
| 45 | +- Updated Admin DB Viewer expectations to show Controls as the owner of input mapping and controller profile tables. |
| 46 | + |
| 47 | +## Remaining Migration Work |
| 48 | + |
| 49 | +- None for required UI ownership, DB ownership, mapping persistence ownership, controller profile ownership, or device detection ownership. |
| 50 | +- Future removal PR: delete the deprecated `toolbox/input-mapping-v2/` route when old links no longer need guidance. |
| 51 | +- Historical manifest/schema references to old tool keys were not changed because this PR does not change engine runtime contracts. |
| 52 | + |
| 53 | +## Validation Performed |
| 54 | + |
| 55 | +- PASS - `node --check toolbox/controls/controls.js` |
| 56 | +- PASS - `node --check toolbox/controls/controls-api-client.js` |
| 57 | +- PASS - `node --check src/dev-runtime/server/mock-api-router.mjs` |
| 58 | +- PASS - `node --check src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 59 | +- PASS - `node --check src/dev-runtime/persistence/mock-db-store.js` |
| 60 | +- PASS - `node --check src/dev-runtime/guest-seeds/tool-metadata-inventory.js` |
| 61 | +- PASS - `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 62 | +- PASS - `node --check tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs` |
| 63 | +- PASS - `node --check tests/playwright/tools/AdminDbViewer.spec.mjs` |
| 64 | +- PASS - HTML restriction scan on `toolbox/controls/index.html` and `toolbox/input-mapping-v2/index.html`: no inline script/style/event handler matches. |
| 65 | +- PASS - Old ownership scan: no active `input-mapping-v2` server constants, repository client, DB owner, or mock router ownership hooks remain. |
| 66 | +- PASS - `git diff --check` passed with line-ending warnings only. |
| 67 | +- PASS - `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs`: 5/5 passed. |
| 68 | +- PASS - `npx playwright test tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs`: 4/4 passed. |
| 69 | +- PASS - `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs -g "current read-only Local Mem DB tables|current read-only Local DB tables"`: 2/2 passed. |
| 70 | +- WARN - `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs`: 6/7 passed; the broader persistence test failed on an existing Colors page asset request for `assets/theme-v2/images/characters/palette-manager.png`, outside this Controls ownership scope. |
| 71 | + |
| 72 | +## V8 Coverage |
| 73 | + |
| 74 | +- PASS - `docs_build/dev/reports/playwright_v8_coverage_report.txt` generated. |
| 75 | +- PASS - `toolbox/controls/controls.js`: 91% function coverage in the final Controls run. |
| 76 | +- PASS - `toolbox/controls/controls-api-client.js`: 100% function coverage in the final Controls run. |
| 77 | +- WARN - Server/dev-runtime changed JS files are not collected by browser V8 coverage; advisory only. |
| 78 | + |
| 79 | +## Manual Validation Steps |
| 80 | + |
| 81 | +1. Open `toolbox/controls/index.html`. |
| 82 | +2. Confirm the Controls tool shows Actions, Table Input Mappings, Controller Profile, Devices, and Status. |
| 83 | +3. Add a mapping and confirm it persists after reload. |
| 84 | +4. Add a controller profile and confirm it persists after reload. |
| 85 | +5. Open `toolbox/input-mapping-v2/index.html`. |
| 86 | +6. Confirm the page is deprecated guidance only and links to Controls. |
| 87 | +7. Open Admin DB Viewer and confirm Controls owns `input_mapping_records` and `input_controller_profile_records`. |
| 88 | + |
| 89 | +## Skipped Lanes |
| 90 | + |
| 91 | +- Full samples validation: SKIPPED. Samples were not in scope and no sample JSON or engine runtime behavior changed. |
| 92 | +- Full suite: SKIPPED. Targeted Controls, metadata, and DB ownership lanes covered the changed behavior. |
| 93 | + |
| 94 | +## Artifacts |
| 95 | + |
| 96 | +- PASS - Review diff: `docs_build/dev/reports/codex_review.diff` |
| 97 | +- PASS - Changed files: `docs_build/dev/reports/codex_changed_files.txt` |
| 98 | +- PASS - Repo-structured delta ZIP: `tmp/PR_26161_025-controls-authoritative-ownership_delta.zip` |
0 commit comments