Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (103)
💤 Files with no reviewable changes (98)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughDocumentation and example migration.json files updated to simplify the on-disk migration manifest format. Migration identity is now defined as ChangesMigration manifest format revision
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
@prisma-next/extension-upgrade-skill
@prisma-next/skills
@prisma-next/upgrade-skill
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/extension-cipherstash
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/architecture` docs/subsystems/7. Migration System.md:
- Line 230: The manifest description uses two different keys for the same field;
replace occurrences of migrationId with migrationHash in the updated sections so
the on-disk manifest (migration.json) consistently documents the key as
migrationHash (you may still mention migrationId as a conceptual alias if
needed); ensure both the line showing "migration.json # from/to hashes,
migrationId — no inlined contracts" and the other referenced spot use
migrationHash and update any explanatory text that refers to the storage key to
match migrationHash.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 988dac06-2942-4871-b240-abc039b18c8c
⛔ Files ignored due to path filters (2)
projects/migration-manifest-drop-inline-contracts/plan.mdis excluded by!projects/**projects/migration-manifest-drop-inline-contracts/spec.mdis excluded by!projects/**
📒 Files selected for processing (163)
docs/architecture docs/adrs/ADR 169 - On-disk migration persistence.mddocs/architecture docs/subsystems/7. Migration System.mdexamples/cipherstash-integration/migrations/app/20260512T1716_migration/migration.jsonexamples/cipherstash-integration/migrations/cipherstash/20260601T0000_install_eql_bundle/migration.jsonexamples/mongo-demo/migrations/app/20260409T1030_migration/migration.jsonexamples/mongo-demo/migrations/app/20260415_add-posts-author-index/migration.jsonexamples/multi-extension-monorepo/packages/audit/migrations/20260601T0000_create_audit_event/migration.jsonexamples/multi-extension-monorepo/packages/feature-flags/migrations/20260601T0000_create_feature_flag/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260302T1000_alice_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260302T1100_bob_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260302T1200_staging_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260303T1000_merge_alice/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260303T1100_merge_bob/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260304T1000_add_comments/migration.jsonexamples/prisma-next-demo/migration-fixtures/complex/20260305T1000_add_tags/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260302T1100_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260302T1200_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260303T1000_merge_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260303T1100_merge_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/converging-branches/20260303T1200_merge_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260302T1000_alice_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260302T1100_bob_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260302T1200_bob_experiment/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260303T1000_merge_alice/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260303T1100_merge_bob/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260303T1200_bob_experiment_2/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond/20260302T1000_alice_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond/20260302T1100_bob_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond/20260303T1000_merge_alice/migration.jsonexamples/prisma-next-demo/migration-fixtures/diamond/20260303T1100_merge_bob/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260302T1100_widen_email/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260303T1000_email_default/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260304T1000_change_default/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260305T1000_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260306T1000_add_comments/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260307T1000_kitchen_sink/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260308T1000_rollback/migration.jsonexamples/prisma-next-demo/migration-fixtures/kitchen-sink/20260326T1428_migration/migration.jsonexamples/prisma-next-demo/migration-fixtures/linear/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/linear/20260302T1000_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260304T1000_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260305T1000_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260306T1000_add_comments/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260307T1000_add_tags/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260307T1100_late_branch/migration.jsonexamples/prisma-next-demo/migration-fixtures/long-spine/20260308T1000_add_everything/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260302T1100_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260302T1200_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1430_migration/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1431_foobar/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1431_migration/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1432_foobar/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260302T1100_staging/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260304T1000_add_comments/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260305T1000_add_tags/migration.jsonexamples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260306T1000_rollback_to_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback-continue/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback-continue/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback-continue/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback-continue/20260304T1000_rollback_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback-continue/20260305T1000_rollback_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback-continue/20260306T1000_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback/20260304T1000_rollback_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/rollback/20260305T1000_rollback_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260302T1000_alice_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260302T1100_bob_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260303T1000_merge_1a/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260303T1100_merge_1b/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260304T1000_add_comments/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260304T1100_add_posts_branch/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260305T1000_merge_2a/migration.jsonexamples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260305T1100_merge_2b/migration.jsonexamples/prisma-next-demo/migration-fixtures/single-branch/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/single-branch/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/single-branch/20260302T1100_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/single-branch/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/skip-rollback/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/skip-rollback/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/skip-rollback/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/skip-rollback/20260304T1000_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/skip-rollback/20260305T1000_rollback_to_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/skip-rollback/20260306T1000_rollback_to_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/sub-branches/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/sub-branches/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/sub-branches/20260302T1100_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/sub-branches/20260303T1000_add_bio/migration.jsonexamples/prisma-next-demo/migration-fixtures/sub-branches/20260303T1100_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/wide-fan/20260301T1000_init/migration.jsonexamples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1000_add_phone/migration.jsonexamples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1100_add_posts/migration.jsonexamples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1200_add_avatar/migration.jsonexamples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1300_add_category/migration.jsonexamples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1400_add_settings/migration.jsonexamples/prisma-next-demo/migrations/app/20260422T0720_initial/migration.jsonexamples/prisma-next-demo/migrations/app/20260422T0742_migration/migration.jsonexamples/prisma-next-demo/migrations/app/20260422T0748_migration/migration.jsonexamples/prisma-next-postgis-demo/migrations/app/20260512T1309_migration/migration.jsonexamples/prisma-next-postgis-demo/migrations/postgis/20260601T0000_install_postgis_extension/migration.jsonexamples/retail-store/migrations/app/20260513T0505_initial/migration.jsonexamples/retail-store/migrations/app/20260513T0507_add_product_category_index/migration.jsonexamples/retail-store/migrations/app/20260513T0508_backfill_product_status/migration.jsonpackages/1-framework/1-core/framework-components/src/control/control-migration-types.tspackages/1-framework/1-core/framework-components/src/control/control-spaces.tspackages/1-framework/3-tooling/cli/src/commands/migration-new.tspackages/1-framework/3-tooling/cli/src/commands/migration-plan.tspackages/1-framework/3-tooling/cli/src/control-api/types.tspackages/1-framework/3-tooling/cli/test/commands/migration-apply.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-e2e.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-invariants.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-plan-command.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-plan.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-ref.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-show.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-tamper.test.tspackages/1-framework/3-tooling/cli/test/control-api/db-init.test.tspackages/1-framework/3-tooling/cli/test/control-api/db-update.test.tspackages/1-framework/3-tooling/cli/test/migration-cli.test.tspackages/1-framework/3-tooling/cli/test/utils/contract-space-seed-phase.test.tspackages/1-framework/3-tooling/migration/README.mdpackages/1-framework/3-tooling/migration/src/errors.tspackages/1-framework/3-tooling/migration/src/hash.tspackages/1-framework/3-tooling/migration/src/io.tspackages/1-framework/3-tooling/migration/src/migration-base.tspackages/1-framework/3-tooling/migration/test/deletable-node-modules.test.tspackages/1-framework/3-tooling/migration/test/fixtures.tspackages/1-framework/3-tooling/migration/test/hash.test.tspackages/1-framework/3-tooling/migration/test/io.test.tspackages/1-framework/3-tooling/migration/test/materialise-extension-migration-package-if-missing.test.tspackages/1-framework/3-tooling/migration/test/materialise-migration-package.test.tspackages/1-framework/3-tooling/migration/test/migration-base.test.tspackages/2-mongo-family/9-family/src/core/mongo-target-descriptor.tspackages/2-sql/9-family/src/core/migrations/types.tspackages/3-extensions/cipherstash/migrations/20260601T0000_install_eql_bundle/migration.jsonpackages/3-extensions/paradedb/migrations/20260601T0000_install_pg_search_extension/migration.jsonpackages/3-extensions/pgvector/migrations/20260601T0000_install_vector_extension/migration.jsonpackages/3-extensions/pgvector/migrations/20260601T0000_install_vector_extension/migration.tspackages/3-extensions/postgis/migrations/20260601T0000_install_postgis_extension/migration.jsonpackages/3-extensions/postgis/migrations/20260601T0000_install_postgis_extension/migration.tspackages/3-targets/6-adapters/postgres/test/migrations/db-init-update.cli.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/db-init-update.cli.test.tstest/integration/test/contract-space-fixture-mongo/migrations.tstest/integration/test/contract-space-fixture/migrations.tstest/integration/test/extension-pgvector-scenario-a.e2e.integration.test.ts
💤 Files with no reviewable changes (111)
- examples/prisma-next-demo/migration-fixtures/diamond/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/skip-rollback/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/linear/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/sub-branches/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/single-branch/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260303T1000_email_default/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback/20260304T1000_rollback_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260302T1100_bob_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260303T1000_add_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback-continue/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260303T1100_merge_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260302T1000_alice_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback-continue/20260304T1000_rollback_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond/20260303T1000_merge_alice/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260303T1000_merge_alice/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260303T1000_merge_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond/20260302T1000_alice_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260302T1200_staging_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback-continue/20260305T1000_rollback_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1400_add_settings/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260302T1100_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260304T1000_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/linear/20260302T1000_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback-continue/20260306T1000_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260303T1000_merge_1a/migration.json
- examples/prisma-next-demo/migration-fixtures/skip-rollback/20260306T1000_rollback_to_init/migration.json
- examples/multi-extension-monorepo/packages/feature-flags/migrations/20260601T0000_create_feature_flag/migration.json
- examples/prisma-next-demo/migration-fixtures/wide-fan/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/skip-rollback/20260305T1000_rollback_to_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond/20260302T1100_bob_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260303T1100_merge_1b/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1431_migration/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260303T1200_merge_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback/20260303T1000_add_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260302T1100_add_posts/migration.json
- examples/prisma-next-demo/migrations/app/20260422T0720_initial/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260305T1100_merge_2b/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260303T1100_merge_bob/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260303T1100_merge_bob/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1430_migration/migration.json
- examples/prisma-next-demo/migration-fixtures/single-branch/20260303T1000_add_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback-continue/20260303T1000_add_bio/migration.json
- examples/mongo-demo/migrations/app/20260409T1030_migration/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1432_foobar/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback/20260305T1000_rollback_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/rollback-continue/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/single-branch/20260302T1100_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260305T1000_merge_2a/migration.json
- examples/prisma-next-demo/migration-fixtures/skip-rollback/20260304T1000_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260304T1100_add_posts_branch/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260307T1000_kitchen_sink/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260326T1431_foobar/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260303T1000_add_bio/migration.json
- examples/prisma-next-demo/migrations/app/20260422T0742_migration/migration.json
- examples/prisma-next-demo/migration-fixtures/sub-branches/20260303T1100_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260326T1428_migration/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260304T1000_add_comments/migration.json
- examples/prisma-next-demo/migration-fixtures/sub-branches/20260302T1100_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-branch/20260302T1200_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260304T1000_change_default/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260302T1100_widen_email/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260307T1100_late_branch/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260303T1000_add_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260305T1000_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260302T1100_bob_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/skip-rollback/20260303T1000_add_bio/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260306T1000_rollback_to_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260301T1000_init/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260305T1000_add_tags/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260304T1000_add_comments/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260306T1000_add_comments/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260305T1000_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260302T1100_staging/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1100_add_posts/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260307T1000_add_tags/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260302T1000_alice_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/sub-branches/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260308T1000_rollback/migration.json
- examples/prisma-next-demo/migration-fixtures/converging-branches/20260302T1200_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/kitchen-sink/20260306T1000_add_comments/migration.json
- examples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1200_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260303T1000_merge_alice/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260305T1000_add_tags/migration.json
- examples/prisma-next-demo/migration-fixtures/single-branch/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migrations/app/20260422T0748_migration/migration.json
- examples/prisma-next-demo/migration-fixtures/long-spine/20260308T1000_add_everything/migration.json
- examples/prisma-next-demo/migration-fixtures/sub-branches/20260303T1000_add_bio/migration.json
- examples/multi-extension-monorepo/packages/audit/migrations/20260601T0000_create_audit_event/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond/20260303T1100_merge_bob/migration.json
- examples/prisma-next-demo/migration-fixtures/skip-rollback/20260302T1000_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260303T1200_bob_experiment_2/migration.json
- examples/prisma-next-demo/migration-fixtures/diamond-sub-branch/20260302T1200_bob_experiment/migration.json
- examples/prisma-next-demo/migration-fixtures/multi-rollback-branch/20260304T1000_add_comments/migration.json
- examples/prisma-next-demo/migration-fixtures/complex/20260302T1100_bob_add_avatar/migration.json
- examples/prisma-next-demo/migration-fixtures/sequential-diamonds/20260302T1000_alice_add_phone/migration.json
- examples/prisma-next-demo/migration-fixtures/wide-fan/20260302T1300_add_category/migration.json
86c4f24 to
486f8c8
Compare
Adds projects/prisma-next-agent-skill/specs/upgrade-skill.spec.md as a hand-off artefact for an implementer. Pins the two-skill architecture (published @prisma-next/upgrade-skill plus in-repo .agents/skills/record-recipe/), the per-transition recipe layout (one recipe.md per transition plus colocated portable scripts), the publish-pipeline gate that refuses to ship a version with an examples/ or packages/3-extensions/ diff but no covering recipe, and the validation-by-execution protocol (the change-making agent runs the recipe against in-repo example apps and extensions before merge). Records 20 functional requirements, 8 non-functional requirements, 12 acceptance criteria, and 2 residual implementer questions. PR #502 (migration.json bookend drop) is the worked example throughout. Refs: TML-2514, TML-2515 Signed-off-by: Will Madden <[email protected]>
Adds projects/prisma-next-agent-skill/specs/upgrade-skill.spec.md as a hand-off artefact for an implementer. Pins the two-skill architecture (published @prisma-next/upgrade-skill plus in-repo .agents/skills/record-recipe/), the per-transition recipe layout (one recipe.md per transition plus colocated portable scripts), the publish-pipeline gate that refuses to ship a version with an examples/ or packages/3-extensions/ diff but no covering recipe, and the validation-by-execution protocol (the change-making agent runs the recipe against in-repo example apps and extensions before merge). Records 20 functional requirements, 8 non-functional requirements, 12 acceptance criteria, and 2 residual implementer questions. PR #502 (migration.json bookend drop) is the worked example throughout. Refs: TML-2514, TML-2515 Signed-off-by: Will Madden <[email protected]>
Adds projects/prisma-next-agent-skill/specs/upgrade-skill.spec.md as a hand-off artefact for an implementer. Pins the two-skill architecture (published @prisma-next/upgrade-skill plus in-repo .agents/skills/record-recipe/), the per-transition recipe layout (one recipe.md per transition plus colocated portable scripts), the publish-pipeline gate that refuses to ship a version with an examples/ or packages/3-extensions/ diff but no covering recipe, and the validation-by-execution protocol (the change-making agent runs the recipe against in-repo example apps and extensions before merge). Records 20 functional requirements, 8 non-functional requirements, 12 acceptance criteria, and 2 residual implementer questions. PR #502 (migration.json bookend drop) is the worked example throughout. Refs: TML-2514, TML-2515 Signed-off-by: Will Madden <[email protected]>
Adds projects/prisma-next-agent-skill/specs/upgrade-skill.spec.md as a hand-off artefact for an implementer. Pins the two-skill architecture (published @prisma-next/upgrade-skill plus in-repo .agents/skills/record-recipe/), the per-transition recipe layout (one recipe.md per transition plus colocated portable scripts), the publish-pipeline gate that refuses to ship a version with an examples/ or packages/3-extensions/ diff but no covering recipe, and the validation-by-execution protocol (the change-making agent runs the recipe against in-repo example apps and extensions before merge). Records 20 functional requirements, 8 non-functional requirements, 12 acceptance criteria, and 2 residual implementer questions. PR #502 (migration.json bookend drop) is the worked example throughout. Refs: TML-2514, TML-2515 Signed-off-by: Will Madden <[email protected]>
Introduces the new `packages/0-shared/` tier (alongside `0-config`) and populates it with the two leaf publish-only workspace packages that will be distributed via npm as agent skills: - `@prisma-next/upgrade-skill` — for users of Prisma Next. Its `SKILL.md` carries the consumer-facing flow: Step 0 ensure-latest, the FR27 pre-flight that reads `prisma-next.config.ts` and each installed extension's pinned `@prisma-next/*` version before refusing to upgrade past the lowest pin, role detection, version detection, the per-minor transition chain, and the bump → install → instructions → validate → commit per-step loop. - `@prisma-next/extension-upgrade-skill` — for extension authors. Same shape minus the user-side pre-flight, plus a `pnpm exec prisma-next-check-pins` sanity check after each bump step. Declares a `bin` for `prisma-next-check-pins`; the bin file is a stub for this milestone (real CLI lands next). Both packages ship a placeholder `upgrades/0.6-to-0.7/instructions.md` with `changes: []` so the publish gate has a real directory to verify against; the first real entries land via PR #502's rebase. Neither package declares the other as any kind of dependency (satisfies the hard requirement that the two skills have no cross-package dep). The `0-shared` tier mirrors `0-config`'s precedent: not registered in `architecture.config.json` (and therefore not enumerated by `dependency-cruiser.config.mjs` either) — the packages have no runtime dependencies and are not imported by any other workspace package, so they need no module-group entry. `pnpm-workspace.yaml` already covers them via `packages/**`; no additional wiring is needed. m1 of the upgrade-skill mechanism (TML-2519). The placeholder `SKILL.md` bodies, README content, and stub bin are the substrate the next milestones will fill in. Signed-off-by: Will Madden <[email protected]>
Introduces the new `packages/0-shared/` tier (alongside `0-config`) and populates it with the two leaf publish-only workspace packages that will be distributed via npm as agent skills: - `@prisma-next/upgrade-skill` — for users of Prisma Next. Its `SKILL.md` carries the consumer-facing flow: Step 0 ensure-latest, the FR27 pre-flight that reads `prisma-next.config.ts` and each installed extension's pinned `@prisma-next/*` version before refusing to upgrade past the lowest pin, role detection, version detection, the per-minor transition chain, and the bump → install → instructions → validate → commit per-step loop. - `@prisma-next/extension-upgrade-skill` — for extension authors. Same shape minus the user-side pre-flight, plus a `pnpm exec prisma-next-check-pins` sanity check after each bump step. Declares a `bin` for `prisma-next-check-pins`; the bin file is a stub for this milestone (real CLI lands next). Both packages ship a placeholder `upgrades/0.6-to-0.7/instructions.md` with `changes: []` so the publish gate has a real directory to verify against; the first real entries land via PR #502's rebase. Neither package declares the other as any kind of dependency (satisfies the hard requirement that the two skills have no cross-package dep). The `0-shared` tier mirrors `0-config`'s precedent: not registered in `architecture.config.json` (and therefore not enumerated by `dependency-cruiser.config.mjs` either) — the packages have no runtime dependencies and are not imported by any other workspace package, so they need no module-group entry. `pnpm-workspace.yaml` already covers them via `packages/**`; no additional wiring is needed. m1 of the upgrade-skill mechanism (TML-2519). The placeholder `SKILL.md` bodies, README content, and stub bin are the substrate the next milestones will fill in. Signed-off-by: Will Madden <[email protected]>
486f8c8 to
69a386e
Compare
…512) Spec and plan for removing the inlined fromContract / toContract fields from migration.json. The destination contract already lives in the sibling end-contract.json on disk; the inlined copy roughly doubles every migration artefact for non-trivial schemas. Locks in a structural property along the way: the runner depends only on migration.json + ops.json + the project-root contract.json. Per-migration *-contract.json files are authoring-time conveniences for migration plan and migration.ts, never apply-time dependencies. A regression test pins this. Refs: TML-2512, TML-2515 (broader back-compat policy work) Supersedes: TML-2274 (closed as duplicate) Signed-off-by: Will Madden <[email protected]>
…oContract fields Locks in the post-TML-2512 manifest shape: a migration.json carrying either inlined contract field must be rejected at read time, not silently tolerated. The fields will be removed from MigrationMetadata in the next commit; this test fails today (the manifest is currently accepted) and goes green once the schema drops them. Refs: TML-2512 Signed-off-by: Will Madden <[email protected]>
…ifest The migration.json manifest no longer carries fromContract / toContract. The destination contract for a migration lives in the sibling end-contract.json file authored alongside the package; the predecessor contract lives in its own directory's end-contract.json. This removes the duplication that roughly doubled every migration artefact for non-trivial schemas. Concrete changes: - MigrationMetadata no longer declares fromContract / toContract. - MigrationMetadataSchema in io.ts rejects manifests carrying either field (strict mode via the existing `+: reject` policy). A pair of regression tests pins this. - computeMigrationHash continues to ignore the dropped fields (no behavior change for the hash itself - ADR 199 has always treated contracts as out-of-hash); the strip destructure is simplified accordingly. - migration plan now reads the predecessor's contract by parsing <predecessorDir>/end-contract.json. migration new no longer needs the parsed contract at all (it only scaffolds an empty migration.ts). - materialiseMigrationPackage stops writing a per-package contract.json side-car. The runtime aggregate loader has always read the per-space contract head from <migrationsDir>/<spaceId>/contract.json, never from individual migration directories - the side-car was dead bytes. - assertBookendsMatchMeta and the MIGRATION.STALE_CONTRACT_BOOKENDS error code are removed. With contracts no longer inlined in the manifest, the staleness mismatch they guarded against can no longer occur. - Test fixtures and CLI tests updated to match the new metadata shape. Refs: TML-2512 Supersedes: TML-2274 (closed as duplicate) Signed-off-by: Will Madden <[email protected]>
Repo-wide cross-check pass after Checkpoint A surfaced sites the
TypeScript-only sweep missed:
- `MigrationApplyStep.toContract` was a dead public-API field with no
producer or consumer; dropped, along with the now-unused `Contract`
import in the CLI control-api types.
- Two contract-space integration fixtures (sqlite + postgres + mongo)
still hand-rolled `fromContract`/`toContract` into the metadata they
wrote with `materialiseMigrationPackage`. The new schema rejected
these as legacy fields and the loader surfaced a "contract-space
integrity failure". Stripped the fields from each fixture.
- Refreshed stale doc-comments and README phrasing that referenced
`metadata.toContract` as the source of truth for the predecessor
contract (now read from `end-contract.json`) or the runners
contract input (now the project-root contract).
- Dropped a leftover `toContract: {}` mock literal in
`migration-plan-command.test.ts` that the CLI no longer reads.
`pnpm -r typecheck` and `pnpm test:packages` both clean (modulo two
pre-existing pg pool flakes that pass on focused reruns).
Refs: TML-2512
Signed-off-by: Will Madden <[email protected]>
…or rename `f82073a6b examples(retail-store): rename masterCategory → primaryCategory` edited the manifests' ops payloads in place but did not recompute `migrationHash`, leaving these three entries internally inconsistent (stored hash no longer reproduced against the on-disk ops). Healed by recomputing the hash; identity is intentionally allowed to shift here since these are example artefacts with no external pinned references (verified by grep across the repo) and no `signature` field is present on any manifest in the tree. Caught while running the manifest-strip pass for TML-2512: the strip pass's hash-invariance guard refused to write these three because the recomputed hash did not match the stored one, even though no actual field-strip had taken place yet. Fixing this drift first keeps the TML-2512 strip pass a pure deletion with no identity churn. Signed-off-by: Will Madden <[email protected]>
…ifests T7 of TML-2512. Sweep every on-disk `migration.json` in the tree and remove the redundant `fromContract` / `toContract` keys; the full contract IRs already live in sibling `start-contract.json` / `end-contract.json` artefacts (or are reachable through them via the predecessor link), so inlining them in the manifest was pure duplication. The pass is a pure deletion. Stored `migrationHash` values are preserved verbatim — the hash framing in `computeMigrationHash` was designed (ADR 199) to anchor migration identity on storage-hash bookends (`from`, `to`) and the ops payload, not on contract IRs, so stripping the keys does not change the content-addressed identity. The strip script reads each manifest, deletes the two keys, recomputes the hash against the bookend-less envelope, and refuses to write if the value drifts. All 123 manifests cleared the invariance check after the preceding retail-store heal commit. Net diff: -26282 insertions / +132 deletions across 123 files (the +132 is JSON re-serialisation of preserved keys; no value changes). Refs: TML-2512 Signed-off-by: Will Madden <[email protected]>
… files
T8 of TML-2512. The migration loader must not require sibling
`start-contract.json` / `end-contract.json` files on disk; those are
author-time conveniences (TypeScript imports for `migration.ts` data
migrations, IDE jump-to-definition) rather than structural inputs to
the runner. The new tests:
- `loads a package whose directory holds only migration.json + ops.json`
asserts the single-package reader succeeds against a directory that
literally contains nothing else, and additionally asserts the
directory listing itself is exactly those two files.
- `readMigrationsDir loads packages whose directories hold only
migration.json + ops.json` asserts the multi-package directory
scanner has the same property when iterating siblings.
These pin the contract that the apply / verify pipelines only consume
`{migration.json, ops.json}` per migration; future changes that
re-introduce a sidecar dependency (e.g. parsing `end-contract.json`
inside the loader) will fail here.
Refs: TML-2512
Signed-off-by: Will Madden <[email protected]>
…ndependence
T9 of TML-2512. Two doc updates:
- `docs/architecture docs/subsystems/7. Migration System.md`. The
"File Layout" diagram now shows the actual per-package contents
(`start-contract.{json,d.ts}` + `end-contract.{json,d.ts}` next to
the manifest, not a single `contract.{json,d.ts}` pair). The "Model"
paragraph drops the "edge embeds the full fromContract / toContract
IR" wording — the bookends now hold storage hashes only — and points
readers to the sibling snapshot files. The "Storage-only identity"
paragraph drops the "canonicalized fromContract / toContract … are
excluded from the hash" wording: the fields are not part of the
manifest at all any more, so framing them as "excluded" is
misleading. A new "Runner-side independence from contract snapshots"
section names the durable property (apply only needs migration.json
+ ops.json per package, plus the project-root contract) and cites
the regression test that pins it.
- `docs/architecture docs/adrs/ADR 169 - On-disk migration persistence.md`.
Added a "Status" section at the top marking the ADR as partially
superseded — sections 3 ("Content-addressed migration identity")
and 7 ("Full contracts embedded in migration packages") were
reversed by ADR 199 (storage-only identity) and the manifest strip
driven by TML-2512. The body is preserved unchanged for historical
context per the supersession convention used elsewhere in the ADR
set.
Refs: TML-2512
Signed-off-by: Will Madden <[email protected]>
…sing Closing the spec acceptance gap for TML-2512: `migration plan` and `migration new` both reach for the previous migration's sibling `end-contract.json` when an earlier migration exists, but neither surfaced a useful diagnostic if that file was gone — they bubbled the raw `ENOENT` up to Commander, which prints a bare stack trace. Wrap both reads. `migration plan` raises `errorFileNotFound` from within `readPredecessorEndContract`, names the predecessor directory in the `why`, and points the operator at re-emitting the predecessor migration in the `fix`. `migration plan`'s outer load-phase `catch` forwards a `CliStructuredError` instance through unchanged rather than re-wrapping it in a generic `errorUnexpected` envelope. `migration new` does not parse the predecessor contract (it only copies the sibling files), so the file read happens later inside `copyFilesWithRename`; the same envelope is produced there. New unit test in `migration-plan-command.test.ts` injects an `ENOENT` into the mocked `readFile`, runs the command, and asserts the emitted JSON error envelope names the missing file path, the predecessor migration directory, and the operator-facing fix string. Empirically verified end-to-end against the `prisma-next-demo` example: deleting the latest migration's `end-contract.json` and re-running `migration plan` now exits with `PN-CLI-4004` and the same structured payload the unit test pins. Refs: TML-2512 Signed-off-by: Will Madden <[email protected]>
…he on-disk key The migration manifest field is named `migrationHash` in the schema (`MigrationMetadataSchema` in `io.ts`) and in every committed `migration.json`, but the subsystem doc inherited a long-standing `migrationId` label that was used inconsistently — most uses referred to the on-disk field name, not to a distinct conceptual identifier. The runner-independence section added in this branch (line 255) already uses `migrationHash`; this commit aligns the rest of the document with the code and with that section, so a reader who lands on the File Layout block or the Storage-only identity subsection sees the same key name they will see when they open a `migration.json`. Refs: TML-2512 Signed-off-by: Will Madden <[email protected]>
…s (TML-2512) Adds matching `changes[]` entries to both the user-facing `@prisma-next/upgrade-skill` and the `@prisma-next/extension-upgrade-skill` packages, plus a shared `strip-inline-contracts.ts` colocated script (duplicated per the no-cross-dep policy). The script walks the project root, identifies every `migration.json` whose JSON has the manifest shape (`from` / `to` / `migrationHash` keys), and excises any `fromContract` / `toContract` properties at the text level. The text-level strip preserves the formatting of every surviving field byte-for-byte (whitespace, inline-vs-multiline arrays, key ordering, trailing newline conventions), so the resulting diff for a downstream consumer is exclusively the two key removals — no incidental re-pretty-printing churn. The script reparses its own output as a guard against accidental corruption. The user-facing entry is purely the strip; users almost never read `metadata.fromContract` / `metadata.toContract` from application code, so the residual work is filesystem-level. The extension-author entry adds a second `changes[]` entry naming the source-level rename / drop work (TypeScript that constructs or destructures `MigrationMetadata`) plus a prose pointer to scrub stale `toContract` references from seed `migration.ts` doc comments — the framework-shipped seed migrations in this PR were updated for exactly that reason. Validation: ran the script against the substrate reverted to `origin/main` state and confirmed it strips all 123 affected manifests to the same shape the PR carries forward (the residual diff after running consists only of three project-specific stale-hash repairs and a couple of trailing-newline conventions, none of which are upgrade-shaped transformations). `pnpm check:upgrade-coverage` passes. Refs: TML-2512 Signed-off-by: Will Madden <[email protected]>
…nHash Rebase resolution incorrectly kept a `signature` destructure that was removed from `MigrationMetadata` on main, breaking typecheck and the in-test type checker. Signed-off-by: Will Madden <[email protected]>
2d4245b to
08fafe6
Compare
closes TML-2512
At a glance
A
migration.jsonafter this change is the manifest, nothing more:{ "from": "sha256:f76977c7745bd6fbf38728c544b372927969f19955489d7ff5c9c1eddcdc0b36", "to": "sha256:8a15f8e37a3a8731578a87102f9507da65b5f84556f84320ea0ead82645e394d", "hints": { "used": [], "applied": [], "plannerVersion": "2.0.0" }, "labels": [], "createdAt": "2026-05-13T05:07:50.592Z", "providedInvariants": [], "migrationHash": "sha256:7405331b31014ccebdf507ec55a0907f13c15b95cc6ef11c53bc415e8309ba62" }The same migration on
maincarries a fullfromContractand a fulltoContractobject embedded inline — typically thousands of lines for a non-trivial schema. The contract content already lives next door in the siblingstart-contract.json/end-contract.jsonfiles; the manifest copy was redundant.Decision
Two related changes ship together:
MigrationMetadatadropsfromContractandtoContract. The arktype schema inio.tsrejects manifests that still carry them (clean break, no tolerant loader). Hash framing is unaffected — those fields were never part ofmigrationHash(ADR 199).migration applyconsumesmigration.json+ops.jsonper package, plus the project-root / per-spacecontract.jsonfor head state. The siblingstart-contract.json/end-contract.jsonfiles remain for author-time convenience (typed access frommigration.ts, predecessor lookup duringmigration plan), but a user who deletes every*-contract.jsoncan still apply migrations. This is now pinned by a test rather than an aspiration (Migration System subsystem doc).How it fits together
Type and schema.
MigrationMetadata(control-migration-types.ts) loses the two fields.MigrationMetadataSchema(io.ts) keeps'+': 'reject'so legacy manifests fail loud with a clear arktype error.computeMigrationHash(hash.ts) loses its strip destructure — there is nothing left to strip.Producers.
migration-plan.tsandmigration-new.tsstop assembling the two fields intobaseMetadata.migration-base.ts:buildAttestedMetadatadoes the same;assertBookendsMatchMetaand theMIGRATION.STALE_CONTRACT_BOOKENDSerror code are deleted alongside it.Predecessor lookup moves to disk.
migration planpreviously readpredecessor.metadata.toContractto feed the planner'sfromContractparameter. It now reads the predecessor's siblingend-contract.json(migration-plan.ts). TheMigrationPlanner.plan({ fromContract: Contract \| null, ... })interface is unchanged; the planner stays file-I/O-free.materialiseMigrationPackagestops writing dead bytes. It used to emit a per-packagecontract.jsonthat no reader consumed. The aggregate loader has always sourced per-space contract heads from<migrationsDir>/<spaceId>/contract.json, never from individual migration directories.Diagnostics for missing predecessor. If the predecessor's
end-contract.jsonis gone,migration planandmigration newnow raiseerrorFileNotFound(PN-CLI-4004) naming the file and pointing the operator at re-emitting the predecessor. Previously this bubbled a rawENOENTstack through Commander.All committed manifests regenerated. 123
migration.jsonfiles acrossexamples/, both extension seeds (pgvector, postgis), and every test fixture lose the inlined bodies. A separate small commit heals three retail-store manifests whose stored hashes had drifted fromcomputeMigrationHashdue to an earlier directory rename — that drift was pre-existing and only became visible once the framing was tightened.Behavior changes & evidence
migration.jsonno longer carriesfromContract/toContract. Manifests that still do are rejected with an arktype "unknown key" error at load time.migration applyruns from{migration.json, ops.json}per package only.loads a package whose directory holds only migration.json + ops.jsonand the multi-package equivalent, both assertingreaddirreturns exactly those two filenamesmigration planreads the predecessor contract from disk.readPredecessorEndContract)migration plan/migration newraise a structuredPN-CLI-4004when the predecessor'send-contract.jsonis missing.surfaces a structured file-not-found error when the predecessor end-contract.json is missingmaterialiseMigrationPackagestops emitting per-packagecontract.json.materialiseMigrationPackage)migrationHashfor every existing migration is byte-identical. Verified bywip/strip-manifest-bookends.ts --checkafter regeneration: no drift across the 123 manifests touched.Compatibility / migration / risk
fromContract/toContractwill fail to load with an arktype "unknown key" error. The only known external consumer is the Cipherstash extension; we are sending a heads-up directly with regeneration instructions.migrationHashwas already storage-only (ADR 199); the contracts were stripped before hashing all along. Anyone who pinned amigrationHashvalue continues to see the same value.MigrationPlanner. The planner still takes{ fromContract: Contract | null, ... }as a value, file I/O stays in the CLI.test:packages,test:integration, andtest:e2eall pass on this branch.Follow-ups
Alternatives considered
'+': 'reject'on the schema is the simplest possible invariant, and the only external consumer is a single extension we can reach directly. A shim would have outlived its usefulness in days while permanently weakening the schema.contracts/directory. Genuinely tidier than the sibling-file convention, but out of scope for a redundancy-removal PR. The sibling-file approach is already proven andmigration planreads exactly one file per invocation.Summary by CodeRabbit
Documentation
Chores