|
| 1 | +# Migration Plan Contract Tests Validation |
| 2 | + |
| 3 | +PR: `PR_26152_091-migration-plan-contract-tests` |
| 4 | + |
| 5 | +## Scope |
| 6 | + |
| 7 | +- Added Migration Plan contract definition under `src/shared/contracts`. |
| 8 | +- Added Migration Plan fixture scenarios. |
| 9 | +- Added Migration Plan targeted contract test suite. |
| 10 | +- Added Migration Plan contract specification document. |
| 11 | +- No database, authentication, installer, updater, migration implementation, file delivery, download, UI, HTML, CSS, or runtime implementation changes. |
| 12 | + |
| 13 | +## Commands |
| 14 | + |
| 15 | +| Command | Result | |
| 16 | +| --- | --- | |
| 17 | +| `node --check src/shared/contracts/migrationPlanContract.js` | PASS | |
| 18 | +| `node --check tests/shared/MigrationPlanContract.test.mjs` | PASS | |
| 19 | +| `node tests/shared/MigrationPlanContract.test.mjs` | PASS | |
| 20 | +| `node tests/shared/VersionCompatibilityContract.test.mjs` | PASS | |
| 21 | +| `node tests/shared/UpdateChannelContract.test.mjs` | PASS | |
| 22 | +| `node tests/shared/InstallReceiptContract.test.mjs` | PASS | |
| 23 | +| `node tests/shared/LibraryItemContract.test.mjs` | PASS | |
| 24 | +| `node tests/shared/DownloadGrantContract.test.mjs` | PASS | |
| 25 | +| `node tests/shared/EntitlementContract.test.mjs` | PASS | |
| 26 | +| `node tests/shared/MarketplaceListingContract.test.mjs` | PASS | |
| 27 | +| `node tests/shared/PublishContract.test.mjs` | PASS | |
| 28 | +| `node tests/shared/ReleaseContract.test.mjs` | PASS | |
| 29 | +| `node tests/shared/ProjectContract.test.mjs` | PASS | |
| 30 | +| `node tests/shared/IdentityPermissionsContract.test.mjs` | PASS | |
| 31 | +| `git diff --name-only -- '*.css' '*.html'` | PASS - no CSS or HTML changes | |
| 32 | +| `git diff --check` | PASS | |
| 33 | +| `npm run codex:review-artifacts` | PASS | |
| 34 | + |
| 35 | +## Contract Coverage |
| 36 | + |
| 37 | +Validated Migration Plan rules: |
| 38 | + |
| 39 | +- Migration Plan requires owner. |
| 40 | +- Migration Plan requires project. |
| 41 | +- Migration Plan requires target Release linkage. |
| 42 | +- Migration Plan requires Version Compatibility linkage. |
| 43 | +- Migration Plan requires Update Channel linkage. |
| 44 | +- Migration Plan requires Library Item linkage. |
| 45 | +- Migration Plan requires Install Receipt linkage. |
| 46 | +- `versionCompatibility.ownerId`, `updateChannel.ownerId`, `libraryItem.ownerId`, and `installReceipt.ownerId` must match `ownerId`. |
| 47 | +- `targetRelease.projectId`, `versionCompatibility.projectId`, `updateChannel.projectId`, `libraryItem.projectId`, and `installReceipt.projectId` must match `projectId`. |
| 48 | +- `versionCompatibility.releaseId`, `updateChannel.releaseId`, `libraryItem.releaseId`, and `installReceipt.releaseId` must match `targetRelease.releaseId`. |
| 49 | +- `updateChannel.publishId`, `libraryItem.publishId`, and `installReceipt.publishId` must match `versionCompatibility.publishId`. |
| 50 | +- `installReceipt.libraryItemId` must match `libraryItem.libraryItemId`. |
| 51 | +- `sourceVersion`, `targetVersion`, and `schemaVersion` must be positive integers. |
| 52 | +- `targetVersion` must match `targetRelease.version`. |
| 53 | +- `targetVersion` must match `versionCompatibility.targetVersion`. |
| 54 | +- `schemaVersion` must match `versionCompatibility.supportedSchemaVersion`. |
| 55 | +- Migration state is limited to `notRequired`, `required`, `blocked`, and `completed`. |
| 56 | +- `notRequired` requires `sourceVersion` and `targetVersion` to match. |
| 57 | +- `required` and `completed` require `targetVersion` to be newer than `sourceVersion`. |
| 58 | +- `completed` requires `completedAt`. |
| 59 | +- If Version Compatibility is `blocked` or `incompatible`, Migration Plan must be `blocked`. |
| 60 | +- Migration Plan access remains owner-private unless platform administration permission applies. |
| 61 | + |
| 62 | +Validated forbidden leakage: |
| 63 | + |
| 64 | +- Runtime state rejected. |
| 65 | +- ToolState data rejected. |
| 66 | +- Installer state rejected. |
| 67 | +- Updater implementation details rejected. |
| 68 | +- Migration implementation code rejected. |
| 69 | +- File bytes rejected. |
| 70 | +- Download state rejected. |
| 71 | + |
| 72 | +## Samples Decision |
| 73 | + |
| 74 | +SKIP. This PR only changes shared contract definitions, contract fixtures, contract tests, docs/specs, and reports. Samples are not in scope. |
| 75 | + |
| 76 | +## Playwright |
| 77 | + |
| 78 | +Playwright impacted: No. This PR has no UI, runtime, tool behavior, rendering, or page changes. |
| 79 | + |
| 80 | +## Manual Validation |
| 81 | + |
| 82 | +1. Review `docs/dev/specs/MIGRATION_PLAN_CONTRACT.md`. |
| 83 | +2. Review `src/shared/contracts/migrationPlanContract.js`. |
| 84 | +3. Confirm Migration Plan links to Project, target Release, Version Compatibility, Update Channel, Library Item, Install Receipt, and owner records. |
| 85 | +4. Confirm migration state validation covers `notRequired`, `required`, `blocked`, and `completed`. |
| 86 | +5. Confirm source/target/schema version validation and compatibility gating rules are documented and tested. |
| 87 | +6. Confirm Migration Plan does not carry runtime, toolState, installer, updater, migration implementation code, file bytes, or download state. |
| 88 | +7. Confirm `docs/dev/reports/codex_review.diff` and `docs/dev/reports/codex_changed_files.txt` exist for review. |
0 commit comments