|
| 1 | +# PR_26172_CHARLIE_040-controls-game-journey-api-client-resolution |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +Status: PASS. |
| 6 | + |
| 7 | +Resolved two retained API-client exceptions by moving them to canonical shared JavaScript: |
| 8 | + |
| 9 | +- `toolbox/controls/controls-api-client.js` -> `assets/js/shared/controls-api-client.js` |
| 10 | +- `toolbox/game-journey/game-journey-api-client.js` -> `assets/js/shared/game-journey-api-client.js` |
| 11 | + |
| 12 | +No feature behavior was changed. |
| 13 | + |
| 14 | +## Files Changed |
| 15 | + |
| 16 | +- `assets/js/shared/controls-api-client.js` |
| 17 | +- `assets/js/shared/game-journey-api-client.js` |
| 18 | +- `assets/toolbox/controls/js/index.js` |
| 19 | +- `assets/toolbox/game-journey/js/index.js` |
| 20 | +- `account/user-controls-page.js` |
| 21 | +- `scripts/validate-canonical-repository-structure.mjs` |
| 22 | +- `scripts/validate-browser-env-agnostic.mjs` |
| 23 | +- `tests/dev-runtime/ProductDataProviderContractHardening.test.mjs` |
| 24 | +- `tests/regression/CanonicalRepositoryStructureGuardrail.test.mjs` |
| 25 | +- `docs_build/dev/reports/PR_26172_CHARLIE_040-controls-game-journey-api-client-resolution.md` |
| 26 | +- `docs_build/dev/reports/codex_review.diff` |
| 27 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 28 | + |
| 29 | +## Controls API Client Resolution |
| 30 | + |
| 31 | +Decision: migrated to shared. |
| 32 | + |
| 33 | +Reason: |
| 34 | + |
| 35 | +- The client is used by the Controls tool and the account User Controls page. |
| 36 | +- `assets/js/shared/` is canonical for reusable browser helpers. |
| 37 | +- Consumers validated through direct browser page-load probe. |
| 38 | + |
| 39 | +Updated consumers: |
| 40 | + |
| 41 | +- `assets/toolbox/controls/js/index.js` |
| 42 | +- `account/user-controls-page.js` |
| 43 | + |
| 44 | +## Game Journey API Client Resolution |
| 45 | + |
| 46 | +Decision: migrated to shared. |
| 47 | + |
| 48 | +Reason: |
| 49 | + |
| 50 | +- The canonical structure allows shared JS under `assets/js/shared/`. |
| 51 | +- Moving to shared avoids creating an unapproved secondary tool-local JS file beside `index.js`. |
| 52 | +- Targeted Game Journey browser probe validated the moved client and completion-metrics rendering with the existing Postgres stub. |
| 53 | + |
| 54 | +Updated consumer: |
| 55 | + |
| 56 | +- `assets/toolbox/game-journey/js/index.js` |
| 57 | + |
| 58 | +## Validation Lane Report |
| 59 | + |
| 60 | +- `node --check assets/js/shared/controls-api-client.js` |
| 61 | + - Result: PASS |
| 62 | +- `node --check assets/js/shared/game-journey-api-client.js` |
| 63 | + - Result: PASS |
| 64 | +- `node --check assets/toolbox/controls/js/index.js` |
| 65 | + - Result: PASS |
| 66 | +- `node --check assets/toolbox/game-journey/js/index.js` |
| 67 | + - Result: PASS |
| 68 | +- `node --check account/user-controls-page.js` |
| 69 | + - Result: PASS |
| 70 | +- Active stale reference check for old Controls/Game Journey client paths |
| 71 | + - Result: PASS |
| 72 | + - No active non-report references remain. |
| 73 | +- `git diff --check` |
| 74 | + - Result: PASS |
| 75 | +- `npm run validate:canonical-structure` |
| 76 | + - Result: PASS |
| 77 | + - Blocking violations: 0 |
| 78 | + - Approved legacy exceptions: 478 |
| 79 | +- `node --test tests/regression/CanonicalRepositoryStructureGuardrail.test.mjs` |
| 80 | + - Result: PASS |
| 81 | +- Direct browser page-load probe: |
| 82 | + - Controls: PASS, heading rendered and `assets/js/shared/controls-api-client.js` returned HTTP 200. |
| 83 | + - Game Journey: PASS, heading rendered, shared client returned HTTP 200, completion metrics rendered. |
| 84 | + - Account User Controls: PASS, heading rendered and shared Controls client returned HTTP 200. |
| 85 | +- `node --test tests/dev-runtime/ProductDataProviderContractHardening.test.mjs` |
| 86 | + - Result: FAIL |
| 87 | + - Existing unrelated failures: |
| 88 | + - Public config request order expectation. |
| 89 | + - Admin/tool votes import expectation. |
| 90 | + - The moved Controls and Game Journey client path list was updated in this test; the remaining failures are outside this PR scope. |
| 91 | + |
| 92 | +## Branch Validation |
| 93 | + |
| 94 | +- Current branch: `PR_26172_CHARLIE_repository-compliance-stack` |
| 95 | +- Expected branch: `PR_26172_CHARLIE_repository-compliance-stack` |
| 96 | +- Local/origin sync before PR: `0 0` |
| 97 | +- Branch validation: PASS |
| 98 | + |
| 99 | +## Requirement Checklist |
| 100 | + |
| 101 | +- Resolve `controls-api-client.js`: PASS |
| 102 | +- Resolve `game-journey-api-client.js`: PASS |
| 103 | +- Migrate if safe: PASS |
| 104 | +- Otherwise document exceptions: PASS, no exception retained for these two files. |
| 105 | +- Preserve behavior: PASS |
| 106 | +- No feature changes: PASS |
| 107 | +- Produce ZIP artifact: PASS after artifact creation. |
| 108 | + |
| 109 | +## Manual Validation Notes |
| 110 | + |
| 111 | +Controls and Game Journey API-client exceptions are resolved. The only remaining target-area exception after this PR is the Assets upload worker. |
0 commit comments