|
| 1 | +# Entitlement Contract Tests Validation |
| 2 | + |
| 3 | +PR: `PR_26152_085-entitlement-contract-tests` |
| 4 | + |
| 5 | +## Scope |
| 6 | + |
| 7 | +- Added Entitlement contract definition under `src/shared/contracts`. |
| 8 | +- Added Entitlement fixture scenarios. |
| 9 | +- Added Entitlement targeted contract test suite. |
| 10 | +- Added Entitlement contract specification document. |
| 11 | +- No database, authentication, payment, download, UI, HTML, CSS, or runtime implementation changes. |
| 12 | + |
| 13 | +## Commands |
| 14 | + |
| 15 | +| Command | Result | |
| 16 | +| --- | --- | |
| 17 | +| `node --check src/shared/contracts/entitlementContract.js` | PASS | |
| 18 | +| `node --check tests/shared/EntitlementContract.test.mjs` | PASS | |
| 19 | +| `node tests/shared/EntitlementContract.test.mjs` | PASS | |
| 20 | +| `node tests/shared/MarketplaceListingContract.test.mjs` | PASS | |
| 21 | +| `node tests/shared/PublishContract.test.mjs` | PASS | |
| 22 | +| `node tests/shared/ReleaseContract.test.mjs` | PASS | |
| 23 | +| `node tests/shared/ProjectContract.test.mjs` | PASS | |
| 24 | +| `node tests/shared/IdentityPermissionsContract.test.mjs` | PASS | |
| 25 | +| `git diff --name-only -- '*.css' '*.html'` | PASS - no CSS or HTML changes | |
| 26 | +| `git diff --check` | PASS | |
| 27 | + |
| 28 | +## Contract Coverage |
| 29 | + |
| 30 | +Validated Entitlement rules: |
| 31 | + |
| 32 | +- Entitlement requires owner. |
| 33 | +- Entitlement requires project. |
| 34 | +- Entitlement requires marketplace listing linkage. |
| 35 | +- Entitlement requires source Release linkage. |
| 36 | +- Entitlement requires source Publish linkage. |
| 37 | +- `marketplaceListing.projectId` must match `projectId`. |
| 38 | +- `marketplaceListing.releaseId` must match `sourceRelease.releaseId`. |
| 39 | +- `marketplaceListing.publishId` must match `sourcePublish.publishId`. |
| 40 | +- `sourcePublish.releaseId` must match `sourceRelease.releaseId`. |
| 41 | +- Entitlement types are limited to `owned`, `licensed`, `granted`, and `revoked`. |
| 42 | +- Active entitlement types require `grantedAt`. |
| 43 | +- Revoked entitlements require `revokedAt`. |
| 44 | +- Entitlement access remains owner-private unless platform administration permission applies. |
| 45 | + |
| 46 | +Validated forbidden leakage: |
| 47 | + |
| 48 | +- Payment state rejected. |
| 49 | +- Auth session state rejected. |
| 50 | +- Runtime state rejected. |
| 51 | +- ToolState data rejected. |
| 52 | +- Download state rejected. |
| 53 | + |
| 54 | +## Samples Decision |
| 55 | + |
| 56 | +SKIP. This PR only changes shared contract definitions, contract fixtures, contract tests, docs/specs, and reports. Samples are not in scope. |
| 57 | + |
| 58 | +## Playwright |
| 59 | + |
| 60 | +Playwright impacted: No. This PR has no UI, runtime, tool behavior, rendering, or page changes. |
| 61 | + |
| 62 | +## Manual Validation |
| 63 | + |
| 64 | +1. Review `docs/dev/specs/ENTITLEMENT_CONTRACT.md`. |
| 65 | +2. Review `src/shared/contracts/entitlementContract.js`. |
| 66 | +3. Confirm Entitlement links to Marketplace Listing, Project, Release, and Publish records without carrying payment, auth session, runtime, toolState, or download state. |
| 67 | +4. Confirm `docs/dev/reports/codex_review.diff` and `docs/dev/reports/codex_changed_files.txt` exist for review. |
0 commit comments