Skip to content

Commit 532031b

Browse files
committed
Add game manifest contract tests for GameFoundryStudio - PR_26152_081-manifest-contract-tests
1 parent 30d4331 commit 532031b

5 files changed

Lines changed: 1155 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Manifest Contract Tests Validation
2+
3+
PR: `PR_26152_081-manifest-contract-tests`
4+
5+
## Scope
6+
7+
- Added `src/shared/contracts/gameManifestContract.js`.
8+
- Added `tests/shared/GameManifestContract.test.mjs`.
9+
- Added `tests/fixtures/manifests/manifest-scenarios.json`.
10+
- Added `docs/dev/specs/GAME_MANIFEST_CONTRACT.md`.
11+
12+
No database, authentication, UI, CSS, HTML, runtime page, or samples changes were made.
13+
14+
## Contract Rules Validated
15+
16+
- Game Manifest requires owner.
17+
- Game Manifest requires project.
18+
- Game Manifest requires `projectType = game`.
19+
- Game Manifest may reference valid tool state references.
20+
- Game Manifest may reference valid asset references.
21+
- Game Manifest is a portable export/import format.
22+
- Database remains the working system.
23+
- Manifest is not the database source of truth.
24+
- Manifest cannot bypass ownership, visibility, or permissions.
25+
- Archived manifest is immutable unless policy allows edits.
26+
27+
## Validation Commands
28+
29+
- `node --check src/shared/contracts/gameManifestContract.js` - PASS
30+
- `node --check tests/shared/GameManifestContract.test.mjs` - PASS
31+
- `node tests/shared/GameManifestContract.test.mjs` - PASS
32+
- `node tests/shared/ProjectContract.test.mjs` - PASS
33+
- `node tests/shared/ProjectWorkspaceRuntimeContract.test.mjs` - PASS
34+
- `node tests/shared/ToolStateContract.test.mjs` - PASS
35+
- `node tests/shared/IdentityPermissionsContract.test.mjs` - PASS
36+
- `$files = Get-ChildItem tests/shared/tools -Filter *.test.mjs | Sort-Object Name; foreach ($file in $files) { node $file.FullName; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } }` - PASS, 36 tool contract tests ran
37+
- `git diff --name-only -- '*.css' '*.html'` - PASS, no output
38+
- `rg -n "\s+$" src/shared/contracts/gameManifestContract.js tests/shared/GameManifestContract.test.mjs tests/fixtures/manifests/manifest-scenarios.json docs/dev/specs/GAME_MANIFEST_CONTRACT.md` - PASS, no trailing whitespace
39+
- `git diff --cached --name-only` - PASS, no staged files
40+
41+
## Validation Lanes
42+
43+
- Lanes executed: contract validation for Manifest, Project Type, Project Workspace, Project, Tool State, Tool contracts, and Identity/Permissions.
44+
- Lanes skipped: runtime, integration, engine, samples, and recovery/UAT because this PR does not change runtime behavior, handoff contracts, engine surfaces, samples, or recovery behavior.
45+
- Samples decision: SKIP because this PR is limited to contract/docs/test surfaces.
46+
- Playwright impacted: No. This PR is contract/docs/test only and does not change UI or browser runtime behavior.
47+
48+
## Expected PASS Behavior
49+
50+
- Valid Game Manifest contract records are accepted.
51+
- Missing owner, missing project, missing project type, non-game project type, invalid tool state references, invalid asset references, and invalid export formats are rejected.
52+
- Portable Game Manifest export strips database owner/project ids and validates as portable.
53+
- Visibility and permission checks remain bound to Project and Identity/Permissions contracts.
54+
- Archived manifests cannot be edited unless policy explicitly allows archived manifest edits.
55+
56+
## Expected WARN Behavior
57+
58+
- No WARN behavior was observed in the targeted validation lane.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Game Manifest Contract
2+
3+
## Status
4+
5+
This is a contract planning document for GameFoundryStudio Game Manifest behavior.
6+
7+
It defines required Game Manifest contract rules before database, authentication, UI, runtime, publishing, marketplace, or storage implementation begins.
8+
9+
This document does not authorize runtime changes, database implementation, authentication implementation, page changes, CSS changes, HTML changes, JavaScript changes, or schema migrations.
10+
11+
## Manifest Fields
12+
13+
Game Manifest records define:
14+
15+
- `manifestId`
16+
- `ownerId`
17+
- `projectId`
18+
- `projectType`
19+
- `sourceToolStates`
20+
- `sourceAssets`
21+
- `visibility`
22+
- `version`
23+
- `status`
24+
- `exportFormat`
25+
26+
## Required Rules
27+
28+
- Game Manifest requires owner.
29+
- Game Manifest requires project.
30+
- Game Manifest requires `projectType = game`.
31+
- Game Manifest may reference tool states.
32+
- Game Manifest may reference assets.
33+
- Game Manifest is a portable export/import format.
34+
- Database remains the working system.
35+
- Manifest is not the database source of truth.
36+
- Manifest cannot bypass ownership, visibility, or permissions.
37+
- Archived manifest is immutable unless policy allows edits.
38+
39+
## Source References
40+
41+
Source tool state references must identify:
42+
43+
- `toolStateId`
44+
- `toolType`
45+
- optional positive `version`
46+
47+
Source asset references must identify:
48+
49+
- `assetId`
50+
- approved `assetType`
51+
- optional positive `version`
52+
53+
Approved source asset types:
54+
55+
- `vector`
56+
- `palette`
57+
- `image`
58+
- `audio`
59+
- `tilemap`
60+
- `localization`
61+
62+
## Portability
63+
64+
Portable Game Manifest export preserves:
65+
66+
- manifest id
67+
- project type
68+
- source tool state references
69+
- source asset references
70+
- visibility
71+
- version
72+
- status
73+
- export format
74+
75+
Portable Game Manifest export must not carry:
76+
77+
- database owner id
78+
- database project id
79+
- database id
80+
- credentials
81+
- permissions internals
82+
- moderation internals
83+
84+
## Ownership And Permissions Boundary
85+
86+
Game Manifest ownership is project-owned through a Game Project.
87+
88+
The manifest does not create a separate ownership model. It remains bound by Project ownership, Project visibility, Project permissions, Identity/Permissions rules, and explicit policy gates for archived editing.
89+
90+
Public or unlisted visibility does not grant edit permission.
91+
92+
## Database Boundary
93+
94+
The database remains the working system for persisted Project and Game Manifest records.
95+
96+
Game Manifest JSON remains the portable export/import format for game configuration. It must preserve enough source references to import or validate dependencies, but it does not replace the database as the source of persisted ownership, permissions, or audit state.
97+
98+
## Non-Goals
99+
100+
This document does not:
101+
102+
- define SQL schema
103+
- define API routes
104+
- implement manifest persistence
105+
- implement authentication
106+
- implement authorization checks
107+
- implement Project Workspace storage
108+
- implement runtime manifest loading
109+
- implement publishing
110+
- implement marketplace behavior
111+
- change runtime behavior
112+
- change CSS, HTML, JavaScript, TypeScript, or JSON files outside the contract/test scope

0 commit comments

Comments
 (0)