Skip to content

feat(packs): @prisma/client 6 to 7 migration pack - #269

Draft
lucasbraum wants to merge 9 commits into
mainfrom
lucasbraum/pack-prisma-7
Draft

lucasbraum wants to merge 9 commits into
mainfrom
lucasbraum/pack-prisma-7

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

Pack

@prisma/client >=6 <7 → >=7 <8 (queue entry @prisma/client, now verified). Measures verified: 7 public repositories, 29 of 29 real breaking sites found, no breaking false positive. verification.json records it (pack test --write). Draft for review; see the open questions before trusting the label.

Most of Prisma 7 is outside TypeScript (schema.prisma, package.json, prisma.config.ts, the environment). The rest lives in the generated client, which check never regenerates: @prisma/client's published types are export * from '.prisma/client/default', so the type diff finds no usage at all. So every rule finds its sites with detect. The pack reads the workspace's TypeScript project, and its inventory is package.json, **/*.prisma, prisma.config.* and .nvmrc. Evidence and the full classification: packages/core/src/packs/prisma-client/RESEARCH.md.

prisma and every installed @prisma/adapter-* are a releaseGroup. An adapter the upgrade has to add is a new dependency: the client-adapter guide names it and the decision says so, and Uptide adds nothing.

Sources

All read 2026-10-20 and pinned (in meta.sources):

  • Upgrade guide to v7, prisma/web 42f3146 (file last changed 866b345, 2026-10-12); also reachable with WebFetch at prisma.io
  • Release notes 7.0.0 to 7.10.1, every one read for breaking items: 7.3.0 reverts mapped enums
  • v7 connection pool defaults and v6 environment variables, same commit
  • Published @prisma/client 6.19.3 / 7.10.1 and prisma 6.19.3 / 7.10.1 (declarations, runtime/library.js, the CLI bundle and schema wasm), adapter declarations 6.19.3 / 7.10.1, registry manifests
  • A probe (not committed) that generated both prisma-client-js and prisma-client with 7.10.1, compiled 6-style code against each with TypeScript 5.9.3, ran prisma validate on schema variants, and constructed PrismaClient with no adapter on Node 22

Classification summary

Changes
Rewrite (1) cli-skip-flags: drop --skip-generate/--skip-seed from migrate dev/db push scripts. 7 never generates or seeds there, so the command does the same thing. Declines when a skip flag belongs to another command. Exercised by basalt
Assisted, breaking (10) client-adapter (no adapter/accelerateUrl, datasources, datasourceUrl; also require and dynamic import() clients), schema-datasource-url (url/directUrl/shadowDatabaseUrl, P1012), package-json-prisma, cli-removed-flags, config-removed-options (engine/adapter in prisma.config.ts), mongodb-unsupported, client-middleware ($use, Prisma.Middleware), metrics-removed, adapter-renames, removed-entrypoints (runtime/library, /wasm, …)
Assisted, deprecated (1) engine-type (7.10.1 accepts and ignores it)
Behavior notes env-not-loaded (finding and decision): neither the CLI nor the client loads .env any more. 6's client loaded it at construction (runtime/library.js), and the decision names the schema's env("…") lines, where the app read its URL on 6. cli-implicit-steps (finding and decision): migrate dev/reset no longer seed or generate. connection-url-params (finding): connection_limit, pool_timeout and the other v6 URL parameters the adapters don't read. Decisions: client-js-generator, ssl-validation, mapped-enum-values (only for targets below 7.3.0), runtime-minimums (Node ^20.19/^22.12/>=24, TypeScript >=5.4). generated-client: see below
Confirmed but not a rule Accelerate (in client-adapter's guide)
Rejected as 6 → 7 changes, with evidence output required (6.19.3 already required it for prisma-client; prisma-client-js still generates into node_modules at 7.10.1); ESM required (the 7.10.1 manifest has no type: module, and the probe compiled it as CommonJS)

generated-client: linking @prisma/client 7 next to a client generated at 6 gives TS2305/TS7006/TS7031/TS2339 that a real upgrade never has. foldFindings folds every compile error no rule claims into one "needs a look" finding at the schema's generator block, as its evidence. Without the fold, the first score had 176 breaking false positives.

Ground-truth repositories

Every site was read by hand and committed (cac9bca) before the first score. Licences are permissive, and no commit carries an agent co-author trailer.

Repository Pinned commit Upgrade Sites
BearStudio/start-ui-web (MIT) 7a4e236 #781 (6.19.2 → 7.10.0) 5 (2 breaking)
jqlang/playground (MIT) 48a8e19 #344 (6.19.3 → 7.8.0) 2
openwallet-foundation-labs/ehr-wallet (Apache-2.0) a574d2b #114 (6.19.3 → 7.10.0) 10 (9 breaking)
bcgov/nr-permitconnect-navigator-service, app (Apache-2.0) 6d63485 #574 (6.19.3 → 7.10.0) 5 (3 breaking)
basaltkit/basalt (MIT) 2c255d3 #188 (6.19.3 → 7.9.1) 4
AlexAgo83/cr-league (MIT) 67861c3 #30 (6.19.3 → 7.9.1) 5
MarvinLeRouge/HexaRot, backend (MIT, withoutGenerated: its config's env() needs the database URL) 117ef40 #160 (6.19.2 → 7.10.0) 4

About 50 PRs were screened. Those dropped are listed with reasons in RESEARCH.md: 25 with agent co-author trailers or agent bodies, 9 without a permissive licence, 3 not a 6 → 7 project upgrade, and 4 human and permissive but not drafted yet. All clones were read-only; no push, issue or comment on any of them.

uptide pack test output

uptide pack test @prisma/client · verified
fixtures      7 cases, 28 sites · pass
ground truth
  BearStudio/start-ui-web@7a4e236f6ac3         @prisma/client 6.19.2 → 7.10.0  predicted 4, expected 5, false positives 0, false negatives 0
    with prisma 6.19.2 → 7.10.0
  jqlang/playground@48a8e191766c               @prisma/client 6.19.3 → 7.8.0  predicted 4, expected 2, false positives 2, false negatives 0
    with prisma 6.19.3 → 7.8.0
  openwallet-foundation-labs/ehr-wallet@a574d2bae9af @prisma/client 6.19.3 → 7.10.0  predicted 11, expected 10, false positives 2, false negatives 1
    with prisma 6.19.3 → 7.10.0
  bcgov/nr-permitconnect-navigator-service@6d6348508329 @prisma/client 6.19.3 → 7.10.0  predicted 6, expected 5, false positives 2, false negatives 1
    with prisma 6.19.3 → 7.10.0
  basaltkit/basalt@2c255d3fd97b                @prisma/client 6.19.3 → 7.9.1  predicted 4, expected 4, false positives 0, false negatives 0
    with prisma 6.19.3 → 7.9.1
  AlexAgo83/cr-league@67861c3c23d7             @prisma/client 6.19.3 → 7.9.1  predicted 8, expected 5, false positives 3, false negatives 0
    with prisma 6.19.3 → 7.9.1
  MarvinLeRouge/HexaRot@117ef409197e           @prisma/client 6.19.2 → 7.10.0  predicted 4, expected 4, false positives 0, false negatives 0
    ! generator failed: prisma generate --schema prisma/schema.prisma (Failed to load config file "~/.cache/uptide-prisma7/truth/MarvinLeRouge__HexaRot@117ef409197e5cb3c8e308d8bc9cd09015c360a0/backend" as a TypeScript/JavaScript module. Error: PrismaConfigEnvError: Missing required environment variable: DATABASE_URL); scored without it: backend/prisma.config.ts reads env("DATABASE_URL"), which throws when the variable is unset: prisma generate needs the project's database URL at this commit.
    with prisma 6.19.2 → 7.10.0

  rule                         precision  recall    tp   fp   fn
  cli-implicit-steps                  0%      0%     0    3    1
  cli-skip-flags                    100%    100%     1    0    0
  client-adapter                    100%    100%    17    0    0
  client-js-generator                n/a      0%     0    0    2
  config-removed-options            100%    100%     1    0    0
  connection-url-params             100%    100%     1    0    0
  env-not-loaded                     67%    100%     2    1    0
  generated-client                    0%     n/a     0    5    0
  package-json-prisma               100%    100%     3    0    0
  schema-datasource-url             100%    100%     7    0    0
  overall (sites)                    78%     94%    32    9    2
  behavior notes (sites)             25%     60%     3    9    2
  breaking (sites)                  100%    100%    29    0    0

false positives (9)
  jqlang/playground@48a8e191766c  package.json:15  cli-implicit-steps (deprecated)
  jqlang/playground@48a8e191766c  prisma/schema.prisma:7  generated-client (deprecated)
  openwallet-foundation-labs/ehr-wallet@a574d2bae9af  package.json:15  cli-implicit-steps (deprecated)
  openwallet-foundation-labs/ehr-wallet@a574d2bae9af  prisma/schema.prisma:4  generated-client (deprecated)
  bcgov/nr-permitconnect-navigator-service@6d6348508329  package.json:63  env-not-loaded (deprecated)
  bcgov/nr-permitconnect-navigator-service@6d6348508329  src/db/prisma/schema.prisma:1  generated-client (deprecated)
  AlexAgo83/cr-league@67861c3c23d7  apps/api/package.json:19  generated-client (deprecated)
  AlexAgo83/cr-league@67861c3c23d7  package.json:26  cli-implicit-steps (deprecated)
  AlexAgo83/cr-league@67861c3c23d7  prisma/schema.prisma:1  generated-client (deprecated)

false negatives (2)
  openwallet-foundation-labs/ehr-wallet@a574d2bae9af  prisma/schema.prisma:5  client-js-generator (behavior)
  bcgov/nr-permitconnect-navigator-service@6d6348508329  src/db/prisma/schema.prisma:2  client-js-generator (behavior)

reported under another rule (1)
  BearStudio/start-ui-web@7a4e236f6ac3  package.json:58  env-not-loaded, expected cli-implicit-steps

gate          29 breaking sites, 6 behavior-note sites in public ground truth · verified
rewrites      precision    tp   fp  (real true positives, scored false positives)
  cli-skip-flags                    100%     1    0
PASS @prisma/client: verified

The 9 false positives are all "needs a look" notes, never breaking. The 2 misses are client-js-generator decisions, which are never reported as sites.

Smoke (no LLM spend)

  • uptide check @prisma/client --allow-candidate on jqlang at its base commit: the 2 breaking sites, 3 notes, prisma moving as a release-group member, and the stale-client error folded with its evidence.
  • UPTIDE_INTERNAL=1 uptide fix @prisma/client --allow-candidate --no-llm on a clean jqlang clone: the 2 assisted sites stay manual, and 77 tests pass. Verification fails on one TS2305: the post-bump prisma generate fails on the schema url the run left manual, so the stale client stays.
  • The same on a local 6.19.3 fixture: --skip-generate is dropped by the rewrite, prisma and @prisma/client move to 7.10.1 together, and 3 sites stay manual.
  • On a basalt clone, fix stops before migrating: "Requested @prisma/client@7.10.1, but packages/prisma has 6.19.3 installed". Another workspace keeps 6. That is fix's monorepo handling, not the pack.

Checks

  • pnpm test: uptide 48 files, 538 tests passed; @uptide/core 202 files passed (4 skipped), 2481 tests passed (37 skipped)
  • pnpm typecheck: 3 tasks successful
  • pnpm lint: 952 files checked, no fixes applied. Its 2 warnings and 1 info are in bench/score.mjs, biome.json and next/platform.test.ts, none touched here
  • pnpm public:check: clean with a dummy UPTIDE_PRIVATE_DENYLIST, and clean with the local denylist. No .md file here is named plan, roadmap or audit
  • pnpm docs:links: every relative link resolves

Changeset: minor. A new verified pack changes what check and fix do for @prisma/client by default, and recent verified packs used minor.

Open questions

  1. Ground truth outside source files. packs:truth drafts only *.ts and tsconfig files (SOURCE_FILE in packs/tooling/truth-diff.ts). 12 of the 29 breaking sites are in schema.prisma, package.json or prisma.config.ts, read by hand from the same git diff -U0 with the same rules. I did not change the engine. Accept this for the verified label, or add those files to the draft tool first? Until then, keep it candidate?
  2. The generated-client fold drops a whole class of compile errors into one note. Each is a stale-client artifact (I checked every message shape in cr-league and bcgov), but it is a pack hiding compiler output. The real fix is an engine change: generate the target client in an isolated copy during check.
  3. Path convention. docs/packs.md says ground-truth files are repository-relative, but every pack names a directory entry's files from the directory. I followed the packs (04ac449, no site changed); the docs may want a line.
  4. Adapters in the release group. No Prisma page says "keep the adapter at the client's version". The evidence is the lockstep publishing, the exact driver-adapter-utils pins, and the 7.0.0 class renames. @prisma/instrumentation is left out (the docs install it @latest).
  5. Known gaps. A class that extends PrismaClient with no options to super (NestJS PrismaService; HexaRot added a constructor, which the truth rules count as no site). ?schema= in a PostgreSQL URL (cr-league handled it, but no source this pack cites says so). db push asking for consent under an AI agent (basalt; not in the sources read).
  6. Behavior precision is 25%. cli-implicit-steps flags prisma migrate dev scripts the repositories kept. The behavior did change for them, but the truth rule counts only what the upgrade changed. Keep it as a finding, or make it a decision only?

Checklist

  • Every rule and note comes from a source listed in meta.sources
  • Every rule that rewrites or detects has a fixture case, with a site it must leave alone (keep)
  • Ground truth: public repositories at the commit before their upgrade; expected findings read from their own upgrade commit and the compiler, never copied from Uptide's output
  • At least two public repositories for verified
  • pnpm uptide pack test @prisma/client passes and its output is pasted above; verification.json written with --write
  • pnpm lint && pnpm typecheck && pnpm test pass
  • Changeset added
  • No private code, names or paths anywhere: fixtures are synthetic, ground truth is public

🤖 Generated with Claude Code

lucasbraum and others added 9 commits October 20, 2026 11:19
Source ledger (prisma/web 42f3146 guide, 7.0.0 to 7.10.1 release notes,
6.19.3 and 7.10.1 tarballs, a probe of both generators) and the
classification of every breaking change, before any pack code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Detect-based rules: check sees no usage of @prisma/client (its types are
the generated client), so the pack reads schema.prisma, package.json,
prisma.config.* and the workspace's TypeScript project. One rewrite
(cli-skip-flags: 7 never generates or seeds where the flags skipped it);
everything else is assisted. prisma and installed driver adapters are a
release group. Scaffolded with uptide pack new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Committed before the first score. BearStudio/start-ui-web #781,
jqlang/playground #344, openwallet-foundation-labs/ehr-wallet #114,
bcgov/nr-permitconnect-navigator-service #574, basaltkit/basalt #188,
AlexAgo83/cr-league #30, MarvinLeRouge/HexaRot #160: every site read by
hand from each upgrade commit; the compiler draft against a client
generated at 6 is never a site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Ground truth for an entry with `directory` names files relative to that
directory (redis, sentry-browser, next, typescript do), not to the
repository: bcgov (app) and HexaRot (backend). No site, rule or line
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
…nd mocks

Linking @prisma/client 7 next to a client generated at 6 gives compile
errors no real upgrade has: they fold into one generated-client finding
at the schema's generator block, as its evidence. Files a generator
writes (its output directory, Prisma's generated header) are not read,
a client the file mocks with jest.mock/vi.mock is never a site, and
tests are not where a connection pool is configured. prisma-client-js
is a decision: 7 still supports it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
A workspace whose schema lives at the monorepo root (cr-league apps/api)
has no schema of its own to anchor the generated-client finding: its
package.json line that declares @prisma/client is where its client
comes from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
cli-implicit-steps names the package.json scripts it found; the
connection URL parameters are findings only, since the decision context
holds no source strings. A jqlang smoke run listed both with nothing
behind them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
uptide pack test @prisma/client --write: 7 public repositories, 29 of 29
breaking sites found, no breaking false positive (verified gate);
cli-skip-flags exercised by basalt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
…d changeset

RESEARCH.md records every repository screened, the measured pack test and
what the engine cannot express. pnpm docs:packs adds the pack to the
README and the compatibility matrix; the queue entry is verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
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.

1 participant