Repository navigation
refactor(objectql): split registry.ts into section modules by codemod (split 1 of 8), a move with the public exports unchanged - #34285
Conversation
…runnable command The first pass of codemod-split-engine.mjs, copied with its host parameterised (registry.ts, SchemaRegistry, registry-*, #33949) and an exports-equality proof added beside its byte-identity proof. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
… (move-only) Generated by node scripts/codemod-split-registry.mjs --write on a branch cut from origin/main; never hand-edited. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…plit moved Six READERS rows named registry.ts sites that the split moved, unedited, into registry-top-level.ts and registry-platform-global.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…y split's changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…ons in registry.ts Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…rea-E1-33949-registry
node scripts/codemod-split-registry.mjs --write on registry.ts at 86350e1, after the open PR that touched it merged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…its two path readers look, and regenerates Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…e the split now keeps it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…h main Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
… split on it registry.ts took a 73-line change on main; the split is regenerated from main's registry.ts with node scripts/codemod-split-registry.mjs --write. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
📓 Docs Drift CheckThis PR changes 1 package(s): 81 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 20 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 b59ae5410c7b6ce69f1b9ed68d74267ab7191f07 && git checkout b59ae5410c7b6ce69f1b9ed68d74267ab7191f07
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7d06248d923d21d9cc453442ca89c324bd0304c0 e06e1a9d536524d73485a1c916f14f8db52c7c4a && git checkout -B drift-repro 7d06248d923d21d9cc453442ca89c324bd0304c0 && git merge --no-ff e06e1a9d536524d73485a1c916f14f8db52c7c4a
node scripts/docs-audit/affected-docs.mjs --json 7d06248d923d21d9cc453442ca89c324bd0304c0
|
… split on it registry.ts changed on main; the split is regenerated from main's registry.ts with node scripts/codemod-split-registry.mjs --write. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…ed at the regeneration commit plus the margin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review claim · head b89e3e4 · 2026-11-16T07:47Z |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — PASSHead-sha: L1 ordinary ACCEPT read (no contract face:
Tier H by size (+12,829/−7,105): this goes to the seat for the hand-off. The area does not arm it. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG 维护者速读Head-sha:
席位意见:建议批准。这是机械搬家,有字节级自证,L1 唯一没做到的本地重跑,席位已经补上。拖久了 main 一旦改到 registry.ts 就得重新生成,现在合并成本最低。 席位核对
|
|
你只是分拆文件,为什么会多出5000行? |
1 similar comment
|
你只是分拆文件,为什么会多出5000行? |
…script lives in branch history only Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
… reasons cite the split's PR instead of a script path Comments and text only; no code moves. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft Final head declared · PR #34285 (#33949 split 1 of 8,
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34285 · L1-b · 2026-11-16T10:27ZHead-sha: L1 delta · ACCEPT · area o1-D 定稿评论 6913648882 所钉 head;对照 PASS 6910597882(@ Delta 读数: 规则一:一次性脚本不入仓 — 成立。 本 head 树内无该脚本;它只在分支历史(
规则二:增长逐文件点清 — 成立。 净增 +2,657(
门禁 check-runs(head 其他:首行 落地条款:改动 >3,000 行 ⇒ 终局四件套,区线程 ⛔ 不落,交席位照 SKILL.md〈路径分叉〉①–④ 交棒(待维护者批准)。head 再移 ⇒ 只读 delta。 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H 维护者速读Head-sha:
席位意见:建议批准。我在本 head 跑了核验,读数与正文一致;脚本删除后 席位核对
|
Requested by Steedos · project thread
Part of #33949. This PR is split 1 of 8 under ruling item 1:
packages/objectql/src/registry.ts. It also adds the split facade's line ceiling, as ruling item 2 and the ceiling gate from #34103 require. It follows the maintainer rule for splits (#33949 comment 6911407209): the split script is not committed, the PR body carries its proof readings, and the net growth is accounted for per file. The other seven splits stay open on the card.Clause-②: no
Metadata-protocol: none
维护者速读
registry.ts(12,577 行)按章节拆成 13 个模块,registry.ts留作转发入口,剩 6,326 行,并按裁决第 2 条给它登记行数上限 6,426(6,326 + 100)。对外导出一个不少,类型/值种类不变,只是代码搬家,不改任何行为。拆分脚本不进仓库,只留在本分支历史(b89e3e42b8)里供核验。registry.ts的 68 个导出名与种类不变。净增约 2,650 行,下文「Growth account」逐文件列出来源。回滚就是 revert 本 PR。scripts/facade-delegation-registry.json新增的 1 行 facade、15 行例外(没搬的成员及原因)和 1 行上限;③packages/objectql/src/registry.ts的转发形态。git show b89e3e42b8:scripts/codemod-split-registry.mjs > scripts/codemod-split-registry.mjs; node scripts/codemod-split-registry.mjs --verify --base $(git merge-base HEAD origin/main); echo exit=$?; rm scripts/codemod-split-registry.mjs。预期看到byte-identity: 200/200 … 127/127 … identical与exports-equality: equal,外加恰好一行 ✗,说registry-facet-hosts.ts与生成稿不同,因此 exit=1。原因是该文件头注释在脚本删除后改了措辞,而脚本对这个文件做整文件比对;原因与对照证明见 Tests。What changes
registry.tsis split by a codemod: pass 1 of theengine.tssplit codemod, re-targeted atSchemaRegistry, plus an exports-equality proof. Following the maintainer rule, the script is not in this PR's tree. It lives in this branch's history: it was added in4001a5c559, last changed inc92a4d31b4, and deleted in08a3d7ae79. Read it withgit show b89e3e42b8:scripts/codemod-split-registry.mjs(blobeb7cc556a0). It has to run from the repo'sscripts/directory, because it imports the sibling helpersinvoked-as.mjsandts-parse.mjsand resolves the repo root from its own path.SchemaRegistrykeeps every member's signature and docblock, and each moved method is a one-call stub:Facet.name.call(FacetHost.of(this), …).registry-facet-hosts.tsdeclares a host per facet and the class installs them in a static block, so a facet reads private state only through its host.registry-top-level.ts.registry.tsre-exports by name every one it exported before.registry.ts. Each method that stays is a row inscripts/facade-delegation-registry.jsonexceptions, citing [Decision] next codemod splits for the large hot files, in order, and whether to name a shrink-only line ceiling (hot-file card F) #33949 with its stay reason (barethis, inferred return type, a parameter that shadows a moved name, a computed name, the constructor). That is the same shape theengine.tssplit left for its members pass.registry.tsbecause a reader looks for them in that file by path:mergeObjectDefinitionsandisShareableNamespace(ADR symbol anchors),REGISTRY_LOG_LEVELS(check:registry-log-declaredandcheck:rest-log-declaredread it fromregistry.ts), andTENANT_SCOPE_INDEX(an ADR-0117registry.ts#organization_idtoken). So the ADRs and the two gates are untouched.scripts/facade-delegation-registry.jsonregistersregistry.ts/SchemaRegistryas a facade, socheck:facade-delegation-onlyholds it to delegation from here on.DECLARED_WATCH_HINTSin that gate names the file.ceilingsgains{ file: registry.ts, baseLines: 6326, baseCommit: c27f4ab0d6, maxLines: 6426, ruling: 6897467376 }.c27f4ab0d6is the regeneration commit: the merge of origin/mainf9120b8692, with the split regenerated on it. The rewording commit changed no line ofregistry.ts(still 6,326 lines), so the row stands.exceptionsreasons cite "the [Decision] next codemod splits for the large hot files, in order, and whether to name a shrink-only line ceiling (hot-file card F) #33949 split codemod (PR refactor(objectql): split registry.ts into section modules by codemod (split 1 of 8), a move with the public exports unchanged #34285, kept in its branch history, not committed)" instead of a script path. They change comments and text only: acrosspackages/objectql/src, 36 changed lines betweenb89e3e42b8and this head, every one a*or//comment line.@objectstack/objectqlpatch, a move only.Growth account
The diff is +9,762 / −7,105, a net of +2,657. Per file (
git diff --numstat $(git merge-base HEAD origin/main) HEAD):registry.ts, the facade side: stubs, section comments, imports, the re-export list, the static host blockscripts/facade-delegation-registry.json(1 facade row, 15 exception rows, 1 ceiling row).changeset/33949-registry-split.mdscripts/check-facade-delegation-only.mjs(one watch hint)federated-injected-column-readers.test.ts(5 keys re-keyed)So the split code itself grows by +2,529 (8,780 − 6,251):
registry.ts. The codemod's own plan counts 800 of them as stub lines (each moved method keeps its signature, gains a marker comment and becomes a one-call forward) and 22 as import lines; the rest are section comments, the re-export list and the static host block. The plan reading istotal: 200/215 methods move into 11 module(s): 3799 body lines out, 800 stub lines in, plus 22 import lines.registry.tsgave up (8,780 − 7,100). Per module, the lines that are not moved text are 1,818: 459 header lines, 156 import lines and 1,203 lines of facet wrapper, duplicated signatures (a facet's static method repeats the signature the stub keeps) and the host interfaces. Against that, 138 lines deleted fromregistry.tsreappear in no module (mostly the blank and signature lines the stubs replace). 1,818 − 138 = 1,680.registry-apps.tsregistry-bare-names.tsregistry-facet-hosts.tsregistry-items.tsregistry-namespaces-and-claims.tsregistry-object-registration.tsregistry-package-addressing.tsregistry-packages.tsregistry-picklists.tsregistry-platform-global.tsregistry-restore.tsregistry-storage.tsregistry-top-level.tsHow each figure was counted
git diff --numstat $(git merge-base HEAD origin/main) HEAD.import.importstatements.registry.tsingit diff MERGE_BASE HEAD -- packages/objectql/src/registry.ts.}can be credited to whichever module meets it first. The per-module split of moved text against overhead is approximate. The totals are exact.f9120b8692'sregistry.ts, from the history copy of the script.Open PRs that touch
registry.tsMeasured at 2026-11-16T05:51Z over all 62 open PRs, through the paginated REST files list: no open PR other than this one touches
registry.ts.Earlier overlaps are all already inside the split. #34036 (+45 / −1) merged at 19:50Z, #34156 (+73 / −7) at 01:46Z, and #34224 (+31 / −2) after that. The split is regenerated on origin/main
f9120b8692, which contains all three.Tests
The split's proofs (the script from branch history)
Last run with the script in the tree, on
b89e3e42b8, from the repo root:Re-run on this head (
e06e1a9d53, after the deletion and the rewording), with the history copy put back atscripts/codemod-split-registry.mjsfor the run and removed afterwards. Its blob iseb7cc556a0, the same bytes as above.What the proof compares and what it ignores, plainly:
registry.tsis checked whole: undoing the split must rebuild the base byte for byte. The rewording changed no line of it.registry-top-level.tsis checked statement by statement: each moved declaration, with its leading comments, must be byte-identical. The header comment before the first statement is not compared.registry-facet-hosts.tsis compared whole against what the script generates. So the reworded header comment of that file is the one ✗ above.Control leg. On the same head, with only
registry-facet-hosts.tsput back to itsb89e3e42b8bytes (blob9b780d1060; its diff to this head is the 3-line header comment and nothing else), the same command givesexit 0. The file was then restored toHEAD(blob8cca5ac880), andgit diff HEADwas empty. So the twelve other reworded headers are outside what the proof compares, and the one ✗ is that header and nothing else.Ablation of the exports-equality proof (a reading against the history sha)
The ablation was run while the script was in the tree, on the same blob
eb7cc556a0thatgit show b89e3e42b8:scripts/codemod-split-registry.mjsreturns today. Each leg went throughscripts/ablation-replace.mjs; each restore was proven blob == HEAD withgit diff HEADempty.Readings
Package tests
pnpm --filter @objectstack/objectql test: 599/599 test files and 13,366/13,366 tests pass onb89e3e42b8(lock VERDICT command-exit 0). The commits after it change comments, text and the deleted script only.b89e3e42b8for objectql and all 11 (75/75 tasks). Their tests ran on the earlier split heads3683e1eb53and537121403d: the runtime suite, and the cli unit tier (--project unit) at 423/423 files and 6,010/6,010 tests. This is a declared narrowing; CI runs them in full.federated-injected-column-readers.test.tskeys each reader asFILE#FUNCTION :: column. Five keys follow their function to its new file: three toregistry-top-level.tsand two toregistry-platform-global.ts. Theorganization_idrow stays atregistry.ts, whereTENANT_SCOPE_INDEXis pinned. No assertion changed.Acceptance notes
exceptionsrows are first-pass stays, as onengine.ts. A members pass that moves them is a separate card, not this PR.codemod-split-*.mjsscripts already on main are removed by scripts: delete the committed one-off codemod-split-*.mjs scripts and the comments that point at them #34345, not here.Verification
Head
e06e1a9d53. It is the regeneration mergec27f4ab0d6(origin/mainf9120b8692) plus three commits: the ceiling row (b89e3e42b8), the script's deletion (08a3d7ae79) and the comment-only rewording (e06e1a9d53).On
b89e3e42b8(the last code change; the two later commits change comments, text and the deleted script only), all under os-verify-lock with VERDICT command-exit 0:pnpm check:facade-delegation-only: self-test 44 cases, then the gate. It readsregistry.ts: 6326 lines, ceiling 6426 (100 left).93 run, 0 NOT-MEASURED.b89e3e42b8: 51 check-runs, 35 success, 16 skipped, 0 failure.On
e06e1a9d53: NOT MEASURED. A maintainer order (09:01Z) stopped the run before it got the verify lock. These gates were not run on this head: objectql typecheck,federated-injected-column-readers.test.ts,check:facade-delegation-only,check:adr-symbol-anchors, eslint on the touched files, and the dispatch-gates union. Derived for this head, the union is the same 93 families as onb89e3e42b8. What was run on this head is the split proof in Tests: byte-identity 200/200 and 127/127, exports-equality equal over 68 names. Also a check that every changed line inpackages/objectql/srcsinceb89e3e42b8is a comment line (36 lines, 0 non-comment). CI on this head is the reading to take.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ