Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Rules:

## Current Version/Date

- Project Instructions Version: 2026.06.28.004
- Project Instructions Version: 2026.06.28.005
- Date: 2026-06-28
- Owner: OWNER

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project Instructions Version

Current Project Instructions Version: 2026.06.28.004
Current Project Instructions Version: 2026.06.28.005

Last Updated: 2026-06-28

Expand All @@ -12,6 +12,7 @@ Last Updated: 2026-06-28
- Startup validation now verifies the branching policy document was loaded instead of duplicating policy text.
- Added backlog startup assignment policy requiring `BACKLOG_MASTER.md` and Tool Votes/Admin Owner priority signal review during team startup.
- Added proposed repository layout architecture plan for future `www/`, `api/`, and `dev/` separation.
- Added repository layout scaffold governance for `www/`, `api/`, and `dev/local-runtime/`.
- 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.
15 changes: 9 additions & 6 deletions dev/build/ProjectInstructions/PROJECT_STATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Project State

```yaml
project_state_version: "2026-06-28.PR_26179_OWNER_010"
project_state_version: "2026.06.28.005"
last_updated: "2026-06-28"
current_main_commit: "40de767476d70cadfd1292c916844c2f31b6f185"
repository_status:
Expand All @@ -10,21 +10,22 @@ repository_status:
runtime_database: "Postgres"
creator_metadata: "API to Postgres"
creator_assets: "API to R2"
project_instructions_version: "2026-06-28.PR_26179_OWNER_010"
repository_structure_version: "2026-06-28.PR_26179_OWNER_010"
canonical_layout_version: "2026-06-28.PR_26179_OWNER_010"
project_instructions_version: "2026.06.28.005"
repository_structure_version: "2026.06.28.005"
canonical_layout_version: "2026.06.28.005"
active_teams:
- "Owner"
- "Alfa"
- "Bravo"
- "Charlie"
- "Delta"
- "Golf"
latest_owner_pr: "PR_26179_OWNER_010-canonical-project-folder-instructions"
latest_structure_pr: "PR_26179_OWNER_010-canonical-project-folder-instructions"
latest_owner_pr: "PR_26180_OWNER_005-repository-layout-scaffold"
latest_structure_pr: "PR_26180_OWNER_005-repository-layout-scaffold"
valid_top_level_folders:
- "account/"
- "admin/"
- "api/"
- "assets/"
- "community/"
- "company/"
Expand All @@ -39,10 +40,12 @@ valid_top_level_folders:
- "owner/"
- "src/"
- "toolbox/"
- "www/"
valid_dev_folders:
- "dev/archive/"
- "dev/build/"
- "dev/config/"
- "dev/local-runtime/"
- "dev/reports/"
- "dev/scripts/"
- "dev/templates/"
Expand Down
8 changes: 4 additions & 4 deletions dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ The backlog is the authoritative source for determining the next logical PRs.

- Team: Owner
- Product Area: Repository Architecture Simplification
- Status: Planned
- Percent Complete: 0%
- Active PR: PR_26180_OWNER_004-repository-layout-architecture-plan
- Next Milestone: Architecture plan
- Status: Active
- Percent Complete: 10%
- Active PR: PR_26180_OWNER_005-repository-layout-scaffold
- Next Milestone: Move browser-served application to `www/`
- Source / Reference: `dev/build/ProjectInstructions/repository/repository_layout_architecture_plan.md`

## Game Journey MVP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Establish the canonical repository structure for future development and reduce t
Valid top-level folders:
- account/
- admin/
- api/
- assets/
- community/
- company/
Expand All @@ -23,16 +24,19 @@ Valid top-level folders:
- owner/
- src/
- toolbox/
- www/

Root product and repo sections:
- account/, admin/, community/, company/, learn/, legal/, marketplace/, memberships/, and owner/ are production website sections.
- assets/ contains production website and tool assets.
- api/ is the target Node/API/server application surface for the repository layout simplification workstream.
- docs/ is production Docs & Help content.
- games/ is public game discovery.
- toolbox/ is the Creator toolbox/workspace.
- deploy/ contains deployment configuration.
- dev/ contains the development workspace.
- src/ contains deployable application/runtime/API source.
- www/ is the target browser-served application surface for the repository layout simplification workstream.

Deployable application source:
- src/web/{feature-name}/
Expand All @@ -51,6 +55,7 @@ Valid dev workspace folders:
- dev/archive/
- dev/build/
- dev/config/
- dev/local-runtime/
- dev/reports/
- dev/scripts/
- dev/templates/
Expand All @@ -62,6 +67,7 @@ Dev workspace ownership:
- dev/archive/ owns historical reference material only.
- dev/build/ owns active Project Instructions, architecture, database DDL/DML/seed docs, standards, backlog, PR planning, and governance.
- dev/config/ owns development-only runner and tooling configuration.
- dev/local-runtime/ owns developer-only local runtime bootstrap, team port resolution, local diagnostics, and browser launch orchestration after the migration step that moves those files.
- dev/reports/ owns authoritative Codex reports for the repository. Reports committed to `main` are the official record.
- dev/scripts/ owns development-only scripts and runners.
- dev/templates/ owns reusable development templates.
Expand Down Expand Up @@ -96,6 +102,8 @@ These legacy transition buckets may remain until explicit migration PRs move the
## Rules

- Root is production website and standard repository configuration only.
- www/ is the browser-served application target surface for migration.
- api/ is the Node/API/server application target surface for migration.
- src/ is deployable application/runtime/API code.
- dev/ is development workspace only.
- deploy/ is deployment configuration.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Repository Layout Architecture Plan

Status: Proposed
Status: Active Scaffold
Owner: Owner
Scope: Documentation/governance only

Expand All @@ -10,6 +10,16 @@ Document the proposed repository architecture simplification before any file mov

This plan does not authorize moving files, changing runtime behavior, changing package commands, or mixing feature work into layout migration PRs.

## Current Migration Status

`PR_26180_OWNER_005-repository-layout-scaffold` creates the empty canonical destination shells:

- `www/`
- `api/`
- `dev/local-runtime/`

No browser, API, server, test, script, or runtime files move in the scaffold PR.

## Proposed Future Layout

```text
Expand Down Expand Up @@ -94,38 +104,47 @@ Rules:
- Each migration PR must update references, validation, reports, and ZIP artifacts for only its scoped move.
- Each migration PR must include rollback notes or clear validation evidence.

## Proposed Stacked PR Sequence
## Active Stacked PR Sequence

1. `www/` shell and governance
- Create the destination shell and document browser-served ownership.
- Do not move product pages yet.
1. `PR_26180_OWNER_005-repository-layout-scaffold`
- Create `www/`, `api/`, and `dev/local-runtime/` shells.
- Update architecture docs and backlog status only.

2. `api/` shell and governance
- Create the destination shell and document API/server ownership.
- Do not move API/runtime implementation yet.
2. `PR_26180_OWNER_006-move-www-application`
- Move browser-served application files into `www/`.
- Include root HTML pages, `assets/`, `toolbox/`, `account/`, `legal/`, `learn/`, `play/`, and other browser-served static routes.
- Update internal static references only as needed.
- Do not move API/server files.

3. Browser-served public section moves
- Move root browser-served product sections into `www/` in small groups.
- Preserve routes through compatibility redirects or server/static configuration as needed.
3. `PR_26180_OWNER_007-move-api-application`
- Move server/API application files into `api/`.
- Include Local API server runtime files, API routes, services, database, storage, auth, publishing, and admin server code.
- Do not move developer-only startup orchestration.
- Browser code must not import from `api/`.

4. Browser asset moves
- Move browser assets into `www/` ownership.
- Preserve asset URLs or update references in the same PR.
4. `PR_26180_OWNER_008-move-dev-local-runtime`
- Move developer-only local runtime into `dev/local-runtime/`.
- Include team-aware bootstrap, port config, local startup orchestration, local diagnostics, and browser launch support.
- Update `package.json` commands to point to the new local-runtime paths.

5. API/server moves
- Move Node/API/server entry points and service code into `api/`.
- Preserve API contract shape and route behavior.
5. `PR_26180_OWNER_009-move-tests-and-validation`
- Ensure all tests and validation suites live under `dev/tests/` or the current canonical dev test structure.
- Update test paths after the `www/`, `api/`, and `dev/` migrations.
- Do not change behavior.

6. Runtime/shared source boundary cleanup
- Move deployable browser/runtime/API modules into `www/` or `api/` ownership as appropriate.
- Keep shared runtime dependency direction explicit.
6. `PR_26180_OWNER_010-update-ci-and-scripts`
- Update CI, package scripts, validation scripts, and developer utilities for the new layout.
- Preserve `npm run dev:bootstrap`, `npm run dev:api`, `npm run dev:web`, and `npm run dev:local-api`.

7. Developer bootstrap and validation updates
- Update local developer bootstrap and validation paths after deployable surfaces are moved.
- Keep `dev/` developer-only.
7. `PR_26180_OWNER_011-remove-legacy-layout`
- Remove or retire obsolete legacy paths after all references are updated.
- Hard stop if any runtime, test, or CI reference still points to old locations.

8. Legacy path cleanup
- Remove or archive obsolete empty folders and compatibility shims only after validation proves they are unused.
8. `PR_26180_OWNER_012-final-layout-validation`
- Validate final repository layout.
- Confirm `www/` owns the browser-served app, `api/` owns the server app, and `dev/` owns the developer workspace.
- Confirm runtime does not depend on `dev/`, browser code does not import `api/`, and legacy references are removed or documented.
- Mark Repository Architecture Simplification complete in `BACKLOG_MASTER.md`.

## Hard Rules

Expand All @@ -148,4 +167,3 @@ npm run validate:canonical-structure
```

Additional targeted validation must match the moved surface.

1 change: 1 addition & 0 deletions dev/local-runtime/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PR_26180_OWNER_005-repository-layout-scaffold Branch Validation

| Check | Result | Notes |
| --- | --- | --- |
| Startup validation completed | PASS | Project Instructions v2026.06.28.004 loaded before branch creation; PR updates version to v2026.06.28.005. |
| Current branch | PASS | `PR_26180_OWNER_005-repository-layout-scaffold` |
| Expected stacked base | PASS | Created from `PR_26180_OWNER_004-repository-layout-architecture-plan`. |
| Worktree clean before edits | PASS | Branch started with no modified files. |
| PR model | PASS | Owner stacked PR under Repository Architecture Simplification. |
| Previous dependency documented | PASS | `PR_26180_OWNER_004-repository-layout-architecture-plan` |
| Next dependency documented | PASS | `PR_26180_OWNER_006-move-www-application` |
| Runtime/API/UI/database scope | PASS | No implementation files changed. |

Starting HEAD: `906a0970acd4e3f896cde02a0cc1a593c3122cd9`
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# PR_26180_OWNER_005-repository-layout-scaffold Manual Validation Notes

- Confirmed new scaffold directories are tracked only by `.gitkeep` files.
- Confirmed no browser pages, assets, API/server code, scripts, tests, or package commands moved in this PR.
- Confirmed the active stacked PR sequence is documented in the repository layout architecture plan.
- Confirmed BACKLOG_MASTER.md now identifies PR005 as the active Repository Architecture Simplification milestone.
- No Product Owner UI validation is required for this scaffold/governance-only step.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# PR_26180_OWNER_005-repository-layout-scaffold Report

## Executive Summary

PASS - Created the initial repository layout scaffold for the Repository Architecture Simplification workstream. The PR adds empty tracked shells for `www/`, `api/`, and `dev/local-runtime/` and updates Project Instructions, canonical structure, project state, architecture plan status, and BACKLOG_MASTER status only.

No browser-served application files, API/server files, tests, scripts, runtime code, UI pages, database files, or package commands were moved or changed.

## Stack Metadata

- Workstream: Repository Architecture Simplification
- PR model: Stacked PR
- Stack step: 1 of 8 after baseline architecture plan
- Previous dependency: `PR_26180_OWNER_004-repository-layout-architecture-plan`
- Current PR: `PR_26180_OWNER_005-repository-layout-scaffold`
- Next dependency: `PR_26180_OWNER_006-move-www-application`
- Base branch for GitHub PR: `PR_26180_OWNER_004-repository-layout-architecture-plan`
- Source branch: `PR_26180_OWNER_005-repository-layout-scaffold`

## Scope

- Added `www/.gitkeep`.
- Added `api/.gitkeep`.
- Added `dev/local-runtime/.gitkeep`.
- Updated canonical repository structure governance to recognize the new scaffold destinations.
- Updated Project Instructions version from `2026.06.28.004` to `2026.06.28.005`.
- Updated repository layout architecture plan with the active stacked PR sequence.
- Updated BACKLOG_MASTER.md to mark Repository Architecture Simplification active at 10%.

## Baseline Observation

GitHub reported baseline PR #283 as open draft and conflicting against `main` at the time this stacked branch was created. This PR is still correctly stacked on the baseline branch named by Owner direction. The baseline must be resolved before this stack can merge into `main`.

## Runtime Impact

None. This is a scaffold/governance-only PR and does not move application files or alter commands.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PR_26180_OWNER_005-repository-layout-scaffold Requirement Checklist

| Requirement | Result | Evidence |
| --- | --- | --- |
| Use stacked PRs | PASS | Branch created from `PR_26180_OWNER_004-repository-layout-architecture-plan`, not from unrelated work. |
| No feature work | PASS | Scaffold and governance/status updates only. |
| No behavior changes unless required by path migration | PASS | No behavior changes. |
| Keep PR focused on one migration step | PASS | Only layout scaffold destinations were added. |
| Preserve startup validation | PASS | Project Instructions startup contract retained. |
| Preserve Project Instructions versioning | PASS | Version incremented to `2026.06.28.005`. |
| Update BACKLOG_MASTER.md status | PASS | Repository Architecture Simplification set to Active, 10%, current PR005. |
| Reports under dev/reports | PASS | Required reports generated in `dev/reports/`. |
| ZIP under dev/workspace/zips | PASS | ZIP generated as `dev/workspace/zips/PR_26180_OWNER_005-repository-layout-scaffold_delta.zip`. |
| Create www/ shell | PASS | `www/.gitkeep`. |
| Create api/ shell | PASS | `api/.gitkeep`. |
| Create dev/local-runtime/ shell | PASS | `dev/local-runtime/.gitkeep`. |
| Do not move application files | PASS | No application files moved. |
| Update architecture docs/status only | PASS | Canonical structure, layout plan, project state, version, and backlog updated. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PR_26180_OWNER_005-repository-layout-scaffold Validation Report

| Validation | Result | Notes |
| --- | --- | --- |
| git diff --check | PASS | No whitespace errors. |
| npm run validate:canonical-structure | PASS | Blocking violations: 0; approved legacy exceptions: 501. |
| Targeted impacted tests | PASS | Not impacted; scaffold/governance-only PR with no runtime file moves. |
| Playwright | PASS | Not required; no browser-served files or UI routing changed. |
| Runtime/API/UI/database changes | PASS | None detected. |

## Commands Run

```text
git diff --check
npm run validate:canonical-structure
```
39 changes: 15 additions & 24 deletions dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
# git diff --name-status merge-base(origin/main, HEAD)..working-tree
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
M dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
M dev/reports/codex_changed_files.txt
M dev/reports/codex_review.diff

# git ls-files --others --exclude-standard
api/.gitkeep
dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
dev/build/ProjectInstructions/PROJECT_STATE.md
dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
dev/build/ProjectInstructions/repository/canonical_repository_structure.md
dev/build/ProjectInstructions/repository/repository_layout_architecture_plan.md
dev/reports/PR_26180_OWNER_004-repository-layout-architecture-plan_branch-validation.md
dev/reports/PR_26180_OWNER_004-repository-layout-architecture-plan_manual-validation-notes.md
dev/reports/PR_26180_OWNER_004-repository-layout-architecture-plan_report.md
dev/reports/PR_26180_OWNER_004-repository-layout-architecture-plan_requirement-checklist.md
dev/reports/PR_26180_OWNER_004-repository-layout-architecture-plan_validation-report.md

# git diff --stat merge-base(origin/main, HEAD)..working-tree
.../ProjectInstructions/PROJECT_INSTRUCTIONS.md | 3 +-
.../PROJECT_INSTRUCTIONS_VERSION.md | 3 +-
.../ProjectInstructions/backlog/BACKLOG_MASTER.md | 12 +
dev/reports/codex_changed_files.txt | 46 +-
dev/reports/codex_review.diff | 1085 +++++++-------------
5 files changed, 430 insertions(+), 719 deletions(-)

# merge-base
b3a2b30f51a1050596bbad2d7db211e1cba45b66
dev/local-runtime/.gitkeep
dev/reports/PR_26180_OWNER_005-repository-layout-scaffold_branch-validation.md
dev/reports/PR_26180_OWNER_005-repository-layout-scaffold_manual-validation-notes.md
dev/reports/PR_26180_OWNER_005-repository-layout-scaffold_report.md
dev/reports/PR_26180_OWNER_005-repository-layout-scaffold_requirement-checklist.md
dev/reports/PR_26180_OWNER_005-repository-layout-scaffold_validation-report.md
dev/reports/codex_changed_files.txt
dev/reports/codex_review.diff
www/.gitkeep
Loading
Loading