Skip to content

Commit 7a8f079

Browse files
committed
Add www route root compatibility
1 parent d103c92 commit 7a8f079

18 files changed

Lines changed: 414 additions & 98 deletions

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.006
120+
- Project Instructions Version: 2026.06.28.007
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.006
3+
Current Project Instructions Version: 2026.06.28.007
44

55
Last Updated: 2026-06-28
66

@@ -14,6 +14,7 @@ Last Updated: 2026-06-28
1414
- Added proposed repository layout architecture plan for future `www/`, `api/`, and `dev/` separation.
1515
- Added repository layout scaffold governance for `www/`, `api/`, and `dev/local-runtime/`.
1616
- Added `www/` migration map for safe browser-served application movement planning.
17+
- Added local route-root compatibility toggle documentation for future `www/` activation.
1718
- Codex must read this version file and the latest repository copy of `PROJECT_INSTRUCTIONS.md` before performing work.
1819
- Codex must discard previously remembered Project Instructions and treat the repository copy as authoritative.
1920
- 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: 6 additions & 6 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.006"
4+
project_state_version: "2026.06.28.007"
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.006"
14-
repository_structure_version: "2026.06.28.006"
15-
canonical_layout_version: "2026.06.28.006"
13+
project_instructions_version: "2026.06.28.007"
14+
repository_structure_version: "2026.06.28.007"
15+
canonical_layout_version: "2026.06.28.007"
1616
active_teams:
1717
- "Owner"
1818
- "Alfa"
1919
- "Bravo"
2020
- "Charlie"
2121
- "Delta"
2222
- "Golf"
23-
latest_owner_pr: "PR_26180_OWNER_006-www-migration-map"
24-
latest_structure_pr: "PR_26180_OWNER_006-www-migration-map"
23+
latest_owner_pr: "PR_26180_OWNER_007-www-route-root-compatibility"
24+
latest_structure_pr: "PR_26180_OWNER_007-www-route-root-compatibility"
2525
valid_top_level_folders:
2626
- "account/"
2727
- "admin/"

dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ The backlog is the authoritative source for determining the next logical PRs.
3939
- Team: Owner
4040
- Product Area: Repository Architecture Simplification
4141
- Status: Active
42-
- Percent Complete: 15%
43-
- Active PR: PR_26180_OWNER_006-www-migration-map
42+
- Percent Complete: 20%
43+
- Active PR: PR_26180_OWNER_007-www-route-root-compatibility
4444
- Next Milestone: Move browser-served application to `www/`
4545
- Source / Reference: `dev/build/ProjectInstructions/repository/repository_layout_architecture_plan.md`; `dev/build/ProjectInstructions/repository/www_migration_map.md`
4646

dev/build/ProjectInstructions/repository/www_migration_map.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ Recommended approach for the actual move PR:
170170
5. Do not introduce browser redirects unless a static route cannot be served directly.
171171
6. Document every temporary shim with removal criteria for the legacy-layout cleanup PR.
172172

173+
## Route Root Compatibility Toggle
174+
175+
`PR_26180_OWNER_007-www-route-root-compatibility` installs the local compatibility switch without moving browser files.
176+
177+
The future activation toggle is:
178+
179+
```text
180+
GAMEFOUNDRY_LOCAL_WEB_ROOT=www
181+
```
182+
183+
Default behavior remains current repository-root static serving when `GAMEFOUNDRY_LOCAL_WEB_ROOT` is unset, empty, `.`, `root`, or `repo-root`.
184+
185+
When `GAMEFOUNDRY_LOCAL_WEB_ROOT=www`, local static serving prefers `www/` for public browser URLs while retaining repository-root fallback for compatibility during migration.
186+
187+
This toggle is for local runtime and test helpers only. It does not change production deployment, public URLs, API routes, or package commands.
188+
173189
## Required Sequence For Safe www Move
174190

175191
1. Freeze the public route contract.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PR_26180_OWNER_007 Branch Validation
2+
3+
## Result
4+
5+
PASS
6+
7+
## Checks
8+
9+
| Check | Result |
10+
|---|---|
11+
| Current branch is `PR_26180_OWNER_007-www-route-root-compatibility` | PASS |
12+
| Branch is stacked on `PR_26180_OWNER_006-www-migration-map` | PASS |
13+
| Startup validation completed | PASS |
14+
| Project Instructions version loaded | PASS: `2026.06.28.007` |
15+
| `PROJECT_BRANCHING_POLICY.md` loaded | PASS |
16+
| `BACKLOG_MASTER.md` loaded | PASS |
17+
| No browser-served files moved | PASS |
18+
| Reports path uses `dev/reports/` | PASS |
19+
| ZIP path uses `dev/workspace/zips/` | PASS |
20+
21+
## Notes
22+
23+
This is a stacked Owner PR based on `PR_26180_OWNER_006-www-migration-map`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26180_OWNER_007 Manual Validation Notes
2+
3+
## Manual Review
4+
5+
- Confirmed no browser-served files were moved.
6+
- Confirmed public URLs remain unchanged.
7+
- Confirmed the future web-root activation toggle is documented as `GAMEFOUNDRY_LOCAL_WEB_ROOT=www`.
8+
- Confirmed the default remains repository-root static serving until the actual `www/` move PR.
9+
- Confirmed route-root compatibility work is limited to local static serving and test helper support.
10+
11+
## Manual Test Guidance
12+
13+
After applying this PR, Owner can test:
14+
15+
1. Start the current local development flow with no web-root override.
16+
2. Open `/index.html`, `/toolbox/index.html`, and an `/assets/...` URL.
17+
3. Confirm the routes continue to load from the current repository-root layout.
18+
4. In a future migration branch, set `GAMEFOUNDRY_LOCAL_WEB_ROOT=www` after browser files are moved and confirm the same public URLs load from `www/`.
19+
20+
## Runtime Scope
21+
22+
No UI, API, database, or product behavior changes are expected from this PR.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# PR_26180_OWNER_007-www-route-root-compatibility Report
2+
3+
## Executive Summary
4+
5+
PASS. This PR prepares local static route-root compatibility for the future `www/` migration without moving browser-served files or changing public URLs.
6+
7+
The implementation adds a shared local static route resolver that can prefer a configurable web root while preserving the current repository-root serving default. The documented future toggle is:
8+
9+
```text
10+
GAMEFOUNDRY_LOCAL_WEB_ROOT=www
11+
```
12+
13+
Default behavior remains current root serving when the variable is unset, empty, `.`, `root`, or `repo-root`.
14+
15+
## Source Plan
16+
17+
Used `dev/build/ProjectInstructions/repository/www_migration_map.md` as the source plan. The map now documents the route-root compatibility toggle and the default/future behavior split.
18+
19+
## Changed Files
20+
21+
- `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md`
22+
- `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md`
23+
- `dev/build/ProjectInstructions/PROJECT_STATE.md`
24+
- `dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md`
25+
- `dev/build/ProjectInstructions/repository/www_migration_map.md`
26+
- `dev/scripts/start-dev.mjs`
27+
- `dev/tests/dev-runtime/StaticWebRootCompatibility.test.mjs`
28+
- `dev/tests/helpers/playwrightRepoServer.mjs`
29+
- `dev/tests/playwright/tools/StaticWebRootCompatibility.spec.mjs`
30+
- `src/dev-runtime/server/local-api-server.mjs`
31+
- `src/dev-runtime/server/static-web-root.mjs`
32+
33+
## Implementation Notes
34+
35+
- Added `src/dev-runtime/server/static-web-root.mjs` for shared local static route resolution.
36+
- Updated the local dev web server, Local API static fallback, and Playwright repo server helper to use the shared resolver.
37+
- Added configurable `webRoot` support for test helpers and local server internals.
38+
- Preserved public route URLs including `/index.html`, `/toolbox/index.html`, `/assets/...`, `/account/...`, `/admin/...`, and `/games/...`.
39+
- Preserved compatibility alias behavior such as `/tools/...` resolving to `/toolbox/...`.
40+
- Kept repository-root serving as the default until the actual `www/` move PR.
41+
- No browser-served files were moved.
42+
- No public URL changes were introduced.
43+
- No API/server architecture changes were introduced.
44+
45+
## Owner Recommendation
46+
47+
Ready for review as the route-root compatibility preparation step before moving browser-served files into `www/`.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PR_26180_OWNER_007 Requirement Checklist
2+
3+
| Requirement | Result | Evidence |
4+
|---|---|---|
5+
| Use `www_migration_map.md` as source plan | PASS | Updated `dev/build/ProjectInstructions/repository/www_migration_map.md` with the compatibility toggle. |
6+
| Preserve `/index.html` | PASS | Covered by Node and Playwright route-root tests. |
7+
| Preserve `/toolbox/index.html` | PASS | Covered by Node and Playwright route-root tests. |
8+
| Preserve `/assets/...` | PASS | Covered by Node and Playwright route-root tests. |
9+
| Preserve `/account/...` | PASS | Covered by Node route normalization test. |
10+
| Preserve `/admin/...` | PASS | Covered by Node route normalization test. |
11+
| Preserve `/games/...` | PASS | Covered by Node route normalization test. |
12+
| Add configurable web root support | PASS | Added shared `resolveLocalWebRoot` / `resolveStaticRouteTarget` helper. |
13+
| Default remains current root serving | PASS | Default local web root is repository root. |
14+
| Document future toggle | PASS | Documented `GAMEFOUNDRY_LOCAL_WEB_ROOT=www`. |
15+
| Update targeted tests if needed | PASS | Added Node and Playwright route-root compatibility tests. |
16+
| No browser files moved | PASS | No root HTML/pages/assets/toolbox files moved. |
17+
| No public URL changes | PASS | URLs remain unchanged; only filesystem lookup is configurable. |
18+
| No API/server architecture change | PASS | Local static resolution was shared; API architecture was not changed. |
19+
| No product behavior change | PASS | Default local behavior remains root serving. |
20+
21+
## Scope Result
22+
23+
PASS. Changes are limited to route-root compatibility, tests/helpers, and governance/status documentation.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PR_26180_OWNER_007 Validation Report
2+
3+
## Required Validation
4+
5+
| Command | Result |
6+
|---|---|
7+
| `node --check src/dev-runtime/server/static-web-root.mjs` | PASS |
8+
| `node --check dev/scripts/start-dev.mjs` | PASS |
9+
| `node --check src/dev-runtime/server/local-api-server.mjs` | PASS |
10+
| `node --check dev/tests/helpers/playwrightRepoServer.mjs` | PASS |
11+
| `node --check dev/tests/dev-runtime/StaticWebRootCompatibility.test.mjs` | PASS |
12+
| `node --check dev/tests/playwright/tools/StaticWebRootCompatibility.spec.mjs` | PASS |
13+
| `node ./dev/scripts/run-node-test-files.mjs dev/tests/dev-runtime/StaticWebRootCompatibility.test.mjs` | PASS |
14+
| `npx playwright test dev/tests/playwright/tools/StaticWebRootCompatibility.spec.mjs --reporter=line` | PASS: 2/2 |
15+
| `git diff --check` | PASS |
16+
| `npm run validate:canonical-structure` | PASS |
17+
18+
## Notes
19+
20+
An exploratory broader Playwright route/navigation smoke was also attempted with `dev/tests/playwright/tools/ToolNavigationPrevNext.spec.mjs`. Two route-opening tests passed; one registry coverage assertion failed on a non-scope "Registry entry missing for Sprites" condition. The required focused route-root compatibility lane passed and no registry changes are included in this PR.
21+
22+
## Result
23+
24+
PASS

0 commit comments

Comments
 (0)