Skip to content

Commit ab64ec6

Browse files
committed
Add Update Channel contract tests and release promotion boundaries - PR_26152_089-update-channel-contract-tests
1 parent 8b7e3e2 commit ab64ec6

5 files changed

Lines changed: 2271 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Update Channel Contract Tests Validation
2+
3+
PR: `PR_26152_089-update-channel-contract-tests`
4+
5+
## Scope
6+
7+
- Added Update Channel contract definition under `src/shared/contracts`.
8+
- Added Update Channel fixture scenarios.
9+
- Added Update Channel targeted contract test suite.
10+
- Added Update Channel contract specification document.
11+
- No database, authentication, payment, installer, updater, download, UI, HTML, CSS, or runtime implementation changes.
12+
13+
## Commands
14+
15+
| Command | Result |
16+
| --- | --- |
17+
| `node --check src/shared/contracts/updateChannelContract.js` | PASS |
18+
| `node --check tests/shared/UpdateChannelContract.test.mjs` | PASS |
19+
| `node tests/shared/UpdateChannelContract.test.mjs` | PASS |
20+
| `node tests/shared/InstallReceiptContract.test.mjs` | PASS |
21+
| `node tests/shared/LibraryItemContract.test.mjs` | PASS |
22+
| `node tests/shared/DownloadGrantContract.test.mjs` | PASS |
23+
| `node tests/shared/EntitlementContract.test.mjs` | PASS |
24+
| `node tests/shared/MarketplaceListingContract.test.mjs` | PASS |
25+
| `node tests/shared/PublishContract.test.mjs` | PASS |
26+
| `node tests/shared/ReleaseContract.test.mjs` | PASS |
27+
| `node tests/shared/ProjectContract.test.mjs` | PASS |
28+
| `node tests/shared/IdentityPermissionsContract.test.mjs` | PASS |
29+
| `git diff --name-only -- '*.css' '*.html'` | PASS - no CSS or HTML changes |
30+
| `git diff --check` | PASS |
31+
| `npm run codex:review-artifacts` | PASS |
32+
33+
## Contract Coverage
34+
35+
Validated Update Channel rules:
36+
37+
- Update Channel requires owner.
38+
- Update Channel requires project.
39+
- Update Channel requires valid channel type.
40+
- Allowed channel types are `stable`, `beta`, `alpha`, and `preview`.
41+
- Update Channel requires assigned Release.
42+
- Update Channel requires assigned Publish record.
43+
- Update Channel requires Library Item linkage.
44+
- Update Channel requires Install Receipt linkage.
45+
- Update Channel requires `assignedAt`.
46+
- `libraryItem.ownerId` and `installReceipt.ownerId` must match `ownerId`.
47+
- `assignedRelease.projectId`, `assignedPublish.projectId`, `libraryItem.projectId`, and `installReceipt.projectId` must match `projectId`.
48+
- `assignedPublish.releaseId` must match `assignedRelease.releaseId`.
49+
- `libraryItem.releaseId` and `installReceipt.releaseId` must match `assignedRelease.releaseId`.
50+
- `libraryItem.publishId` and `installReceipt.publishId` must match `assignedPublish.publishId`.
51+
- `installReceipt.libraryItemId` must match `libraryItem.libraryItemId`.
52+
- Promotion moves toward the stable channel in the order `preview` -> `alpha` -> `beta` -> `stable`.
53+
- Promotion cannot move backward or target the same channel.
54+
- Promotion requires `promotesFrom` and `promotedAt` together.
55+
- Update Channel access remains owner-private unless platform administration permission applies.
56+
57+
Validated forbidden leakage:
58+
59+
- Payment state rejected.
60+
- Auth session state rejected.
61+
- Runtime state rejected.
62+
- ToolState data rejected.
63+
- Installer state rejected.
64+
- Updater implementation details rejected.
65+
- Download state rejected.
66+
67+
## Samples Decision
68+
69+
SKIP. This PR only changes shared contract definitions, contract fixtures, contract tests, docs/specs, and reports. Samples are not in scope.
70+
71+
## Playwright
72+
73+
Playwright impacted: No. This PR has no UI, runtime, tool behavior, rendering, or page changes.
74+
75+
## Manual Validation
76+
77+
1. Review `docs/dev/specs/UPDATE_CHANNEL_CONTRACT.md`.
78+
2. Review `src/shared/contracts/updateChannelContract.js`.
79+
3. Confirm Update Channel links to Project, Release, Publish, Library Item, Install Receipt, and owner records.
80+
4. Confirm Update Channel promotion only moves from `preview` toward `stable`.
81+
5. Confirm Update Channel does not carry payment, auth session, runtime, toolState, installer, updater, or download state.
82+
6. Confirm `docs/dev/reports/codex_review.diff` and `docs/dev/reports/codex_changed_files.txt` exist for review.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Update Channel Contract
2+
3+
## Purpose
4+
5+
The Update Channel contract defines a metadata-only record that assigns a published or retired Release and Publish record to a named update lane.
6+
7+
Update Channel links an owner to a Project, Release, Publish record, Library Item, and Install Receipt. It does not store payment state, auth session state, runtime state, toolState data, installer state, updater implementation details, or download state.
8+
9+
## Ownership
10+
11+
- Every Update Channel requires `ownerId`.
12+
- `ownerId` is the user whose library/install context is receiving update assignment metadata.
13+
- Update Channel access is owner-private unless platform administration permission applies.
14+
- Update Channel does not replace Project, Release, Publish, Library Item, or Install Receipt ownership.
15+
16+
## Required Linkage
17+
18+
Update Channel requires:
19+
20+
- `projectId`
21+
- `assignedRelease`
22+
- `assignedPublish`
23+
- `libraryItem`
24+
- `installReceipt`
25+
26+
Required consistency:
27+
28+
- `libraryItem.ownerId` must match `ownerId`.
29+
- `installReceipt.ownerId` must match `ownerId`.
30+
- `assignedRelease.projectId` must match `projectId`.
31+
- `assignedPublish.projectId` must match `projectId`.
32+
- `libraryItem.projectId` must match `projectId`.
33+
- `installReceipt.projectId` must match `projectId`.
34+
- `assignedPublish.releaseId` must match `assignedRelease.releaseId`.
35+
- `libraryItem.releaseId` must match `assignedRelease.releaseId`.
36+
- `installReceipt.releaseId` must match `assignedRelease.releaseId`.
37+
- `libraryItem.publishId` must match `assignedPublish.publishId`.
38+
- `installReceipt.publishId` must match `assignedPublish.publishId`.
39+
- `installReceipt.libraryItemId` must match `libraryItem.libraryItemId`.
40+
41+
## Channel Types
42+
43+
Allowed update channel types:
44+
45+
- `stable`
46+
- `beta`
47+
- `alpha`
48+
- `preview`
49+
50+
## Release Assignment
51+
52+
Update Channel assignment requires:
53+
54+
- `assignedRelease`
55+
- `assignedPublish`
56+
- `assignedAt`
57+
58+
Assigned Release references must identify a published or retired Release. Assigned Publish references must identify a published or retired Publish record and must point back to the assigned Release.
59+
60+
## Promotion Rules
61+
62+
Promotion order moves toward the stable channel:
63+
64+
`preview` -> `alpha` -> `beta` -> `stable`
65+
66+
Rules:
67+
68+
- `promotesFrom` is optional for direct channel assignment.
69+
- `promotesFrom` must be a valid channel type when provided.
70+
- A promotion must move from a less stable channel toward a more stable channel.
71+
- A promotion cannot move backward.
72+
- A promotion cannot target the same channel type.
73+
- `promotedAt` is required when `promotesFrom` is provided.
74+
- `promotedAt` cannot be provided without `promotesFrom`.
75+
76+
## Fields
77+
78+
- `updateChannelId`
79+
- `ownerId`
80+
- `projectId`
81+
- `channelType`
82+
- `assignedRelease`
83+
- `assignedPublish`
84+
- `libraryItem`
85+
- `installReceipt`
86+
- `assignedAt`
87+
- `promotesFrom`
88+
- `promotedAt`
89+
- `channelNotes`
90+
91+
## Forbidden State
92+
93+
Update Channel records must not contain:
94+
95+
- payment state
96+
- auth session state
97+
- runtime state
98+
- toolState data
99+
- installer state
100+
- updater implementation details
101+
- download state
102+
103+
Update workflows may use an Update Channel later, but update URLs, updater jobs, patch bytes, install plans, installer state, download grants, and runtime context do not live inside the Update Channel contract.
104+
105+
## Non-Goals
106+
107+
- No database implementation.
108+
- No authentication implementation.
109+
- No payment implementation.
110+
- No installer implementation.
111+
- No updater implementation.
112+
- No download implementation.
113+
- No UI or runtime behavior changes.

0 commit comments

Comments
 (0)