Skip to content

Commit 8b7e3e2

Browse files
committed
Add Install Receipt contract tests and local install tracking boundaries - PR_26152_088-install-receipt-contract-tests
1 parent 1e43c82 commit 8b7e3e2

5 files changed

Lines changed: 2251 additions & 0 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Install Receipt Contract Tests Validation
2+
3+
PR: `PR_26152_088-install-receipt-contract-tests`
4+
5+
## Scope
6+
7+
- Added Install Receipt contract definition under `src/shared/contracts`.
8+
- Added Install Receipt fixture scenarios.
9+
- Added Install Receipt targeted contract test suite.
10+
- Added Install Receipt contract specification document.
11+
- No database, authentication, payment, CDN, installer, file delivery, UI, HTML, CSS, or runtime implementation changes.
12+
13+
## Commands
14+
15+
| Command | Result |
16+
| --- | --- |
17+
| `node --check src/shared/contracts/installReceiptContract.js` | PASS |
18+
| `node --check tests/shared/InstallReceiptContract.test.mjs` | PASS |
19+
| `node tests/shared/InstallReceiptContract.test.mjs` | PASS |
20+
| `node tests/shared/LibraryItemContract.test.mjs` | PASS |
21+
| `node tests/shared/DownloadGrantContract.test.mjs` | PASS |
22+
| `node tests/shared/EntitlementContract.test.mjs` | PASS |
23+
| `node tests/shared/MarketplaceListingContract.test.mjs` | PASS |
24+
| `node tests/shared/PublishContract.test.mjs` | PASS |
25+
| `node tests/shared/ReleaseContract.test.mjs` | PASS |
26+
| `node tests/shared/ProjectContract.test.mjs` | PASS |
27+
| `node tests/shared/IdentityPermissionsContract.test.mjs` | PASS |
28+
| `git diff --name-only -- '*.css' '*.html'` | PASS - no CSS or HTML changes |
29+
| `git diff --check` | PASS |
30+
31+
## Contract Coverage
32+
33+
Validated Install Receipt rules:
34+
35+
- Install Receipt requires owner.
36+
- Install Receipt requires project.
37+
- Install Receipt requires Library Item linkage.
38+
- Install Receipt requires Entitlement linkage.
39+
- Install Receipt requires Marketplace Listing linkage.
40+
- Install Receipt requires source Release linkage.
41+
- Install Receipt requires source Publish linkage.
42+
- `libraryItem.ownerId` and `entitlement.ownerId` must match `ownerId`.
43+
- `libraryItem.projectId` and `entitlement.projectId` must match `projectId`.
44+
- `libraryItem.entitlementId` must match `entitlement.entitlementId`.
45+
- `libraryItem.listingId` and `entitlement.listingId` must match `marketplaceListing.listingId`.
46+
- `libraryItem.releaseId`, `entitlement.releaseId`, and `marketplaceListing.releaseId` must match `sourceRelease.releaseId`.
47+
- `libraryItem.publishId`, `entitlement.publishId`, and `marketplaceListing.publishId` must match `sourcePublish.publishId`.
48+
- `sourcePublish.releaseId` must match `sourceRelease.releaseId`.
49+
- Receipt status is limited to `installed`, `removed`, `failed`, and `superseded`.
50+
- Installed receipts require `installedAt`.
51+
- Install Receipt access remains owner-private unless platform administration permission applies.
52+
53+
Validated forbidden leakage:
54+
55+
- Payment state rejected.
56+
- Auth session state rejected.
57+
- Runtime state rejected.
58+
- ToolState data rejected.
59+
- File bytes rejected.
60+
- CDN details rejected.
61+
- Installer implementation details rejected.
62+
63+
## Samples Decision
64+
65+
SKIP. This PR only changes shared contract definitions, contract fixtures, contract tests, docs/specs, and reports. Samples are not in scope.
66+
67+
## Playwright
68+
69+
Playwright impacted: No. This PR has no UI, runtime, tool behavior, rendering, or page changes.
70+
71+
## Manual Validation
72+
73+
1. Review `docs/dev/specs/INSTALL_RECEIPT_CONTRACT.md`.
74+
2. Review `src/shared/contracts/installReceiptContract.js`.
75+
3. Confirm Install Receipt links to Library Item, Entitlement, Marketplace Listing, Project, Release, Publish, and owner records.
76+
4. Confirm Install Receipt does not carry payment, auth session, runtime, toolState, file bytes, CDN details, or installer implementation details.
77+
5. Confirm `docs/dev/reports/codex_review.diff` and `docs/dev/reports/codex_changed_files.txt` exist for review.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Install Receipt Contract
2+
3+
## Purpose
4+
5+
The Install Receipt contract defines a metadata-only record of an install outcome for a user's library item.
6+
7+
Install Receipt links an owner to a Library Item, Entitlement, Marketplace Listing, Project, Release, and Publish record. It does not store payment state, auth session state, runtime state, toolState data, file bytes, CDN details, or installer implementation details.
8+
9+
## Ownership
10+
11+
- Every Install Receipt requires `ownerId`.
12+
- `ownerId` is the user whose library item produced the receipt.
13+
- Install Receipt access is owner-private unless platform administration permission applies.
14+
- Install Receipt does not replace Library Item, Entitlement, Marketplace Listing, Project, Release, or Publish ownership.
15+
16+
## Required Linkage
17+
18+
Install Receipt requires:
19+
20+
- `projectId`
21+
- `libraryItem`
22+
- `entitlement`
23+
- `marketplaceListing`
24+
- `sourceRelease`
25+
- `sourcePublish`
26+
27+
Required consistency:
28+
29+
- `libraryItem.ownerId` must match `ownerId`.
30+
- `entitlement.ownerId` must match `ownerId`.
31+
- `libraryItem.projectId` must match `projectId`.
32+
- `entitlement.projectId` must match `projectId`.
33+
- `libraryItem.entitlementId` must match `entitlement.entitlementId`.
34+
- `libraryItem.listingId` must match `marketplaceListing.listingId`.
35+
- `libraryItem.releaseId` must match `sourceRelease.releaseId`.
36+
- `libraryItem.publishId` must match `sourcePublish.publishId`.
37+
- `entitlement.listingId` must match `marketplaceListing.listingId`.
38+
- `entitlement.releaseId` must match `sourceRelease.releaseId`.
39+
- `entitlement.publishId` must match `sourcePublish.publishId`.
40+
- `marketplaceListing.projectId` must match `projectId`.
41+
- `marketplaceListing.releaseId` must match `sourceRelease.releaseId`.
42+
- `marketplaceListing.publishId` must match `sourcePublish.publishId`.
43+
- `sourcePublish.releaseId` must match `sourceRelease.releaseId`.
44+
45+
## Receipt Status
46+
47+
Allowed install receipt statuses:
48+
49+
- `installed`
50+
- `removed`
51+
- `failed`
52+
- `superseded`
53+
54+
Installed receipts require `installedAt`.
55+
56+
## Fields
57+
58+
- `installReceiptId`
59+
- `ownerId`
60+
- `projectId`
61+
- `libraryItem`
62+
- `entitlement`
63+
- `marketplaceListing`
64+
- `sourceRelease`
65+
- `sourcePublish`
66+
- `receiptStatus`
67+
- `installedAt`
68+
- `removedAt`
69+
- `failedAt`
70+
- `supersededAt`
71+
- `receiptNotes`
72+
73+
## Forbidden State
74+
75+
Install Receipt records must not contain:
76+
77+
- payment state
78+
- auth session state
79+
- runtime state
80+
- toolState data
81+
- file bytes
82+
- CDN details
83+
- installer implementation details
84+
85+
Install workflows may use an Install Receipt later, but install paths, installed file manifests, installer logs, package manager details, CDN URLs, file bytes, and runtime state do not live inside the Install Receipt contract.
86+
87+
## Non-Goals
88+
89+
- No database implementation.
90+
- No authentication implementation.
91+
- No payment implementation.
92+
- No CDN implementation.
93+
- No installer implementation.
94+
- No file delivery implementation.
95+
- No UI or runtime behavior changes.

0 commit comments

Comments
 (0)