Repository navigation
refactor(driver-sql): the by-path readers read the sql-driver facade, so the codemod moves the five path-reader members (#30147 phase 2c) - #30363
Conversation
… so the codemod moves the five path-reader members (#30147 phase 2c) A new reader, scripts/sql-driver-split-source.mjs, returns SqlDriver as one text: each codemod stub's body replaced by the facet body it calls, the leaf ahead of the class. The five packages/cli generate-* pins and check-keyed-text-bounds read through it, so the codemod empties PATH_READER_PINS and PATH_READER_NEEDLES and writes createColumn's return type. Regenerated from 21510bb: createColumn, createAuditTimestampColumn, varcharColumnChars, ensureShardTable and initObjects move; the registry loses their five rows (73 -> 68). cli declares the modules the reader follows. Claude-Session: https://claude.ai/code/session_01WGufzj4B2cbnRLVdgtLcDZ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 30 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 13 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 a9cee8043f863235abbcce9af864f9ba618bbdbe && git checkout a9cee8043f863235abbcce9af864f9ba618bbdbe
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0e4dfbe27a2a312864cd8d14e4954b6af14e2a22 b401d5d3492e7666c0bab71c7f6f9318f1ace738 && git checkout -B drift-repro 0e4dfbe27a2a312864cd8d14e4954b6af14e2a22 && git merge --no-ff b401d5d3492e7666c0bab71c7f6f9318f1ace738
node scripts/docs-audit/affected-docs.mjs --json 0e4dfbe27a2a312864cd8d14e4954b6af14e2a22
|
|
domain:devx#1 · os-support-ai · session_01WGufzgBDcBNVmSmo7VFHpj Stamp: 2026-11-05T08:06Z 维护者速读
席位核对
|
Requested by Yibo Wang · project thread
Part of #30147 (phase 2c of 2a-2d: the readers that sliced
sql-driver.tsby path read the facade form, so the codemod moves the five path-reader members. 2d and the phase 3 measurement stay open on the card.)维护者速读
scripts/sql-driver-split-source.mjs,把SqlDriver重新读成一份文本(每个 codemod stub 的方法体换成它所调用的 facet 方法体,leaf 放回类前);cli 的 5 个 generate-* pin 和check-keyed-text-bounds.mjs改用它。codemod 因此清空 2 个 pin 和 10 个 needle,createColumn写出返回类型void,重新生成后 5 个成员变成委托,登记表 73 → 68。sql-driver.ts本文件的文字,codemod 只好把这 5 个方法留在类上(Facade codemods: retire the codemod-limit exception rows in the facade gate registry (protocol.ts, engine.ts, sql-driver.ts) #30147,裁决 6597555122 第 3 条:读者与模块同一个 PR 里跟上)。.d.ts与 base 相同;5 个 pin 断言一条未改,只换了读取来源。回滚即 revert。sql-driver-split-source.mjs(约 160 行,只认 codemod 写的 stub 形态,认不出就抛错而不是读 stub);cross-package-test-inputs.mjs与turbo.json里为 cli 新增的声明。node scripts/codemod-split-sql-driver.mjs --self-test(新电池 "split readers (Facade codemods: retire the codemod-limit exception rows in the facade gate registry (protocol.ts, engine.ts, sql-driver.ts) #30147)" 8 例)和node scripts/check-keyed-text-bounds.mjs --self-test(新增 3 例),都退出 0。Clause-②: no
Metadata-protocol: none
What changes
Five members stayed on
SqlDriverbecause readers slicedsql-driver.tsby path:createColumn,createAuditTimestampColumn,varcharColumnChars,ensureShardTableandinitObjects. Each reader now readsSqlDriveras one text, and the codemod tables that held the five go.scripts/sql-driver-split-source.mjs(new, with its.d.mts).readSqlDriverSource(srcDir)returnssql-driver.tswith the body of every codemod stub replaced by the body of the facet method it calls, and the leaf (sql-driver-top-level.ts) put back ahead of the class. A method's own signature on the class is then followed by its own body, as before the split. It follows exactly the stub the codemod writes: one statement, carrying the[#29520 codemod]marker, returning<X>Facet.<m>(…)or<X>Facet.<m>.call(<x>Host.of(this), …)(or the generic spelling), with the module named in the marker. A marked body of any other shape, a missing module, or a facet without that static member throws. The reader never hands back the stub text. Unmarked bodies (the hand-series delegations) stay as they are. It is a reading, not an undo: imports, a private docblock and the stub-side spellings stay as the split has them.--verifyremains the byte-for-byte proof.Readers.
packages/cligenerate-* pins (builtin-id-column,field-type-vocabulary,file-reference-width,multiple-json-column,string-family-width) buildSQL_DRIVER_SOURCEfromreadSqlDriverSource(DRIVER_SQL_SRC).textinstead ofreadFileSync(…/sql-driver.ts). No assertion, anchor or message changes.scripts/check-keyed-text-bounds.mjsreads its emitter the same way. A reader refusal becomes the gate's existing{ error }refusal.Codemod (
scripts/codemod-split-sql-driver.mjs).PATH_READER_PINS(2 rows) andPATH_READER_NEEDLES(10 rows) are emptied. Both tables stay, with a note on why they are empty.EXPLICIT_RETURN_TYPESgainscreateColumn: 'void', copied from the basedist/index.d.ts(protected createColumn(…): void;).21510bba:createColumn,createAuditTimestampColumnandvarcharColumnCharsmove tosql-driver-column-creation.ts;ensureShardTableandinitObjectsmove tosql-driver-rotation.ts; two top-level declarations move to the leaf.sql-driver.tsgoes from 10,624 to 9,741 lines.Declarations. The pins now read every
sql-driver-*.tsmodule a stub names, through paths the cross-package scan cannot name.scripts/cross-package-test-inputs.mjsgives@objectstack/clithe globpackages/drivers/driver-sql/src/sql-driver-*.tsplus the reader and its.d.mts, withheldBywitnesses naming the five pins (and one forsql-driver.ts, which no literal names any more).turbo.json@objectstack/cli#testcarries the same three inputs. The glob also matches the package's tests; that adds no re-run, becausecli#testalready depends onbuild→^build, and driver-sql'sbuildhashes$TURBO_DEFAULT$.Registry. The five rows are deleted, so 73 rows become 68 (the base has 73: #30264 added four
engine.tsrows after 2b's count of 69).The three
sql-driver.tsrows left on #30147 areapplyFilterCondition(2d),get supportsandstatic DIALECT_CONNECT_TIMEOUT(phase 3 names both).Tests
Codemod
--self-testgains a seventh battery, "split readers (Facade codemods: retire the codemod-limit exception rows in the facade gate registry (protocol.ts, engine.ts, sql-driver.ts) #30147)", with 8 cases, driven over a split the script generates and lays out on disk:106 cases in 7 batteries (98 in 6 before); the battery floor goes 6 → 7.
check-keyed-text-bounds --self-testgains 3 cases in "the emitter-derived family" (floor 3 → 6): the family is read through a stub from the facet module, and a stub naming an undeclared facet or of another shape refuses.No assertion in any of the five pins changes. Before the reader change, the regenerated tree reds 28 of their cases and
check-keyed-text-boundsexits 2 ("could not find the keyed-text arm"). Measured.The suites below ran at base
bfca0efband at head; the counts are equal.vitest run)SqlDriver)SqlDriver)check-liveness.testAcceptance notes
check-keyed-text-bounds.mjsand the cli pins are by-path readers.skip-changeset): no published behaviour or surface changes.Verification
Head
d67df0b5, baseorigin/mainbfca0efb.Proof readings
node scripts/codemod-split-sql-driver.mjs --verify --base 21510bbaexit 0, "180/180 moved bodies identical to base (body, parameters, return type, async); 129/129 moved top-level declarations identical to base (leading comments included); sql-driver.ts 18334 -> 9741 lines; undoing the split does rebuild the base byte-for-byte".--writeruns from the unsplit input give output tree sha2560d2ba8a299610def947cd879cee7e7c36aae58aecfca0f8acacc395339f7bf16both times (input sha2562d2ebebd…), and the tree on disk is unchanged by either..d.ts:dts-public.mjsover the base and headdistexit 0,pass: true, both files raw-equal (index.d.tssha25692e2cfb2…on both sides, as at 2a and 2b).pnpm --filter @objectstack/driver-sql typecheckandpnpm --filter @objectstack/cli typecheck(which includescheck:test-typecheck, so the pins' import of the.d.mts) exit 0.check-tenant-chokepoint: 24/21/3/4/0 across 39 files at base and head;--self-testexit 0.--listat base and head: 52 durability seams with the same verdicts (103 read seams); the only change is the line of the tworunWideningAlters()seams insidesql-driver-rotation.ts(:321/:367→:661/:707), becauseensureShardTableandinitObjectsmoved in above them.check-keyed-text-bounds: exit 0 over the tree, the family read through the stub is the same 8 types;--self-testexit 0.check-cross-package-test-inputsandcheck-ci-filter-parityexit 0.--self-testexit 0 (gate script and its cases untouched).node scripts/pm/dispatch-gates.mjs --commands: 79 derived commands, each run, all exit 0;--ranreconciles 79 derived, 79 run, 0 NOT-MEASURED. Also run: the codemod,check-keyed-text-bounds, durability,check-tenant-chokepointand facade gate--self-tests,check:lean-entry-closure, eslint over the changed files (0 errors), all exit 0.Generated by Claude Code