Skip to content

Commit b424f29

Browse files
committed
Move browser-owned src files into www
1 parent f4be737 commit b424f29

739 files changed

Lines changed: 11318 additions & 1926 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/API_RUNTIME_BOUNDARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ It is intentionally not `dev/tests/dev-runtime`:
1111
Deployment boundary:
1212

1313
- DEV validation may execute `api/` through local server commands.
14-
- Browser pages, Theme V2 scripts, toolbox pages, and `src/engine` runtime code must use declared API/service contracts instead of importing `api/` directly.
14+
- Browser pages, Theme V2 scripts, toolbox pages, and `www/src/engine` runtime code must use declared API/service contracts instead of importing `api/` directly.
1515
- If a dev-only adapter is needed by a browser page, expose it through the Local API contract while keeping the implementation under `api/`.
1616
- Developer-only local bootstrap/orchestration remains outside `api/` until the scoped `dev/local-runtime/` migration PR.

api/admin/admin-notes-menu.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const ADMIN_NOTES_LOCAL_MENU_LABEL = "Notes";
66
export const ADMIN_MY_STUFF_MENU_LABEL = "My Stuff";
77

88
const HEADER_PARTIAL_PATH = "www/assets/theme-v2/partials/header-nav.html";
9-
const LOCAL_HEADER_PARTIAL_PATH = "src/dev-runtime/admin/header-nav.local.html";
9+
const LOCAL_HEADER_PARTIAL_PATH = "www/src/dev-runtime/admin/header-nav.local.html";
1010

1111
function repoRelativePath(repoRoot, targetPath) {
1212
return path.relative(repoRoot, targetPath).replaceAll(path.sep, "/");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "../../src/shared/toolbox/tool-metadata-inventory.js";
1+
export * from "../../www/src/shared/toolbox/tool-metadata-inventory.js";

api/server/local-api-router.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ import {
133133
import {
134134
getAdminNavigationItems,
135135
getOwnerNavigationItems,
136-
} from "../../src/api/admin-owner-navigation.js";
136+
} from "../../www/src/api/admin-owner-navigation.js";
137137
import { createPaletteSourceMockDbRows } from "../guest-seeds/palette-source-mock-db.js";
138138
import {
139139
SUPABASE_AUTH_PROVIDER_ID,
@@ -6929,8 +6929,8 @@ SELECT pg_database_size(current_database()) AS database_size_bytes,
69296929
adminMainItems: getAdminNavigationItems(),
69306930
ownerMenuItems: getOwnerNavigationItems(),
69316931
ownership: {
6932-
adminMainItems: "src/api/admin-owner-navigation.js",
6933-
ownerMenuItems: "src/api/admin-owner-navigation.js",
6932+
adminMainItems: "www/src/api/admin-owner-navigation.js",
6933+
ownerMenuItems: "www/src/api/admin-owner-navigation.js",
69346934
routeMap: "static shell route resolution",
69356935
},
69366936
source: "server-api",

dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Rules:
117117

118118
## Current Version/Date
119119

120-
- Project Instructions Version: 2026.06.28.017
120+
- Project Instructions Version: 2026.06.28.018
121121
- Date: 2026-06-28
122122
- Owner: OWNER
123123

dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Project Instructions Version
22

3-
Current Project Instructions Version: 2026.06.28.017
3+
Current Project Instructions Version: 2026.06.28.018
44

55
Last Updated: 2026-06-28
66

@@ -25,6 +25,7 @@ Last Updated: 2026-06-28
2525
- Added root leftover audit and `src/` transition plan for the final repository layout cleanup stage.
2626
- Removed safe empty local root directory shells and documented blocked local-only `assets/` cleanup.
2727
- Removed the local demo `.gfsp` artifact and recorded a file-by-file `src/` destination audit for future scoped migrations.
28+
- Moved PR017-audited browser/www-owned legacy `src/` files into `www/src/` while preserving public `/src/...` browser route compatibility under the `www` web root.
2829
- Codex must read this version file and the latest repository copy of `PROJECT_INSTRUCTIONS.md` before performing work.
2930
- Codex must discard previously remembered Project Instructions and treat the repository copy as authoritative.
3031
- Codex must validate canonical report and ZIP paths, branching model, and legacy path avoidance before work proceeds.

dev/build/ProjectInstructions/PROJECT_STATE.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Project State
22

33
```yaml
4-
project_state_version: "2026.06.28.017"
4+
project_state_version: "2026.06.28.018"
55
last_updated: "2026-06-28"
66
current_main_commit: "40de767476d70cadfd1292c916844c2f31b6f185"
77
repository_status:
@@ -10,18 +10,18 @@ repository_status:
1010
runtime_database: "Postgres"
1111
creator_metadata: "API to Postgres"
1212
creator_assets: "API to R2"
13-
project_instructions_version: "2026.06.28.017"
14-
repository_structure_version: "2026.06.28.017"
15-
canonical_layout_version: "2026.06.28.017"
13+
project_instructions_version: "2026.06.28.018"
14+
repository_structure_version: "2026.06.28.018"
15+
canonical_layout_version: "2026.06.28.018"
1616
active_teams:
1717
- "Owner"
1818
- "Alfa"
1919
- "Bravo"
2020
- "Charlie"
2121
- "Delta"
2222
- "Golf"
23-
latest_owner_pr: "PR_26180_OWNER_017-src-dissection-and-demo-cleanup"
24-
latest_structure_pr: "PR_26180_OWNER_017-src-dissection-and-demo-cleanup"
23+
latest_owner_pr: "PR_26180_OWNER_018-move-src-browser-to-www"
24+
latest_structure_pr: "PR_26180_OWNER_018-move-src-browser-to-www"
2525
valid_top_level_folders:
2626
- "api/"
2727
- "deploy/"
@@ -40,7 +40,8 @@ valid_dev_folders:
4040
- "dev/tools/"
4141
- "dev/workspace/"
4242
known_technical_debt:
43-
- "Browser API client modules remain under src/api/ until the final src layer migration moves them into src/web/ or src/runtime/."
44-
- "src/dev-runtime/admin/ remains as a legacy Admin Notes browser-viewer compatibility path until a scoped browser admin migration retires it."
43+
- "API/server-owned contracts, schemas, and project data store modules remain under src/shared/ until PR_26180_OWNER_019 moves them to api/."
44+
- "Developer/source reference files remain under src/ until PR_26180_OWNER_020 moves them to dev/."
45+
- "src/dev-runtime/admin/.gitkeep remains as a placeholder until PR_26180_OWNER_021 retires the empty root src folder."
4546
- "repository_directory_standard.md and codex_project_instructions_startup.md are superseded pointers retained for compatibility."
4647
```

dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ The backlog is the authoritative source for determining the next logical PRs.
4040
- Product Area: Repository Architecture Simplification
4141
- Status: Active
4242
- Percent Complete: 99%
43-
- Active PR: PR_26180_OWNER_017-src-dissection-and-demo-cleanup
44-
- Next Milestone: Final layout validation and completion report
43+
- Active PR: PR_26180_OWNER_018-move-src-browser-to-www
44+
- Next Milestone: Move API/server-owned source to api/
4545
- Source / Reference: `dev/build/ProjectInstructions/repository/repository_layout_architecture_plan.md`; `dev/build/ProjectInstructions/repository/www_migration_map.md`
4646

4747
## Game Journey MVP

dev/build/ProjectInstructions/repository/canonical_repository_structure.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Valid top-level folders:
1414
- www/
1515

1616
Root product and repo sections:
17-
- www/ owns browser-served production website sections, Creator toolbox pages, public game discovery, production Docs & Help, and browser assets.
17+
- www/ owns browser-served production website sections, Creator toolbox pages, public game discovery, production Docs & Help, browser assets, and browser-owned runtime/client modules under `www/src/`.
1818
- api/ is the Node/API/server application surface for server entry points, API routing, API services, database access, storage access, auth, setup, publishing, and admin server logic.
1919
- deploy/ contains deployment configuration.
2020
- dev/ contains the development workspace.
@@ -26,14 +26,14 @@ Deployable application source:
2626
- src/api-runtime/{feature-name}/
2727
- src/runtime/{feature-name}/
2828

29-
Final src layer ownership:
30-
- src/web/ owns browser-facing deployable application modules used by public pages, account/admin surfaces, and Creator tools.
31-
- src/api-runtime/ owns deployable API/runtime service modules that back the shared Browser -> API -> Postgres/R2 contract.
32-
- src/runtime/ owns deployable game, tool, engine, and shared runtime capabilities.
33-
- Existing top-level src/advanced/, src/api/, src/engine/, src/shared/, and src/tools/ directories are legacy transition buckets until explicit migration PRs move them.
29+
Final source ownership after the repository layout simplification:
30+
- `www/src/` owns browser-facing deployable application modules used by public pages, account/admin surfaces, Creator tools, game runtime, shared browser utilities, and browser API clients.
31+
- `api/` owns deployable API/runtime service modules that back the shared Browser -> API -> Postgres/R2 contract.
32+
- `dev/` owns developer-only source, scripts, tests, reports, local runtime orchestration, and reference material.
33+
- Existing root `src/shared/contracts/`, `src/shared/schemas/`, `src/shared/projectDataStore/`, and source-reference files are legacy transition buckets until explicit migration PRs move them.
3434
- Browser API clients remain outside `api/`; browser-served code must use API/service contracts instead of importing top-level `api/` files directly.
35-
- `src/dev-runtime/admin/` remains only as a legacy Admin Notes browser-viewer compatibility path until a scoped browser admin migration retires it.
36-
- Do not add new top-level src/ layer names outside src/web/, src/api-runtime/, or src/runtime/ without OWNER approval.
35+
- `www/src/dev-runtime/admin/` preserves the public `/src/dev-runtime/admin/...` Admin Notes browser-viewer compatibility route under the `www` web root.
36+
- Do not add new root `src/` layer names or new root `src/` work without OWNER approval.
3737
- Do not use team names in runtime source filenames.
3838

3939
Valid dev workspace folders:
@@ -60,6 +60,9 @@ Dev workspace ownership:
6060
- dev/tools/ owns development-only tooling.
6161
- dev/workspace/ owns generated output: tmp, zips, logs, generated files, and test-results.
6262

63+
Browser-served runtime/client source:
64+
- www/src/
65+
6366
Browser-served tools:
6467
- www/toolbox/{tool-name}/index.html
6568

@@ -75,14 +78,18 @@ Shared JavaScript:
7578
- www/assets/js/shared/
7679

7780
Legacy transition buckets:
78-
- src/advanced/
79-
- src/api/
80-
- src/engine/
81-
- src/shared/
82-
- src/tools/
83-
- src/dev-runtime/admin/
84-
85-
These legacy transition buckets may remain until explicit migration PRs move them into `src/web/`, `src/api-runtime/`, or `src/runtime/`.
81+
- www/src/advanced/
82+
- www/src/api/
83+
- www/src/engine/
84+
- www/src/shared/
85+
- www/src/tools/
86+
- www/src/dev-runtime/admin/
87+
- src/shared/contracts/
88+
- src/shared/schemas/
89+
- src/shared/projectDataStore/
90+
- src/dev-runtime/admin/.gitkeep
91+
92+
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/`.
8693

8794
## Rules
8895

@@ -102,7 +109,8 @@ These legacy transition buckets may remain until explicit migration PRs move the
102109
- Do not create new folders unless they fit the documented canonical structure.
103110
- If a requested or generated path does not clearly fit the canonical structure, Codex must HARD STOP and report the proposed path.
104111
- New development follows the canonical structure.
105-
- New deployable `src/` work follows `src/web/`, `src/api-runtime/`, or `src/runtime/`.
112+
- New browser-owned source belongs under `www/` according to the browser source and asset rules above.
113+
- New API/server source belongs under `api/`.
106114
- New non-deployable work belongs under `dev/`.
107115
- Required reports belong under flat `dev/reports/`.
108116
- Required ZIPs belong under `dev/workspace/zips/`; generated temporary artifacts belong under `dev/workspace/tmp/`.

dev/build/ProjectInstructions/repository/www_migration_map.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# www Migration Map
22

3-
Status: Implemented migration map
3+
Status: Implemented migration map and browser source migration
44
Owner: Owner
55
Workstream: Repository Architecture Simplification
6-
PR: PR_26180_OWNER_006-www-migration-map; PR_26180_OWNER_008-move-www-application
6+
PR: PR_26180_OWNER_006-www-migration-map; PR_26180_OWNER_008-move-www-application; PR_26180_OWNER_018-move-src-browser-to-www
77

88
## Purpose
99

@@ -15,9 +15,11 @@ This map began as a no-runtime-change governance artifact. `PR_26180_OWNER_008-m
1515

1616
The browser-served application now lives under `www/`.
1717

18+
PR_26180_OWNER_018 moved the PR017-audited browser/www-owned legacy `src/` files into `www/src/`.
19+
1820
Current local runtime, test helpers, and browser pages keep URLs such as `/index.html`, `/toolbox/index.html`, `/assets/theme-v2/css/theme.css`, `/account/sign-in.html`, `/admin/system-health.html`, and `/games/index.html` while resolving browser-served files from `www/`.
1921

20-
The move preserved public route URLs while changing the filesystem lookup root. Repository-root fallback remains available for transition-only compatibility, including browser imports that still reference root-level `src/`.
22+
The move preserved public route URLs while changing the filesystem lookup root. Browser imports that use `/src/...` or relative paths resolving to `/src/...` now resolve under `www/src/` when `www/` is the served web root.
2123

2224
## Current Browser-Served Surface
2325

@@ -54,7 +56,7 @@ Broad active-reference search across browser roots, `src/`, `dev/scripts/`, and
5456
| `legal/` | 13 | Footer/navigation route references and page links. |
5557
| `learn/` | 9 | Learn route links and navigation. |
5658
| `play/` | 7 | No root folder exists; review references manually before introducing a route. |
57-
| `src/` | 451 | Browser imports, server imports, tests, validation aliases, and current runtime/source modules. |
59+
| `src/` | 451 | Browser imports, server imports, tests, validation aliases, and legacy runtime/source modules before the browser-owned subset moved to `www/src/`. |
5860

5961
The high `src/` count means the browser migration cannot be treated as static files only. Several browser-facing pages import modules from root-level `src/`, including account/admin/toolbox flows.
6062

@@ -103,7 +105,7 @@ Examples of current references that depend on root-level path relationships:
103105
- `toolbox/toolRegistry.js` imports from `../src/shared/toolbox/tool-metadata-inventory.js`.
104106
- `assets/toolbox/*/js/index.js` imports from `../../../../src/` or `../../../../toolbox/` in several tool flows.
105107

106-
These references can be preserved temporarily by serving compatibility paths from the repository root, but the final architecture should move browser-facing runtime modules into `www/` or an approved deployable browser module surface.
108+
These references are preserved by serving the browser-owned source modules from `www/src/` while keeping public `/src/...` URL compatibility.
107109

108110
## Current Local Web Server Root Behavior
109111

0 commit comments

Comments
 (0)