|
| 1 | +# Library Item Contract Tests Validation |
| 2 | + |
| 3 | +PR: `PR_26152_087-library-item-contract-tests` |
| 4 | + |
| 5 | +## Scope |
| 6 | + |
| 7 | +- Added Library Item contract definition under `src/shared/contracts`. |
| 8 | +- Added Library Item fixture scenarios. |
| 9 | +- Added Library Item targeted contract test suite. |
| 10 | +- Added Library Item contract specification document. |
| 11 | +- No database, authentication, payment, CDN, install, file delivery, UI, HTML, CSS, or runtime implementation changes. |
| 12 | + |
| 13 | +## Commands |
| 14 | + |
| 15 | +| Command | Result | |
| 16 | +| --- | --- | |
| 17 | +| `node --check src/shared/contracts/libraryItemContract.js` | PASS | |
| 18 | +| `node --check tests/shared/LibraryItemContract.test.mjs` | PASS | |
| 19 | +| `node tests/shared/LibraryItemContract.test.mjs` | PASS | |
| 20 | +| `node tests/shared/DownloadGrantContract.test.mjs` | PASS | |
| 21 | +| `node tests/shared/EntitlementContract.test.mjs` | PASS | |
| 22 | +| `node tests/shared/MarketplaceListingContract.test.mjs` | PASS | |
| 23 | +| `node tests/shared/PublishContract.test.mjs` | PASS | |
| 24 | +| `node tests/shared/ReleaseContract.test.mjs` | PASS | |
| 25 | +| `node tests/shared/ProjectContract.test.mjs` | PASS | |
| 26 | +| `node tests/shared/IdentityPermissionsContract.test.mjs` | PASS | |
| 27 | +| `git diff --name-only -- '*.css' '*.html'` | PASS - no CSS or HTML changes | |
| 28 | +| `git diff --check` | PASS | |
| 29 | + |
| 30 | +## Contract Coverage |
| 31 | + |
| 32 | +Validated Library Item rules: |
| 33 | + |
| 34 | +- Library Item requires owner. |
| 35 | +- Library Item requires project. |
| 36 | +- Library Item requires Entitlement linkage. |
| 37 | +- Library Item requires Marketplace Listing linkage. |
| 38 | +- Library Item requires source Release linkage. |
| 39 | +- Library Item requires source Publish linkage. |
| 40 | +- `entitlement.ownerId` must match `ownerId`. |
| 41 | +- `entitlement.projectId` must match `projectId`. |
| 42 | +- `entitlement.listingId` must match `marketplaceListing.listingId`. |
| 43 | +- `entitlement.releaseId` must match `sourceRelease.releaseId`. |
| 44 | +- `entitlement.publishId` must match `sourcePublish.publishId`. |
| 45 | +- `marketplaceListing.projectId` must match `projectId`. |
| 46 | +- `marketplaceListing.releaseId` must match `sourceRelease.releaseId`. |
| 47 | +- `marketplaceListing.publishId` must match `sourcePublish.publishId`. |
| 48 | +- `sourcePublish.releaseId` must match `sourceRelease.releaseId`. |
| 49 | +- Library status is limited to `available`, `hidden`, `revoked`, and `archived`. |
| 50 | +- All Library Items require `addedAt`. |
| 51 | +- Hidden Library Items require `hiddenAt`. |
| 52 | +- Revoked Library Items require `revokedAt`. |
| 53 | +- Archived Library Items require `archivedAt`. |
| 54 | +- Library Item access remains owner-private unless platform administration permission applies. |
| 55 | + |
| 56 | +Validated forbidden leakage: |
| 57 | + |
| 58 | +- Payment state rejected. |
| 59 | +- Auth session state rejected. |
| 60 | +- Runtime state rejected. |
| 61 | +- ToolState data rejected. |
| 62 | +- File bytes rejected. |
| 63 | +- CDN details rejected. |
| 64 | +- Install state rejected. |
| 65 | + |
| 66 | +## Samples Decision |
| 67 | + |
| 68 | +SKIP. This PR only changes shared contract definitions, contract fixtures, contract tests, docs/specs, and reports. Samples are not in scope. |
| 69 | + |
| 70 | +## Playwright |
| 71 | + |
| 72 | +Playwright impacted: No. This PR has no UI, runtime, tool behavior, rendering, or page changes. |
| 73 | + |
| 74 | +## Manual Validation |
| 75 | + |
| 76 | +1. Review `docs/dev/specs/LIBRARY_ITEM_CONTRACT.md`. |
| 77 | +2. Review `src/shared/contracts/libraryItemContract.js`. |
| 78 | +3. Confirm Library Item links to Entitlement, Marketplace Listing, Project, Release, Publish, and owner records. |
| 79 | +4. Confirm Library Item does not carry payment, auth session, runtime, toolState, file bytes, CDN details, or install state. |
| 80 | +5. Confirm `docs/dev/reports/codex_review.diff` and `docs/dev/reports/codex_changed_files.txt` exist for review. |
0 commit comments