fix(cli): re-measure the better-auth better-sqlite3 peer record, correct what it credits, and pin the declaration it justifies - #17095
Conversation
…record, and pin the declaration it justifies better-auth peers `better-sqlite3@^12.0.0` while `@objectstack/cli` declares `^13.0.3`, so every fresh resolve of a tree containing the CLI prints an unmet peer. The reading that decides what to do about it existed only inside the scaffold generator, was taken on better-auth 1.7.1, and credited the wrong package for the 13.x copy. Re-measured on the pinned 1.7.2 and on a bare project depending on `@objectstack/cli@17.3.0`; the declaration is correct and stays. Corrects the record in both scaffold producers and adds the gate that holds the declaration to the reasoning behind it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
…tter-sqlite3-peer-range
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 22 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin b523ae915a6da5ed37ef52342ad343cdb1536edc && git checkout b523ae915a6da5ed37ef52342ad343cdb1536edc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c43bac704819ecb4ae7ecc92b7b3fa2681befe6b 6a9b7b4989119b0251b7042de31f8921dda22dbd && git checkout -B drift-repro c43bac704819ecb4ae7ecc92b7b3fa2681befe6b && git merge --no-ff 6a9b7b4989119b0251b7042de31f8921dda22dbd
node scripts/docs-audit/affected-docs.mjs --json c43bac704819ecb4ae7ecc92b7b3fa2681befe6b
|
Fixes #16813
Clause-②: no
The first step was a measurement, and it picked the branch
Triage was emphatic that nothing was decidable until the compatibility reading existed, and it was right. Here is that reading, taken rather than inherited — the card's core assertion was explicitly unverified by triage, so it is re-taken from source below.
The card's core assertion is TRUE, from two independent sources
Neither the card nor the triage comment was used as a source for this.
GET https://registry.npmjs.org/better-auth/1.7.2readspeerDependencies["better-sqlite3"] = "^12.0.0".node_modules/.pnpm/better-auth@1.7.2_.../node_modules/better-auth/package.jsonreads the same.Both also carry a detail the card and triage omit, and it is load-bearing:
peerDependenciesMeta["better-sqlite3"] = {"optional": true}.The two readings triage confirmed relocate cleanly, with one correction — the CLI's declaration is in
optionalDependencies, notdependencies(packages/cli/package.json), andpackages/plugins/plugin-auth/package.jsonpins"better-auth": "1.7.2"exactly.Reproduced, including the trap
A clean install on a satisfied lockfile proves nothing, so the reproduction was run as a real resolve against the published package — a bare project depending on
@objectstack/cli@17.3.0,pnpm install --lockfile-only:The resolved lockfile names the binding copy exactly: the
@objectstack/cli@17.3.0snapshot carriesoptionalDependencies: better-sqlite3: 13.0.3.The compatibility answer: compatible, and structurally so
Triage's re-grade trigger 1 asks whether better-auth's SQLite adapter touches an API that moved between better-sqlite3 12 and 13. Measured NOT met, and it cannot be met:
better-auth@1.7.2tarball, exactly one names better-sqlite3 —package.json, i.e. the peer declaration itself. Zero code files reference it. Positive control on the same grep:kyselynames 9 files.Databasethe caller constructs and hands it to Kysely; its own sqlite test path uses node's built-innode:sqliteDatabaseSync.AuthManager.createDatabaseConfig()(packages/plugins/plugin-auth/src/auth-manager.ts) returnscreateObjectQLAdapterFactory(...), orundefinedfor better-auth's in-memory adapter. Never aDatabase.So the card stays p3. Per triage's own decision tree, "compatible" makes the correct action bookkeeping, not a choice — which is what this PR is.
Why no range moves
The card offered pulling the CLI back inside caret-12 as the other branch. Measured, it is not a neutral alternative. Three arms, same bare project, same pnpm:
@objectstack/cli@17.3.0)allowedVersionswidening (what the scaffold already ships)The second copy is dead weight: this package loads better-sqlite3 itself (
packages/cli/src/utils/sqlite-occupancy.ts) and knex resolves 13.x through@objectstack/driver-sqleither way. Clearing a report by installing an unused native module is a worse tree than the report.What actually changes here
Not a range — the record, which had two measured errors in it, plus the gate that was missing.
@objectstack/driver-sqlfor the 13.x copy. On the chain that reports, the binding copy is the CLI's ownoptionalDependenciesentry — pnpm names it in the warning text. Editing driver-sql alone would not move this line.packages/cli/test/better-sqlite3-peer-declaration.pin.test.ts. The scaffold widens better-auth's peer to a major, and the only reason that major is right is the CLI's declaration; held apart, either can move alone and stay green. The pin reads the major out of the manifest and compares, so neither moves without the other, and the naive "fix" this card invites fails loudly with the reason attached.Both scaffold producers carry the corrected prose. No declaration, no widening entry and no resolution moves, so
pnpm-lock.yamlis untouched — which also means this does not contend with the open PRs holding it.This PR does not silence the warning for an existing consumer such as hotcrm, and is not meant to: it establishes that the warning is benign, corrects two errors in the record, and pins the declaration so the wrong remedy cannot land later. A consumer that wants the line gone adopts the same scoped
allowedVersionsentry the scaffold already emits (better-auth>better-sqlite3:13) in its ownpnpm-workspace.yaml— a downstream action, deliberately not implemented here, and one that suppresses the report without moving any resolution.Ablation for the new pin
Committed first, then mutated, with the mutation proved on disk before the run:
1 -> 0and0 -> 1; mutated blobf09c205cdiffers from the HEAD blob5d84eb3e, so the edit landed and the reading is not a no-opexpected '13' to be '12'andexpected '12' not to be '12'— 2 failed / 2 passed5d84eb3e,git diff HEADemptyDirection observed: turned red, as predicted.
Verification
pnpm --filter @objectstack/cli exec vitest run --project unit— 190 files / 2628 tests passed (re-run on the merged head)pnpm --filter create-objectstack test— 16 files / 203 tests passedpnpm --filter @objectstack/cli --filter create-objectstack typecheck— exit 0. Note this package'stsconfigincludessrconly, so the test layer is the declared hidden layer held by the shrink-only ledger;check:type-check-coverageis what governs it, and it is green.scripts/pm/dispatch-gates.mjsderived 62, re-derived after mergingorigin/main(still 62, no new families), and--ranreconciles 62 run, 0 NOT-MEASURED, 0 UNRUN.pnpm lint(the full repo union,eslint . --no-inline-config) — exit 0, measured at6a9b7b4989.check:dual-build-cjs-loadsandcheck:i18n-coverage("PREREQUISITE NOT MET", packages with nodist/), andcheck:type-check-debt(OOM under container contention; its siblingcheck:type-check-coverageis green). Declared to CI.Clause-② — re-derived from the delivered diff, and the answer changed shape
Dispatch declared
noon the assumption the landing surface would be a range inpackages/cli/package.json. It is not — the diff landed inpackages/cli/src/commands/init.ts, the blank template'spnpm-workspace.yaml, two test files and a changeset. Re-derived against both limbs:SCAFFOLD_ALLOWED_PEER_VERSIONSalready existed and its value is unchanged; what changed is the prose beside it. Nothing an author or a caller writes against moves.packages/spec/src/**, no error-code ledger, no*.zod.tscontract schema.Both limbs still miss, so the declaration stays
no— but it is a differentnothan the one dispatch reasoned about, which is why it is re-derived here rather than carried forward.验收备注
pnpm-workspace.yamlthatobjectstack initrenders still explains the RETIRED@better-auth/scim>better-callpeer rule as if it were live — and both consistency tests strip comments before asserting, so no gate reads it #17093 — the rendered scaffold comment ininit.tsstill explains the RETIRED@better-auth/scim>better-callrule as if it were live, and both consistency tests strip comments before asserting, so no gate reads it. The sibling template already records the retirement, so the two scaffold paths disagree. A different entry from this card's, hence a different defect, hence filed rather than carried.better-auth 1.7.3resolving alongside 1.7.2 in a consumer tree pinned to@objectstack/cli@17.3.0. That is bug(plugin-auth): published 17.1.0/17.2.0/17.3.0 float@better-auth/coreto 1.7.3, which droppedcreateLocalAccountIssuer— a freshobjectstack dev --seed-adminnever creates the system tables and never seeds #16186, already fixed at@objectstack/plugin-auth@17.4.0— visible here only because the CLI's 17.3.0 pins drag the older plugin-auth in. Nothing owed.pnpm-workspace.yamlalready names this blind spot in its own comment. Closing it would move this repo's resolution and therefore the lockfile, which is a decision with a cost, not a rider on this card. Whoever next touches that lockfile region is the carrier.Generated by Claude Code
Generated by Claude Code