Repository navigation
refactor(objectql): move the find and findOne bodies into the find facet through the facade port (E2) - #31116
Conversation
codemod-split-engine --members find,findOne on main 5f00374, proved by its byte-exact undo; the two facade-delegation exception rows go with them. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2fL8RrJDkowuFhXUPG
📓 Docs Drift CheckThis PR changes 2 package(s): 46 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 14 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 173 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 dab766829fc07bdcc6030a4ceef68cf178a2e630 && git checkout dab766829fc07bdcc6030a4ceef68cf178a2e630
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5f0037449256ccb0855e258ffc4fd4bff84d1a67 8c46a17a83effd0a1c24f7f3e7c9cf5d5515d75e && git checkout -B drift-repro 5f0037449256ccb0855e258ffc4fd4bff84d1a67 && git merge --no-ff 8c46a17a83effd0a1c24f7f3e7c9cf5d5515d75e
node scripts/docs-audit/affected-docs.mjs --json 5f0037449256ccb0855e258ffc4fd4bff84d1a67
|
|
domain:server#2 · marchtian · session_017ihL2fBJ6xsLWJsnNJGMMx 席位核对 — ACCEPT · domain:server#2 · Head-sha:
|
…move engine.ts no longer imports planFormulaProjection, ENGINE_QUERY_SLOTS or applyFormulaPlan, so the query.fields and query.top liveness rows and the api-backend checklist item cite their declarations in engine-top-level.ts, and the alias fold its new call site in engine-find.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2fL8RrJDkowuFhXUPG
|
domain:server#2 · marchtian · session_017ihL2fBJ6xsLWJsnNJGMMx 席位核对 — ACCEPT · domain:server#2 · Head-sha:
|
Requested by 田騏 · project thread
domain:server#2 · marchtian · session_017ihL2fL8RrJDkowuFhXUPG
Refs #30020
Clause-②: no
Metadata-protocol: none
Skills-docs: none — an internal move inside
@objectstack/objectql; nothing a metadata author writes changes维护者速读
scripts/codemod-split-engine.mjs --members find,findOne把ObjectQL的find和findOne两个方法体搬进已有的engine-find.tsfacet,类上只留一行委托桩(签名和 docblock 原样保留);同时删掉登记表里这两行例外(19 → 17)。这是 refactor: move shared state out of the protocol.ts and engine.ts facades into state-owning facets, so the hot bodies left on the class can become delegations (ruling 6624345766) #30020 §5 系列的 E2,codemod 本身一行没改。engine.ts继续变小(11,111 → 10,739 行)。这两个方法体把引擎本身交给钩子(ql: this),按规则 A 改读宿主的facade端口。@objectstack/objectql的三个公开.d.ts与 main 构建结果逐字节相同。回滚即 revert 本 PR。packages/objectql/src/engine-find.ts的FindHost接口与ql: this.facade两处;packages/objectql/src/engine.ts的find/findOne桩和findHost安装行;scripts/facade-delegation-registry.json。node scripts/codemod-split-engine.mjs --members --verify --base origin/main预期 exit 0,输出 “2 moved method(s) (find, findOne); engine.ts 11111 -> 10739 lines; undoing the moves does rebuild the base … byte-for-byte”。What changes
node scripts/codemod-split-engine.mjs --members find,findOne --writeonmain5f0037449. Both bodies move intopackages/objectql/src/engine-find.ts, the facet that already holds their read helpers (requireFindOnePredicate,reportFindFailure); no new module. The stubs, theFindHostmembers, the host factory entries and the imports are the codemod's own output; nothing was hand-edited.findandfindOnestay on the class with their docblocks and signatures byte for byte; onlyasyncis dropped from the stub, as every stub of the series does. Each isreturn FindFacet.X.call(findHost.of(this), …).ql: this). Under rule R1 that readsql: this.facade, andFindHostgains thereadonly facade: ObjectQLport with its docblock, plus afacade: engineinstall entry.engine.ts(the prune the proof recomputes).scripts/facade-delegation-registry.json: thefindandfindOnerows (#30020,bare-this) are removed; nothing added. Exceptions 19 → 17;engine.ts's#30020rows left:update,insert,delete,constructor,[SEED_USER_GRANTS],transaction..changeset/30020-objectql-find-findone-facet.md:@objectstack/objectqlpatch (source maps ship), the two declaration lines in its body.8c46a17a83): the move pruned three import bindings fromengine.tsthat evidence anchors named.packages/spec/liveness/query.json(query.fields→engine-top-level.ts#planFormulaProjection;query.top→engine-top-level.ts#ENGINE_QUERY_SLOTSandengine-find.ts#foldEngineOptionAliases, each row's note dated) anddocs/qa/platform-checklist/areas/api-backend.json(engine-top-level.ts#applyFormulaPlan). Anchor text only, same precedent as refactor(objectql): move the last 28 hand-series private docblocks out of engine.ts with the codemod's third pass (slice 2 of 2) #30415 and fix(metadata-protocol): move findData into its facet; host-split refuses a method read as a value, so getDiscovery stays #30838; the changeset adds'@objectstack/spec': patchbecauseliveness/ships in itsfiles[]. These two files are outside the original claim surface; the seat amended the claim (6707298150). The red this fixed: Test Core (2/8),packages/spec/scripts/liveness/evidence.test.ts"every local path#symbol anchor names a symbol its file contains".scripts/codemod-split-engine.mjs. E2 needs no capability E1 did not ship.Rules applied (reconstructed)
The previous seat's
design.md(R1–R7, H2) is not reachable from this seat. The rules below are rebuilt from the card's design comment 6677924765, ruling 6687865760 and PR #30987's body.facadehost port, and computing hand-stub slots; move eight #30020 bodies #30987): a barethisa moved body hands on becomesthis.facade. Two sites here,ql: this.facadeinfind's andfindOne's hook contexts. This is the only rule E2 exercises.engine.tsexports) and H2 (--hand-slots): not reached. The plan asked for none of them and wrote nothis[k]host access, no./engine.jsvalue import and no hand-slot move.facadehost port, and computing hand-stub slots; move eight #30020 bodies #30987, its only caller; not reached..d.tsstays byte-equal. (refactor(scripts,objectql): codemod-split-engine moves bodies that hand the engine on through afacadehost port, and computing hand-stub slots; move eight #30020 bodies #30987's.d.tsdelta came from private docblocks; there are none here.)this→this.facade.Tests
No test file changes: a byte-proven move with no behaviour change. The suites run unchanged against the moved bodies.
Acceptance notes
.d.ts: byte-equal at base and head. This is stronger than refactor(scripts,objectql): codemod-split-engine moves bodies that hand the engine on through afacadehost port, and computing hand-stub slots; move eight #30020 bodies #30987, which lost 83 lines of private docblocks from the shared chunk.Verification
All readings are at head
df1ae02829, whose base isorigin/main5f0037449(mainhad not moved when the PR opened).Undo proof (byte-exact) and determinism
node scripts/codemod-split-engine.mjs --members find,findOne --write: exit 0. Output tree sha2565e6887d1e3d389d599d28d3ac70e4a8db35f0bd36232cf254bd24f9266220020, input sha2564e979556f4ab17da5c087a435bb5bf56928d025ea3eaabe191ed99542c4f43a1(=git show 5f0037449:packages/objectql/src/engine.ts | sha256sum). The plan-only run before it printed the same output sha256.node scripts/codemod-split-engine.mjs --members --verify --base origin/mainon the committed head: exit 0. "undo proof: 2 moved method(s) (find, findOne); engine.ts 11111 -> 10739 lines; undoing the moves does rebuild the base engine.ts and its modules byte-for-byte once the 19 import binding(s) only moved bodies read are pruned from the base (ENGINE_FIND_OPTION_KEYS, ENGINE_QUERY_SLOTS, ENGINE_WIRE_ONLY_SLOTS, FindHookResultNotArrayError, FindOneHookResultNotRecordError, PLATFORM_PROVISIONED_COLUMNS, applyFormulaPlan, assertOrderByIsMaterializable, assertProjectionHasNoDottedPaths, assertProjectionNamesAField, isFindOneResultShape, mergeReadContext, planFormulaProjection, refuseProjectionOfUnknownColumns, rejectInternalFieldEvaluation, rowsWithSelectedColumnsAnswered, rowsWithoutFormulaWidening, withFileOwnerKey, withoutFormulaWidening)".engine.tsbase4e979556…→ head9f090702…;engine-find.tsbase76b336ec…(476 lines) → head5bfcb0a4…(910 lines).node scripts/codemod-split-engine.mjs --self-test: exit 0, 169 cases in 11 batteries.Public declaration files
@objectstack/objectqlbuilt withpnpm --filter @objectstack/objectql buildwith the two source files at base5f0037449, then at head.dist/core.d.ts(a8fd9093…),dist/index.d.ts(3a798237…) anddist/util-BK7LVy6k.d.ts(24ed9187…) are byte-equal:diff -ris empty, and the chunk hash itself does not change. Control: the stub's text, matched by the regex\.find\.call\(findHost\.of\(this\), occurs 0 times in the basedist/index.mjsand once in the head's.Package suites and gates
pnpm --filter @objectstack/objectql typecheck(tsc pluscheck:test-typecheck) andpnpm --filter @objectstack/objectql test, underos-verify-lock: VERDICT command-exit 0. Test Files 564 passed (564), Tests 11422 passed (11422).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat8c46a17a83: 76 families (the anchor files addcheck:livenessandcheck:platform-checklistamong others), all 76 exit 0,--ran76/76, 0 NOT-MEASURED;evidence.test.ts48/48. Atdf1ae02829: 66 families, all 66 exit 0. Two first answered exit 3 on prerequisites and were re-run once those were met:node scripts/check-plugin-teardown-shape.mjs --self-testneeded a non-shallow clone (git fetch --unshallow), 48 cases pass;pnpm check:dual-build-cjs-loadsneeded everydist/(pnpm build, 119 tasks, exit 0), 116 entry points across 71 packages load.--ranatdf1ae02829: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN.pnpm check:facade-delegation-onlyexit 0 (17 named exceptions);node scripts/check-facade-delegation-only.mjs --self-testexit 0 (37 cases);pnpm lintexit 0.🤖 Generated with Claude Code
Generated by Claude Code