Repository navigation
refactor(objectql): spell the eight ObjectQL facade methods' inferred return types and move five bodies into their facets (.d.ts byte-equal) - #30571
Conversation
…ight protocol.ts doors kept on the facade Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
…ypes Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
… is spelled and why the body stays Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
… types Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
…he seed receipt's landed rows from main Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
…ctQL methods kept on the facade Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
…g, init and destroy into their facets with the codemod's fourth pass Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
… five moves Claude-Session: https://claude.ai/code/session_01Utp6CXZTh9qvT24wTN6dd6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 3 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 c092574efa4571caf807f6c774d941358b1d140d && git checkout c092574efa4571caf807f6c774d941358b1d140d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin db04e5ce581a92f349a532f52786c95acd7ec4ac 2ea0deb9d1f7dcf0aca872e2b5543e96e372fb9a && git checkout -B drift-repro db04e5ce581a92f349a532f52786c95acd7ec4ac && git merge --no-ff 2ea0deb9d1f7dcf0aca872e2b5543e96e372fb9a
node scripts/docs-audit/affected-docs.mjs --json db04e5ce581a92f349a532f52786c95acd7ec4ac
|
|
domain:server#5 · os-bill · session_01Utp6CYVV6fcAQrNTDQRvPb 维护者速读
席位意见:同意落地,作为 #30054 的 engine.ts 半边。 席位核对Head
|
Requested by Bill · project thread
domain:server#5 · os-bill · session_01Utp6CYVV6fcAQrNTDQRvPb
维护者速读
engine.ts门面上 8 个因返回类型靠推断而留在类上的ObjectQL方法把返回类型写明在签名上(逐字取自今天的.d.ts);其中getStatus、triggerHooks、setDatasourceMapping、init、destroy五个再用 codemod 第四遍(refactor: sweep the #4918as anysites in engine.ts's six erasure-pinned methods so the codemod can move them (about 550 lines) #30055 的--members)把方法体搬进各自的 facet 模块,类上只留一行转调;allow-list 删掉这 5 行。@objectstack/objectql的三个公开.d.ts改前改后逐字节相同,codemod 的撤销证明逐字节通过。回滚即撤本 PR。packages/objectql/src/engine.ts里init/destroy的新 stub,再看engine-secrets-and-routing.ts里搬进来的init方法体。node scripts/codemod-split-engine.mjs --members --verify --base 405373c08预期 exit 0、“5 moved method(s) … does rebuild the base … byte-for-byte”;node scripts/check-facade-delegation-only.mjs预期 exit 0、56 条具名例外。registerApp、registerDriver、registerHook三个 codemod 拒绝搬,留在类上(见 Acceptance notes)。Part of #30054 (the
engine.tshalf: all eight return types spelled, five bodies moved; three engine.ts bodies and the eight protocol.ts bodies stay, see Acceptance notes)Clause-②: no — the published
index.d.ts,core.d.tsand the shared declaration chunk of@objectstack/objectqlare byte-equal before and after, so no exported member changes.Metadata-protocol: none
Skills-docs: none — an internal refactor of eight method signatures and five method bodies' location; no published type or behaviour changes, and no skill text names them.
What changes
engine.ts).registerApp,registerHook,registerDriver,init,triggerHooks,destroy,setDatasourceMappingandgetStatusdeclare their return type, copied from the line the base build printed for each indist/util-*.d.ts(theObjectQLclass), re-indented to the file's two spaces.getStatusspellsname: "data"with the printer's double quotes, which the declaration emit keeps.--members).node scripts/codemod-split-engine.mjs --members getStatus,triggerHooks,setDatasourceMapping,init,destroy --write:getStatusandtriggerHooksgo toengine-hooks-and-functions.ts,setDatasourceMappingandinittoengine-secrets-and-routing.ts,destroytoengine-migration-state.ts. Each method stays on the class with its docblock and signature as a one-call stub. Nothing generated is edited by hand.engine.facade-return-types.pin.test.tsparsesengine.tsand requires each of the eight methods to carry its exact return type text.@objectstack/objectqlpatch: the declarations are byte-equal, but the shipped source maps move.Tests
origin/main'sengine.ts(restored unstaged, then put back fromHEAD,git diff HEADempty) 8 of 9 fail, one per method.scripts/ablation-replace.mjs):init's stub annotation removed, anchor 1 → 0, blob2fa8f560→20c28b40; the pin goes 1 failed / 8 passed, naminginit; restored to theHEADblob withgit diff HEADempty.origin/main(five members with a body and no row) and green at head.@objectstack/objectqlfull suite: 554 files passed, 11,019 tests passed at head2ea0deb9d(and the same counts before the branch moved ontoc23eafa88).pnpm --filter @objectstack/objectql typecheckexit 0 at head.Acceptance notes
--memberspass will not move.registerAppandregisterDriver: the pass refuses with "engine-registration.ts: its header is not as the first pass wrote it" (that module's header was edited by hand whenisExternalWriteForbiddenwas written there, Effective object permissions ignore the external write gate, so the console offers New, Import, Edit and Delete on a read-only external object #30370).registerHook: the pass writes the move but its undo proof fails ("undoing the moves out of engine-hooks-and-functions.ts does not rebuild its base (first difference at line 44)", in that module's import block). Each is measured alone and together; the order lands only what is mechanical, so their rows stay with the reason.engine.ts:registerApp,registerDriver,registerHook(types spelled, bodies stay).protocol.ts: the eight doors typed by refactor(metadata-protocol): spell the inferred return types of the eight protocol.ts doors the facade keeps (.d.ts byte-equal) #30516, whose move waits on the protocol codemod's missing facade pass (codemod-split-protocol: add a pass that moves a member of the landed protocol.ts facade into its facet (it refuses its own output, and the split no longer re-proves from its #29985 base) #30518). The seat decides whether those eleven rows move to codemod-split-protocol: add a pass that moves a member of the landed protocol.ts facade into its facet (it refuses its own output, and the split no longer re-proves from its #29985 base) #30518 or a sibling card and the card closes, or the card stays open..d.tsprints the signature.mainwas refused in this session, so the branch mergesorigin/mainover refactor(metadata-protocol): spell the inferred return types of the eight protocol.ts doors the facade keeps (.d.ts byte-equal) #30516's old commits (the merged tree equalsmainexactly:git diff origin/mainwas empty before this PR's commits), and the PR's commit list shows those old commits. The diff is this PR's seven files only.Verification
Head
2ea0deb9d, baseorigin/mainc23eafa88.Declaration-file proof
origin/mainc23eafa88'sengine.tsand its three facet modules restored into the head tree,turbo run build --filter=@objectstack/objectql...,core.d.ts,index.d.tsandutil-DJB5AN6K.d.tscopied aside (byte-equal to the first base build at8e5fabe58, from which the types were copied).pnpm buildinpackages/objectql(tsup with DTS, thencheck-dts-emitted);cmpagainst the base copies: all three byte-equal (util-DJB5AN6K.d.tssha2567f1e928b2f3aceac…). The same held after the annotation commit alone, before the move.Codemod proof
--members getStatus,triggerHooks,setDatasourceMapping,init,destroyplan, then--write: output tree sha256ebff07ef5c50e416…both times; "5 moved method(s) … engine.ts 11321 -> 11223 lines; undoing the moves does rebuild the base engine.ts and its modules byte-for-byte once the 7 import binding(s) only moved bodies read are pruned from the base".--members --verify --base 405373c08(the annotation commit, on this base) exit 0 with the same reading.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat head2ea0deb9d: 70 derived commands (change set: 7 paths, +262 / -168, under the 3,000 threshold). Each ran with its exit code recorded before any pipe; all 70 exit 0.--ranreconciles 70 derived, 70 run, 0 NOT-MEASURED, 0 UNRUN.node scripts/check-facade-delegation-only.mjs: "5 facade class(es) in 3 file(s) hold delegations only, 56 named exception(s)", exit 0. Againstorigin/main's tree (--roota detachedc23eafa88worktree,--registrythis head's): exit 1, five problems, one per moved member.--no-inline-configover the five changed source files exit 0 at head.Generated by Claude Code