Skip to content
Open
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
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.018
- Project Instructions Version: 2026.06.28.019
- 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.018
Current Project Instructions Version: 2026.06.28.019

Last Updated: 2026-06-28

Expand All @@ -26,6 +26,7 @@ Last Updated: 2026-06-28
- Removed safe empty local root directory shells and documented blocked local-only `assets/` cleanup.
- 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.
- 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.
14 changes: 7 additions & 7 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.018"
project_state_version: "2026.06.28.019"
last_updated: "2026-06-28"
current_main_commit: "40de767476d70cadfd1292c916844c2f31b6f185"
repository_status:
Expand All @@ -10,18 +10,18 @@ repository_status:
runtime_database: "Postgres"
creator_metadata: "API to Postgres"
creator_assets: "API to R2"
project_instructions_version: "2026.06.28.018"
repository_structure_version: "2026.06.28.018"
canonical_layout_version: "2026.06.28.018"
project_instructions_version: "2026.06.28.019"
repository_structure_version: "2026.06.28.019"
canonical_layout_version: "2026.06.28.019"
active_teams:
- "Owner"
- "Alfa"
- "Bravo"
- "Charlie"
- "Delta"
- "Golf"
latest_owner_pr: "PR_26180_OWNER_018-move-src-browser-to-www"
latest_structure_pr: "PR_26180_OWNER_018-move-src-browser-to-www"
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"
valid_top_level_folders:
- "api/"
- "deploy/"
Expand All @@ -40,7 +40,7 @@ valid_dev_folders:
- "dev/tools/"
- "dev/workspace/"
known_technical_debt:
- "API/server-owned contracts, schemas, and project data store modules remain under src/shared/ until PR_26180_OWNER_019 moves them to api/."
- "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."
- "repository_directory_standard.md and codex_project_instructions_startup.md are superseded pointers retained for compatibility."
Expand Down
4 changes: 2 additions & 2 deletions dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ 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_018-move-src-browser-to-www
- Next Milestone: Move API/server-owned source to api/
- Active PR: PR_26180_OWNER_019b-move-browser-shared-schemas-to-www
- 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`

## Game Journey MVP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Deployable application source:

Final source ownership after the repository layout simplification:
- `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.
- `www/src/shared/contracts/` and `www/src/shared/schemas/tools/` own browser/runtime-consumed contracts and tool schemas that must remain available through the public `/src/shared/...` route shape.
- `api/` owns deployable API/runtime service modules that back the shared Browser -> API -> Postgres/R2 contract.
- `dev/` owns developer-only source, scripts, tests, reports, local runtime orchestration, and reference material.
- 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.
- Remaining root `src/shared/contracts/`, `src/shared/schemas/`, `src/shared/projectDataStore/`, and source-reference files are legacy transition buckets until explicit migration PRs move them.
- Browser API clients remain outside `api/`; browser-served code must use API/service contracts instead of importing top-level `api/` files directly.
- `www/src/dev-runtime/admin/` preserves the public `/src/dev-runtime/admin/...` Admin Notes browser-viewer compatibility route under the `www` web root.
- Do not add new root `src/` layer names or new root `src/` work without OWNER approval.
Expand Down Expand Up @@ -82,6 +83,8 @@ Legacy transition buckets:
- www/src/api/
- www/src/engine/
- www/src/shared/
- www/src/shared/contracts/
- www/src/shared/schemas/
- www/src/tools/
- www/src/dev-runtime/admin/
- src/shared/contracts/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# PR_26180_OWNER_019b-move-browser-shared-schemas-to-www Branch Validation

| Check | Status | Evidence |
| --- | --- | --- |
| Current branch | PASS | `PR_26180_OWNER_019b-move-browser-shared-schemas-to-www` |
| Expected stacked base | PASS | Branch created from `PR_26180_OWNER_019a-contracts-schemas-obsolescence-audit`. |
| Worktree at start | PASS | Clean before branch creation. |
| Worktree after implementation | PASS | Contains only scoped PR changes and generated reports. |
| Branch model | PASS | Owner stacked PR based on prior direct dependency. |
| Protected developer workspace | PASS | No protected dev workspace paths moved. |

## Current Status Snapshot

```text
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
M dev/build/ProjectInstructions/PROJECT_STATE.md
M dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
M dev/build/ProjectInstructions/repository/canonical_repository_structure.md
M dev/reports/codex_changed_files.txt
M dev/reports/codex_review.diff
M dev/scripts/validate-json-contracts.mjs
M dev/tests/tools/ObjectVectorStudioV2DeleteCleanup.test.mjs
M dev/tests/tools/ToolManifestBoundary.test.mjs
R src/shared/contracts/replayContracts.js -> www/src/shared/contracts/replayContracts.js
R src/shared/schemas/tools/3d-asset-viewer.schema.json -> www/src/shared/schemas/tools/3d-asset-viewer.schema.json
R src/shared/schemas/tools/3d-camera-path-editor.schema.json -> www/src/shared/schemas/tools/3d-camera-path-editor.schema.json
R src/shared/schemas/tools/3d-json-payload.schema.json -> www/src/shared/schemas/tools/3d-json-payload.schema.json
R src/shared/schemas/tools/asset-manager-v2.schema.json -> www/src/shared/schemas/tools/asset-manager-v2.schema.json
R src/shared/schemas/tools/asset-pipeline.schema.json -> www/src/shared/schemas/tools/asset-pipeline.schema.json
R src/shared/schemas/tools/audio-sfx-playground-v2.schema.json -> www/src/shared/schemas/tools/audio-sfx-playground-v2.schema.json
R src/shared/schemas/tools/collision-inspector-v2.schema.json -> www/src/shared/schemas/tools/collision-inspector-v2.schema.json
R src/shared/schemas/tools/input-mapping-v2.schema.json -> www/src/shared/schemas/tools/input-mapping-v2.schema.json
R src/shared/schemas/tools/midi-studio-v2.schema.json -> www/src/shared/schemas/tools/midi-studio-v2.schema.json
R src/shared/schemas/tools/object-vector-studio-v2.schema.json -> www/src/shared/schemas/tools/object-vector-studio-v2.schema.json
R src/shared/schemas/tools/palette-browser.schema.json -> www/src/shared/schemas/tools/palette-browser.schema.json
R src/shared/schemas/tools/palette-manager-v2.schema.json -> www/src/shared/schemas/tools/palette-manager-v2.schema.json
R src/shared/schemas/tools/parallax-editor.schema.json -> www/src/shared/schemas/tools/parallax-editor.schema.json
R src/shared/schemas/tools/performance-profiler.schema.json -> www/src/shared/schemas/tools/performance-profiler.schema.json
R src/shared/schemas/tools/physics-sandbox.schema.json -> www/src/shared/schemas/tools/physics-sandbox.schema.json
R src/shared/schemas/tools/replay-visualizer.schema.json -> www/src/shared/schemas/tools/replay-visualizer.schema.json
R src/shared/schemas/tools/sprite-editor.schema.json -> www/src/shared/schemas/tools/sprite-editor.schema.json
R src/shared/schemas/tools/state-inspector.schema.json -> www/src/shared/schemas/tools/state-inspector.schema.json
R src/shared/schemas/tools/svg-asset-studio.schema.json -> www/src/shared/schemas/tools/svg-asset-studio.schema.json
R src/shared/schemas/tools/text2speech-V2.schema.json -> www/src/shared/schemas/tools/text2speech-V2.schema.json
R src/shared/schemas/tools/tile-map-editor.schema.json -> www/src/shared/schemas/tools/tile-map-editor.schema.json
R src/shared/schemas/tools/vector-map-editor.schema.json -> www/src/shared/schemas/tools/vector-map-editor.schema.json
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PR_26180_OWNER_019b-move-browser-shared-schemas-to-www Manual Validation Notes

- Confirmed moved files match PR019a audit `Active browser/runtime dependency` rows.
- Confirmed representative public schema URLs still resolve through the `www` web root:
- `/src/shared/schemas/tools/object-vector-studio-v2.schema.json`
- `/src/shared/schemas/tools/text2speech-V2.schema.json`
- `/src/shared/schemas/tools/palette-browser.schema.json`
- `/src/shared/contracts/replayContracts.js`
- Confirmed no API/server files were moved.
- Confirmed no protected developer workspace files were moved.
- Confirmed no product/UI/database implementation files changed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# PR_26180_OWNER_019b-move-browser-shared-schemas-to-www Report

## Executive Summary

Moved the PR019a-audited active browser/runtime shared contract and tool schema files from root `src/shared/` into `www/src/shared/`.

This preserves public browser route compatibility because the local/static web root serves `www/`, so URLs such as `/src/shared/schemas/tools/palette-browser.schema.json` still resolve to `www/src/shared/schemas/tools/palette-browser.schema.json`.

No API/server-owned files, validation-only files, protected developer workspace files, UI pages, database files, or product behavior were moved.

## Stack Context

- Workstream: Repository Architecture Simplification
- Previous dependency: `PR_26180_OWNER_019a-contracts-schemas-obsolescence-audit`
- Base branch: `PR_26180_OWNER_019a-contracts-schemas-obsolescence-audit`
- Source branch: `PR_26180_OWNER_019b-move-browser-shared-schemas-to-www`
- Intended next dependency: remaining server/API and dev-owned `src/` retirement PRs

## Source Of Truth

Used `dev/reports/PR_26180_OWNER_019a-contracts-schemas-obsolescence-audit_audit.csv`.

Only rows classified as `Active browser/runtime dependency` with recommendation `move to www/` were moved.

## Moved Files

- src/shared/contracts/replayContracts.js -> www/src/shared/contracts/replayContracts.js
- src/shared/schemas/tools/3d-asset-viewer.schema.json -> www/src/shared/schemas/tools/3d-asset-viewer.schema.json
- src/shared/schemas/tools/3d-camera-path-editor.schema.json -> www/src/shared/schemas/tools/3d-camera-path-editor.schema.json
- src/shared/schemas/tools/3d-json-payload.schema.json -> www/src/shared/schemas/tools/3d-json-payload.schema.json
- src/shared/schemas/tools/asset-manager-v2.schema.json -> www/src/shared/schemas/tools/asset-manager-v2.schema.json
- src/shared/schemas/tools/asset-pipeline.schema.json -> www/src/shared/schemas/tools/asset-pipeline.schema.json
- src/shared/schemas/tools/audio-sfx-playground-v2.schema.json -> www/src/shared/schemas/tools/audio-sfx-playground-v2.schema.json
- src/shared/schemas/tools/collision-inspector-v2.schema.json -> www/src/shared/schemas/tools/collision-inspector-v2.schema.json
- src/shared/schemas/tools/input-mapping-v2.schema.json -> www/src/shared/schemas/tools/input-mapping-v2.schema.json
- src/shared/schemas/tools/midi-studio-v2.schema.json -> www/src/shared/schemas/tools/midi-studio-v2.schema.json
- src/shared/schemas/tools/object-vector-studio-v2.schema.json -> www/src/shared/schemas/tools/object-vector-studio-v2.schema.json
- src/shared/schemas/tools/palette-browser.schema.json -> www/src/shared/schemas/tools/palette-browser.schema.json
- src/shared/schemas/tools/palette-manager-v2.schema.json -> www/src/shared/schemas/tools/palette-manager-v2.schema.json
- src/shared/schemas/tools/parallax-editor.schema.json -> www/src/shared/schemas/tools/parallax-editor.schema.json
- src/shared/schemas/tools/performance-profiler.schema.json -> www/src/shared/schemas/tools/performance-profiler.schema.json
- src/shared/schemas/tools/physics-sandbox.schema.json -> www/src/shared/schemas/tools/physics-sandbox.schema.json
- src/shared/schemas/tools/replay-visualizer.schema.json -> www/src/shared/schemas/tools/replay-visualizer.schema.json
- src/shared/schemas/tools/sprite-editor.schema.json -> www/src/shared/schemas/tools/sprite-editor.schema.json
- src/shared/schemas/tools/state-inspector.schema.json -> www/src/shared/schemas/tools/state-inspector.schema.json
- src/shared/schemas/tools/svg-asset-studio.schema.json -> www/src/shared/schemas/tools/svg-asset-studio.schema.json
- src/shared/schemas/tools/text2speech-V2.schema.json -> www/src/shared/schemas/tools/text2speech-V2.schema.json
- src/shared/schemas/tools/tile-map-editor.schema.json -> www/src/shared/schemas/tools/tile-map-editor.schema.json
- src/shared/schemas/tools/vector-map-editor.schema.json -> www/src/shared/schemas/tools/vector-map-editor.schema.json

## Path Updates

- Updated active tool/schema tests to read browser tool schemas from `www/src/shared/schemas/tools/`.
- Updated `dev/scripts/validate-json-contracts.mjs` so tool schema validation indexes `www/src/shared/schemas/tools/` while still indexing remaining root `src/shared/schemas/` files.
- Updated Project Instructions version/state/canonical structure/backlog to record the browser schema/contract ownership split.

## Compatibility Decision

Schema `$id` values and browser string identifiers remain in the public `src/shared/schemas/tools/...` form. This is intentional because the public browser URL shape remains `/src/shared/...` under the `www` web root.

## Scope Guard

- Runtime behavior changed: No
- Product/UI pages changed: No
- API/server files moved: No
- Database files changed: No
- Protected developer workspace moved: No
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PR_26180_OWNER_019b-move-browser-shared-schemas-to-www Requirement Checklist

| Requirement | Status | Evidence |
| --- | --- | --- |
| Use PR019a audit as source of truth | PASS | Moved only `Active browser/runtime dependency` rows from PR019a audit CSV. |
| Move active browser/runtime contracts and schemas to `www/src/shared/` | PASS | 23 audited files moved to `www/src/shared/`. |
| Preserve dynamic browser schema loading | PASS | `/src/shared/schemas/tools/<tool>.schema.json` route shape resolves from `www/src/shared/schemas/tools/`. |
| Preserve public `/src/shared/...` URLs | PASS | Static route resolver check passed for representative schema and replay contract URLs. |
| Update browser/runtime imports only where required | PASS | Existing browser relative imports continued to resolve; no browser/API behavior changes required. |
| Do not move validation-only files | PASS | Remaining root validation-only schemas/contracts were not moved. |
| Do not move API/server files | PASS | No `api/` files moved. |
| Do not delete schemas/contracts unless audit proves unused | PASS | No schema/contract deletion performed. |
| Do not change product behavior | PASS | Route compatibility and focused Playwright route smoke passed. |
| Do not move protected developer workspace files | PASS | No protected `dev/workspace/generated`, `zips`, or `tmp` files moved. |
| Required reports under `dev/reports/` | PASS | Reports generated. |
| Required ZIP under `dev/workspace/zips/` | PASS | ZIP generated separately after report creation. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# PR_26180_OWNER_019b-move-browser-shared-schemas-to-www Validation Report

| Validation | Status | Notes |
| --- | --- | --- |
| Startup validation | PASS | Loaded Project Instructions v2026.06.28.018 before work; PR updates version to v2026.06.28.019. |
| Branch validation | PASS | Started from `PR_26180_OWNER_019a-contracts-schemas-obsolescence-audit`; created stacked branch `PR_26180_OWNER_019b-move-browser-shared-schemas-to-www`. |
| `node --check dev/scripts/validate-json-contracts.mjs` | PASS | Syntax check passed. |
| `node --check dev/tests/tools/ToolManifestBoundary.test.mjs` | PASS | Syntax check passed. |
| `node --check dev/tests/tools/ObjectVectorStudioV2DeleteCleanup.test.mjs` | PASS | Syntax check passed. |
| Targeted node tests | PASS | `ToolManifestBoundary` and `StaticWebRootCompatibility` passed. |
| Static schema URL checks | PASS | Representative `/src/shared/schemas/tools/...` and `/src/shared/contracts/replayContracts.js` routes resolve from `www/`. |
| Browser import/reference scan | PASS | No browser code imports top-level `api/`; stale active root filesystem schema references were updated. Public schema IDs remain intentionally unchanged. |
| Focused Playwright route smoke | PASS | `dev/tests/playwright/tools/StaticWebRootCompatibility.spec.mjs`: 2/2 passed. |
| `npm run validate:canonical-structure` | PASS | Canonical repository structure guardrail passed. |
| `git diff --check` | PASS | Passed; Git reported line-ending normalization warnings only. |

## Notes

`dev/tests/tools/ObjectVectorStudioV2DeleteCleanup.test.mjs` is not part of the active node test runner and still depends on a removed legacy Object Vector tool module path from before this PR. This PR updated only its schema file path for the moved browser schema; it did not expand into legacy test resurrection.
Binary file modified dev/reports/codex_changed_files.txt
Binary file not shown.
Binary file modified dev/reports/codex_review.diff
Binary file not shown.
11 changes: 7 additions & 4 deletions dev/scripts/validate-json-contracts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import path from "node:path";

const ROOT = process.cwd();
const REPORT_DIR = path.join(ROOT, "docs", "dev", "reports");
const SCHEMA_ROOT = path.join(ROOT, "tools", "schemas");
const SCHEMA_ROOTS = [
path.join(ROOT, "www", "src", "shared", "schemas"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep JSON-contract CI from failing on moved schemas

When callers use --ci (for example dev/scripts/PS/validate-tool-schemas.ps1 -Ci), adding the moved www/src/shared/schemas tree to the schema index makes this script evaluate all 22 payload schemas with the old failure criteria: strictness inventory rows count as CI failures, and validateToolSchemas still requires root tool/version fields these schemas do not declare. node dev/scripts/validate-json-contracts.mjs --mode tools --ci now reports all 22 tool schemas invalid and exits 1, so the JSON-contract validation path is broken unless the CI criteria are updated for these moved schemas.

Useful? React with 👍 / 👎.

path.join(ROOT, "src", "shared", "schemas")
];
const DEPRECATED_GAME_TOOL_IDS = new Set(["asset-browser", "palette-browser", "vector-map-editor"]);

function parseArgs(argv) {
Expand Down Expand Up @@ -110,7 +113,7 @@ function writeCsv(filePath, columns, rows) {
}

function buildSchemaIndex() {
const schemaFiles = walkFiles(SCHEMA_ROOT, (filePath) => filePath.endsWith(".json"));
const schemaFiles = SCHEMA_ROOTS.flatMap((schemaRoot) => walkFiles(schemaRoot, (filePath) => filePath.endsWith(".json")));
const schemaIndex = new Map();
schemaFiles.forEach((filePath) => {
const rel = normalizeRel(filePath);
Expand Down Expand Up @@ -493,7 +496,7 @@ function schemaPathForToolId(toolId) {
if (!normalized) {
return "";
}
return `src/shared/schemas/tools/${normalized}.schema.json`;
return `www/src/shared/schemas/tools/${normalized}.schema.json`;
}

function validateToolPayloadShallow(toolId, payload, schema, pointer) {
Expand Down Expand Up @@ -700,7 +703,7 @@ function validateGames(schemaIndex, validate) {
function validateToolSchemas(schemaIndex, validate) {
const rows = [];
for (const [schemaPath, schema] of schemaIndex.entries()) {
if (!schemaPath.startsWith("src/shared/schemas/tools/") || !schemaPath.endsWith(".schema.json")) {
if (!schemaPath.startsWith("www/src/shared/schemas/tools/") || !schemaPath.endsWith(".schema.json")) {
continue;
}
const errors = [];
Expand Down
Loading
Loading