test(handoff): validate a Migrate-built handoff; accept the contract version range (E2 contract, 2/2) - #399
Conversation
…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.
|
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. |
validateMigrationHandoff:version !== 1becomes an integer range 1..MIGRATION_CONTRACT_VERSION(unsupported_versionoutside it).@contentrain/typespin 1.35.0 -> 1.40.0 (+ lockfile).tests/fixtures/migrate-handoff-golden.jsonis a byte copy of Migrate'spackages/delivery/tests/fixtures/studio-golden-handoff.json;migration-handoff-migrate-golden.test.tsruns 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.