Repository navigation
refactor(objectql): move 36 hand-series private docblocks out of engine.ts with the codemod's third pass (slice 1 of 2) - #30341
Conversation
…ne.ts with the codemod's third pass (slice 1 of 2) scripts/codemod-split-engine.mjs gains --hand-docs: a private hand-series stub's docblock moves onto the function in its hand module (replacing the placeholder, one level out), the stub's marker says so, the module header gains one note; public and protected docblocks stay on the class. The proof undoes every move and rebuilds the base engine.ts and hand modules byte for byte. This slice runs it on 8 hand modules (929 docblock lines). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
…n earlier slice landed in The proof now undoes every move in the head and in the base and compares the two, so the second slice's in-run proof holds on the first slice's output and against the unsliced base alike. One self-test case pins it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
…ed, and prove the prune
noUnusedLocals counts a JSDoc {@link X} as a read, so five engine.ts
import bindings went unused once their docblocks moved. --hand-docs now
prunes them (and the // lines directly above a declaration that goes
whole); the proof recomputes the prune from the head and requires every
pruned name to be linked by a moved docblock. Re-run on main a26abbc:
the tree equals a fresh --write there.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
…cs proof An ablation of the per-module comparison stayed green: every case so far edited a moved docblock, which the engine.ts half catches. One case now edits a body byte in a hand module. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
…agged marker as a hand stub Its marker is 'The body lives in' with no tag, so the pass saw 85 of the 86 hand stubs. The fixture's beta stub now carries the untagged form. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
|
domain:server#3 · os-bill · session_01Utp6CYHBS7P5hkUQrNHkHZ os-dev report: #30053 slice 1 of 2, PR #30341 (draft), head
|
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 21 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 3ff9df97a33a575420bfa5b46d48790417fd1fde && git checkout 3ff9df97a33a575420bfa5b46d48790417fd1fde
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bfca0efb79ac5df2049f392cdecd3bbeeea9ec61 b09479c5ddb37e675eeb246ea187ed0adfe8fb25 && git checkout -B drift-repro bfca0efb79ac5df2049f392cdecd3bbeeea9ec61 && git merge --no-ff b09479c5ddb37e675eeb246ea187ed0adfe8fb25
node scripts/docs-audit/affected-docs.mjs --json bfca0efb79ac5df2049f392cdecd3bbeeea9ec61
|
|
domain:server#3 · os-bill · session_01Utp6CbPxYq1wQmUNWvMZkC Flake note · 2026-11-05T07:14Z
|
|
domain:server#3 · os-bill · session_01Utp6CbPxYq1wQmUNWvMZkC 席位核对ACCEPT · head
|
Requested by Bill · project thread
Refs #30053
Clause-②: no
Metadata-protocol: none
维护者速读
scripts/codemod-split-engine.mjs加了第三遍--hand-docs:手写系列([maintainer] refactor(objectql): splitsrc/engine.ts(23,903 lines, +7,501 in 30 days) along itsObjectQLseams, one move-only slice per PR #25522 等)私有桩的 docblock 从engine.ts的类上搬到手写模块里它调用的那个函数上,替换原来的占位注释;公有 / protected 的 docblock 留在类上。本 PR 是两片中的第一片:8 个手写模块、36 块、929 行。生成物未手改。engine.ts和 21 个手写模块;公有.d.ts相等;objectql 测试 base 550 文件 / 10,951 = head;回滚就是 revert。engine.ts顶部被剪掉的 5 个 import 绑定(只被搬走的 docblock 的{@link}引用);③ 任一手写模块头部新增的一段说明。pnpm install --frozen-lockfile后运行node scripts/codemod-split-engine.mjs --hand-docs --verify --base a26abbc6,应看到36 moved (929 lines) across 8 module(s)、13550 -> 12618 lines,退出码 0;--self-test105 例通过。Fixes #30053)在本 PR 合并后从同一分支名接着开。What changes
scripts/codemod-split-engine.mjs: a third pass,--hand-docs. The hand series moved its bodies out ofengine.tsbefore the codemod existed and kept every docblock on the class; each hand-module function carries the placeholder/** The body of \ObjectQL#x`; the method's docblock there is its contract. */`. The codemod's own rule moves a private method's docblock with its body and keeps a public or protected one on the class. This pass applies that rule to the hand series and touches nothing else.[#25522 cut N](83),[#27495](2) or the untaggedThe body lives inofserveReferenceNames(1). 86 in all., its docblock with it, the phrase the codemod's own stubs use. The module's header docblock gains one paragraph saying private docblocks moved here, because each header says the docblock stays on the class.noUnusedLocalscounts a JSDoc{@link X}as a read, so fiveengine.tsimport bindings went unused once their docblocks moved:RelatedFieldBinding,collectReferenceTraversals,optionVisibilityReadsPermissions,readsPermissionPredicateandREADABLE_IDS_MAX_CHAIN_DEPTH. The pass prunes them with the first pass'spruneImports. The last one was a wholeimport typethat existed only for those links, so it goes with the two//lines directly above it (a newdropAttachedCommentsoption; the first pass keeps its default and its output is unchanged).--modules a.ts,b.tsmoves only the named modules' stubs, and a stub already moved is skipped, so the next slice runs on this one's output.engine.tsand each hand module byte for byte. The import prune is recomputed from the head and applied to the base, and every pruned name must be linked by a moved docblock. A base no slice touched undoes to itself, so againstmainthis is "the undo rebuilds the base"; against a base an earlier slice landed in, it proves only the new slice.--hand-docs --verify --base <ref>re-proves a tree on disk.--self-test: 105 cases in 8 batteries (was 86 in 7). The new battery "hand-series docblocks (third pass)" (floor 19) covers the verdicts, the move, the marker, the header note, determinism, slices composing, the prune, and feeds the proof what it must refuse: one character edited in a moved docblock, one edited elsewhere in a hand module, a moved docblock dropped, a staying docblock dropped, a public docblock moved, a marker over a docblock still on the class, a missing header note, a dropped binding no moved docblock links, and an unknown--modulesname.--hand-docs --modules <the 8 below> --writeonmaina26abbc6, unedited (the branch mergedmainand its tree equals a fresh--writethere).What moved in this slice (8 modules, 36 docblocks, 929 lines)
engine-secret-internal-fields.tsengine-master-detail-related.tsengine-readable-ids-permission-formula.tsengine-delete-cascade.tsengine-execution-plumbing.tsengine-migration-flags.tsengine-datasource-routing.tsengine-package-registration.tspackages/objectql/src/engine.ts: 13,550 → 12,618 lines.What stays on the class
validate,count,execute,resolveSecret,checkDriversHealth, the compatibility API, …)validationMessageContextnoteAdmittedValueShapeViolationThe second slice
10 modules, 28 docblocks, 858 lines:
engine-count-aggregate.ts,engine-driver-options.ts,engine-execute-transactions.ts,engine-file-reference-hydration.ts,engine-hook-dispatch.ts,engine-query-lowering.ts,engine-realtime-publish.ts,engine-reference-name-visible.ts,engine-referential-integrity.ts,engine-validation-messages.ts. The plan on this head prints exactly that list (--hand-docswith no--modules), and its in-run proof against this slice passes. It opens after this PR merges and carriesFixes #30053.Verification
All at head
b09479c5unless stated.node scripts/codemod-split-engine.mjs --hand-docs --verify --base a26abbc6: exit 0.36 moved (929 lines) across 8 module(s), 0 already moved at base; engine.ts 13550 -> 12618 lines; undoing every move rebuilds the base, undone the same way, for engine.ts and its 21 hand module(s) byte-for-byte, once the 5 import binding(s) only a moved docblock linked are pruned.--writein a separate worktree ata26abbc6, writesengine.tsand the 8 modules byte-identical to the committed head (cmp, all 9), output tree sha2567883ed99…8ea5..d.ts.packages/objectql/distbuilt at basea26abbc6twice and at head twice. Base 1 = base 2 and head 1 = head 2, byte for byte. Base against head:coreandindex(.d.tsand.d.mts) are byte-identical;util-HASHhas 193/193 statements and 334/334 private members, and its public surface (each class's private members removed with their docblocks) is EQUAL. The raw difference is the 929 lines of moved private docblocks (tsc emits a private member's docblock). Control: dropping one public docblock from the head's.d.tsis caught (DIFFERS).scripts/ablation-replace.mjs, each restored to the HEAD blob: the per-module comparison off → "one edited character elsewhere in a hand module fails" goes red (this ablation first stayed green, which is why that case exists); theengine.tscomparison off → "one edited character in a moved docblock fails" and "a staying docblock dropped from the class fails" go red; the pruned-name link check off → "a binding the head dropped that no moved docblock links fails" goes red.test: basea26abbc6550 files / 10,951 passed, head 550 / 10,951. objectqltypecheck(tsc + check:test-typecheck): exit 0.second-object-read-exposure.pin.test.tsandrow-serving-door-exposure.pin.test.ts(7/7), typesdriver-error-classification.callers.test.ts(11/11),check-facade-delegation-only(OK, registry unchanged),check:adr-anchors(OK;engine.tsstill names ADR-0057, ADR-0067 and ADR-0119), eslint on every changed file: exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 72 commands, each run after a fullturbo run build --filter='!@objectstack/docs'(exit 0). All 72 exit 0;--ran: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN.Acceptance notes
{@link}s inside a moved docblock now sit in the hand module, where a name the class declares ({@link getDriver}and the like) resolves to the module's function of that name or to nothing. The text is unchanged by design: the pass moves bytes, it does not rewrite them. No gate reads those links.patch,@objectstack/objectql) is included, as refactor: facade ObjectRepository and ScopedContext in engine.ts with the same codemod (about 700 lines), as the ObjectQL class already is #30052's was.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses on the changed files.main, one pull request. (the designated thread branch, as the Claim records; first of two slices)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ