A contract with a bm25 index must build type declarations, now that the ORM development build 8.0.1-dev.18 fixes it #6
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6"
general
weight: 0.35
wmadden
An application that uses this extension's
bm25index type can now build type declarations, and this repository's checks require it. For example, with"declaration": truein the application'stsconfig.json:Until now, under pnpm,
tscstopped on that file:The defect was in Prisma ORM, not in this package, and prisma/orm#31283 fixed it. The fix reaches this repository by moving it to the ORM build that contains it, which is what this pull request does.
The decision
This repository is separate from the ORM repository, and builds the extension from the ORM packages published on npm. Until Prisma ORM 8.0 is released it names one exact development build of them (a build the ORM publishes from every push to its
main). This pull request moves that build from8.0.1-dev.15to8.0.1-dev.18, the newest, and makes two decisions along the way:1. The check for the error above now requires a pass. It used to expect exactly that error.
2. A test that used ORM functions which are no longer published now asks the function
prisma db migrateitself uses, in place of keeping a private copy of the removed ones.Nothing is published by this pull request, and this package's own behaviour does not change. A user gets the declaration fix by upgrading Prisma ORM.
Why now
A nightly run builds this repository against the ORM's newest development build, to find out early when the ORM changes something the extension relies on. It fails since last night (issue 4). Since
8.0.1-dev.15the ORM renamed one import path the extension uses and stopped publishing two others (prisma/orm#31276). The ORM removed paths it found no use of outside its own packages; this repository's tests used two of them.1. Declaration emit must pass
scripts/check-application.mjspacks the extension, installs it into a new application the way a user would, and builds type declarations for two contracts: one with abm25index and one without the extension, so that a failure can be told apart from one the ORM causes on its own.DEVELOPING.mdrecorded the TS2742 error as a known gap, and the check expected exactly that error for thebm25contract. It was written to fail once the ORM fixed the gap, so that the record could not outlive the defect.8.0.1-dev.18contains the fix, so:DEVELOPING.mdare removed;test/declaration-emit.test.ts, loses a compiler option (preserveSymlinks) that made TypeScript find the ORM packages in a way that hid the error. It passes without it, and now fails if the error comes back.2. What the ORM's path changes required
InternalErrorfrom@prisma/orm-framework/utils/internal-erroris nowInvariantErrorfromutils/invariant-error. The shipped code throws it in one place,src/core/proximity-chain.ts, for a state only a bug in this package could cause. The ORM's upgrade script for this change (platform-paths-an-extension-uses) rewrote the import. The lint rule that forbidsthrow new Errornames the allowed class in its message (biome-plugins/no-bare-throw.grit); that file is not TypeScript, so the script skips it, and it is renamed by hand.test/descriptor.test.tschecks which of the package's migrations run from an empty database, and from the first contract the package ever shipped. It built the migration graph withreconstructGraphand searched it withfindPathWithDecision, from@prisma/orm-toolchain/migration-tools/migration-graph, starting fromEMPTY_CONTRACT_HASHfrommigration-tools/constants. Neither path is published any more. The test now describes the package's migrations withcreateAggregateContractSpaceand asksresolveRecordedPath, both from@prisma/orm-toolchain/migration-tools/aggregate, which is still published. "An empty database" is now "no recorded contract" (null). The test asserts the same migration names as before.DEVELOPING.mdlists every ORM import path the repository uses, andpnpm lint:entrypointskeeps the list equal to the imports. It gains the two new paths and loses the three old ones.The rest of the move
@prisma/orm-*version in the twopackage.jsonfiles, and the build named inDEVELOPING.mdandCONTRIBUTING.md, is8.0.1-dev.18.prismacommand-line tool depends on its own copy of@prisma/orm-toolchainand@prisma/orm-framework, and no release of it uses this build. Twooverridesinpnpm-workspace.yamlmake it use the same copy as the extension; without them it writes contract files in an older format. They stay, and now name8.0.1-dev.18.CONTRIBUTING.mdand three CI step names now say that the application check builds type declarations.Checked
descriptor,declaration-emit,operations,structured-errors). The rest of the unit suite runs in this pull request's CI.What the upgrade found wrong in the ORM's upgrade guidance is recorded in the ORM team's tracker (TML-4016), not here.
Alternatives considered
8.0.1-dev.15until the next release candidate. The nightly run would stay red, so a second breaking change in the ORM would go unnoticed, and every change would arrive at once on release day.prisma db migratedoes.preserveSymlinks. Both exist only to live with the defect. With the fix installed, requiring a pass is what catches the defect if it returns.Agent: romeo-32