
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
@prisma-next/migration-tools
Advanced tools
On-disk migration persistence, hash verification, and chain reconstruction for Prisma Next
Internal package. This package is an implementation detail of
prisma-nextand is published only to support its runtime. Its API is unstable and may change without notice. Do not depend on this package directly; installprisma-nextinstead.
On-disk migration persistence, hash verification, and history reconstruction for Prisma Next.
MigrationMetadata, MigrationOps, MigrationPackage, MigrationGraph)migration.json + ops.json)computeMigrationHash in hash.ts uses explicit framing:
migrationHash) from
the metadata envelope, then canonicalize the stripped envelope and the
ops array.[hash(metadata), hash(ops)].This avoids delimiter-ambiguity and pins migrationHash to a 2-tuple over
the on-disk storage shape. Per ADR 199 — Storage-only migration identity,
contracts are anchored by the storage-hash bookends (from, to) inside
the metadata envelope — the full contract IRs themselves are not part of
the manifest.
readMigrationPackage performs intentionally shallow ops.json validation in io.ts:
id, label, operationClass)Full semantic validation happens in target/family migration planners and runners at execution/planning time.
ops.json does NOT containops.json carries the post-lowering execution form of every operation. The runner is a dispatcher, not a compiler — it does not invoke the lowerer, the codec system, the contract validator, or any other build-time pipeline at apply time. See ADR 192 — ops.json is the migration contract §"No compilation at apply time".
Concretely, an ops.json file does not contain:
migration.ts is authoring sugar; apply never imports it.codec, codecId, typeParams). Codecs are resolved during lowering; their wire-format outputs land in params[] (SQL) or as literals in the structured command (Mongo). See ADR 212 — AST-bound codec resolution.(sql_template, params[]) for SQL, structured kind-discriminated commands for Mongo.Tampering and corruption are detected by migrationId (content-addressed hash of migration.json + ops.json; see ADR 199). The "no apply-time compilation" invariant is what makes that hash meaningful: it pins what executes, not just what the author intended.
graph TD
CLI["CLI commands<br/>(migration new, plan, apply, show, status)"] --> IO["io.ts<br/>File I/O"]
CLI --> HASH["hash.ts<br/>Migration hashing"]
CLI --> GRAPH["migration-graph.ts<br/>Graph operations"]
IO --> META["metadata.ts<br/>MigrationMetadata"]
IO --> PKG["package.ts<br/>MigrationPackage, MigrationOps"]
HASH --> IO
HASH --> CAN["@prisma-next/framework-components/utils<br/>canonicalizeJson"]
HASH --> CP["@prisma-next/emitter<br/>canonicalizeContract"]
GRAPH --> GR["graph.ts<br/>MigrationGraph, MigrationEdge"]
GRAPH --> ABS["@prisma-next/migration-tools/constants<br/>EMPTY_CONTRACT_HASH"]
| Package | Why |
|---|---|
@prisma-next/contract | Contract type for embedded contracts in metadata |
@prisma-next/framework-components | MigrationPlanOperation types (via ./control) |
@prisma-next/emitter | canonicalizeContract |
arktype | Runtime shape validation for migration.json and ops.json |
@prisma-next/utils | Workspace utility dependency (currently no direct runtime imports in this package) |
pathe | Cross-platform path manipulation |
@prisma-next/cli (M3) — CLI commands consume these functions| Subpath | Contents |
|---|---|
./metadata | MigrationMetadata |
./package | MigrationPackage, MigrationOps |
./graph | MigrationGraph, MigrationEdge |
./io | writeMigrationPackage, readMigrationPackage, readMigrationsDir, formatMigrationDirName |
./hash | computeMigrationHash, verifyMigrationHash |
./migration-graph | reconstructGraph, findLeaf, findPath, detectCycles, detectOrphans |
./errors | MigrationToolsError |
./constants | EMPTY_CONTRACT_HASH |
Each migration is a directory containing two files:
migrations/
20260225T1430_add_users/
migration.json # MigrationMetadata
ops.json # MigrationPlanOperation[]
See ADR 028 and ADR 001 for design rationale.
pnpm build # Build with tsdown
pnpm test # Run tests
pnpm typecheck # Type-check
FAQs
On-disk migration persistence, hash verification, and chain reconstruction for Prisma Next
We found that @prisma-next/migration-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.