Skip to content

feat!: before 8.0.0, compute each contract hash from its own section with every value the author wrote, then freeze the rules (changes every existing hash) - #31203

Merged
wmadden-electric merged 35 commits into
mainfrom
ga-compat-hashes
Nov 29, 2026

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

At a glance

The decision: before 8.0.0, Prisma changes how it computes a contract's hashes, in two ways, and from 8.0.0 those rules do not change again until Prisma 9. Every existing hash changes once, in this release.

A contract has three hashes. The storage hash identifies the database the contract describes: its tables, columns and indexes. The profile hash identifies the database features the contract requires, such as RETURNING. The execution hash identifies the defaults the client fills in when it writes a row. The storage hash matters most, because Prisma writes it into five places:

prisma/contract.json                                     "storageHash": "6a0532b8…"
migrations/app/20261124T0900_add_phone/migration.json    "from": "09807bbe…", "to": "6a0532b8…"
migrations/snapshots/6a0532b8…/contract.json             a saved copy of the contract (a snapshot), named by its hash
migrations/app/refs/production.json                      "hash": "6a0532b8…"
the database's marker                                    storage hash 6a0532b8…

The marker is a row Prisma keeps in the database to record which contract it matches. A ref names the contract an environment such as production should be at.

The two changes:

// Before: the storage hash was computed from the whole contract, with the other parts blanked out
{ "schemaVersion": "1", "targetFamily": "sql", "target": "postgres", "profileHash": "", "roots": {},
  "domain": { "namespaces": {} }, "storage": { "...": "..." }, "capabilities": {}, "extensions": {}, "meta": {} }

// After: from the storage section alone, with every value the author wrote
{ "storage": { "...": "..." } }
  1. Each hash is computed from its own section of the contract only: storage, capabilities or execution.
  2. No value the author wrote is left out. The old rules dropped every false, [] and {}, so an index option such as { "fastupdate": false } was lost from the file, the hash and the database.

The cost, once: a project from a release candidate runs a script that rewrites the hashes in its files, and signs each database again with prisma db sign, which checks that the database matches the contract and records the new hashes in its marker.

Why the rules change now, and only now

If a later release computed a different hash for the same contract, all five places above would stop agreeing at once. Migrations would no longer chain from one to the next, saved copies would look edited, and every database would report that it does not match its contract. So within Prisma 8 the rules cannot change. Both defects below would be frozen in with them, so they are repaired now.

Defect 1: the hash covered more than the section

Because the storage hash was computed from a blanked copy of the whole contract, the first change to the file's format version, or a new field in any blanked part, would have changed every hash.

The target and the family were in the input too. A family is a kind of database Prisma supports (SQL or MongoDB), and a target is one database in it (PostgreSQL, MySQL, MariaDB). A hash is only ever compared with hashes from the same project, or from an extension the project declares, and a project has one target. So the target in a hash changed no comparison. Its one effect showed after a project moved between two targets that write the same storage. MySQL and MariaDB share their type names, so their storage can be identical. After such a move, no migration ended at the new contract's hash, no saved copy was named by it, and the marker no longer matched, so the team had to start its migration history again. The family adds nothing a target does not already say.

Defect 2: the rules dropped values the author wrote

The old rule left out every false and empty value except at a list of known places. That is right for a family's own defaults. For example, a column's many: false (the column holds one value, not a list) means the same as no many at all. But a value that belongs to the database or to an extension is not a default the family can drop:

{ "name": "posts_tags_idx", "type": "gin", "options": { "fastupdate": false } }

was written and hashed as "options": {}, so the migration created the index without the option, and an index with the option had the same hash as one without. A check of every place the old rule fired found these:

Value What went wrong
A PostgreSQL index's options, { fastupdate: false } Written as {}; the index was created without the option
A MongoDB partial index filter, { isAdmin: false } Written as {}, a filter that matches every document
A MongoDB clustered collection, clusteredIndex: {} Dropped, so the contract described an ordinary collection
A MongoDB collation's backwards: false, where the locale's default is true Dropped, so the locale's default applied
A column type's parameters, { strict: false } Two contracts with different parameters had the same hash
A default-value generator's parameters, { upper: false } Dropped, so the generator used its own default
A false or empty value inside an entry an extension defines Dropped, so the extension read a different setting

Now the framework leaves out nothing. Each family names the fields it defines as defaults, in one function, normalizeStorage, which is applied both when storage is written and when it is hashed. The full list is in ADR 010.

Two smaller repairs

Each of these also changes hashes, so this is their one chance:

  • The SQL profile hash now covers the contract's capabilities. It covered an empty list, so a database that lacked a required feature still matched. Flags that are off are left out, so writing a flag as false or leaving it out gives the same hash.
  • Lists whose order means nothing are sorted before hashing: a SQL table's checks, foreign keys, indexes and uniques, and a MongoDB collection's indexes. Reordering two relations in a model reorders their foreign keys, which used to ask for a migration that did nothing.

What follows from these changes

A contract for the wrong target is caught by checks that name it. Without the target in the hash, nothing about a hash says which target it was for. The hash caught a contract for the wrong target only by accident: a stale MySQL contract used against a database a MariaDB contract had signed did not match the marker, but the error said only that the database did not match, not that the target was wrong. And a stale contract used against a database it had signed itself matched. Explicit checks catch it in every case and say what is wrong:

  • the runtime refuses a contract for another target (RUNTIME.CONTRACT_TARGET_MISMATCH);
  • the extension loader refuses an extension built for another target (MIGRATION.CONTRACT_SPACE_VIOLATION);
  • new here: every command that loads the project's migrations and extensions, including db sign, db init, db update, db migrate, migration plan and migration status, refuses an app contract whose target is not the config's, with CONTRACT.TARGET_MISMATCH, the code db verify already reports. contract emit, which is how a stale contract is fixed, is not refused. The commands that change a database had no such check before.

Two targets may write the same storage only if a migration planned by either one runs on the other, because after a move the project keeps its migrations. MariaDB plans with MySQL's planner, so this holds. A target built outside this repository takes on the same rule. After such a move the storage hashes, migrations, saved copies and refs stay as they are. The profile hash changes where the two targets' capabilities differ, as MySQL's and MariaDB's do, so each database is signed again with prisma db sign.

An extension's newest saved copy now follows the installed extension. An extension can ship its own tables and migrations, and Prisma keeps a saved copy of the extension's contract next to the app's, named by its storage hash. A copy already on disk was never rewritten. So an extension whose capabilities changed while its storage did not, or a project that moved from MySQL to MariaDB, kept a copy with the old profile hash or target. prisma db sign recorded that stale profile hash in the database. Now the copy is replaced when the installed extension's contract differs. This fixed the stale saved copies in this repository's examples.

The freeze is held by tests, not by care. Each family keeps saved contracts and their expected hashes as literals in a test. Changing one of those literals is changing the rules. prisma contract emit refuses to write a storage that does not hash to its storage hash, and the commands that render a saved contract's types refuse a contract file whose recorded hash does not match, with CONTRACT.VALIDATION_FAILED naming both hashes. Families and targets built outside this repository get assertContractHashes, which recomputes the hashes of their saved contracts and throws CONTRACT.HASH_MISMATCH naming each one that differs, because the freeze binds their part of the rules too.

Signing a database that only accepts migrations. A database can carry a change policy that allows changes only through migrations, and it refuses db sign. prisma db sign --force overrides that one refusal for the upgrade. It still checks that the database matches the contract, changes no schema, and keeps the policy. No error message suggests it; only the upgrade instructions do.

For users of a release candidate

A project that starts on the release this ships in is not affected. A project from an earlier release candidate keeps reading its files and running queries (#31200, merged, made later releases read those files). But the commands that compare the contract with a database refuse until it follows the upgrade instructions. Extensions have their own version of the instructions.

  1. With the release the project is on now, deploy every pending migration, so each database is at the newest contract.
  2. Upgrade Prisma, run the instructions' script, and run prisma contract emit, in either order. A run of the script that stops partway is finished by running it again.
  3. In the deploy, sign each database with prisma db sign --no-advance-ref, then run prisma db migrate. The flag stops db sign from writing a ref file into the deploy's checkout. Add --force where the database allows only migrations.

Two effects users will see:

  • prisma migration status no longer shows the earlier migrations as applied. The database's list of applied migrations holds their old hashes. Nothing is applied again, because db migrate works from the marker.
  • The CLI refuses an extension built for an earlier release until the extension is rebuilt. The error says what the application and the extension's author each do.

The instructions also cover a value the release candidate dropped, such as the index option above. contract emit writes it back, so the contract now really differs from the database. The script lists each such contract, and the change ships as a migration; for an index option, which prisma migration plan cannot change in place, the instructions give a hand-written one. They also cover a database the deploy did not reach in time: it is signed at the last migration it applied, which db sign takes by that migration's directory name.

Framework changes that need your agreement

The repository's rules say changes to packages/1-framework need the reviewer's explicit agreement. These change what a family, target or tool built on the framework must call or implement:

  • ContractSerializer gets one required member, normalizeStorage, in place of three optional hooks, so every family supplies its own normal form. If it stayed optional, a family that supplied none would write and hash its content with no normal form, and nothing would tell it.
  • The canonicalizer, the code that turns a contract into the text that is hashed, loses the dropping rule and its lists of paths, so it only sorts and encodes.
  • computeStorageHash, computeProfileHash, computeExecutionHash and buildExecutionSection no longer take target or targetFamily.
  • assertContractHashes and its error CONTRACT.HASH_MISMATCH are published.
  • writeContractSnapshot takes whenPresent: 'keep' | 'replace', so the step that writes an extension's newest saved copy can replace it. A replacement that fails and cannot put the old copy back throws a new error, MIGRATION.CONTRACT_SNAPSHOT_REPLACE_FAILED, which names where the old copy was left.

The CLI's behaviour also changes, in the framework's CLI package: db sign --force, the refusal in contract emit, and the target check in the commands that load the project's migrations and extensions. None of these changes adds family or target vocabulary to the framework.

How it was verified

  • Expected hashes as literals. Each family's test of the hash rules holds its expected hashes as literals, and fails when the target is added back to the hash input.
  • Two implementations agree. The upgrade script, which shares no code with the package, was run on four saved 8.0.0-rc.25 projects (one MongoDB, three PostgreSQL). Its output matched the package's for every contract, saved copy, migration and ref. Every contract, saved copy and migration this release writes was recomputed and agrees. The release-candidate fixtures keep their old hashes on purpose.
  • The normal form is stable. Each of 322 contracts this release emits, across all five databases, is byte-identical after being read and written again.
  • Each row of the table has a test that fails on the old rule, and every default a family names was checked against the database's own default.
  • Each target check has a test that fails without it: db sign, db init, db migrate, migration plan, db verify in both families, the extension loader, and a move from MySQL to MariaDB with an extension whose saved copy is stale.
  • The upgrade. The script's tests run on projects that 8.0.0-rc.25 itself emitted, planned and migrated, in both orders, interrupted at every point, and run twice. By hand, on real 8.0.0-rc.25 PostgreSQL and MongoDB projects and databases: both orders; a project with fastupdate: false, ending with the option set on the index; a migrations-only database with --force, and --force refusing a database whose schema does not match; a database one migration behind.
  • Review. Independent design and code reviews of each part, and of the final branch.
  • CI runs the package and end-to-end suites on the pull request. The integration suite runs in the merge queue.

Known gaps

Recorded in the project's follow-up list:

  • A TypeScript contract used without emitting can log a wrong marker warning when the config names an extension its source does not. No hash changes, so it can be fixed in any release.
  • Some MongoDB validator lists keep an order that means nothing, such as the branches of a derived oneOf. Sorting them could make the planner propose changing a validator that is already right in a live database, so they were left. After 8.0.0 that order is frozen until Prisma 9.

API changes

No application source code changes. These are for authors of a family, a target, an extension or a tool built on the toolchain. Each package's api-breaks.json records its breaks against 8.0.0-rc.25.

The changed exports
  • @prisma/orm-framework: new assertContractHashes, AssertContractHashesOptions, SavedContractHashes and HashedContractSections. ContractSerializer has one required normalizeStorage (type NormalizeStorage) in place of the optional shouldPreserveEmpty, sortStorage and hash hooks. CanonicalizeContractOptions and the storage hash's arguments follow, and the hash functions and buildExecutionSection no longer take target or targetFamily. Removed with the dropping rule: createPreserveEmptyPredicate, matchesPathPattern, PathPattern, PreserveEmptyPathSegment, PreserveEmptyPredicate and StorageSort; createStorageSort now orders by name, then content.
  • @prisma/orm-family-sql: sqlContractCanonicalizationHooks is replaced by normalizeSqlStorage and normalizeSqlDomain, on a new entry contract/normal-form. SqlContractSerializerBase supplies normalizeStorage.
  • @prisma/orm-family-mongo: mongoContractCanonicalizationHooks is replaced by normalizeMongoStorage and normalizeMongoDomain, on contract/normal-form; MongoContractSerializerBase supplies normalizeStorage.
  • @prisma/orm-postgres, @prisma/orm-mysql, @prisma/orm-mariadb, @prisma/orm-sqlite and @prisma/orm-mongo: each re-exports the changed entries: contract/hashing changes, and family-contract/normal-form replaces family-contract/canonicalization-hooks.
  • @prisma/orm-target-postgres: PostgresContractSerializer no longer overrides which empty values are kept.
  • @prisma/orm-target-mysql, @prisma/orm-target-sqlite and @prisma/orm-target-mongo: each contract serializer inherits normalizeStorage from its family's base.
  • @prisma/orm-toolchain: prisma db sign gains --force (DbSignOptions, ExecuteDbSignOptions, ExecuteDbSignSuccess). EmitOptions takes the family's normalizeStorage. createSnapshotContentVerifier and DescriptorSelfConsistencyInputs take normalizeStorage, and SnapshotCanonicalizationHooks goes, because MongoDB snapshots are now checked like SQL ones. writeContractSnapshot takes whenPresent. renderContractDts refuses a contract file whose recorded storage hash does not match its storage, and its failure result carries the two hashes in an optional storageHashMismatch.
  • @prisma/orm-extension-supabase: no export changes; its bundled contract has new hashes, so the hash literal types in its api.txt changed.

Reviewing the diff

A suggested reading order

About 1,400 of the changed files are the repository's own contracts, migrations, saved copies and refs, rewritten with new hashes. Read the rest in this order:

  1. packages/1-framework/0-foundation/contract/src/hashing.ts and canonicalization.ts: the new inputs, and a canonicalizer that only sorts.
  2. Each family's normal-form.ts, in packages/2-sql-family/1-core/contract and packages/2-mongo-family/1-foundation/mongo-contract, with their tests.
  3. Each family's hash-rules.fixed-answers.test.ts.
  4. enrichContract in the CLI and the SQL contract builder, where the profile hash gets the contract's capabilities.
  5. The target check in contract-space-aggregate-loader.ts, and the snapshot replacement in contract-snapshot-store.ts.
  6. db sign --force in the CLI.
  7. The upgrade instructions and script, with the script's tests in test/integration/test/upgrade-instructions/contract-hash-inputs/.
  8. ADR 332 and ADR 010.

Two existing tests changed their expectations. The end-to-end test of a project exactly as the last release candidate left it keeps its assertions; its comment now says a database that release candidate signed needs the upgrade steps. Two examples expect foreign keys and MongoDB indexes in the sorted order.

The sign-off check cannot read a pull request of more than 250 commits, so the earlier history was squashed into one commit; it is kept on ga-compat-hashes-backup-pre-squash.

Alternatives considered

On the hash input:

  • Keep the target and the family in each hash. Rejected: no comparison needs them, and they cut a project off from its own migrations after a move between targets that write the same storage. A contract for the wrong target is better caught by a check that names the mistake than by a hash that only says the database does not match.
  • Freeze the old input. Rejected: the format version and the blanked parts would stay in every hash, so the first format change would change them all.
  • Hash the file as written, by its format version's rules. Rejected: the hash would change when a later format version lays out storage differently.
  • Record which rules produced a hash, and support several. Rejected: a project would hold hashes computed two ways, and every comparison would need converting. Git's plan for a new hash function rules out mixing two in one repository for the same reason.

On what goes into each section:

  • Keep the dropping rule and add the missing exceptions. Rejected: the list grew with every defect found, and the next one would be found after the freeze. A rule that keeps everything fails loudly when a family forgets a default; the old one failed silently.
  • Require that false and empty always mean absent inside values a family does not own. Rejected: a convention nothing checks, put on outside authors, where a violation gives two different contracts one hash.
  • Repair the SQL profile hash later, in the capabilities work. Rejected: that work also lands before 8.0.0, so the rules would change twice and every project would be signed twice.

On moving existing databases:

  • A migration from each old hash to its new one. Rejected: one extra migration for every old hash a database could be at, each starting from a hash with no saved copy.
  • Rewrite the database's list of applied migrations, so migration status keeps its history. Rejected: a write to every database's history table only for what migration status displays; nothing reads that list to decide what to apply.
  • Exempt db sign from the change policy. Rejected: signing could then hide, on any database, that it left its migration history. --force keeps that a deliberate act, and the flag stays available for recovering a database the upgrade did not reach.

Agent: alexvanhalen-55

🤖 Generated with Claude Code

@wmadden-electric
wmadden-electric requested a review from a team as a code owner November 24, 2026 12:26
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Review skipped: 1076 files exceed the limit of 300

Walkthrough

Warning

Review details and warnings were omitted to fit the comment limit.

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma/orm-better-auth

npm i https://pkg.pr.new/@prisma/orm-better-auth@31203

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@31203

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@31203

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@31203

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@31203

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@31203

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@31203

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@31203

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@31203

@prisma/orm-mariadb

npm i https://pkg.pr.new/@prisma/orm-mariadb@31203

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@31203

@prisma/orm-mysql

npm i https://pkg.pr.new/@prisma/orm-mysql@31203

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@31203

@prisma/orm-postgres-contrib

npm i https://pkg.pr.new/@prisma/orm-postgres-contrib@31203

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@31203

@prisma/orm-target-mariadb

npm i https://pkg.pr.new/@prisma/orm-target-mariadb@31203

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@31203

@prisma/orm-target-mysql

npm i https://pkg.pr.new/@prisma/orm-target-mysql@31203

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@31203

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@31203

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@31203

commit: 7777df5

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 311.75 KB (-0.11% 🔽)
postgres / emit 271.91 KB (-0.18% 🔽)
mongo / no-emit 243.89 KB (+0.04% 🔺)
mongo / emit 198.35 KB (+0.39% 🔺)
cf-worker / no-emit 377.13 KB (-0.09% 🔽)
cf-worker / emit 332.44 KB (-0.12% 🔽)

@wmadden-electric
wmadden-electric marked this pull request as draft November 24, 2026 12:36
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 24, 2026 12:38
@wmadden-electric
wmadden-electric marked this pull request as draft November 24, 2026 23:28
@wmadden-electric wmadden-electric changed the title feat!: every contract hash covers only what it is about, changes once now, and keeps its rules for the rest of Prisma 8 feat!: every contract hash changes once, to cover only its own part of the contract, and its rules are frozen for Prisma 8 Nov 25, 2026
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 25, 2026 15:55
@wmadden-electric
wmadden-electric marked this pull request as draft November 26, 2026 12:40
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 26, 2026 13:02
@wmadden-electric
wmadden-electric marked this pull request as draft November 26, 2026 22:48
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 26, 2026 23:05
wmadden-electric added a commit that referenced this pull request Nov 27, 2026
…L holds them

The subsystem docs, the capabilities reference and the capability-gating pattern now say that on PostgreSQL the target and driver declare capabilities and the client checks its connection, while on MySQL, MariaDB and SQLite the adapter's fixed list goes into every contract and no client check runs. They also say the SQL profile hash covers no capabilities today, until #31203.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric marked this pull request as draft November 27, 2026 08:24
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Public API changes

This pull request changes the api.txt list of 11 packages and the recorded breaks or expected example-app errors of 14 packages or apps. Its description needs a section headed ## API changes that names each export below, in backticks, on a line that says why it changes. A package name in backticks, on a line with a reason, covers every change in that package. A change to a package’s api-breaks.json is named by the package, and a change to examples/last-release-errors.json by examples/<app>, and a change to packages/9-public/removed-error-codes.json by the error code. You can start from this:

## API changes

- `@prisma/orm-extension-supabase`:
- `@prisma/orm-extension-supabase (not exported): ProfileHash`:
- `@prisma/orm-extension-supabase (not exported): StorageHash`:
- `@prisma/orm-family-mongo`:
- `@prisma/orm-family-mongo/contract/canonicalization-hooks: mongoContractCanonicalizationHooks`:
- `@prisma/orm-family-mongo/contract/normal-form: normalizeMongoDomain`:
- `@prisma/orm-family-mongo/contract/normal-form: normalizeMongoStorage`:
- `@prisma/orm-family-mongo/family/ir: MongoContractSerializerBase`:
- `@prisma/orm-family-mongo/family: MongoContractSerializerBase`:
- `@prisma/orm-family-sql`:
- `@prisma/orm-family-sql/contract/canonicalization-hooks: sqlContractCanonicalizationHooks`:
- `@prisma/orm-family-sql/contract/normal-form: normalizeSqlDomain`:
- `@prisma/orm-family-sql/contract/normal-form: normalizeSqlStorage`:
- `@prisma/orm-family-sql/contract: normalizeSqlDomain`:
- `@prisma/orm-family-sql/contract: normalizeSqlStorage`:
- `@prisma/orm-family-sql/contract: sqlContractCanonicalizationHooks`:
- `@prisma/orm-family-sql/family/ir: SqlContractSerializerBase`:
- `@prisma/orm-family-sql/family: SqlContractSerializerBase`:
- `@prisma/orm-framework`:
- `@prisma/orm-framework (not exported): ComputeStorageHashArgs`:
- `@prisma/orm-framework/components/control: ContractSerializer`:
- `@prisma/orm-framework/components: ContractSerializer`:
- `@prisma/orm-framework/contract/hashing-utils: PathPattern`:
- `@prisma/orm-framework/contract/hashing-utils: PreserveEmptyPathSegment`:
- `@prisma/orm-framework/contract/hashing-utils: createPreserveEmptyPredicate`:
- `@prisma/orm-framework/contract/hashing-utils: createStorageSort`:
- `@prisma/orm-framework/contract/hashing-utils: matchesPathPattern`:
- `@prisma/orm-framework/contract/hashing: AssertContractHashesOptions`:
- `@prisma/orm-framework/contract/hashing: CanonicalizeContractOptions`:
- `@prisma/orm-framework/contract/hashing: HashedContractSections`:
- `@prisma/orm-framework/contract/hashing: NormalizeStorage`:
- `@prisma/orm-framework/contract/hashing: PreserveEmptyPredicate`:
- `@prisma/orm-framework/contract/hashing: SavedContractHashes`:
- `@prisma/orm-framework/contract/hashing: StorageSort`:
- `@prisma/orm-framework/contract/hashing: assertContractHashes`:
- `@prisma/orm-framework/contract/hashing: buildExecutionSection`:
- `@prisma/orm-framework/contract/hashing: computeExecutionHash`:
- `@prisma/orm-framework/contract/hashing: computeProfileHash`:
- `@prisma/orm-framework/contract: AssertContractHashesOptions`:
- `@prisma/orm-framework/contract: CanonicalizeContractOptions`:
- `@prisma/orm-framework/contract: HashedContractSections`:
- `@prisma/orm-framework/contract: NormalizeStorage`:
- `@prisma/orm-framework/contract: PathPattern`:
- `@prisma/orm-framework/contract: PreserveEmptyPathSegment`:
- `@prisma/orm-framework/contract: PreserveEmptyPredicate`:
- `@prisma/orm-framework/contract: SavedContractHashes`:
- `@prisma/orm-framework/contract: StorageSort`:
- `@prisma/orm-framework/contract: assertContractHashes`:
- `@prisma/orm-framework/contract: buildExecutionSection`:
- `@prisma/orm-framework/contract: computeExecutionHash`:
- `@prisma/orm-framework/contract: computeProfileHash`:
- `@prisma/orm-framework/contract: createPreserveEmptyPredicate`:
- `@prisma/orm-framework/contract: createStorageSort`:
- `@prisma/orm-framework/contract: matchesPathPattern`:
- `@prisma/orm-mariadb`:
- `@prisma/orm-mariadb/family-contract/canonicalization-hooks: everything from @prisma/orm-family-sql/contract/canonicalization-hooks`:
- `@prisma/orm-mariadb/family-contract/normal-form: everything from @prisma/orm-family-sql/contract/normal-form`:
- `@prisma/orm-mongo`:
- `@prisma/orm-mongo/family-contract/canonicalization-hooks: everything from @prisma/orm-family-mongo/contract/canonicalization-hooks`:
- `@prisma/orm-mongo/family-contract/normal-form: everything from @prisma/orm-family-mongo/contract/normal-form`:
- `@prisma/orm-mysql`:
- `@prisma/orm-mysql/family-contract/canonicalization-hooks: everything from @prisma/orm-family-sql/contract/canonicalization-hooks`:
- `@prisma/orm-mysql/family-contract/normal-form: everything from @prisma/orm-family-sql/contract/normal-form`:
- `@prisma/orm-postgres`:
- `@prisma/orm-postgres/family-contract/canonicalization-hooks: everything from @prisma/orm-family-sql/contract/canonicalization-hooks`:
- `@prisma/orm-postgres/family-contract/normal-form: everything from @prisma/orm-family-sql/contract/normal-form`:
- `@prisma/orm-sqlite`:
- `@prisma/orm-sqlite/family-contract/canonicalization-hooks: everything from @prisma/orm-family-sql/contract/canonicalization-hooks`:
- `@prisma/orm-sqlite/family-contract/normal-form: everything from @prisma/orm-family-sql/contract/normal-form`:
- `@prisma/orm-target-mongo`:
- `@prisma/orm-target-mysql`:
- `@prisma/orm-target-postgres`:
- `@prisma/orm-target-postgres/target/runtime: PostgresContractSerializer`:
- `@prisma/orm-target-postgres/target: PostgresContractSerializer`:
- `@prisma/orm-target-sqlite`:
- `@prisma/orm-toolchain`:
- `@prisma/orm-toolchain (not exported): ExecuteDbSignSuccess`:
- `@prisma/orm-toolchain/cli/control-api: DbSignOptions`:
- `@prisma/orm-toolchain/cli/control-api: ExecuteDbSignOptions`:
- `@prisma/orm-toolchain/cli/control-api: RenderContractDtsFailure`:
- `@prisma/orm-toolchain/emitter: EmitOptions`:
- `@prisma/orm-toolchain/migration-tools/contract-snapshot-store: SnapshotCanonicalizationHooks`:
- `@prisma/orm-toolchain/migration-tools/contract-snapshot-store: createSnapshotContentVerifier`:
- `@prisma/orm-toolchain/migration-tools/contract-snapshot-store: writeContractSnapshot`:
- `@prisma/orm-toolchain/migration-tools/spaces: DescriptorSelfConsistencyInputs`:
- `@prisma/orm-toolchain/migration-tools: DescriptorSelfConsistencyInputs`:
- `@prisma/orm-toolchain/migration-tools: SnapshotCanonicalizationHooks`:
- `@prisma/orm-toolchain/migration-tools: createSnapshotContentVerifier`:
- `@prisma/orm-toolchain/migration-tools: writeContractSnapshot`:

packages/9-public/@prisma/orm-extension-supabase/api-breaks.json

- {"path":"./runtime","export":"ServiceRoleDb","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"13f925f8685a2861","reason":"A column name that several joined tables share must now name its table (prisma/orm#31150), and `transaction()` is a type error for a contract that does not require `sql.interactiveTransactions`; a release candidate's contract may still call it (prisma/orm#31218)."}
+ {"path":"./runtime","export":"ServiceRoleDb","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"a6d7c5668130548c","reason":"A column name that several joined tables share must now name its table (prisma/orm#31150), and `transaction()` is a type error for a contract that does not require `sql.interactiveTransactions`; a release candidate's contract may still call it (prisma/orm#31218). The Supabase contract's storage and profile hash literals also take the values this release's hash rules give the same contract (ADR 332)."}
- {"path":"./runtime","export":"SupabaseDb","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"77c0302affe4a3e9","reason":"A column name that several joined tables share must now name its table (prisma/orm#31150), and `transaction()` is a type error for a contract that does not require `sql.interactiveTransactions`; a release candidate's contract may still call it (prisma/orm#31218)."}
+ {"path":"./runtime","export":"SupabaseDb","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"963d992aa6179baa","reason":"A column name that several joined tables share must now name its table (prisma/orm#31150), and `transaction()` is a type error for a contract that does not require `sql.interactiveTransactions`; a release candidate's contract may still call it (prisma/orm#31218). The Supabase contract's storage and profile hash literals also take the values this release's hash rules give the same contract (ADR 332)."}
+ {"path":"./runtime","export":"SupabaseExtensionContract","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"6c7c059f284f8164","reason":"The Supabase contract's capabilities are the ones it requires; the `postgres` flags this release retired, such as `jsonAgg`, are gone (prisma/orm#31218). Its storage and profile hash literals also take the values this release's hash rules give the same contract (ADR 332)."}
- {"path":"./runtime","export":"SupabaseExtensionContract","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"aa1d211f375e6a3c","reason":"The Supabase contract's capabilities are the ones it requires; the `postgres` flags this release retired, such as `jsonAgg`, are gone (prisma/orm#31218)."}
- {"path":"./runtime","export":"SupabaseInternalDb","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"927d50a8cf68b4ae","reason":"The Supabase contract's capabilities are the ones it requires; the `postgres` flags this release retired, such as `jsonAgg`, are gone (prisma/orm#31218)."}
+ {"path":"./runtime","export":"SupabaseInternalDb","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"b7e2d00160015326","reason":"The Supabase contract's capabilities are the ones it requires; the `postgres` flags this release retired, such as `jsonAgg`, are gone (prisma/orm#31218). The Supabase contract's storage and profile hash literals also take the values this release's hash rules give the same contract (ADR 332)."}

@prisma/orm-extension-supabase

- (not exported) type ProfileHash = ProfileHashBase<'3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2'>
+ (not exported) type ProfileHash = ProfileHashBase<'8bf60124f2eff444303498058072094fc8493bc1cc217a5a75c45937e13b56c3'>
- (not exported) type StorageHash = StorageHashBase<'110ad99e1e466691bdb0a4349a17365561e76ad017f58beb272f4496b05b8e9e'>
+ (not exported) type StorageHash = StorageHashBase<'ba1278c831abc67bcdfe94cd7516ad01c6d53f88a7f02110ea2539c19be984b5'>

packages/9-public/@prisma/orm-family-mongo/api-breaks.json

+ {"path":"./contract/canonicalization-hooks","export":"*","test":"path","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Renamed to `contract/normal-form`: the module now holds the family's normal form of storage, which also leaves out the family's defaults, not only hash hooks (ADR 010)."}
+ {"path":"./family","export":"MongoContractSerializer","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"5adfcfa27c7ca93c","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family","export":"MongoContractSerializer","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"5adfcfa27c7ca93c","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family","export":"MongoContractSerializerBase","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"716d174f116e7fe3","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family","export":"MongoContractSerializerBase","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"716d174f116e7fe3","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"MongoContractSerializer","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"5adfcfa27c7ca93c","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"MongoContractSerializer","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"5adfcfa27c7ca93c","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"MongoContractSerializerBase","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"716d174f116e7fe3","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"MongoContractSerializerBase","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"716d174f116e7fe3","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}

@prisma/orm-family-mongo

- ./contract/canonicalization-hooks: const mongoContractCanonicalizationHooks: { readonly shouldPreserveEmpty: PreserveEmptyPredicate; }
+ ./contract/normal-form: const normalizeMongoStorage: NormalizeStorage
+ ./contract/normal-form: function normalizeMongoDomain(domain: unknown): unknown
+ ./family/ir: class MongoContractSerializerBase, readonly required property normalizeStorage: NormalizeStorage
- ./family/ir: class MongoContractSerializerBase, required property shouldPreserveEmpty: PreserveEmptyPredicate
+ ./family: class MongoContractSerializerBase, readonly required property normalizeStorage: NormalizeStorage
- ./family: class MongoContractSerializerBase, required property shouldPreserveEmpty: PreserveEmptyPredicate

packages/9-public/@prisma/orm-family-sql/api-breaks.json

+ {"path":"./contract","export":"sqlContractCanonicalizationHooks","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/canonicalization-hooks","export":"*","test":"path","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Renamed to `contract/normal-form`: the module now holds the family's normal form of storage, which also leaves out the family's defaults, not only hash hooks (ADR 010)."}
+ {"path":"./family","export":"SqlContractSerializer","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"8f554f25f6bc0827","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family","export":"SqlContractSerializer","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"8f554f25f6bc0827","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family","export":"SqlContractSerializerBase","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"81aac9dfdd5fb63f","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family","export":"SqlContractSerializerBase","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"81aac9dfdd5fb63f","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"SqlContractSerializer","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"8f554f25f6bc0827","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"SqlContractSerializer","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"8f554f25f6bc0827","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"SqlContractSerializerBase","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"81aac9dfdd5fb63f","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./family/ir","export":"SqlContractSerializerBase","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"81aac9dfdd5fb63f","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}

@prisma/orm-family-sql

- ./contract/canonicalization-hooks: const sqlContractCanonicalizationHooks: { readonly shouldPreserveEmpty: PreserveEmptyPredicate; readonly sortStorage: StorageSort; }
+ ./contract/normal-form: const normalizeSqlStorage: NormalizeStorage
+ ./contract/normal-form: function normalizeSqlDomain(domain: unknown): unknown
+ ./contract: const normalizeSqlStorage: NormalizeStorage
- ./contract: const sqlContractCanonicalizationHooks: { readonly shouldPreserveEmpty: PreserveEmptyPredicate; readonly sortStorage: StorageSort; }
+ ./contract: function normalizeSqlDomain(domain: unknown): unknown
+ ./family/ir: class SqlContractSerializerBase, readonly required property normalizeStorage: NormalizeStorage
- ./family/ir: class SqlContractSerializerBase, required property hashCanonicalizationHooks: { readonly shouldPreserveEmpty: PreserveEmptyPredicate; readonly sortStorage: StorageSort; }
- ./family/ir: class SqlContractSerializerBase, required property shouldPreserveEmpty: PreserveEmptyPredicate
- ./family/ir: class SqlContractSerializerBase, required property sortStorage: StorageSort
+ ./family: class SqlContractSerializerBase, readonly required property normalizeStorage: NormalizeStorage
- ./family: class SqlContractSerializerBase, required property hashCanonicalizationHooks: { readonly shouldPreserveEmpty: PreserveEmptyPredicate; readonly sortStorage: StorageSort; }
- ./family: class SqlContractSerializerBase, required property shouldPreserveEmpty: PreserveEmptyPredicate
- ./family: class SqlContractSerializerBase, required property sortStorage: StorageSort

packages/9-public/@prisma/orm-framework/api-breaks.json

+ {"path":"./components","export":"ControlAdapterDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"2cf06ed9c7f8477c","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components","export":"ControlAdapterDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"440a3ed32050305a","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components","export":"ControlFamilyDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"2cf06ed9c7f8477c","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components","export":"ControlFamilyDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"440a3ed32050305a","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components","export":"ControlStack","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"2cf06ed9c7f8477c","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components","export":"ControlStack","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"440a3ed32050305a","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
- {"path":"./components","export":"CreateControlStackInput","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"619b059c1de8c793","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components","export":"CreateControlStackInput","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"d2fcc4055d632764","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components","export":"MigratableTargetDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"5f8a3328df3f7562","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components","export":"MigratableTargetDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"eea1681330bf07aa","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). A target's contract serializer also supplies the required `normalizeStorage`, the family's normal form of storage, which the framework applies when it writes and when it hashes (ADR 010, ADR 332)."}
- {"path":"./components","export":"createControlStack","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"580079d42905baee","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components","export":"createControlStack","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"64995d1d37bedaf9","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components","export":"hasMigrations","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"1259e5e8248767aa","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components","export":"hasMigrations","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"657546d043dabb0d","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./components/control","export":"ControlAdapterDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"2cf06ed9c7f8477c","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components/control","export":"ControlAdapterDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"440a3ed32050305a","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components/control","export":"ControlFamilyDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"2cf06ed9c7f8477c","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components/control","export":"ControlFamilyDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"440a3ed32050305a","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components/control","export":"ControlStack","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"2cf06ed9c7f8477c","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components/control","export":"ControlStack","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"440a3ed32050305a","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
- {"path":"./components/control","export":"CreateControlStackInput","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"619b059c1de8c793","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components/control","export":"CreateControlStackInput","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"d2fcc4055d632764","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components/control","export":"MigratableTargetDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"5f8a3328df3f7562","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components/control","export":"MigratableTargetDescriptor","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"eea1681330bf07aa","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). A target's contract serializer also supplies the required `normalizeStorage`, the family's normal form of storage, which the framework applies when it writes and when it hashes (ADR 010, ADR 332)."}
- {"path":"./components/control","export":"createControlStack","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"580079d42905baee","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components/control","export":"createControlStack","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"64995d1d37bedaf9","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./components/control","export":"hasMigrations","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"1259e5e8248767aa","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./components/control","export":"hasMigrations","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"657546d043dabb0d","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./config","export":"PrismaConfig","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"1e6e821151f5b892","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./config","export":"PrismaConfig","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"21ba537b3e284905","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./config","export":"defineConfig","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"232d35def51952fa","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./config","export":"defineConfig","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"ce24738f65287bec","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./config/config-types","export":"PrismaConfig","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"1e6e821151f5b892","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./config/config-types","export":"PrismaConfig","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"21ba537b3e284905","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./config/config-types","export":"defineConfig","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"232d35def51952fa","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218). Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
- {"path":"./config/config-types","export":"defineConfig","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"ce24738f65287bec","reason":"A schema difference's cause can now be `database-capabilities-not-provided`, for a database that lacks a capability the contract requires (prisma/orm#31218)."}
+ {"path":"./contract","export":"PathPattern","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"PreserveEmptyPathSegment","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"PreserveEmptyPredicate","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"StorageSort","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"canonicalizeContract","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"37d9777fda7750c0","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./contract","export":"canonicalizeContractToObject","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"9a37899c51e8529f","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./contract","export":"computeStorageHash","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"c57910a407ae896d","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332). It no longer takes `target` or `targetFamily`, because no hash covers them (ADR 332)."}
+ {"path":"./contract","export":"createPreserveEmptyPredicate","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"matchesPathPattern","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing","export":"PreserveEmptyPredicate","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing","export":"StorageSort","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing","export":"canonicalizeContract","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"37d9777fda7750c0","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./contract/hashing","export":"canonicalizeContractToObject","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"9a37899c51e8529f","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332)."}
+ {"path":"./contract/hashing","export":"computeStorageHash","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"c57910a407ae896d","reason":"Each family now supplies its normal form of storage as a required `normalizeStorage`, which the framework applies when it writes and when it hashes; the framework's canonicalizer no longer leaves out defaults or empty values by path, so the earlier hooks are gone (ADR 010, ADR 332). It no longer takes `target` or `targetFamily`, because no hash covers them (ADR 332)."}
+ {"path":"./contract/hashing-utils","export":"PathPattern","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"PreserveEmptyPathSegment","test":"type","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"createPreserveEmptyPredicate","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"matchesPathPattern","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}

@prisma/orm-framework

+ (not exported) type ComputeStorageHashArgs = { storage: Record<string, unknown>; readonly normalizeStorage: NormalizeStorage; }
- (not exported) type ComputeStorageHashArgs = { target: string; targetFamily: string; storage: Record<string, unknown>; readonly shouldPreserveEmpty?: PreserveEmptyPredicate; readonly sortStorage?: StorageSort; }
- ./components/control: interface ContractSerializer, readonly optional property hashCanonicalizationHooks?: { readonly shouldPreserveEmpty?: PreserveEmptyPredicate; readonly sortStorage?: StorageSort; }
- ./components/control: interface ContractSerializer, readonly optional property shouldPreserveEmpty?: PreserveEmptyPredicate
- ./components/control: interface ContractSerializer, readonly optional property sortStorage?: StorageSort
+ ./components/control: interface ContractSerializer, readonly required property normalizeStorage: NormalizeStorage
- ./components: interface ContractSerializer, readonly optional property hashCanonicalizationHooks?: { readonly shouldPreserveEmpty?: PreserveEmptyPredicate; readonly sortStorage?: StorageSort; }
- ./components: interface ContractSerializer, readonly optional property shouldPreserveEmpty?: PreserveEmptyPredicate
- ./components: interface ContractSerializer, readonly optional property sortStorage?: StorageSort
+ ./components: interface ContractSerializer, readonly required property normalizeStorage: NormalizeStorage
- ./contract/hashing-utils: function createPreserveEmptyPredicate(patterns: readonly PathPattern[]): PreserveEmptyPredicate
+ ./contract/hashing-utils: function createStorageSort(targets: readonly NamedArraySortTarget[], compare?: (a: unknown, b: unknown) => number): NormalizeStorage
- ./contract/hashing-utils: function createStorageSort(targets: readonly NamedArraySortTarget[], compare?: (a: unknown, b: unknown) => number): StorageSort
- ./contract/hashing-utils: function matchesPathPattern(path: readonly string[], pattern: PathPattern): boolean
- ./contract/hashing-utils: type PathPattern = readonly PreserveEmptyPathSegment[]
- ./contract/hashing-utils: type PreserveEmptyPathSegment = '*' | readonly string[] | string
+ ./contract/hashing: function assertContractHashes(options: AssertContractHashesOptions): void
+ ./contract/hashing: function buildExecutionSection(input: { readonly defaults: ReadonlyArray<ExecutionMutationDefault>; }): ContractExecutionSection | undefined
- ./contract/hashing: function buildExecutionSection(input: { readonly target: string; readonly targetFamily: string; readonly defaults: ReadonlyArray<ExecutionMutationDefault>; }): ContractExecutionSection | undefined
+ ./contract/hashing: function computeExecutionHash(args: { execution: Record<string, unknown>; }): ExecutionHashBase<string>
- ./contract/hashing: function computeExecutionHash(args: { target: string; targetFamily: string; execution: Record<string, unknown>; }): ExecutionHashBase<string>
+ ./contract/hashing: function computeProfileHash(args: { capabilities: Record<string, Record<string, boolean>>; }): ProfileHashBase<string>
- ./contract/hashing: function computeProfileHash(args: { target: string; targetFamily: string; capabilities: Record<string, Record<string, boolean>>; }): ProfileHashBase<string>
+ ./contract/hashing: interface AssertContractHashesOptions
+ ./contract/hashing: interface AssertContractHashesOptions, readonly required property contracts: readonly SavedContractHashes[]
+ ./contract/hashing: interface AssertContractHashesOptions, readonly required property normalizeStorage: NormalizeStorage
- ./contract/hashing: interface CanonicalizeContractOptions, readonly optional property shouldPreserveEmpty?: PreserveEmptyPredicate
- ./contract/hashing: interface CanonicalizeContractOptions, readonly optional property sortStorage?: StorageSort
+ ./contract/hashing: interface CanonicalizeContractOptions, readonly required property normalizeStorage: NormalizeStorage
+ ./contract/hashing: interface HashedContractSections
+ ./contract/hashing: interface HashedContractSections, readonly optional property execution?: Record<string, unknown>
+ ./contract/hashing: interface HashedContractSections, readonly required property capabilities: Record<string, Record<string, boolean>>
+ ./contract/hashing: interface HashedContractSections, readonly required property storage: Record<string, unknown>
+ ./contract/hashing: interface SavedContractHashes
+ ./contract/hashing: interface SavedContractHashes, readonly optional property executionHash?: string
+ ./contract/hashing: interface SavedContractHashes, readonly required property contract: HashedContractSections
+ ./contract/hashing: interface SavedContractHashes, readonly required property name: string
+ ./contract/hashing: interface SavedContractHashes, readonly required property profileHash: string
+ ./contract/hashing: interface SavedContractHashes, readonly required property storageHash: string
+ ./contract/hashing: type NormalizeStorage = (storage: unknown) => unknown
- ./contract/hashing: type PreserveEmptyPredicate = (path: readonly string[]) => boolean
- ./contract/hashing: type StorageSort = (storage: unknown) => unknown
+ ./contract: function assertContractHashes(options: AssertContractHashesOptions): void
+ ./contract: function buildExecutionSection(input: { readonly defaults: ReadonlyArray<ExecutionMutationDefault>; }): ContractExecutionSection | undefined
- ./contract: function buildExecutionSection(input: { readonly target: string; readonly targetFamily: string; readonly defaults: ReadonlyArray<ExecutionMutationDefault>; }): ContractExecutionSection | undefined
+ ./contract: function computeExecutionHash(args: { execution: Record<string, unknown>; }): ExecutionHashBase<string>
- ./contract: function computeExecutionHash(args: { target: string; targetFamily: string; execution: Record<string, unknown>; }): ExecutionHashBase<string>
+ ./contract: function computeProfileHash(args: { capabilities: Record<string, Record<string, boolean>>; }): ProfileHashBase<string>
- ./contract: function computeProfileHash(args: { target: string; targetFamily: string; capabilities: Record<string, Record<string, boolean>>; }): ProfileHashBase<string>
- ./contract: function createPreserveEmptyPredicate(patterns: readonly PathPattern[]): PreserveEmptyPredicate
+ ./contract: function createStorageSort(targets: readonly NamedArraySortTarget[], compare?: (a: unknown, b: unknown) => number): NormalizeStorage
- ./contract: function createStorageSort(targets: readonly NamedArraySortTarget[], compare?: (a: unknown, b: unknown) => number): StorageSort
- ./contract: function matchesPathPattern(path: readonly string[], pattern: PathPattern): boolean
+ ./contract: interface AssertContractHashesOptions
+ ./contract: interface AssertContractHashesOptions, readonly required property contracts: readonly SavedContractHashes[]
+ ./contract: interface AssertContractHashesOptions, readonly required property normalizeStorage: NormalizeStorage
- ./contract: interface CanonicalizeContractOptions, readonly optional property shouldPreserveEmpty?: PreserveEmptyPredicate
- ./contract: interface CanonicalizeContractOptions, readonly optional property sortStorage?: StorageSort
+ ./contract: interface CanonicalizeContractOptions, readonly required property normalizeStorage: NormalizeStorage
+ ./contract: interface HashedContractSections
+ ./contract: interface HashedContractSections, readonly optional property execution?: Record<string, unknown>
+ ./contract: interface HashedContractSections, readonly required property capabilities: Record<string, Record<string, boolean>>
+ ./contract: interface HashedContractSections, readonly required property storage: Record<string, unknown>
+ ./contract: interface SavedContractHashes
+ ./contract: interface SavedContractHashes, readonly optional property executionHash?: string
+ ./contract: interface SavedContractHashes, readonly required property contract: HashedContractSections
+ ./contract: interface SavedContractHashes, readonly required property name: string
+ ./contract: interface SavedContractHashes, readonly required property profileHash: string
+ ./contract: interface SavedContractHashes, readonly required property storageHash: string
+ ./contract: type NormalizeStorage = (storage: unknown) => unknown
- ./contract: type PathPattern = readonly PreserveEmptyPathSegment[]
- ./contract: type PreserveEmptyPathSegment = '*' | readonly string[] | string
- ./contract: type PreserveEmptyPredicate = (path: readonly string[]) => boolean
- ./contract: type StorageSort = (storage: unknown) => unknown

packages/9-public/@prisma/orm-mariadb/api-breaks.json

+ {"path":"./contract","export":"PathPattern","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"PreserveEmptyPathSegment","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"PreserveEmptyPredicate","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"StorageSort","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"createPreserveEmptyPredicate","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract","export":"matchesPathPattern","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing","export":"PreserveEmptyPredicate","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing","export":"StorageSort","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"PathPattern","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"PreserveEmptyPathSegment","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"createPreserveEmptyPredicate","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./contract/hashing-utils","export":"matchesPathPattern","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./family-contract","export":"sqlContractCanonicalizationHooks","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}
+ {"path":"./family-contract/canonicalization-hooks","export":"*","test":"path","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Renamed to `family-contract/normal-form`: the module now holds the family's normal form of storage, which also leaves out the family's defaults, not only hash hooks (ADR 010)."}
+ {"path":"./migration-tools/contract-snapshot-store","export":"SnapshotCanonicalizationHooks","test":"exists","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"e3b0c44298fc1c14","reason":"Removed with the path patterns the framework used to leave out empty values: each family's `normalizeStorage` now names the defaults it leaves out, and `StorageSort` is renamed `NormalizeStorage` (ADR 010)."}

@prisma/orm-mariadb

- ./family-contract/canonicalization-hooks: everything from @prisma/orm-family-sql/contract/canonicalization-hooks
+ ./family-contract/normal-form: everything from @prisma/orm-family-sql/contract/normal-form

155 lines are left out here. The full list is in the job summary of the "API changes" check.

@wmadden-electric wmadden-electric changed the title feat!: every contract hash changes once, to cover only its own part of the contract, and its rules are frozen for Prisma 8 feat!: correct the contract hash rules, then freeze them for Prisma 8 Nov 27, 2026
Base automatically changed from ga-compat-format-versions to main November 28, 2026 07:11
@wmadden-electric wmadden-electric changed the title feat!: correct the contract hash rules, then freeze them for Prisma 8 feat!: freeze the contract hash rules for Prisma 8, with each hash over its own section and no author value dropped Nov 28, 2026
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 28, 2026 08:37
…er its own section and no author value dropped

Each hash covers targetFamily, target and its own section of the contract.
The framework canonicalizer drops no value; each family names the defaults
it leaves out in normalizeStorage. The SQL profile hash covers the
contract's capabilities, flags that are off left out. Foreign keys and
MongoDB indexes are sorted before hashing. assertContractHashes lets a
family or target hold its hashes fixed; prisma db sign gains --force. The
upgrade instructions and script move a release-candidate project to the
new hashes. ADR 332 records the decision and ADR 010 the computation.

Squashed from 312 commits so the sign-off check can read the pull
request; the earlier history is kept on ga-compat-hashes-backup-pre-squash.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wmadden-electric and others added 2 commits November 28, 2026 20:06
…ding example, and drop the one-time move from the pre-releases

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-prisma__orm that referenced this pull request Nov 28, 2026
…hey do not know (prisma#31200)

## At a glance

**The decision: every file Prisma stores in a project states the version
of its format, a reader refuses a version or a field it does not know,
and until `8.0.0` it still reads the files a release candidate wrote.**
`8.0.0` is the first stable release of Prisma 8, which has not shipped;
release candidates (`8.0.0-rc.N`) continue until then.

**Two things need the reviewer's decision:**

1. **This adds one concept to the framework domain,** which the
repository's rules reserve: the shared reader of a stored file's format
version, with its converters. It is there because some paths read a
contract before any family sees it. I recommend accepting it. Details
are under "API changes".
2. **Whether the framework should read a migration's operations strictly
when it loads them.** Today only the commands that act on a database do,
so `migration check` can pass a migration that `db migrate` refuses.
Fixing it adds a hook to the framework. I recommend adding it, in this
pull request or the next. Details are under "Known limits".

Suppose Prisma `8.3` changes how a migration is written, and a teammate
on `8.0` pulls a migration that `8.3` wrote. Without this pull request,
`8.0` could read it and apply only the part it understood. With it,
`8.0` stops before it touches the database (an example of the output):

```text
✘ [MIGRATION.FORMAT_VERSION_NEWER] The migration file (migration.json) "migrations/app/20270301_add_tags/migration.json" was written by a newer release of Prisma
  It is in format version 2, and this release of Prisma reads format version 1 only.
  Upgrade Prisma to the release that wrote the file, or a later one, and run the command again.
```

To make that possible, every file Prisma writes into a project and reads
back later starts with the version of its format:

```text
contract.json             before: { "schemaVersion": "1", "targetFamily": "sql", ... }
                          after:  { "formatVersion": 1,   "targetFamily": "sql", ... }
migration.json            before: { "from": "6c26…", "to": "6b46…", ... }
                          after:  { "formatVersion": 1, "from": "6c26…", "to": "6b46…", ... }
refs/production.json      before: { "hash": "6b46…", "invariants": [] }
                          after:  { "formatVersion": 1, "hash": "6b46…", "invariants": [] }
```

What it costs and what it does not:

- **A project a release candidate wrote keeps working with no step.**
Its files have no `formatVersion`. This release reads them as "format
version 0" and converts them in memory. Each file becomes version 1 the
next time a command writes it. `8.0.0` stops reading version 0, and a
script in the upgrade instructions rewrites the files before that
upgrade.
- **A file with a key Prisma does not define is now refused,** in a
contract, a migration, a ref or an operation. A hand-edited file with a
stray key stops reading. One exception until `8.0.0`: a ref file a
release candidate wrote is read with a stray key dropped, as the release
candidates did.
- **A MongoDB migration that passes `sort` or `returnDocument` to
`rawFindOneAndUpdate`, or `sort` to `rawFindOneAndDelete`, now sends
them to the database.** Earlier releases dropped them when they read the
migration back, so the command ran without them. Applying such a
migration to another database now does what its author wrote.
- **A SQL target built outside this repository must supply a new
function, `readOperations`,** and a contract serializer overrides a
different method. The full list is under "API changes".

About 600 of the changed files are the repository's own contracts,
snapshots, migrations and refs, rewritten by a script; each differs from
`main` only in the version field.

A **snapshot** is the copy of a contract that a migration keeps beside
it. A **ref** is a file that gives a contract a name, such as
`production`. `ops.json` holds the operations of a migration, beside its
`migration.json`.

## The decisions

All are recorded in a new decision record, [ADR
331](docs/architecture%20docs/adrs/ADR%20331%20-%20Stored%20files%20carry%20a%20format%20version%2C%20and%20a%20reader%20refuses%20one%20it%20does%20not%20know.md).

1. **`contract.json`, each snapshot, `migration.json` and each ref file
carry `formatVersion`.** A migration's version also covers its
`ops.json`.
2. **A reader looks at the version first.** A version it knows: it reads
the file. A higher version: it stops and says a newer release wrote the
file. No version: it stops and says how to get a file it can read,
unless the file is one only a release candidate wrote (decision 5).
3. **A reader refuses a field it does not know.** So a release cannot
add a field to a format without raising its version.
4. **A writer writes the oldest version that can hold the data,** so
newer tooling does not force an upgrade on everyone who reads its files.
With one version there is nothing to choose yet; the rule binds the
first release that adds a second.
5. **Until `8.0.0`, files a release candidate wrote are read as version
0 and converted in memory.** Until `8.0.0` the content of format 1 is
also not final: a release candidate may still change it, with upgrade
instructions.
6. **Format 1 of `ops.json` reads every shape of an operation that a
release candidate wrote, for the whole of Prisma 8.**

### Decisions 1 and 2: why the version and the refusal must be in
`8.0.0`

The Prisma 8 compatibility policy promises (its page is a draft,
prisma#31193; the promise itself is agreed) that a later 8.x release
reads every file an earlier one wrote, and the user regenerates nothing.
An `8.0.0` reader stays in use for the whole major. So it must already
know how to recognise a file it cannot read, and it must already refuse
what it does not understand. A reader that ignores an unknown key in
`8.0.0` will ignore, for the whole major, a field a later release adds.
Neither can be added afterwards.

A reader is strict because a migration is an instruction to change a
database. Acting on one that is only partly understood is the failure
the rule prevents.

### Decision 3: what "refuses a field it does not know" changed

Before this pull request several readers ignored unknown keys:

| Reader | Before | Now |
| --- | --- | --- |
| `migration.json` and ref files | A ref ignored unknown fields | Strict
in format 1; a release-candidate ref still has unknown fields dropped |
| Contract (SQL family, PostgreSQL entry kinds, MongoDB family) | About
25 kinds of object ignored an unknown key | Strict; the error names the
key's full path |
| MongoDB `ops.json` | Every object ignored an unknown key | Strict |
| SQL `ops.json` | No reader: the runners treated the parsed file as
operations | A strict reader in the SQL family, to which each SQL target
supplies its own fields |
| A type's parameters | Prisma's own types ignored an unknown parameter,
and no command checked them | Each of Prisma's 16 parameter schemas is
strict, and it is applied when a command reads a contract and when a
client builds the type |
| A contract snapshot | Read strictly only by `migration plan` | Read
strictly by whatever interprets it: planning, signing, `db migrate --to`
and `db update --to` for the snapshot a ref names, and `migration check`
for every snapshot a ref names or a graph ends at. A snapshot a command
only records or identifies by hash is not read |

A **family** is the code shared by databases of one kind (SQL, MongoDB);
a **target** is one database, such as PostgreSQL.

The rule stops at content Prisma carries for someone else, where any key
is accepted. These are the **open places**: `meta`, `capabilities`, an
extension's own section, a generator's parameters, a literal default's
value, an index's options, a SQL statement's parameters, and the MongoDB
documents handed to the database as they are. ADR 331 lists them.

SQL operations are read strictly by everything that acts on their
statements: the runners, the statement preview, and the checks `db
migrate` runs on a recorded path.

A command reads strictly what it interprets in that run, and no more.
`db migrate` records the snapshot of each migration it applies as it is
stored, and `migration status`, `list`, `graph` and `ref set` use hashes
only. This matters for old projects: one with a snapshot in a shape from
before `8.0.0-rc.1`, which no reader of this release reads, still
applies its migrations. The repository's telemetry app is such a
project.

A command that cannot read a stored file names it and says why, and
never calls it unknown or missing. It refuses when it acts on the file;
`migration list`, `graph`, `status` and `check` report it and go on with
the rest. `db update` is the one command that goes on past a file it
acts on: when the snapshot of the contract the database was last at
cannot be read, it warns and continues as for a database with no
recorded origin. Before this, several commands dropped such a file
without a word: `migration list` and `graph` left out a migration,
`migration new` started from the empty contract when its ref could not
be read, and `migration check` reported the migrations after an
unreadable one as unreachable, with advice to delete them. Every command
and entry point that loads a stored file was listed and checked for
this.

The advice a refusal gives follows one rule: restore the file from
version control first; name a command only where that command writes the
file again, and say what else it does; never give a new hash to a
migration a database has applied; never name a contract for the `db` ref
by hand. For example, a lost `migration.json` is written again by
running the migration's `migration.ts`, which gives it a new hash, so
that advice is offered only when no database has applied the migration.
The database commands warn about a migration whose snapshot they cannot
record only when the run applies it.

### Decision 5: why release-candidate files are read, and only until
`8.0.0`

Release-candidate users have asked for fewer forced rewrites. Reading
their files costs them nothing now. It also runs the "convert an earlier
format" path on real files before the first format change after `8.0.0`
depends on it.

A release-candidate file is recognised without guessing: a contract has
`"schemaVersion": "1"` and no `formatVersion`; a `migration.json` or ref
has neither. Only a release candidate wrote those. A contract with
neither field is refused, because no release wrote it. Version 0 has a
converter and no printer, so no release writes it. A test fails if a
release that is not a pre-release still reads version 0, so `8.0.0`
cannot ship with it.

prisma#31203, built on this pull request, changes how contract
hashes are computed. The parts of release-candidate reading that depend
on that are there.

### Decision 6: why older operation shapes are read for the whole major

From `8.0.0` no release may change a migration's hash, and `ops.json` is
covered by that hash. So from `8.0.0` an older shape of an operation can
only be read, never rewritten, and format 1 has to read it for the whole
major. Before `8.0.0` a script could still have rewritten those shapes,
because the hash rules change once before `8.0.0` (prisma#31203).
Reading them was chosen because it is small and costs users no step. The
reader converts each to the current shape before it checks the
operation, so nothing after it sees the older form:

- **SQLite, up to `8.0.0-rc.19`:** every operation carried `"schema":
"main"`. It is dropped. Any other value is refused.
- **PostgreSQL and SQLite, `8.0.0-rc.21` and `rc.22`:** an entry in a
step's `meta` tells the runner to count the rows that still hold a
removed enum value. In those releases it had fewer fields. The reader
fills them in from the same places those releases' runners read them.
- **MongoDB:** a field the query builder writes into a query plan is
declared, and two command options that earlier readers dropped, `sort`
and `returnDocument` on `rawFindOneAndUpdate` and `sort` on
`rawFindOneAndDelete`, are now passed to the command. That changes what
such a migration does when it is applied again: it now does what its
author wrote.

These were found by going through the history of every planner,
operation class and serializer across all 485 published `8.0.0-rc` tags
(each release candidate and the development builds between them),
because the repository holds no saved file of most of them. Contract
shapes from earlier release candidates need no such acceptance:
published upgrade instructions already rewrite them.

## Known limits

Recorded in the project's follow-up list,
`projects/ga-compat-stored-files/deferred.md`:

- **`migration check`, `status`, `list` and `graph` do not read a
target's own operation fields.** They load `ops.json` in the framework
and use only the fields every target shares. So `migration check` can
pass a migration that `db migrate` refuses. Fixing it means the
framework asks the family to read each operation when it loads the file,
which adds to the framework. It is listed in ADR 331 as an alternative
not chosen here, and it is the second decision asked of the reviewer
above.
- **A migration written in code can write an operation that `db migrate`
then refuses,** for the same reason.
- **An index's `type` and `options` are not checked when a contract is
read,** only by the TypeScript builder.
- **SQLite creates an empty database file when `db migrate` refuses a
migration,** because the refusal comes after the database is opened to
read its marker. That was so before this change.
- **Nothing tests that the open places stay open.** A reader that starts
acting on a key inside one needs a new format version, and only the
author of the change knows.

## For users of a release candidate

Nothing to do for this change. [The upgrade
instructions](upgrade-instructions/pending/stored-files-format-version/app/instructions.md),
for applications and for extensions, still ship a script that rewrites
every file to version 1. It is required before upgrading to `8.0.0`, and
optional until then:

```bash
node upgrade-instructions/pending/stored-files-format-version/app/scripts/stored-files-format-version/stored-files-format-version.ts
```

That is its path in this repository. A user gets it with the release's
upgrade guide in the Prisma 8 skill and runs it from their project root.

It renames `schemaVersion` in every contract and snapshot, adds
`formatVersion` to every `migration.json` and ref file, changes no other
byte and no hash, removes an unknown field from a ref file and lists it,
and changes nothing when run again.

## API changes

Application code changes nothing. The changes are for authors of a
family, a target, an extension or a tool built on the toolchain.

- `@prisma/orm-framework`: new entries `contract/format-version`
(`convertContractDocument`, which reads a stored contract's version and
converts an earlier one; `NEWEST_CONTRACT_FORMAT_VERSION`, which a
family writes into the contracts it prints; `isFormatVersionError`; and
their types), so a family built outside this repository reads and writes
a contract the way Prisma does (the same names are also on the
`contract` entry); `contract/internal/format-version`, the shared reader
and its converters for every kind of file (`readStoredDocument`,
`StoredFormat` and their types), which Prisma's own packages reach each
other through and which is not for outside code; and
`utils/upgrade-guides`, the addresses a refusal points to.
`CanonicalizeContractOptions` loses `schemaVersion`, because
`canonicalizeContract` no longer takes or writes it.
`errorContractValidationFailed` accepts the file's path and what kind of
file it is in its options, so a refused contract or snapshot names its
file.
- `@prisma/orm-postgres`, `@prisma/orm-mysql`, `@prisma/orm-mariadb`,
`@prisma/orm-sqlite` and `@prisma/orm-mongo`: each re-exports the three
new framework entries, because a database package re-exports every
framework entry so that code built on it needs no direct dependency on
the framework. That includes the `internal` entry, which Prisma's own
packages use to reach each other and which is not for outside code.
- `@prisma/orm-family-sql`: `SqlContractSerializerBase` gains protected
`parseContractV1` and `printContractV1`, the parser and printer of
contract format 1; the base class reads and writes the version around
them. New: `createSqlOperationsReader`, `SqlOperationsReader`,
`SqlTargetOperationsFormat` and `SqlOperationsLocation`, the strict
reader of SQL operations and what a target supplies to it; and
`probeUnknownKeys`, `SQL_OPERATIONS_OPEN_PLACES`, `DocumentPlace` and
`UnknownKeyProbe`, a test helper with which a SQL target's author checks
that its reader refuses an unknown key everywhere outside the open
places. `SqlControlTargetDescriptor` gains a required `readOperations`,
so **a SQL target built outside this repository must now supply it**.
Its `api-breaks.json` records the breaks against `8.0.0-rc.25`.
- `@prisma/orm-family-mongo`: `MongoContractSerializerBase` and
`MongoContractSerializer` gain `parseContractV1` and `printContractV1`,
for the same reason as the SQL base.
- `@prisma/orm-target-postgres`: `PostgresContractSerializer` overrides
`printContractV1` where it overrode `serializeContract`, because the
base class now writes the version around it.
- `@prisma/orm-target-mysql`: `MysqlContractSerializer` overrides
`printContractV1` for the same reason, and the target supplies
`readOperations`. Its `api-breaks.json` records the breaks.
- `@prisma/orm-target-sqlite`: `SqliteContractSerializer` overrides
`printContractV1` for the same reason.
- `@prisma/orm-target-mongo`: `MongoTargetContractSerializer` overrides
`printContractV1` for the same reason. `deserializeMongoOps` takes an
optional `MongoOperationsLocation`, so a refusal names the migration and
the operation.
- `@prisma/orm-toolchain`: new `parseMigrationMetadataDocument`,
`printMigrationMetadataDocument`, `parseRefDocument`, `printRefDocument`
and their document types, the parser and printer of each version of
`migration.json` and ref files. `computeMigrationHash` accepts
`formatVersion` and leaves it out of the hash. `contractSpaceFromJson`
requires `spaceId`, so an error in a file an extension ships names the
extension. `assertDescriptorSelfConsistency` takes the whole
`contractJson`, so it can read the version first. `buildReadAggregate`
gains `onUnreadableFile`, which refuses an unreadable ref or migration
by default and lets a listing command report it and keep going.
`IntegrityViolation`'s `contractUnreadable` gains the snapshot's `hash`,
so a refusal names the file; the functions that carry that type are
recorded as breaks for it. `DbUpdateOptions` gains an optional
`onUnreadableOrigin`. `enumerateCheckSpaces` takes one options object
(`EnumerateCheckSpacesInputs`) with the family's contract reader, and
`CheckSpace` carries that reader and the migrations that could not be
read; `checkSingleTarget` and `runMigrationCheck` follow. Its
`api-breaks.json` records these. The breaks recorded against
`8.0.0-rc.25` are `contractSpaceFromJson`,
`assertDescriptorSelfConsistency`, `buildReadAggregate`,
`enumerateCheckSpaces`, `checkSingleTarget` and `runMigrationCheck`.

The repository's rule is that the framework domain,
`packages/1-framework`, gains no new concepts. This pull request adds
one there (the first decision asked of the reviewer above): the shared
reader of a stored file's format version, with its converters. It is in
the framework because some paths read a contract before any family sees
it (the CLI's contract reader, the snapshot store, an extension's
bundled files). The strict readers added nothing to the framework. This
addition needs the reviewer's agreement.

## Reviewing the diff

<details>
<summary>A suggested reading order</summary>

1. ADR 331.
2. `packages/1-framework/0-foundation/contract/src/format-version.ts`:
the shared reader, the refusals and their advice, version 0.
3. `packages/1-framework/3-tooling/migration/src/formats/`: one unit per
version of `migration.json` and ref files.
4. Each family's contract serializer base, and the strict contract
validators (`packages/2-sql-family/1-core/contract/src/validators.ts`,
`packages/2-mongo-family/1-foundation/mongo-contract/src/contract-schema.ts`).
5. The SQL operations reader,
`packages/2-sql-family/9-family/src/core/migrations/operations-reader.ts`,
and each SQL target's `read-operations.ts`.
6. The MongoDB operations reader,
`packages/3-targets/mongo/1-target/src/core/migrations/mongo-ops-serializer.ts`.
7. The upgrade instructions and script, with tests in
`test/integration/test/upgrade-instructions/stored-files-format-version/`.

</details>

## How it was verified

- **Each parser and printer:** print, parse, same data back. Each
refusal and each reading path has a test.
- **Strictness:** for each object made strict, a test adds one unknown
key and expects a refusal that names its path. A one-off probe added an
unknown key at every place in the 368 saved contracts that read: 403
distinct places accepted it before, and only the open places do now. A
committed test does the same for every saved SQL `ops.json` of each
target.
- **Nothing saved stops reading:** tests read every saved
`contract.json` and every saved SQL and MongoDB `ops.json`, and fail on
an empty list. They exclude, by name, 46 contracts in shapes from before
`8.0.0-rc.1`, which the published `rc.25` reader refuses too, and the
fixtures of earlier upgrade scripts. Stored contracts under other file
names (112, mostly expected-output files of tests) are not in that test;
a one-off run read all but one deliberate "before" fixture.
- **Older shapes:** each one reads and gives the current shape; a
malformed one is refused. For the enum-value mark, the conversion was
checked against the `rc.22` runner's code.
- **Release-candidate files:** a PostgreSQL and a MongoDB project that
`8.0.0-rc.25` wrote are read file by file. The three tests on `main`
that give an `rc.25` contract to a client pass.
- **The script:** `before` and `after` project trees, a second run, and
files it must refuse.
- **By hand, with the built CLI, on real `8.0.0-rc.25` PostgreSQL and
MongoDB projects with no script run:** `contract emit`, `migration
status`, `migration check`, `migration plan` of a change, `db migrate`,
`db verify` and a query worked, and only the files the commands wrote
moved to version 1.
- **By hand, strictness:** an unknown key was planted in each kind of
stored file and each kind of place, for both databases. Every strict
place refused it, every open place accepted it, the refusal's advice
worked when followed, and no file or database changed. A file at version
2 was refused by every command. The first run found two gaps (a snapshot
and a column's type parameters were accepted) and three commands that
hid or misreported an unreadable file. They are fixed and the fixes
confirmed by hand. One fix first went too far, reading every recorded
snapshot strictly, which stopped the telemetry app migrating an empty
database; review caught it and it was narrowed.
- **By hand, older shapes:** a migration with the older enum-value mark
was applied to a real PostgreSQL database, with and without a row
holding the value, with the same result and messages as the current
shape. On SQLite, `"schema": "main"` applied and `"schema": "other"` was
refused. On MongoDB, the `sort` of a raw command decided which document
changed.
- **By hand, repair advice:** every command a refusal advises was run on
copies of PostgreSQL and MongoDB projects, in the application's space
and an extension's, with and without `--db` and `--config`, and the
project checked afterwards with `migration check` and `db migrate`. Four
review rounds found advice that refused, had side effects it did not
state, or changed a hash; the last round fixed six such findings, and a
final check covered only those six.
- **The merge queue's integration tests** found that the new read-time
check of type parameters reported a refused `varchar(0)` as a generic
"contract validation failed". It now reports the data type's own
`CONTRACT.TYPE_PARAMS_INVALID`, as main did. The CLI passes that error
through as itself, alongside the format version errors. That is a list
of codes chosen by name, not a rule for every library error: these are
the read errors whose own message tells the user what to change, where
the generic wrapper's advice (emit again) would not help. The commands
that only list migrations still report it and go on.
- **Decision record:** reviewed by fresh agents under the repository's
rule for documentation: a cold reader, three times, and a fact checker
against the code, five times, with its last findings corrected.
- **CI** runs on this branch. The whole package, integration and
end-to-end suites were not run locally.
- **Independent review,** design and code separately, on each part, in
several rounds.

## Alternatives considered

- **Refuse a release-candidate file and leave it to the upgrade
script.** Rejected while release candidates continue: every user would
rewrite every stored file for a change that adds one field, and the
conversion path would first run on real files only after `8.0.0`.
- **Read a file with no version as version 1, with no "version 0".**
Rejected: a reader that assumes a version is what the opening example
shows going wrong. Version 0 is recognised by what only a release
candidate wrote, and it has an end date.
- **Ignore fields a reader does not know,** as Protocol Buffers readers
do. Rejected: Prisma would apply a migration while ignoring part of it.
- **Let each new field say whether an older release may ignore it.**
Rejected: someone would have to judge that correctly for every field
ever added. Writing the oldest version that holds the data serves the
same case.
- **Rewrite an older operation shape with an upgrade script.** Possible
before `8.0.0` and not chosen: reading the shapes is small and costs
users no step. From `8.0.0` it is not possible, because a migration's
hash may not change.
- **Read operations strictly when the framework loads `ops.json`.** Not
chosen here, because it adds to the framework. See "Known limits".
- **Record which Prisma release wrote the file.** Rejected: most
releases change no format, so a release number would refuse files an
older release reads perfectly well.
- **A version string such as `"1.2"`.** Rejected: a reader refuses any
version it does not know, so there is no compatible minor step to
express.
- **A version only in `contract.json`, or one for the whole project.**
Rejected: migrations and refs are read on their own, and the files
change independently.
- **A version inside `ops.json`, by wrapping the array in an object.**
Rejected: it would change every migration's hash, and `ops.json` is
never read without its `migration.json`.
- **Include `formatVersion` in the migration hash.** Rejected:
converting a migration to a later format would change its hash.
- **Tell a stored file from a contract Prisma built in memory by which
fields it has.** A command accepts either. Rejected: a file with no
version field at all would be taken for a built contract and accepted.

Agent: alexvanhalen-55

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-authored-by: Claude Fable 5.2 <[email protected]>
wmadden
wmadden previously approved these changes Nov 28, 2026
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	packages/1-framework/0-foundation/contract/test/canonicalization.test.ts
#	packages/3-extensions/paradedb/migrations/20260601T0000_install_pg_search_extension/migration.json
#	packages/3-extensions/paradedb/migrations/20260601T0000_install_pg_search_extension/migration.ts
#	packages/3-extensions/paradedb/migrations/20261029T1342_create_pg_search_extension/migration.json
#	packages/3-extensions/paradedb/migrations/20261029T1342_create_pg_search_extension/migration.ts
#	packages/3-extensions/paradedb/migrations/20261029T1342_declare_pg_search_extension/migration.json
#	packages/3-extensions/paradedb/migrations/20261029T1342_declare_pg_search_extension/migration.ts
#	packages/3-extensions/paradedb/migrations/20261106T1036_find_pg_search_on_search_path/migration.json
#	packages/3-extensions/paradedb/migrations/20261106T1036_find_pg_search_on_search_path/migration.ts
#	packages/3-extensions/paradedb/migrations/20261106T1401_install_pg_search_on_search_path/migration.json
#	packages/3-extensions/paradedb/migrations/20261106T1401_install_pg_search_on_search_path/migration.ts
#	packages/3-extensions/paradedb/migrations/refs/head.json
#	packages/3-extensions/paradedb/migrations/snapshots/64d4b64f45a5eed5da75f456d92729b2412d5c23b7d6f01bafaa8bdb542016de/contract.d.ts
#	packages/3-extensions/paradedb/migrations/snapshots/64d4b64f45a5eed5da75f456d92729b2412d5c23b7d6f01bafaa8bdb542016de/contract.json
#	packages/3-extensions/paradedb/migrations/snapshots/6640f77ac5c9486512863eceb9d99d4f60f2d21ca29385c62c7744d901b0a3c7/contract.d.ts
#	packages/3-extensions/paradedb/migrations/snapshots/6640f77ac5c9486512863eceb9d99d4f60f2d21ca29385c62c7744d901b0a3c7/contract.json
#	packages/3-extensions/paradedb/migrations/snapshots/ed091e3f6c2113d8488b1eac15933b77684d2bec75b6522a15afd4cdc96c369e/contract.d.ts
#	packages/3-extensions/paradedb/migrations/snapshots/ed091e3f6c2113d8488b1eac15933b77684d2bec75b6522a15afd4cdc96c369e/contract.json
#	packages/3-extensions/paradedb/src/contract.d.ts
#	packages/3-extensions/paradedb/src/contract.json
#	packages/3-extensions/paradedb/test/descriptor.test.ts
#	test/integration/test/prisma7-source/fixture-extension-packs.ts
@wmadden-electric
wmadden-electric added this pull request to the merge queue Nov 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 29, 2026
@wmadden-electric
wmadden-electric marked this pull request as draft November 29, 2026 01:27
wmadden-electric and others added 6 commits November 29, 2026 12:34
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	packages/9-public/@prisma/orm-family-mongo/api.txt
#	packages/9-public/@prisma/orm-family-sql/api-breaks.json
#	packages/9-public/@prisma/orm-target-mongo/api-breaks.json
…ive is refused as invalid

Rendering the types of a contract read from a file ran the emitter, whose check that the storage hashes to its recorded storage hash throws an internal error, so a placeholder or edited hash reached the user as CONTRACT.TYPES_RENDER_FAILED, which says the types could not be rendered. The file itself is wrong, so renderContractDts now checks the hash first and reports CONTRACT.VALIDATION_FAILED, saying what the hash is, what the storage gives, and how to write the file again. The emitter keeps its internal error for a contract built from source, where a wrong hash is a bug.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…heir storage gives

Four suites wrote contract.json files with made-up storage hashes. The MongoDB db sign suite failed, because rendering the types of its contract refuses a hash its storage does not give; the db verify suites and the pgvector db init suite passed only because those paths do not check. Each now derives the hash with computeStorageHash and the family normal form. The db sign test that changed only the hash to model a changed contract now changes the capabilities, and checks the marker records the new profile hash.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rage gets its own message

The refusal said the contract failed to deserialize. renderContractDts now returns both hashes in storageHashMismatch, and the refusal says that the contract records one storage hash while its storage gives another, why that happens, and how to write the file again. The error reference names the cause and the commands that meet it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…e capabilities

Both profile hashes come from computeProfileHash over the capabilities the contract lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ers, not escapes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 29, 2026 02:35
@wmadden-electric
wmadden-electric added this pull request to the merge queue Nov 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 29, 2026
@wmadden-electric
wmadden-electric marked this pull request as draft November 29, 2026 03:08
…sorted by name

The MongoDB normal form orders a collection indexes by name, so the emitted contract lists User_email_idx before User_email_key. The db init case read the live index list, whose order is the server one, so it now compares it sorted by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 29, 2026 03:11
@wmadden-electric
wmadden-electric added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 50f1da8 Nov 29, 2026
27 checks passed
@wmadden-electric
wmadden-electric deleted the ga-compat-hashes branch November 29, 2026 03:38
wmadden-electric added a commit that referenced this pull request Nov 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Nov 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Nov 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Nov 29, 2026
…hem, db or conn, and sign only what the database provides

A contract stores what it requires as requiredCapabilities, each key prefixed db. (the database provides it) or conn. (the connection provides it). Signing succeeds only if the database version provides every db. key, and a key no version provides is refused. The client checks conn. keys against its adapter and driver and warns. Extensions no longer declare capabilities. A stored contract that still has capabilities is refused with a message naming the contract-hash-inputs upgrade script, which now also rewrites the field. Fixtures, fixed hash literals and API records are regenerated for the new field and the hash rules of #31203.

The full history of this change is on the branch tml-capabilities-stored-rename-history.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

2 participants