
Security News
New Study Identifies 53 Slopsquatting Targets Across 5 Frontier LLMs
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.
@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
The npm package @prisma-next/migration-tools receives a total of 19,395 weekly downloads. As such, @prisma-next/migration-tools popularity was classified as popular.
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.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.

Security News
The White House’s Gold Eagle Initiative aims to coordinate AI-discovered vulnerabilities, validate findings, and accelerate patching across critical software.

Security News
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.