Skip to content

Commit fb9d59c

Browse files
committed
Add Marketplace Listing contract tests and eligibility boundaries - PR_26152_084-marketplace-listing-contract-tests
1 parent 56c08cc commit fb9d59c

5 files changed

Lines changed: 1282 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Marketplace Listing Contract Tests Validation
2+
3+
PR: `PR_26152_084-marketplace-listing-contract-tests`
4+
5+
## Scope
6+
7+
- Added Marketplace Listing contract definition under `src/shared/contracts`.
8+
- Added Marketplace Listing fixture scenarios.
9+
- Added Marketplace Listing targeted contract test suite.
10+
- Added Marketplace Listing contract specification document.
11+
- No database, authentication, UI, HTML, CSS, payment, moderation, or runtime implementation changes.
12+
13+
## Commands
14+
15+
| Command | Result |
16+
| --- | --- |
17+
| `node --check src/shared/contracts/marketplaceListingContract.js` | PASS |
18+
| `node --check tests/shared/MarketplaceListingContract.test.mjs` | PASS |
19+
| `node tests/shared/MarketplaceListingContract.test.mjs` | PASS |
20+
| `node tests/shared/PublishContract.test.mjs` | PASS |
21+
| `node tests/shared/ReleaseContract.test.mjs` | PASS |
22+
| `node tests/shared/ProjectContract.test.mjs` | PASS |
23+
| `node tests/shared/IdentityPermissionsContract.test.mjs` | PASS |
24+
| `git diff --name-only -- '*.css' '*.html'` | PASS - no CSS or HTML changes |
25+
| `git diff --check` | PASS |
26+
27+
## Contract Coverage
28+
29+
Validated Marketplace Listing rules:
30+
31+
- Listing requires owner.
32+
- Listing requires project.
33+
- Listing requires source Release.
34+
- Listing requires source Publish record.
35+
- Source Publish release linkage must match source Release.
36+
- Visibility must be one of `private`, `unlisted`, `public`, or `marketplace`.
37+
- Lifecycle status must be one of `draft`, `listed`, `unlisted`, or `retired`.
38+
- Listed and retired listings require `listedAt`.
39+
- Listed listings are immutable unless policy allows edits.
40+
- Retired listings remain historically referenceable.
41+
- Marketplace Listing access cannot bypass project ownership, visibility, or permissions.
42+
43+
Validated forbidden leakage:
44+
45+
- Runtime state rejected.
46+
- Auth state rejected.
47+
- Payment state rejected.
48+
- Moderation decision state rejected.
49+
- Tool state payload leakage rejected.
50+
51+
## Samples Decision
52+
53+
SKIP. This PR only changes shared contract definitions, contract fixtures, contract tests, docs/specs, and reports. Samples are not in scope.
54+
55+
## Playwright
56+
57+
Playwright impacted: No. This PR has no UI, runtime, tool behavior, rendering, or page changes.
58+
59+
## Manual Validation
60+
61+
1. Review `docs/dev/specs/MARKETPLACE_LISTING_CONTRACT.md`.
62+
2. Review `src/shared/contracts/marketplaceListingContract.js`.
63+
3. Confirm Marketplace Listing remains metadata-only and does not include runtime, auth, payment, or moderation decision state.
64+
4. Confirm `docs/dev/reports/codex_review.diff` and `docs/dev/reports/codex_changed_files.txt` exist for review.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Marketplace Listing Contract
2+
3+
## Purpose
4+
5+
The Marketplace Listing contract defines the portable listing metadata that connects a published or retired Release and Publish record to marketplace discovery.
6+
7+
Marketplace Listing is not runtime state, authentication state, payment state, or moderation decision state.
8+
9+
## Ownership
10+
11+
- Every Marketplace Listing requires `ownerId`.
12+
- Every Marketplace Listing requires `projectId`.
13+
- Marketplace Listing cannot bypass the ownership, visibility, and permission contracts already defined for platform objects.
14+
- Project remains the persisted ownership container.
15+
16+
## Required Linkage
17+
18+
Marketplace Listing requires:
19+
20+
- `sourceRelease` with `releaseId`, `version`, and optional published/retired status.
21+
- `sourcePublish` with `publishId`, `releaseId`, and optional published/retired status.
22+
- `sourcePublish.releaseId` must match `sourceRelease.releaseId`.
23+
24+
## Fields
25+
26+
- `listingId`
27+
- `ownerId`
28+
- `projectId`
29+
- `sourceRelease`
30+
- `sourcePublish`
31+
- `visibility`
32+
- `status`
33+
- `listedAt`
34+
- `listingTitle`
35+
- `listingSummary`
36+
37+
## Visibility
38+
39+
Allowed Marketplace Listing visibility states:
40+
41+
- `private`
42+
- `unlisted`
43+
- `public`
44+
- `marketplace`
45+
46+
Marketplace and public listings are visible to public viewers. Private listings require owner or granted project access.
47+
48+
## Lifecycle Status
49+
50+
Allowed Marketplace Listing lifecycle states:
51+
52+
- `draft`
53+
- `listed`
54+
- `unlisted`
55+
- `retired`
56+
57+
Listed and retired listings require `listedAt`. Listed and retired listings are immutable unless an explicit policy allows edits.
58+
59+
## Forbidden State
60+
61+
Marketplace Listing records must not contain:
62+
63+
- runtime state
64+
- auth state
65+
- payment state
66+
- moderation decision state
67+
- tool state payloads
68+
69+
Moderation and payment systems may link to Marketplace Listing later, but their decisions and transaction state do not live in the Marketplace Listing contract.
70+
71+
## Non-Goals
72+
73+
- No database implementation.
74+
- No authentication implementation.
75+
- No payment implementation.
76+
- No moderation implementation.
77+
- No UI or runtime behavior changes.

0 commit comments

Comments
 (0)