Skip to content

test(handoff): validate a Migrate-built handoff; accept the contract version range (E2 contract, 2/2) - #399

Merged
ABB65 merged 1 commit into
mainfrom
test/migrate-handoff-golden
Oct 3, 2026
Merged

ABB65 merged 1 commit into
mainfrom
test/migrate-handoff-golden

Conversation

@ABB65

@ABB65 ABB65 commented Oct 3, 2026

Copy link
Copy Markdown
Member
  • validateMigrationHandoff: version !== 1 becomes an integer range 1..MIGRATION_CONTRACT_VERSION (unsupported_version outside it).
  • @contentrain/types pin 1.35.0 -> 1.40.0 (+ lockfile).
  • tests/fixtures/migrate-handoff-golden.json is a byte copy of Migrate's packages/delivery/tests/fixtures/studio-golden-handoff.json; migration-handoff-migrate-golden.test.ts runs it through validate, split, summarize and enrich.

Keep the fixture byte-identical to Migrate's when either side changes the contract. Paired with Contentrain/migrate test/handoff-golden.

…version range

Studio's validator rejected anything but version 1; it now accepts any
integer from 1 up to MIGRATION_CONTRACT_VERSION. A golden handoff written
by Migrate's producer runs through validate, split, summarize and enrich.
Bumps @contentrain/types 1.35.0 to 1.40.0.
@ABB65

ABB65 commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

ONAY 1bbfaaf (t9). (1) The fixture is byte-identical to Migrate's studio-golden-handoff.json from migrate#352 (same sha1 d06048ae…), and that file is produced by Migrate's real buildHandoff + stampHandoff. (2) The version check is now a range, integer, 1..MIGRATION_CONTRACT_VERSION: v1 passes (golden validates), and 0, 1.5 and MIGRATION_CONTRACT_VERSION+1 give unsupported_version with the version in detail (tested; the old v2 test still holds). In @contentrain/types 1.40.0 the constant is still 1, so today this is behaviour-neutral and only stops a future bump from needing a code change. (3) Fresh worktree: unit 176 files / 1915 tests pass, integration 50 files / 467 tests pass; the full CI test:ci job is green (16m). The types bump 1.35.0 to 1.40.0 only touches package.json and the lockfile.

@ABB65
ABB65 merged commit 7a86fd8 into main Oct 3, 2026
2 checks passed
@ABB65
ABB65 deleted the test/migrate-handoff-golden branch October 3, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant