-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodex_review.diff
More file actions
580 lines (570 loc) · 26.2 KB
/
Copy pathcodex_review.diff
File metadata and controls
580 lines (570 loc) · 26.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
diff --git a/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md b/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
index 524ef94fb..1e65998c6 100644
--- a/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
+++ b/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
@@ -117,7 +117,7 @@ Rules:
## Current Version/Date
-- Project Instructions Version: 2026.06.28.019
+- Project Instructions Version: 2026.06.28.020
- Date: 2026-06-28
- Owner: OWNER
diff --git a/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md b/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
index 8f53d469f..f809be6a3 100644
--- a/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
+++ b/dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
@@ -1,6 +1,6 @@
# Project Instructions Version
-Current Project Instructions Version: 2026.06.28.019
+Current Project Instructions Version: 2026.06.28.020
Last Updated: 2026-06-28
@@ -27,6 +27,7 @@ Last Updated: 2026-06-28
- Removed the local demo `.gfsp` artifact and recorded a file-by-file `src/` destination audit for future scoped migrations.
- Moved PR017-audited browser/www-owned legacy `src/` files into `www/src/` while preserving public `/src/...` browser route compatibility under the `www` web root.
- Moved PR019a-audited active browser/runtime shared contracts and tool schemas into `www/src/shared/` while preserving public `/src/shared/...` browser route compatibility.
+- Removed obsolete root `src/` legacy placeholders, stale schema README files, and archived-only debug helpers while preserving active contracts and validation schemas.
- Codex must read this version file and the latest repository copy of `PROJECT_INSTRUCTIONS.md` before performing work.
- Codex must discard previously remembered Project Instructions and treat the repository copy as authoritative.
- Codex must validate canonical report and ZIP paths, branching model, and legacy path avoidance before work proceeds.
diff --git a/dev/build/ProjectInstructions/PROJECT_STATE.md b/dev/build/ProjectInstructions/PROJECT_STATE.md
index dd9f058ab..8bd72875d 100644
--- a/dev/build/ProjectInstructions/PROJECT_STATE.md
+++ b/dev/build/ProjectInstructions/PROJECT_STATE.md
@@ -1,7 +1,7 @@
# Project State
```yaml
-project_state_version: "2026.06.28.019"
+project_state_version: "2026.06.28.020"
last_updated: "2026-06-28"
current_main_commit: "40de767476d70cadfd1292c916844c2f31b6f185"
repository_status:
@@ -10,9 +10,9 @@ repository_status:
runtime_database: "Postgres"
creator_metadata: "API to Postgres"
creator_assets: "API to R2"
-project_instructions_version: "2026.06.28.019"
-repository_structure_version: "2026.06.28.019"
-canonical_layout_version: "2026.06.28.019"
+project_instructions_version: "2026.06.28.020"
+repository_structure_version: "2026.06.28.020"
+canonical_layout_version: "2026.06.28.020"
active_teams:
- "Owner"
- "Alfa"
@@ -20,8 +20,8 @@ active_teams:
- "Charlie"
- "Delta"
- "Golf"
-latest_owner_pr: "PR_26180_OWNER_019b-move-browser-shared-schemas-to-www"
-latest_structure_pr: "PR_26180_OWNER_019b-move-browser-shared-schemas-to-www"
+latest_owner_pr: "PR_26180_OWNER_020-src-legacy-teardown"
+latest_structure_pr: "PR_26180_OWNER_020-src-legacy-teardown"
valid_top_level_folders:
- "api/"
- "deploy/"
@@ -41,7 +41,6 @@ valid_dev_folders:
- "dev/workspace/"
known_technical_debt:
- "Remaining API/server-owned contracts, validation-only schemas, and project data store modules remain under src/shared/ until scoped follow-up PRs move them to api/ or dev/."
- - "Developer/source reference files remain under src/ until PR_26180_OWNER_020 moves them to dev/."
- - "src/dev-runtime/admin/.gitkeep remains as a placeholder until PR_26180_OWNER_021 retires the empty root src folder."
+ - "Remaining actively validated contracts, validation schemas, and project data store modules remain under src/shared/ until scoped follow-up PRs move them to api/ or dev/."
- "repository_directory_standard.md and codex_project_instructions_startup.md are superseded pointers retained for compatibility."
```
diff --git a/dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md b/dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
index 2f73709cb..cfbad05b6 100644
--- a/dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
+++ b/dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
@@ -40,7 +40,7 @@ The backlog is the authoritative source for determining the next logical PRs.
- Product Area: Repository Architecture Simplification
- Status: Active
- Percent Complete: 99%
-- Active PR: PR_26180_OWNER_019b-move-browser-shared-schemas-to-www
+- Active PR: PR_26180_OWNER_020-src-legacy-teardown
- Next Milestone: Move remaining API/server-owned source to api/
- Source / Reference: `dev/build/ProjectInstructions/repository/repository_layout_architecture_plan.md`; `dev/build/ProjectInstructions/repository/www_migration_map.md`
diff --git a/dev/build/ProjectInstructions/repository/canonical_repository_structure.md b/dev/build/ProjectInstructions/repository/canonical_repository_structure.md
index 41be18217..d60ba6140 100644
--- a/dev/build/ProjectInstructions/repository/canonical_repository_structure.md
+++ b/dev/build/ProjectInstructions/repository/canonical_repository_structure.md
@@ -90,7 +90,6 @@ Legacy transition buckets:
- src/shared/contracts/
- src/shared/schemas/
- src/shared/projectDataStore/
-- src/dev-runtime/admin/.gitkeep
The `www/src/` legacy transition buckets preserve public `/src/...` browser import compatibility during source retirement. Remaining root `src/` buckets may remain only until explicit stacked migration PRs move them to `api/` or `dev/`.
diff --git a/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_branch-validation.md b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_branch-validation.md
new file mode 100644
index 000000000..759f6b6d0
--- /dev/null
+++ b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_branch-validation.md
@@ -0,0 +1,13 @@
+# PR_26180_OWNER_020 Branch Validation
+
+| Check | Status | Notes |
+|-------|--------|-------|
+| Current branch | PASS | `PR_26180_OWNER_020-src-legacy-teardown` |
+| Expected base | PASS | Stacked on `PR_26180_OWNER_019b-move-browser-shared-schemas-to-www` workstream branch. |
+| Worktree scope | PASS | Changes limited to obsolete root `src/` deletions, Project Instructions/backlog status updates, guard baseline alignment, and PR reports. |
+| Runtime/API/UI/database changes | PASS | No active runtime, API, UI, or database implementation files changed. |
+| Protected dev workspace paths | PASS | No protected `dev/workspace/generated`, `dev/workspace/zips`, or `dev/workspace/tmp` files moved or deleted. |
+
+## Branch Decision
+
+PASS. Branch is valid for the stacked Owner Repository Architecture Simplification workstream.
diff --git a/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_manual-validation-notes.md b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_manual-validation-notes.md
new file mode 100644
index 000000000..b4f1af5a7
--- /dev/null
+++ b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_manual-validation-notes.md
@@ -0,0 +1,19 @@
+# PR_26180_OWNER_020 Manual Validation Notes
+
+## Manual Review
+
+- Confirmed current branch is `PR_26180_OWNER_020-src-legacy-teardown`.
+- Confirmed deleted files are limited to obsolete root `src/` placeholders, README notes, and debug helpers with no active references.
+- Confirmed remaining root `src/shared/contracts/**`, `src/shared/projectDataStore/**`, and active schema files are still needed by current validation/test references and were not removed.
+- Confirmed archive-only v1-v2 references to deleted debug helpers remain historical and are not active runtime blockers.
+- Confirmed the shared extraction guard baseline change removes only the deleted `src/shared/debug/network.js` entry.
+
+## Manual Runtime Notes
+
+No runtime/UI/API/database behavior was changed. Playwright was not required because this PR removes unreferenced legacy source files and documentation placeholders only.
+
+## ZIP Notes
+
+The repo-structured ZIP for this PR is generated under:
+
+`dev/workspace/zips/PR_26180_OWNER_020-src-legacy-teardown_delta.zip`
diff --git a/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_report.md b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_report.md
new file mode 100644
index 000000000..cf243ad3b
--- /dev/null
+++ b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_report.md
@@ -0,0 +1,56 @@
+# PR_26180_OWNER_020-src-legacy-teardown Report
+
+## Executive Summary
+
+PR_26180_OWNER_020 continues the root `src/` retirement work by removing legacy files that no longer have active runtime, API, dev script, validation, or test references. The PR preserves active root `src/shared/contracts/**`, `src/shared/projectDataStore/**`, and active schema files because they are still used by current dev validation/tests and require separate follow-up ownership moves.
+
+No browser, API, database, or product behavior changes are introduced.
+
+## Source Of Truth
+
+- Base branch: `PR_26180_OWNER_019b-move-browser-shared-schemas-to-www`
+- Workstream: Repository Architecture Simplification
+- Audit source: PR017 src destination audit and PR019a contracts/schemas obsolescence audit
+- Project Instructions version updated to `2026.06.28.020`
+
+## Deleted Legacy Files
+
+| File | Decision | Reason |
+|------|----------|--------|
+| `src/dev-runtime/admin/.gitkeep` | Deleted | Obsolete placeholder. Admin compatibility runtime now lives under `www/src/dev-runtime/admin/`. |
+| `src/engine/README.md` | Deleted | Legacy empty-engine-era note, not an active architecture source. |
+| `src/shared/debug/config.js` | Deleted | Old debug helper referenced only by archived v1-v2 material. No active runtime/test/script references. |
+| `src/shared/debug/network.js` | Deleted | Old debug helper referenced only by archived v1-v2 material. No active runtime/test/script references. |
+| `src/shared/debug/noopDevConsoleIntegration.js` | Deleted | Old debug helper referenced only by archived v1-v2 material. No active runtime/test/script references. |
+| `src/shared/schemas/README.md` | Deleted | Legacy schema README superseded by active Project Instructions/governance. |
+| `src/shared/schemas/tools/README.md` | Deleted | Legacy tool schema README superseded by active Project Instructions/governance. |
+
+## Preserved Root src Files
+
+| Path | Decision | Reason |
+|------|----------|--------|
+| `src/shared/contracts/**` | Preserved | Still actively imported by `dev/tests/shared/**` contract validation. |
+| `src/shared/projectDataStore/**` | Preserved | Still actively imported by current project data store validation tests. |
+| `src/shared/schemas/game.manifest.schema.json` | Preserved | Still actively referenced by current validation/tests. |
+| `src/shared/schemas/samples/sample.tool-payload.schema.json` | Preserved | Still actively referenced by current validation/tests. |
+
+## Legacy Pattern Audit
+
+| Pattern | Result |
+|---------|--------|
+| `src/shared/debug/*` active references | PASS: no active references outside archive/report/workspace folders. |
+| `src/engine/README` active references | PASS: no active references outside archive/report/workspace folders. |
+| `src/shared/schemas/README` active references | PASS: no active references outside archive/report/workspace folders. |
+| `src/dev-runtime/admin/.gitkeep` active references | PASS: no active references outside archive/report/workspace folders. |
+| `www/src/tools/**` | Not present in this PR scope. |
+| Protected dev workspace paths | PASS: no protected `dev/workspace/generated`, `zips`, or `tmp` files moved. |
+
+Archive-only v1-v2 references to the removed debug helpers remain under `dev/archive/v1-v2/**`. They are historical reference material, not active runtime or validation dependencies.
+
+## Shared Extraction Guard
+
+`dev/tools/toolbox-dev/checkSharedExtractionGuard.baseline.json` was updated by removing the single baseline entry for deleted file `src/shared/debug/network.js`. No broad baseline regeneration was committed.
+
+## Owner Recommendation
+
+Proceed with this teardown PR. Remaining root `src/` files require follow-up PRs because active validation currently depends on them.
diff --git a/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_requirement-checklist.md b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_requirement-checklist.md
new file mode 100644
index 000000000..abd58749e
--- /dev/null
+++ b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_requirement-checklist.md
@@ -0,0 +1,19 @@
+# PR_26180_OWNER_020 Requirement Checklist
+
+| Requirement | Status | Evidence |
+|-------------|--------|----------|
+| Base from `PR_26180_OWNER_019b-move-browser-shared-schemas-to-www` | PASS | Branch `PR_26180_OWNER_020-src-legacy-teardown` was created from the PR019b stack. |
+| Do not copy files again | PASS | PR deletes obsolete legacy files only; no duplicate copies were added. |
+| Delete/archive obsolete root `src/` files only after replacement or proof of legacy status | PASS | Seven files removed after active-reference scan found no active runtime/script/test dependencies. |
+| Preserve runtime behavior | PASS | Removed files had no active references outside archive/report/workspace paths. |
+| Hard stop if active `www/api/dev` runtime or validation imports removed files | PASS | Active-reference scan found no active imports for removed files. |
+| Preserve active root `src/shared/contracts/**` and schemas still needed by validation | PASS | Active contract/schema/project data store files remain in root `src/` for follow-up PRs. |
+| Remove `src/dev-runtime/admin/.gitkeep` if obsolete | PASS | Obsolete placeholder removed. |
+| Audit legacy debug/schema/readme patterns | PASS | Active-reference scan completed; archive-only historical references documented. |
+| Do not move protected developer workspace files | PASS | No `dev/workspace/generated`, `dev/workspace/zips`, or `dev/workspace/tmp` files moved. |
+| Required reports under `dev/reports/` | PASS | PR-specific report, checklist, validation report, manual notes, branch validation, diff, and changed-file report created. |
+| Required ZIP under `dev/workspace/zips/` | PASS | Repo-structured ZIP generated for the PR outcome. |
+
+## Remaining Follow-Up
+
+Root `src/shared/contracts/**`, `src/shared/projectDataStore/**`, and active schema files remain because they are still required by current validation/test lanes.
diff --git a/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_validation-report.md b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_validation-report.md
new file mode 100644
index 000000000..fa866c961
--- /dev/null
+++ b/dev/reports/PR_26180_OWNER_020-src-legacy-teardown_validation-report.md
@@ -0,0 +1,33 @@
+# PR_26180_OWNER_020 Validation Report
+
+## Validation Commands
+
+| Command | Status | Notes |
+|---------|--------|-------|
+| `git diff --check` | PASS | No whitespace errors. |
+| `npm run validate:canonical-structure` | PASS | Canonical repository structure guardrail passed with 0 blocking violations. |
+| `node ./dev/scripts/run-node-test-files.mjs dev/tests/dev-runtime/AdminNotesBoundary.test.mjs dev/tests/dev-runtime/StaticWebRootCompatibility.test.mjs dev/tests/tools/ToolManifestBoundary.test.mjs` | PASS | 3/3 targeted node test files passed. |
+| `node dev/tools/toolbox-dev/checkSharedExtractionGuard.mjs` | PASS | Baseline aligned after removing the deleted `src/shared/debug/network.js` entry. |
+| Active legacy reference scan | PASS | No active references to deleted paths found outside archive/report/workspace folders. |
+
+## Active Legacy Reference Scan
+
+Command:
+
+```powershell
+rg -n "src/shared/debug/(config|network|noopDevConsoleIntegration)|src/engine/README|src/shared/schemas/README|src/shared/schemas/tools/README|src/dev-runtime/admin/.gitkeep" www api dev/scripts dev/tests dev/tools package.json .github --glob '!dev/archive/**' --glob '!dev/reports/**' --glob '!dev/workspace/**'
+```
+
+Result: no matches.
+
+## Archive References
+
+Historical references remain under `dev/archive/v1-v2/**`. These are intentionally excluded from active validation blockers because `dev/archive/` is historical reference material only.
+
+## Product Impact
+
+- Runtime behavior changed: No
+- UI changed: No
+- API changed: No
+- Database changed: No
+- Product feature changed: No
diff --git a/dev/tools/toolbox-dev/checkSharedExtractionGuard.baseline.json b/dev/tools/toolbox-dev/checkSharedExtractionGuard.baseline.json
index c4a7df71b..3572073e6 100644
--- a/dev/tools/toolbox-dev/checkSharedExtractionGuard.baseline.json
+++ b/dev/tools/toolbox-dev/checkSharedExtractionGuard.baseline.json
@@ -3216,11 +3216,6 @@
"type": "inline-helper-clone",
"match": "rule:number-is-finite-usage"
},
- {
- "file": "src/shared/debug/network.js",
- "type": "inline-helper-clone",
- "match": "rule:number-is-finite-usage"
- },
{
"file": "www/src/shared/game/highScores.js",
"type": "inline-helper-clone",
diff --git a/src/dev-runtime/admin/.gitkeep b/src/dev-runtime/admin/.gitkeep
deleted file mode 100644
index d0bef0afc..000000000
--- a/src/dev-runtime/admin/.gitkeep
+++ /dev/null
@@ -1 +0,0 @@
-# dev-runtime admin placeholder
diff --git a/src/engine/README.md b/src/engine/README.md
deleted file mode 100644
index 19c1a3f23..000000000
--- a/src/engine/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Engine
-
-Shared framework used by deprecated `archive/v1-v2/samples/` and deprecated `archive/v1-v2/games/`. All modules are ES modules and browser-ready; no build step is required.
-
-## Import Policy
-- Bootstrap via `src/engine/core/index.js` (or `src/engine/core/Engine.js` for legacy direct imports).
-- For subsystems, prefer the public barrel `src/engine/<subsystem>/index.js` when it exists.
-
-## Key Areas
-- `core/` timing, orchestration, metrics
-- `scene/` scene lifecycle and transitions
-- `rendering/` canvas renderers and helpers
-- `input/` keyboard, mouse, gamepad, action mapping
-- `audio/` audio services and backends
-- `physics/` reusable physics primitives and helpers
-- `systems/` reusable runtime system helpers
-- `events/` event routing primitives
-- `camera/` camera and world-to-screen integration
-- `ui/` shared hub and overlay components
-- `world/`, `ecs/`, `collision/`, `utils/` shared math and world helpers
-- `persistence/` serialization and storage
-- `fx/` effects such as `ParticleSystem`
-- platform and pipelines: `runtime/`, `automation/`, `release/`, `security/`, `pipeline/`, `editor/`
-
-## Validation
-- Automated: `npm test` (81/81 passing as of 03/25/2026)
-- In-repo usage: numbered samples and shipped games (Asteroids, Space Duel, Space Invaders, Pacman Lite/Full AI, AI Target Dummy)
diff --git a/src/shared/debug/config.js b/src/shared/debug/config.js
deleted file mode 100644
index 1b9580f7a..000000000
--- a/src/shared/debug/config.js
+++ /dev/null
@@ -1,96 +0,0 @@
-import LocalStorageService from '../../engine/persistence/LocalStorageService.js';
-import { safeTrim, toLowerSafe } from '../string/strings.js';
-const BUILD_DEBUG_MODE = 'prod';
-const BUILD_DEBUG_ENABLED = false;
-
-export function parseBooleanFlag(value, fallback) {
- const normalized = toLowerSafe(value);
- if (!normalized) {
- return fallback;
- }
- if (normalized === '1' || normalized === 'true' || normalized === 'on' || normalized === 'yes') {
- return true;
- }
- if (normalized === '0' || normalized === 'false' || normalized === 'off' || normalized === 'no') {
- return false;
- }
- return fallback;
-}
-
-export function normalizeDebugMode(value, fallback = 'prod') {
- const normalized = toLowerSafe(value);
- if (normalized === 'dev' || normalized === 'qa' || normalized === 'prod') {
- return normalized;
- }
- return fallback;
-}
-
-export function readStoredBoolean(key) {
- if (!key) {
- return null;
- }
-
- const value = new LocalStorageService().getItem(key, null);
- if (value === '1') {
- return true;
- }
- if (value === '0') {
- return false;
- }
-
- return null;
-}
-
-export function writeStoredBoolean(key, value) {
- if (!key) {
- return;
- }
-
- new LocalStorageService().setItem(key, value ? '1' : '0');
-}
-
-export function isLocalDebugEnvironment(documentRef) {
- const protocol = safeTrim(documentRef?.location?.protocol) || safeTrim(globalThis?.location?.protocol);
- const hostname = safeTrim(documentRef?.location?.hostname) || safeTrim(globalThis?.location?.hostname);
-
- if (protocol === 'file:') {
- return true;
- }
-
- return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1';
-}
-
-export function resolveDebugConfig(documentRef, options = {}) {
- const debugStateStorageKey = safeTrim(options?.storageKey);
- const search = safeTrim(documentRef?.location?.search) || safeTrim(globalThis?.location?.search);
- const searchParams = new URLSearchParams(search);
- const queryMode = searchParams.get('debugMode');
- const queryEnabled = searchParams.get('debug');
- const queryRemember = searchParams.get('rememberDebug');
- const queryDemo = searchParams.get('debugDemo');
- const localDebugEnvironment = isLocalDebugEnvironment(documentRef);
- const rememberDebugState = parseBooleanFlag(queryRemember, false);
- const demoMode = parseBooleanFlag(queryDemo, false);
- const defaultMode = localDebugEnvironment
- ? 'dev'
- : normalizeDebugMode(BUILD_DEBUG_MODE, 'prod');
- const debugMode = normalizeDebugMode(queryMode, demoMode ? 'qa' : defaultMode);
- const fallbackEnabled = (BUILD_DEBUG_ENABLED === true || localDebugEnvironment) && debugMode !== 'prod';
- const storedDebugEnabled = debugStateStorageKey && rememberDebugState && queryEnabled === null
- ? readStoredBoolean(debugStateStorageKey)
- : null;
- const debugEnabled = demoMode
- ? true
- : parseBooleanFlag(queryEnabled, storedDebugEnabled ?? fallbackEnabled);
-
- if (debugStateStorageKey && rememberDebugState) {
- writeStoredBoolean(debugStateStorageKey, debugEnabled);
- }
-
- return {
- debugMode,
- debugEnabled,
- rememberDebugState,
- demoMode
- };
-}
diff --git a/src/shared/debug/network.js b/src/shared/debug/network.js
deleted file mode 100644
index 80760171b..000000000
--- a/src/shared/debug/network.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import { asNumber } from "../math/numberNormalization.js";
-import { asArray } from "../array/arrays.js";
-import { asObject } from "../object/objects.js";
-import { safeTrim } from "../string/strings.js";
-
-function toSafeKey(value) {
- return safeTrim(value);
-}
-
-export { asNumber, asArray, asObject };
-export const sanitizeText = safeTrim;
-
-export function toNetworkSnapshot(snapshot, sampleKey) {
- const key = toSafeKey(sampleKey);
- if (!key) {
- return {};
- }
- return asObject(snapshot?.assets?.[key]);
-}
-
-export function getCommandSnapshot(context, sampleKey) {
- const key = toSafeKey(sampleKey);
- if (!key) {
- return {};
- }
- return asObject(context?.assets?.[key]);
-}
-
-export function commandLinesForTrace(context, args = [], options = {}) {
- const normalizedOptions = asObject(options);
- const sanitize = typeof normalizedOptions?.sanitizeText === "function"
- ? normalizedOptions.sanitizeText
- : sanitizeText;
- const formatNumber = typeof normalizedOptions?.formatNumber === "function"
- ? normalizedOptions.formatNumber
- : asNumber;
-
- const snapshot = getCommandSnapshot(context, normalizedOptions?.sampleKey);
- const trace = asObject(snapshot.trace);
- const events = asArray(trace.events);
-
- const requestedCount = Number.parseInt(args?.[0], 10);
- const count = Number.isFinite(requestedCount)
- ? Math.min(20, Math.max(1, requestedCount))
- : 8;
-
- if (events.length === 0) {
- return ["No network trace events recorded."];
- }
-
- const phaseField = toSafeKey(normalizedOptions?.phaseField) || "phase";
- return events
- .slice(-count)
- .reverse()
- .map((event) => {
- const source = asObject(event);
- const details = asObject(source.details);
- const detailsText = Object.keys(details)
- .slice(0, 2)
- .map((key) => `${key}=${String(details[key])}`)
- .join(" ");
- const eventType = sanitize(source.type) || "EVENT";
- const phase = sanitize(source[phaseField]) || "unknown";
- const prefix = `${formatNumber(source.timestampMs, 0)}ms ${eventType} phase=${phase}`;
- return detailsText ? `${prefix} ${detailsText}` : prefix;
- });
-}
diff --git a/src/shared/debug/noopDevConsoleIntegration.js b/src/shared/debug/noopDevConsoleIntegration.js
deleted file mode 100644
index 086fffeb8..000000000
--- a/src/shared/debug/noopDevConsoleIntegration.js
+++ /dev/null
@@ -1,26 +0,0 @@
-export function createNoopDevConsoleIntegration() {
- const runtime = Object.freeze({
- showOverlay() {},
- hideOverlay() {},
- showConsole() {},
- hideConsole() {},
- });
-
- return Object.freeze({
- update() {},
- render() {},
- dispose() {},
- executeCommand() {
- return { status: 'disabled', output: [] };
- },
- getRuntime() {
- return runtime;
- },
- getState() {
- return {
- consoleVisible: false,
- overlayVisible: false,
- };
- },
- });
-}
diff --git a/src/shared/schemas/README.md b/src/shared/schemas/README.md
deleted file mode 100644
index bd1afe5c1..000000000
--- a/src/shared/schemas/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Tool Schemas
-
-JSON schema contracts for tools, samples, and palettes belong here. Workspace Manager V2 uses game manifest validation plus manifest/toolState contract checks instead of a separate Workspace validation contract.
-
-Root-level schema files should not be added.
-
-## Layout
-
-```text
-src/shared/schemas/
- palette.schema.json
- samples
- sample.tool-payload.schema.json
- toolbox/
- <tool>.schema.json
-```
diff --git a/src/shared/schemas/tools/README.md b/src/shared/schemas/tools/README.md
deleted file mode 100644
index 3aa74a489..000000000
--- a/src/shared/schemas/tools/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Tool-Specific Schemas
-
-Each active tool gets one payload schema here.
-
-Examples:
-
-```text
-object-vector-studio-v2.schema.json
-svg-asset-studio.schema.json
-sprite-editor.schema.json
-```
-
-Deprecated historical schemas may remain in this directory for reference, but active workspace manifests should not select them for new tool payload ownership.
-
-Samples should validate against the same schema used by the tool manifest.