|
| 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. |
0 commit comments