|
| 1 | +# Publish Contract Tests Validation |
| 2 | + |
| 3 | +PR: `PR_26152_083-publish-contract-tests` |
| 4 | + |
| 5 | +## Scope |
| 6 | + |
| 7 | +- Added `src/shared/contracts/publishContract.js`. |
| 8 | +- Added `tests/shared/PublishContract.test.mjs`. |
| 9 | +- Added `tests/fixtures/publish/publish-scenarios.json`. |
| 10 | +- Added `docs/dev/specs/PUBLISH_CONTRACT.md`. |
| 11 | + |
| 12 | +No database, authentication, UI, CSS, HTML, runtime page, marketplace moderation, tool state storage, or samples changes were made. |
| 13 | + |
| 14 | +## Contract Rules Validated |
| 15 | + |
| 16 | +- Publish requires owner. |
| 17 | +- Publish requires project. |
| 18 | +- Publish requires source release. |
| 19 | +- Publish visibility must be valid. |
| 20 | +- Publish lifecycle status must be valid. |
| 21 | +- Publish cannot bypass ownership, visibility, or permissions. |
| 22 | +- Published Publish records are immutable unless policy allows edits. |
| 23 | +- Retired Publish records remain historically referenceable. |
| 24 | +- Publish records reject runtime state leakage. |
| 25 | +- Publish records reject auth state leakage. |
| 26 | +- Publish records reject marketplace moderation state leakage. |
| 27 | +- Publish records reject tool state leakage. |
| 28 | + |
| 29 | +## Validation Commands |
| 30 | + |
| 31 | +- `node --check src/shared/contracts/publishContract.js` - PASS |
| 32 | +- `node --check tests/shared/PublishContract.test.mjs` - PASS |
| 33 | +- `node tests/shared/PublishContract.test.mjs` - PASS |
| 34 | +- `node tests/shared/ReleaseContract.test.mjs` - PASS |
| 35 | +- `node tests/shared/GameManifestContract.test.mjs` - PASS |
| 36 | +- `node tests/shared/ProjectContract.test.mjs` - PASS |
| 37 | +- `node tests/shared/ProjectWorkspaceRuntimeContract.test.mjs` - PASS |
| 38 | +- `node tests/shared/ToolStateContract.test.mjs` - PASS |
| 39 | +- `node tests/shared/IdentityPermissionsContract.test.mjs` - PASS |
| 40 | +- `git diff --name-only -- '*.css' '*.html'` - PASS, no output |
| 41 | +- `rg -n "\s+$" src/shared/contracts/publishContract.js tests/shared/PublishContract.test.mjs tests/fixtures/publish/publish-scenarios.json docs/dev/specs/PUBLISH_CONTRACT.md` - PASS, no trailing whitespace |
| 42 | +- `git diff --cached --name-only` - PASS, no staged files |
| 43 | + |
| 44 | +## Validation Lanes |
| 45 | + |
| 46 | +- Lanes executed: contract validation for Publish, Release, Manifest, Project Type, Project Workspace, Project, Tool State, and Identity/Permissions. |
| 47 | +- Lanes skipped: runtime, integration, engine, samples, marketplace moderation, and recovery/UAT because this PR does not change runtime behavior, handoff contracts, engine surfaces, samples, moderation behavior, or recovery behavior. |
| 48 | +- Samples decision: SKIP because this PR is limited to contract/docs/test surfaces. |
| 49 | +- Playwright impacted: No. This PR is contract/docs/test only and does not change UI or browser runtime behavior. |
| 50 | + |
| 51 | +## Expected PASS Behavior |
| 52 | + |
| 53 | +- Valid Publish contract records are accepted. |
| 54 | +- Missing owner, missing project, missing source release, invalid source release, invalid visibility, invalid status, and missing published timestamp are rejected. |
| 55 | +- Publish records reject runtime, auth, marketplace moderation, and tool state leakage. |
| 56 | +- Publish access remains bound to Project and Identity/Permissions contracts. |
| 57 | +- Published Publish records cannot be edited unless policy allows edits. |
| 58 | +- Retired Publish records remain historically referenceable. |
| 59 | + |
| 60 | +## Expected WARN Behavior |
| 61 | + |
| 62 | +- No WARN behavior was observed in the targeted validation lane. |
0 commit comments