Repository navigation
refactor(driver-sql): move resolveHashShadowKeys' body out of sql-driver.ts into sql-driver-introspection.ts (#25521 cut 7) - #26114
Conversation
…ver.ts into sql-driver-introspection.ts (#25521 cut 7) The MySQL hash-shadow enrichment moves unedited beside its only caller, introspectIndexes, and reaches the class through the existing IntrospectionHost (knex only). The class method keeps its name, docblock and signature (less async) and hands the body its host. sql-driver.ts 21,398 -> 21,380 lines; isHashShadowCarrier leaves its import. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AuyWbsvLe5peToiMx3LiTd
📓 Docs Drift Check4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. 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 6e1e41e037f83c3ea8ddad044e8dbe75336c78bb && git checkout 6e1e41e037f83c3ea8ddad044e8dbe75336c78bb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 679fc7ce87c0f9d5d439a65f1a7a24d056a37a74 156e3538f0db8a601c7ef39b26ece9c567c0c567 && git checkout -B drift-repro 679fc7ce87c0f9d5d439a65f1a7a24d056a37a74 && git merge --no-ff 156e3538f0db8a601c7ef39b26ece9c567c0c567
node scripts/docs-audit/affected-docs.mjs --json 679fc7ce87c0f9d5d439a65f1a7a24d056a37a74 |
席位核对ACCEPT · The maintainer's standing authorisation for landing reviewed PRs, verbatim: 「按照 pm-dispatch 规则复核过的都授权」.
Generated by Claude Code |
Requested by Leehom · project thread
Part of #25521
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Ruling-ref: 6348891160
Cut 7 of the
sql-driver.tssplit (#24586 ruling A, recorded in6270097840). The claim is6415078284. The body of the protectedSqlDriver#resolveHashShadowKeys, the MySQL hash-shadow enrichment of the index read, moves unedited intopackages/drivers/driver-sql/src/sql-driver-introspection.ts, besideintrospectIndexes, its only caller (cut 5). It reaches the class through that module's existing host,IntrospectionHost, which already listsknexandresolveHashShadowKeys, so the host is not widened. The method keeps its name, docblock, signature (lessasync) and position.It is move-only, and the card stays open for the later cuts. Branch
claude/project-thread-3jc3ll(platform-assigned to this card thread, as the claim records). The cut commit0b01e18basits onorigin/mainb4199c968; seat 1's #26015 (SqlDriver.upsert) then landed, andorigin/mainwas merged in (156e3538f, merge base0a6948210, clean, no conflict). Every reading below was taken on both pairs: baseb4199c968vs head0b01e18ba, and base0a6948210vs merged head156e3538f.Net line count (the seat's rule from ACCEPT
6385306916).sql-driver.tsgoes from 21,449 lines to 21,431 on the merged pair (21,398 to 21,380 on the first pair): -18. The body is 25 lines out; the stub is 6 lines in; the introspection import gains one name (+1) and its comment one line (+1);isHashShadowCarrierleaves theschema-drift.jsimport (-1), since the moved body was its last value read in the file. The module grows 927 to 975 lines. The slice pays alone, so no hash-shadow neighbour was paired with it.Serial with the file's in-flight PRs. Re-measured at my start: 40 open PRs, each file list read. The only one on
packages/drivers/driver-sql/**,driver-turso/**ordriver-sqlite-wasm/**was #26015 (upsert region at lines ~2256 and ~9495-10078, plus one import line afterunencoded-json-text.js); this cut's region is the introspection stub (~15134) and the import lines 126 and 163-173.git merge-treeof the cut against #26015's headb4fc36f35ewas clean; #26015 then landed first and this branch mergedmainafter it, as card ask 4 says. The Version Packages PR #25640's file list could not be paged through the proxy (HTTP 403 on the redirected page); it has carried onlyCHANGELOG.mdandpackage.jsonchanges for these packages in every earlier cut.The area, measured on
0a6948210resolveHashShadowKeysis lines 15134-15163 ofsql-driver.ts(a 28-line docblock above it, 25 body lines). Its only caller is cut 5'sintrospectIndexesbody insql-driver-introspection.ts, through the host closure.void), so the inferred-return limit does not bite.getBuilder(it reads the catalog throughthis.knex.select(...).from('information_schema.COLUMNS')), socheck:tenant-chokepointrule 1 is untouched.thisread (AST screen): the only member it reads isknex(twice). It has nothis.FIELD.delete/insert/update(site.TursoDriverandSqliteWasmDriverdo not override it (git grepover both packages: 0 hits), and no test, script, doc or ADR names it (git grepoverdocs/,content/,scripts/,.github/: 0 hits).The shape (#23050 shape B, as cuts 1-6 apply it)
async. Its body is one host literal plusresolveHashShadowKeys.call(host, tableName, indexes), marked[#25521 cut 7], and it returns the moved function's own promise.knexgoes as a GETTER that reads the driver at call time (the shape cut 5's stub uses), so aknexreplaced on the instance after construction is the one the body reads.thisas thePickofIntrospectionHostoverknexalone, and the stub annotates its literal as theThisParameterTypeof the moved function. No cast, and no member becomes public.introspectIndexes' body still callsthis.resolveHashShadowKeys(...)through its host closure, which calls the class method on the driver. A subclass override or an instance spy is still the one reached (probe below).isHashShadowCarrierandparseHashShadowKeyParts, both exported byschema-drift.ts, so the module imports them from there (not a copy).sql-driver.tsstill readsparseHashShadowKeyParts(two other call sites) and keeps it; it no longer readsisHashShadowCarrieras a value (two prose mentions in comments remain) and drops it from its import. No declaration gains anexport;index.tsre-exports nothing from the module.[#25521 cut 7]paragraph; thesql-driver.tsimport comment names cut 7.The published
.d.tsdoes not changeUnder the series bar (ruling
6348891160, letter A). Each end built withpnpm --filter @objectstack/driver-sql buildagainst the same dependency tree; the base legs restore the base text of the two files in this worktree after the commits, under an EXIT/INT/TERM trap that restores HEAD (proved by HEAD blob hashes, an emptygit diff HEADand 0 status entries).dist/index.d.tsanddist/index.d.mts(no.d.cts); the two are identical at every end.b4199c968and head0b01e18bais93da45168e82136b7613944525e47402d5dc6f9f8daa9efa4bdceeaa11b52a89(cuts 1-6's hash);cmpidentical.0a6948210and merged head156e3538fare both5028e040e1501b0bd72b91fafcf4e1cb372393c59baa5bab8b936b240dd2d3f5;cmpidentical.dist/index.d.ts: line 5750, theprotected resolveHashShadowKeys(tableName: string, indexes: PhysicalIndex[])declaration, withprotectedremoved, gives766c5f27828eae19be82213dcfedb1fd5f4e52239fb3d6435fc9e5fa0c2f121fand a 4-line diff;cmpexits 1.diff-identical)..call(hostsites indist/index.mjsanddist/index.jsgo 18 to 19.No changeset:
skip-changeset, per ruling6348891160item 4 (move-only, no product behaviour change).Proof of move-only
TypeScript AST leaves (recursive
getChildren, JSDoc skipped), base0a6948210vs merged head156e3538f(and the same on the first pair):this) 8 tokens, 0 differ; return type 4 tokens, 0 differ;asyncmatches.'GENERATION_EXPRESSION'in the.select(...)becomes'GENERATION_EXPRESSI0N'. The check reports 1 token and 1 line different and exitsPROOF FAILED, exit 1.async.sql-driver.ts: 207 statements at both ends; 204 byte-identical. The three that differ are theschema-drift.jsimport (isHashShadowCarrierout), thesql-driver-introspection.jsimport (resolveHashShadowKeysin, its comment rewrapped) and the class (the one member above).schema-drift.jsimport gains two names, and the new statement is the moved function.Readers of
sql-driver.tsby path, checked against the moved textNone needed an edit:
scripts/adr-anchors/packages__drivers__driver-sql__src__sql-driver.ts.jsoncarries ADR-0053 and ADR-0120 D4; neither paragraph describes this body, and the body cites no ADR, so no entry is owed.check:adr-anchors: 88 anchored files at both ends; decision-letter citations on the anchored surface 1,878 at base (0a6948210, clean detached worktree) and 1,878 at head (156e3538f).resolveHashShadowKeys.check:adr-symbol-anchors: 2,658 anchors resolve at both ends.check:tenant-chokepoint. 24getBuilderbindings across 3 files at both ends, rule 2 clean at both. Rule 2'sSCAN_FILESnamessql-driver.tsand not the seam modules, so it no longer visits the body's one.where({ TABLE_SCHEMA, TABLE_NAME })and one.whereIn('COLUMN_NAME', ...)(catalog filters, no null comparand, no tenant column);where/whereIn/whereRaw/rawcall lines insql-driver.tsgo 100 to 98. The verdict and the population the gate prints are unchanged, so it does not go empty.check:logger-receiver-detachexits 0 at both ends.*.pin.test.tsfiles,logger-receiver-detach.test.ts,sql-driver-compile-refusal-seam.test.ts, the spec liveness test and the scripts that readsql-driver.tsas text match none ofisHashShadowCarrier,parseHashShadowKeyParts,HashShadoworshadowKey(git grep: 0 hits).check:driver-conformanceat both ends: 55 covered, 0 in the DEBT ledger, 0 exempt.Verification
tsc --noEmit(driver-sql) exit 0.eslint --no-inline-config packages/drivers/driver-sql/srcexit 0 (driver-sql declares nolintscript; the repo-widepnpm lintis CI's).os-verify-lockcall, exit 0 at every end, compared per test name and status from vitest's JSON reporter:driver-sql: first pair 3,999 tests (3,787 passed, 212 skipped; 247 files); merged pair 4,010 (3,796 passed, 214 skipped; 248 files, fix(driver-sql): upsert with nothing left to merge is a plain INSERT, not merge-ALL #26015's new file). 0 lost, 0 changed, 0 added on each pair.driver-turso(against that end's built driver-sqldist): 2,526 tests (2,492 passed, 34 skipped; 95 files) at every end; 0 / 0 / 0 (2,513 distinct names).driver-sqlite-wasm: 704 tests (704 passed; 39 files) at every end; 0 / 0 / 0.dist, not committed): 17 readings, identical at base and head on both pairs (diffempty). It covered: a direct call with a fakeknexset on the instance after construction (the same builder chain,information_schema.COLUMNS, thedatabase()read, the carrier columns inwhereIn, and the parsedshadowKeyper carrier, NULL-safe and raw, plus an unresolved carrier and a plain index left alone); no carrier (returns without touchingknex); a synchronous throw in the builder and an async rejection (both swallowed, resolvesundefined); a non-array argument (a rejection with aTypeError, never a synchronous throw, at both ends); a subclass override ofresolveHashShadowKeysreached fromintrospectIndexes' MySQL arm (via subclass dialect getters and aknex.rawstub); the real method through that arm; and an instance spy on it, reached once.11627,12998,13015,15479) ran against a local MariaDB 10.11 at base0a6948210and merged head156e3538f: 31 tests at both ends (12 passed, 18 failed, 1 skipped), 0 status differences. MariaDB does not take the shadow path these files assert on (the failures name a missing shadow column or a missing shadow-path log line, identically at both ends), so this cell does not reach the moved body; it is MariaDB, not MySQL 8, and only shows the diff changes nothing there. CI's live MySQL lane, where it runs, is the authority.dispatch-gates --commandson this diff at the merged head156e3538f(merge base0a6948210, no STALE TREE): 55 derived commands, each run with its exit captured before any pipe.--ran: 55 derived, 54 run, 1 NOT MEASURED, 0 unrun. The NOT MEASURED one ischeck:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: it needs every package'sdist), which CI runs.check-plugin-teardown-shape --self-testfirst exited 3 (shallow clone) and exits 0 after fetching its positive-control commit;check:lean-entry-closurefirst exited 3 (noobjectqldist) and exits 0 after building it.check:adr-anchors,check:adr-symbol-anchors,check:commit-card-trailersand its--range origin/main..HEAD(2 commits, clean): all exit 0.Acceptance notes
check:tenant-chokepointrule 2 visits two fewer catalog filters insql-driver.ts(above). WideningSCAN_FILESto the seam modules is a gate edit and the open precondition the series carries for thegetBuilderareas; it is not made here.asyncmethod; a caller awaits the same settlement, and a synchronous throw inside the body still arrives as a rejection (probe reading above).applyIndexDriftOpandrestoreBareIndexAfterFailedTightenintosql-driver-schema-sync.tsbeside cut 6's pair. Neither builds throughgetBuilder; screen statics and price at dispatch;applyIndexDriftOpcarries the ADR-0120 D4 ceremony, so the anchor entry's D4 paragraph would need a new entry for that module.🤖 Generated with Claude Code
https://claude.ai/code/session_01AuyWbsvLe5peToiMx3LiTd