docs(driver-sql): pool docblocks name the factory's max 5, not knex's max 10 - #14773
docs(driver-sql): pool docblocks name the factory's max 5, not knex's max 10#14773os-musk wants to merge 3 commits into
Conversation
… max 10
Two docblocks in `sql-driver.ts` justified themselves with knex's own
`poolDefaults()` (`{min: 2, max: 10}`) as if it were the size the platform
runs at. It is not: `buildSqlPool` in service-datasource's
`default-datasource-driver-factory.ts` hands every SQL datasource an explicit
`{min: 0, max: 5}` unless the datasource declares its own `pool`, so no
factory-composed datasource ever reaches knex's default.
Both docblocks now name `max: 5` and where that number lives, and keep the
knex fact as one clause -- it is true, and it is why the misreading is easy
to have. Comment-only; no executable line moves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
📓 Docs Drift CheckThis PR changes 1 package(s): 7 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 — 10 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 a81a46fa1e2625bdb05519158d96579d162c86ae && git checkout a81a46fa1e2625bdb05519158d96579d162c86ae
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7251bad7d8c3a96725b85104b4c7ff73023bdd5b 9921a0cc90060ff0f356fcdbc5f434c5954096ac && git checkout -B drift-repro 7251bad7d8c3a96725b85104b4c7ff73023bdd5b && git merge --no-ff 9921a0cc90060ff0f356fcdbc5f434c5954096ac
node scripts/docs-audit/affected-docs.mjs --json 7251bad7d8c3a96725b85104b4c7ff73023bdd5b
|
⛔ Held — red on the #14648 queue flake, not on this diff
That is #14648, verbatim — same file, same case, same assertion, same line. ⭐ And the durations corroborate the standing diagnosis rather than merely matching a name: Why this failure cannot be this PR'sThe diff is one file, comment-only, and the dev proved that mechanically rather than asserting it: both versions emitted through ⇒ A behaviour change is impossible here, so a product regression is not among the available explanations. Of the three classes a red belongs to — load, product regression, or a broken validity premise — this one is excluded from the second by construction and lands in the first. Disposition, per the standing #14648 ruleCard #14588 →
One stale reading, recorded so nobody chases it
Generated by Claude Code |
Fixes #14588
Two docblocks in
packages/drivers/driver-sql/src/sql-driver.tsjustified themselves with knex's ownpoolDefaults()—{min: 2, max: 10}— as if that were the pool size the platform runs at. It is not. Every SQL datasource the platform composes goes throughbuildSqlPoolin service-datasource'sdefault-datasource-driver-factory.ts, which hands it an explicit{min: 0, max: 5}unless the datasource declares its ownpool, so nothing the factory builds ever reaches knex's default.Both docblocks now name
max: 5and where that number lives, and keep the knex fact as one clause — it is true, and it is precisely why the misreading is easy to have. Naming the factory file is the point: a reader who learns only "max 5" goes looking in the wrong package next time.Comment-only. No behaviour change, no executable line moves.
The two passages
ensureSequencesTable(the MySQL DDL branch), before:after:
assertBareKnexSafe(the SQLite dead-lock guard), before:after:
Measured on this branch, not inherited
Every prior reading of this card was stale by the time it was used, so all of it was re-taken at
224f8ea4a(the merge base).Closed population.
grep -n "roomy"oversql-driver.tsreturns exactly two sites —:5901and:8204— so the population is two, not a sample. Widened acrosspackages/drivers/driver-sql/**for the claim rather than the word (roomy,max=10,max: 10,poolDefaults,min: 2), the only other hits areREADME.mdexamples where an author explicitly declarespool: { min: 2, max: 10 }inSqlDriverConfig. A declared pool is honoured verbatim, so those are valid config, not a restatement of the stale default. Outside the declared write surface and not touched — reported to triage.The factory default, verified rather than inherited.
buildSqlPoolatpackages/services/service-datasource/src/default-datasource-driver-factory.ts:626readsmin: typeof pool.min === 'number' ? pool.min : 0/max: typeof pool.max === 'number' ? pool.max : 5, and is wired into both thepostgres(:1077) andmysql(:1134) branches. Thesqlitebranch passes no pool at all — SQLite'smax: 1comes from knex's own sqlite3 dialect override,defaults({min: 1, max: 1}, super.poolDefaults()). Read-only; this PR does not touch that package.End-to-end composed config, no live database. Driving the real factory:
Reproducing the filer's reading exactly. The knex fact holds too: knex 3.3.0
Client.poolDefaults()atlib/client.js:229-231returns{ min: 2, max: 10, propagateCreateError: true }.Verification — all at
97c42b50dComment-only, proven mechanically rather than asserted. Both file versions were emitted through
ts.transpileModulewithremoveComments: true(typescript 6.0.3) and the outputs compared:Tests, both sides.
pnpm --filter @objectstack/driver-sql exec vitest run --maxWorkers=2, run at the fix and again with the pre-fix file restored on disk (mutation confirmed by blob hash before the run; restore confirmed byte-identical toHEADafter it):pnpm --filter @objectstack/driver-sql typecheck— exit 0.Gates. 22 families derived from the actual changeset with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands(21 by path, 1 by change kind). All 22 run: 20 exit 0, and 2 land on their own NOT-MEASURED branch, recorded in the gate's own words rather than as green:node scripts/check-test-completeness.mjs— exit 3, noturbo run testlog to hand it: "the local reading for this gate is NOT MEASURED … it is not a red, and there is nothing here to fix."pnpm check:dual-build-cjs-loads— exit 3,PREREQUISITE NOT MET — this gate reads built output, and some package has no dist/ … This is NOT a pass: nothing was measured.It needs a full-repo build; CI does that. The byte-identical emit above is the standing reason this diff cannot move any package's built output.ESLint — a declared narrowing, not a skipped run. Targeted at the one changed file:
eslint --no-inline-config --format jsonreports 1 file linted, 0 errors, 0 warnings. The three pieces the narrowing owes: ① the receiving population is 5768 of 8059 tracked files, computed through eslint's ownESLint.isPathIgnored()againsteslint.config.mjs, not guessed; ② the file count is read from the--format jsonoutput array; ③eslint.config.mjsstates in its own comment that this repo "runs oneeslint.config.mjs, which never enables type-aware linting (noparserOptions.project, no typed@typescript-eslintrules) for ANY file, test or not" — measured there with a positive control — so no untouched file's verdict can depend on this diff. The full repo sweep is CI's run.Scope held
{min: 0, max: 5}is untouched, and the factory was not aligned to knex's default — that default is preserved deliberately since the pre-datasource.config 至今无人校验:驱动 configSchema 是声明但完全惰性的(ADR-0049 enforce-or-remove,#4001 收尾发现) #4410 hardcode and pinned bydefault-datasource-driver-factory.test.ts. If 5 is the wrong number, that is a separate card with a measurement.packages/services/service-datasource/**is read-only in this PR; the docblock cites that file, and citing is not touching.sql-driver-*.test.tsfiles held by test(driver-sql): give the seven unconditionally-live hooks an explicit 60_000 budget #14629 are untouched.packages/drivers/driver-sql/src/sql-driver.ts.No changeset — the diff is comment-only and publishes nothing from any released package (the emitted bytes are identical), so
skip-changesetapplies, per the landed precedent for a comment-only diff.🤖 Generated with Claude Code
Generated by Claude Code
Generated by Claude Code