Skip to content

Commit 8379b82

Browse files
committed
PR_26172_CHARLIE_040-controls-game-journey-api-client-resolution
1 parent e600c70 commit 8379b82

12 files changed

Lines changed: 289 additions & 127 deletions

account/user-controls-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createControlsToolApiRepository } from "../toolbox/controls/controls-api-client.js";
1+
import { createControlsToolApiRepository } from "../assets/js/shared/controls-api-client.js";
22
import { getSessionCurrent } from "../src/api/session-api-client.js";
33
import InputService from "../src/engine/input/InputService.js";
44
import InputCaptureService from "../src/engine/input/InputCaptureService.js";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
createServerRepositoryClient,
33
readServerToolConstants,
44
requireServerConstant,
5-
} from "../../src/api/server-api-client.js";
5+
} from "../../../src/api/server-api-client.js";
66

77
const constants = readServerToolConstants("controls");
88

toolbox/game-journey/game-journey-api-client.js renamed to assets/js/shared/game-journey-api-client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import {
22
createServerRepositoryClient,
33
readServerToolConstants,
44
requireServerConstant,
5-
} from "../../src/api/server-api-client.js";
5+
} from "../../../src/api/server-api-client.js";
66
export {
77
readGameJourneyCompletionMetrics,
88
updateGameJourneyCompletionMetric,
9-
} from "../../src/api/game-journey-completion-api-client.js";
9+
} from "../../../src/api/game-journey-completion-api-client.js";
1010

1111
const constants = readServerToolConstants("game-journey");
1212

assets/toolbox/controls/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
GAME_CONTROL_NORMALIZED_INPUTS,
66
NORMALIZED_USAGE_LABELS,
77
createControlsToolApiRepository,
8-
} from "../../../../toolbox/controls/controls-api-client.js";
8+
} from "../../../js/shared/controls-api-client.js";
99
import {
1010
normalizeNormalizedInput,
1111
normalizedInputOptions,

assets/toolbox/game-journey/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
GAME_JOURNEY_SUGGESTED_TOOLS,
77
createGameJourneyApiRepository,
88
readGameJourneyCompletionMetrics,
9-
} from "../../../../toolbox/game-journey/game-journey-api-client.js";
9+
} from "../../../js/shared/game-journey-api-client.js";
1010
import {
1111
getActiveToolRegistry,
1212
getToolRegistryApiDiagnostic,
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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.
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
R095 toolbox/assets/assets-api-client.js assets/js/shared/assets-api-client.js
2-
M assets/toolbox/assets/js/index.js
3-
M assets/toolbox/objects/js/index.js
4-
A docs_build/dev/reports/PR_26172_CHARLIE_039-assets-api-worker-exception-resolution.md
5-
M docs_build/dev/reports/codex_changed_files.txt
6-
M docs_build/dev/reports/codex_review.diff
1+
M account/user-controls-page.js
2+
R096 toolbox/controls/controls-api-client.js assets/js/shared/controls-api-client.js
3+
R091 toolbox/game-journey/game-journey-api-client.js assets/js/shared/game-journey-api-client.js
4+
M assets/toolbox/controls/js/index.js
5+
M assets/toolbox/game-journey/js/index.js
6+
A docs_build/dev/reports/PR_26172_CHARLIE_040-controls-game-journey-api-client-resolution.md
77
M scripts/validate-browser-env-agnostic.mjs
88
M scripts/validate-canonical-repository-structure.mjs
99
M tests/dev-runtime/ProductDataProviderContractHardening.test.mjs
10+
M tests/regression/CanonicalRepositoryStructureGuardrail.test.mjs

0 commit comments

Comments
 (0)