Skip to content

test(driver-sql): budget the 8th live-cell hook, reached through the rawDriver() helper - #14950

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14628-rawdriver-live-hook-budget
Sep 3, 2026
Merged

test(driver-sql): budget the 8th live-cell hook, reached through the rawDriver() helper#14950
os-musk merged 1 commit into
mainfrom
claude/issue-14628-rawdriver-live-hook-budget

Conversation

@os-musk

@os-musk os-musk commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #14628

The beforeAll of the Field.datetime on MySQL (#3942) suite in
packages/drivers/driver-sql/src/sql-driver-datetime-mysql-storage.test.ts is
the 8th unbudgeted live-cell hook in this package, and the one PR #14629
deliberately left. It gets the same explicit 60_000 third argument the seven
landed with, plus a note recording why the narrow walk missed it.

Test-only: one comment block and one timeout argument. skip-changeset — this
PR publishes nothing from any package.

Why the #14213 walk did not reach it

That walk read each hook's own new SqlDriver(...) argument and matched a
named live-cell constant. This hook constructs no driver in its body at all: it
calls the module-level helper rawDriver() at :51, which hard-codes
MYSQL_CELL.config(). One level of helper indirection hides the liveness from
an argument reading. The same file's three beforeEach hooks call rawDriver()
too, but they also construct a driver inline, which is why the narrow walk
caught them and not this one.

Measured evidence

A — the site is still unbudgeted at origin/main. Base commit 110b85839,
which contains PR #14629 as 13b520069 (git merge-base --is-ancestor says
yes). Before this change:

  • sql-driver-datetime-mysql-storage.test.ts:51const rawDriver = () => new SqlDriver(MYSQL_CELL.config());
  • sql-driver-datetime-mysql-storage.test.ts:57beforeAll(async () => {:62 });, no third argument

B — rawDriver() reaches an unconditionally live cell, not a parametrised
one.
Following the helper: MYSQL_CELL is dialectCell('mysql')
(live-dialect-matrix.testkit.ts:349), which resolves to the DIALECT_CELLS
entry at :308-:323 carrying id: 'mysql', live: true, and a config()
returning a real mysql2 connection URL. It is a fixed cell, never a
matrix-iterated cell.config() that would be SQLite for the sqlite cell — so
this is the same easy shape as the seven, not the declareDialectCell(...)
population #14213 ruled out as a judgement call.

C — the walk, re-run with one level of helper indirection resolved. An AST
walk over all 161 test files in the package, classifying each unbudgeted
beforeAll/beforeEach/afterAll/afterEach that reaches a live cell either
inline or through a module-level helper:

Tree inline-only inline + helper indirect-ONLY budgeted total unbudgeted
13b520069^ (pre-#14629 control) 5 2 1 0 8
110b85839 (base, post-#14629) 0 0 1 7 1
this branch 0 0 0 8 0

The control reproduces the filing's table exactly: the narrow population is
5 + 2 = the seven #14629 budgeted, and the indirect set is 2 + 1 = 3, of which
exactly 1 was not already among the seven. No ninth site. With this change
the population is closed at 8.

D — no prose states the 5000ms figure for a hook. Three mentions of
5000ms exist in this file (:74, :177, :262 before the edit), and all
three are the correct contrastive framing — each pairs "a hook inherits
hookTimeout (measured 10000ms)" against "not testTimeout (5000ms)". None
attributes 5000ms to a hook. As #14629 expected, there was nothing to correct.
The note added here says 10000ms for the hook and names 5000ms only as the
figure an unbudgeted it() gets.

packages/drivers/driver-sql/vitest.config.ts sets neither hookTimeout nor
testTimeout — confirmed by reading the whole file — so both are vitest's own
defaults and the 10000ms figure holds by absence.

Verification

All at 491bf0ec8, the final commit.

  • pnpm --filter '@objectstack/driver-sql^...' build — dependency closure built first; VERDICT command-exit 0.
  • pnpm --filter @objectstack/driver-sql exec tsc --noEmit --listFiles — exit 0, no error TS. The edited file is present in the tsc program (checked with --listFiles, against a control term), so the green covers the edit rather than skipping it.
  • pnpm --filter @objectstack/driver-sql exec vitest run --maxWorkers=2 — Test Files 152 passed, 9 skipped (161); Tests 2294 passed, 140 skipped (2434).
  • The file alone, verbose: 1 file skipped, 15 tests skipped. With no OS_TEST_MYSQL_URL the describe.skipIf(!URL) suites do not run, so the budgeted hook executes only in the live-dialect matrix — the severity qualifier from triage, confirmed rather than assumed.
  • Gate family from node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (no path arguments; it derives the change set from git off the merge base): 33 commands, 30 pass, 0 red. pnpm check:pm-dispatch-gates passes. node scripts/pm/check-governed-merges.mjs --test on the final one-file list: NOT governed, ordinary queue landing.
  • Three of the 33 are NOT MEASURED, each exiting 3 (a finding is 1) and each saying so itself: check-test-completeness.mjs ("That list names this script with NO argument … the local reading for this gate is NOT MEASURED. It is not a red"), and check:dual-build-cjs-loads plus check:type-check-debt, both "PREREQUISITE NOT MET" needing a full workspace build CI performs before them. Declared, not silently dropped: neither can be moved by this diff — nothing here reaches a published dist/, and driver-sql's own tsc --noEmit is clean.
  • No changeset, so the 8 further families the deriver reports as gated on a changeset path do not apply.

🤖 Generated with Claude Code

Generated by Claude Code


Generated by Claude Code

…Driver()`

The `beforeAll` of the `Field.datetime on MySQL (#3942)` suite builds no driver
in its own body — it calls the module-level `rawDriver()` helper, which
hard-codes `MYSQL_CELL.config()`. That one level of indirection is why the
#14213 walk, which read each hook's own `new SqlDriver(...)` argument, reached
the three `beforeEach` hooks in this file and not this one.

Give it the same explicit `60_000` third argument the seven sites of PR #14629
landed with, plus a note recording why the narrow walk missed it and that a
hook inherits `hookTimeout` (measured 10000ms in this package's config, which
sets neither timeout), not `testTimeout` (5000ms).

Re-running the walk with one level of helper indirection resolved: at
`13b520069^` it reports 5 inline-only + 2 inline+helper + 1 indirect-only = 8;
at HEAD with this change, 8 budgeted and 0 unbudgeted. No ninth site.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@github-actions github-actions Bot added the size/s label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json aae0cb395f50c5491442540bbb453265519a1e57packageMentionDocs.

@github-actions github-actions Bot added the tests label Sep 3, 2026
@os-musk os-musk added skip-changeset PR has no user-facing published change; bypasses the changeset gate and removed tests labels Sep 3, 2026 — with Claude
@os-musk
os-musk marked this pull request as ready for review September 3, 2026 16:21
@os-musk
os-musk enabled auto-merge September 3, 2026 16:21
@os-musk
os-musk added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 6392b9c Sep 3, 2026
42 checks passed
@os-musk
os-musk deleted the claude/issue-14628-rawdriver-live-hook-budget branch September 3, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

1 participant