|
| 1 | +# PR_26158_040 Game Deploy Path Plan |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Define the focused MVP path from an editable GameFoundryStudio project to one public playable URL. This PR is planning only; it does not implement runtime publish, deploy, schema, API, or UI behavior. |
| 6 | + |
| 7 | +## Minimum End-To-End Path |
| 8 | + |
| 9 | +Intentional workflow order: |
| 10 | + |
| 11 | +1. Create/Load Project |
| 12 | +2. Open Game Manifest |
| 13 | +3. Validate Manifest |
| 14 | +4. Save Project |
| 15 | +5. Publish Candidate |
| 16 | +6. Deploy Playable Game |
| 17 | +7. Open Public Play URL |
| 18 | + |
| 19 | +This order is a workflow-path exception to alphabetical navigation/list ordering because the request explicitly defines a deploy sequence. |
| 20 | + |
| 21 | +## MVP Flow |
| 22 | + |
| 23 | +| Step | User/System Action | MVP Result | Current State | |
| 24 | +| --- | --- | --- | --- | |
| 25 | +| Create/Load Project | Creator opens Project Workspace, creates or loads one game project. | Active project is known and persisted in DB with owner/role/audit fields. | Partially implemented. Project Workspace can create/open/delete local mock projects and shows project/publishing progress, but reports that public release promotion is not implemented. | |
| 26 | +| Open Game Manifest | Creator opens the project manifest workspace for the active project. | DB-backed manifest record opens with source tool-state and source asset references. | Partially implemented as contracts/schema/runtime parser. No active first-class manifest workspace/runtime save path is wired to Project Workspace. | |
| 27 | +| Validate Manifest | System validates manifest structure, references, asset readiness, and debug/public gates. | Blocking findings must be visible before save or publish candidate creation. | Partially implemented through `game.manifest.schema.json`, `manifestRuntimeParser.js`, `gameManifestContract.js`, `projectAssetValidation.js`, and packaging helpers. Missing integrated gate runner. | |
| 28 | +| Save Project | Creator saves project, manifest, assets, and tool-state references through the server API. | Working DB state is authoritative and audit-owned. | Partially implemented for current tools through API/client paths and local DB work. Missing complete manifest/release save API path. | |
| 29 | +| Publish Candidate | Creator creates a candidate from a validated manifest. | Candidate freezes source manifest/version, release metadata, asset snapshot, validation report, and status. | Contract-only. `releaseContract.js`, `publishContract.js`, and Publish wireframe exist; no connected candidate creation. | |
| 30 | +| Deploy Playable Game | Server generates immutable playable artifacts and deploys to UAT/public storage. | Deploy record references candidate and artifact manifest; no browser-side artifact fabrication. | Pipeline helpers exist for packaging/export/cloud target summaries, but no server deploy endpoint or artifact writer is connected. | |
| 31 | +| Open Public Play URL | Player opens a public URL for the deployed release. | URL serves the immutable playable bundle and does not require creator DB/session state. | Not implemented for generated user games. Archived/reference games and runtime manifest loading exist separately. | |
| 32 | + |
| 33 | +## Current Implemented Pieces |
| 34 | + |
| 35 | +| Area | Evidence | Reusable For MVP | |
| 36 | +| --- | --- | --- | |
| 37 | +| Project creation/opening | `toolbox/project-workspace/index.html`; `toolbox/project-workspace/project-workspace.js`; `src/dev-runtime/persistence/tool-repositories/project-workspace-mock-repository.js` | Use as creator entry point and active project handoff. | |
| 38 | +| Game design readiness | `toolbox/game-design/index.html`; `toolbox/game-design/game-design.js` | Use as upstream project-owned authoring data. | |
| 39 | +| Game configuration readiness | `toolbox/game-configuration/index.html`; `toolbox/game-configuration/game-configuration.js` | Use as upstream playable setup authoring data. | |
| 40 | +| Project assets | `toolbox/assets/index.html`; `toolbox/assets/assets.js`; `src/shared/toolbox/projectAssetValidation.js` | Use asset records and validation findings as release blockers. | |
| 41 | +| Manifest schema/runtime parser | `src/shared/schemas/game.manifest.schema.json`; `src/engine/runtime/manifestRuntimeParser.js` | Use for manifest structure and runtime-load acceptance. | |
| 42 | +| Manifest DB contract | `src/shared/contracts/gameManifestContract.js`; `docs_build/dev/specs/GAME_MANIFEST_CONTRACT.md` | Use for DB record fields, ownership, visibility, version, and portable export boundary. | |
| 43 | +| Release/publish contracts | `src/shared/contracts/releaseContract.js`; `src/shared/contracts/publishContract.js`; `src/shared/contracts/tools/publishStudioContract.js` | Use as candidate and publish record contract starting points. | |
| 44 | +| Packaging/export/cloud helpers | `src/shared/toolbox/projectPackaging.js`; `src/shared/toolbox/multiTargetExport.js`; `src/shared/toolbox/cloudRuntime.js`; `src/shared/toolbox/publishingPipeline.js` | Use as deterministic package/export validation helpers, not as a complete deploy service. | |
| 45 | +| Local API/data boundary | `src/engine/api/*`; `src/dev-runtime/server/mock-api-router.mjs`; Local Mem/Local DB work | Preserve Browser -> Server API -> Data Source for any future publish/deploy writes. | |
| 46 | +| Debug public-release rule | `docs_build/dev/PROJECT_INSTRUCTIONS.md` debug settings rule | Must become a hard release gate. | |
| 47 | + |
| 48 | +## Missing Pieces |
| 49 | + |
| 50 | +| Missing Piece | Why It Blocks MVP | |
| 51 | +| --- | --- | |
| 52 | +| DB-backed game manifest records and API routes | Publish cannot reference a stable manifest version if the manifest is only portable JSON/runtime schema. | |
| 53 | +| Manifest editor/open path for active Project Workspace project | The requested "Open Game Manifest" step needs a first-class route/tool or Project Workspace panel. | |
| 54 | +| Manifest assembly from project/tool state/assets | The system needs one deterministic source for building manifest payloads from DB-owned project data. | |
| 55 | +| Integrated manifest validation gate | Existing validators are not yet one server/API gate that reports manifest, asset, debug, publish, and public-readiness findings. | |
| 56 | +| Save Project transaction boundary | Project, manifest, tool-state references, and asset references need a server-side transaction or equivalent atomic write contract. | |
| 57 | +| Publish candidate record/table/API | Release/publish contracts exist, but there is no candidate creation endpoint, lifecycle table, or UI action. | |
| 58 | +| Immutable deploy artifact writer | No UAT artifact writer currently creates a playable bundle from a candidate. | |
| 59 | +| Public play route resolver | No route maps a published candidate/deploy record to a stable public playable URL. | |
| 60 | +| UAT deploy storage/serving contract | UAT needs a defined storage root, URL base, cache policy, and artifact manifest format. | |
| 61 | +| Debug stripping/rejection implementation | Public playable release must fail if debug settings are enabled, or must strip them in a documented way. | |
| 62 | + |
| 63 | +## Blockers |
| 64 | + |
| 65 | +| Blocker | Resolution Needed | |
| 66 | +| --- | --- | |
| 67 | +| Working DB and portable manifest are not unified by an active manifest service. | Add a server-side manifest service that reads DB state, validates it, and emits portable JSON only as an artifact/export. | |
| 68 | +| Publish page is currently a wireframe. | Add a future Publish Candidate workflow after manifest service exists. | |
| 69 | +| Generated playable artifact format is undefined. | Define a minimal artifact manifest and static bundle layout before deploy implementation. | |
| 70 | +| Public URL authorization/visibility transition is undefined. | Release visibility and publish status must determine public route exposure. | |
| 71 | +| Asset binary persistence is incomplete. | MVP may deploy only assets already available by stable repo/server paths; user-uploaded binary persistence must be blocked or diagnosed until available. | |
| 72 | +| UAT environment storage is not declared in code. | Add UAT deploy config in a later PR before writing artifacts. | |
| 73 | + |
| 74 | +## DB Versus Generated Deploy Artifacts |
| 75 | + |
| 76 | +| Data | DB Source Of Truth | Generated Deploy Artifact | |
| 77 | +| --- | --- | --- | |
| 78 | +| Project identity, owner, members, purpose, status | Yes: project tables with audit and permissions. | Include public display copy only when required by release metadata. | |
| 79 | +| Tool state and authoring records | Yes: DB records per tool/project. | Include only normalized runtime payloads required by the playable bundle. | |
| 80 | +| Game manifest working record | Yes: manifest record, version, status, visibility, source references, validation status. | `game.manifest.json` snapshot for the release candidate. | |
| 81 | +| Source asset records | Yes: asset records, ownership, storage path, metadata, dependency graph, validation findings. | Copied or referenced runtime assets with content/version metadata. | |
| 82 | +| Release candidate | Yes: candidate/release record, source manifest, version, validation report, status. | Candidate manifest/report copied into release bundle for provenance. | |
| 83 | +| Publish record | Yes: public/unlisted/private visibility, publishedAt, source release, status. | Public route manifest may include publish key and public metadata only. | |
| 84 | +| Deploy job/result | Yes: deploy job, target, artifact root, URL, status, diagnostics. | Deployment manifest and immutable static files. | |
| 85 | +| Audit fields, roles, permissions, private diagnostics | Yes only. | Must not be included in public artifacts. | |
| 86 | +| Debug settings | DB may retain creator/debug config. | Public artifacts must strip or reject enabled debug-only settings. | |
| 87 | +| Public play URL | DB stores canonical route/deploy mapping. | Static artifact is served at the URL but does not decide authorization. | |
| 88 | + |
| 89 | +## Required UAT Deployment Path For One Playable Game |
| 90 | + |
| 91 | +MVP UAT should support one validated playable game end to end: |
| 92 | + |
| 93 | +1. UAT user logs in with a creator/admin role that can edit the project. |
| 94 | +2. User opens Project Workspace and loads one Game Project. |
| 95 | +3. User opens the Game Manifest view for that project. |
| 96 | +4. Server builds or opens the latest manifest record from DB-owned project/tool/asset state. |
| 97 | +5. Server runs validation gates and returns a blocking/non-blocking report. |
| 98 | +6. User saves the project/manifest only if blocking findings are zero. |
| 99 | +7. User creates a Publish Candidate from the validated manifest. |
| 100 | +8. Server freezes source manifest version, asset snapshot, validation report, release metadata, and candidate status. |
| 101 | +9. User promotes candidate to UAT deploy. |
| 102 | +10. Server generates artifacts under a UAT deploy root, for example `uat-deploy/games/<gameSlug>/<releaseVersion>/`. |
| 103 | +11. Server writes at minimum: |
| 104 | + - `index.html` or launch shell |
| 105 | + - `game.manifest.json` |
| 106 | + - runtime asset files or stable runtime references |
| 107 | + - `deploy-manifest.json` |
| 108 | + - `validation-report.json` |
| 109 | +12. Server creates/updates a deploy record with a URL such as `/play/<gameSlug>/<releaseVersion>/`. |
| 110 | +13. User opens the public play URL in a new browser context. |
| 111 | +14. Public play route serves the immutable artifact without requiring creator session state. |
| 112 | +15. UAT smoke verifies load success, manifest parse success, required assets resolve, debug mode is absent, and no private DB/audit fields leak. |
| 113 | + |
| 114 | +## Validation Gates |
| 115 | + |
| 116 | +| Gate | Blocking Conditions | MVP Evidence | |
| 117 | +| --- | --- | --- | |
| 118 | +| Manifest structure | Missing `schema`, invalid `version`, missing `game`, missing `launch.directPath`, malformed `tools`, unsupported extra root fields. | `manifestRuntimeParser.js`; `game.manifest.schema.json`; future server manifest gate report. | |
| 119 | +| Manifest DB contract | Missing manifest owner/project/type/version/status/export format, invalid project type, invalid source tool-state or asset references. | `gameManifestContract.js`; future DB-backed manifest record validation. | |
| 120 | +| Asset readiness | Missing asset IDs, unresolved palette/tile/vector/image links, duplicate registry IDs, invalid dependency graph, unavailable binary/runtime paths. | `projectAssetValidation.js`; future deploy gate must include all blocking findings. | |
| 121 | +| Debug settings | Any public/playable candidate contains enabled debug-only settings, debug overlays, dev-only API endpoints, or test-only flags. | `PROJECT_INSTRUCTIONS.md` rule; future gate must reject or strip with explicit report. | |
| 122 | +| Save Project | Active project missing, user cannot edit project, transaction fails, source records changed during save, audit fields invalid. | Future server API save transaction; DB viewer can help inspect Local/UAT state. | |
| 123 | +| Publish state | Candidate references non-validated manifest, release version invalid, visibility invalid, publish status transition invalid, source release not publishable. | `releaseContract.js`; `publishContract.js`; future candidate API. | |
| 124 | +| Deploy artifact | Package root missing, no runtime launch shell, missing `game.manifest.json`, missing asset, artifact manifest invalid, artifact write failed. | `projectPackaging.js`; `multiTargetExport.js`; future UAT deploy writer. | |
| 125 | +| Public play readiness | URL not mapped to published deploy, route requires creator session, manifest fails runtime parse, assets 404, debug enabled, private DB fields present. | Future public route smoke. | |
| 126 | + |
| 127 | +## MVP Implementation Order For Future PRs |
| 128 | + |
| 129 | +1. Manifest service contract: server-side read/build/validate manifest for active project. |
| 130 | +2. Manifest DB table/API: save versioned manifest records with audit and source references. |
| 131 | +3. Publish Candidate API: create candidate from validated manifest and release metadata. |
| 132 | +4. UAT deploy artifact contract: define output layout and `deploy-manifest.json`. |
| 133 | +5. UAT deploy writer: generate one static playable artifact bundle from one candidate. |
| 134 | +6. Public play route: serve one UAT deployed release by stable URL. |
| 135 | +7. Public readiness smoke: validate no debug/private fields and all assets resolve. |
| 136 | + |
| 137 | +## Non-Goals For This PR |
| 138 | + |
| 139 | +- No publish runtime implementation. |
| 140 | +- No deploy endpoint. |
| 141 | +- No DB schema migration. |
| 142 | +- No UAT storage configuration. |
| 143 | +- No Playwright or sample smoke execution. |
| 144 | +- No changes to `start_of_day` folders. |
| 145 | + |
| 146 | +## Requirement Checklist |
| 147 | + |
| 148 | +| Requirement | Result | |
| 149 | +| --- | --- | |
| 150 | +| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first. | PASS | |
| 151 | +| Create focused MVP game deploy path plan. | PASS | |
| 152 | +| Define minimum end-to-end path. | PASS | |
| 153 | +| Identify implemented pieces. | PASS | |
| 154 | +| Identify missing pieces and blockers. | PASS | |
| 155 | +| Identify DB-owned data versus generated deploy artifacts. | PASS | |
| 156 | +| Define required UAT deployment path for one playable game. | PASS | |
| 157 | +| Define validation gates for manifest, assets, debug settings, publish state, and public play readiness. | PASS | |
| 158 | +| Do not implement runtime publish behavior. | PASS | |
| 159 | +| Do not modify `start_of_day` folders. | PASS | |
0 commit comments