Repository navigation
refactor(metadata-protocol): move the single-record data writes through the protocol host (#25467 E2 section 3) - #29788
Conversation
…gh the protocol host (#25467 E2 section 3) validateData, createData, updateData and deleteData keep their docblocks and signatures on ObjectStackProtocolImplementation; their bodies move to protocol-data-writes.ts, changed only by this. reading host. (host-split check). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbY46nuWPvjhNvMiZqA
…and move the two seam ledger rows with the data writes (#25467 E2 section 3) The protocol-data-writes import stands after the class: tsc's declaration emit of getMetaTypes() prints a docblock of protocol.ts picked by character offset, so only a net-zero shift above the class keeps index.d.ts identical. The engine-double-contract seams ledger and its self-test read updateData and deleteData where their bodies now stand. Same rule, nothing loosened. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbY46nuWPvjhNvMiZqA
…block (#25467 E2 section 3) With getMetaTypes() declaring its return type (#29730), the declaration emit no longer prints a docblock of protocol.ts by offset; index.d.ts stays byte-identical to main with the import where the others stand. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbY46nuWPvjhNvMiZqA
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbY46nuWPvjhNvMiZqA
📓 Docs Drift CheckThis PR changes 1 package(s): 12 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 10 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 f586fdcb8beabe92b6b6c8cab1090af34df9984d && git checkout f586fdcb8beabe92b6b6c8cab1090af34df9984d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 601832b1a667992e73d54bf11643849836a6f778 ae528b82771c30d29c90b7370417750de2a48d61 && git checkout -B drift-repro 601832b1a667992e73d54bf11643849836a6f778 && git merge --no-ff ae528b82771c30d29c90b7370417750de2a48d61
node scripts/docs-audit/affected-docs.mjs --json 601832b1a667992e73d54bf11643849836a6f778
|
|
domain:server#4 · os-warren · session_01JQwxbacSXJQqAztgt4UMrS 席位核对ACCEPT ·
|
Requested by Warren · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
维护者速读
protocol.ts里“数据 CRUD”一节中四个单条写入方法(validateData、createData、updateData、deleteData)的方法体,经 E1 宿主机制原样搬进新模块protocol-data-writes.ts;四个方法仍留在类上(签名与文档不变),方法体变成一行转发。src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 裁决 E 的 E2 第 3 节,在席位声明的protocol.ts冻结日内。第 2 节(查询校验)已由 refactor(metadata-protocol): move the query validation out of protocol.ts into protocol-query-validation.ts (#25467 cut 3) #25538 搬完,无可切;第 3 节其余四个方法体按席位裁决 A(6594932448)暂留类中,原因见下文。this.读作host.”之外 AST 与文本全同;对外index.d.ts(ESM 与 CJS)与 main 构建出的逐字节相同。回滚即整体 revert。packages/metadata-protocol/src/protocol-data-writes.ts文件头;protocol.ts里 4 个方法的转发体;scripts/engine-double-contract.seams.json两行路径。cd packages/metadata-protocol && node scripts/host-split.mjs check origin/main updateData protocol-data-writes.ts,预期"ok":true,"textIdentical":true。What changes
Step E2, section 3 "data CRUD" of ruling E (6537939895), on the
protocol.tsfreeze day seat 4 declared (6594835694 on #27737). It is a pure application of the E1 host pattern: no logic changes, and no new rewrite kind.this.xtohost.x)validateDataprotocol-data-writes.tscreateDataprotocol-data-writes.tsupdateDataprotocol-data-writes.tsdeleteDataprotocol-data-writes.tsEach method keeps its docblock, modifiers and signature on the class; its body becomes
return fn(protocolHost(this), …).ProtocolHostand the class's static block gain 3 entries, all call-time closures:assertObjectRegistered,assertVersionMatchandprobeRecord(enginewas already on the host).node scripts/host-split.mjs check origin/main MEMBER protocol-data-writes.tsreadsok: true, textIdentical: truefor all four, and the tool refused none. Negative control, withdeleted === falsechanged to!==indeleteData's moved body, then restored fromHEAD(blob hash equal to the disk hash afterwards):protocol.tsdrops one import name onlyupdateData's body read (byIdUpdateRecord; its re-export stays) and gains the import of the four functions beside the 1b imports.Section 2 has nothing to cut
The order named section 2 (query validation) first. On main
c9c68288its 15 members (assertObjectRegisteredthroughservesExpansionTarget, lines 4881 to 5613) are all stubs of the per-member series'fn.call(host, …)shape, with their bodies inprotocol-query-validation.tssince #25538 (cut 3, merged 2026-10-23). No member in that range still carries a body. The seat re-ordered this thread to section 3.Four bodies of section 3 stay in the class (seat ruling A, 6594932448)
This cut is under ruling E's 1,000-line guide on the seat's ruling. A trial move of all eight bodies measured two gates that read the section by path:
findData,getData,cloneData,probeRecordstay. They hold all 6 of the query-options erasure sitesscripts/query-options-erasure-baseline.jsongrandfathers forprotocol.ts(findData3,getData,cloneData,probeRecord1 each). In a new module they failpnpm lintand the ratchet, and listing the module is the move that baseline forbids (its key set only shrinks against the merge base). Cut 4 keptprobeRecordin the class for the same reason. The seat is filing the card that types those erasures; these four move after it.updateDataanddeleteDatamove, and the engine-double-contract ledger follows them. Both are consumer seams the ledger keys by file.scripts/engine-double-contract.seams.jsonis rewritten by--write(twofilevalues, nothing else), and the self-test's one wiring assertion names the module instead ofprotocol.ts. The rule judged is unchanged: before the ledger move the run readSEAMS_RETAINEDfour times and the self-test failed on the old path (exit 1); after it both exit 0, and the moved bodies still passREFUSES(they throwrecordNotFoundError).Tests
No pin needed an edit. The read-verb pin, the lookup-artifact and hydrate caller-set pins and the system-context census read nothing in the four moved bodies. The query-transport-dialect pin and core's second-object-read-exposure pin read
findDataandgetData, which stay.The published
.d.tsBuilt from main
7ba8b11f5and from this head with the same dependency build.index.d.tsis byte-identical: raw sha2563a15d153…f48075on both sides, ESM equal to CJS, so no normaliser is needed.A measurement worth keeping: on the first base (
c9c68288, before #29730),getMetaTypes()'s inferred return type made tsc's declaration emit print a docblock ofprotocol.tschosen by character offset (the comment leak 1a met). Any net shift of the text above the class changedindex.d.ts, and only a net-zero shift kept it identical (probed at 12 to 28 added characters; only 18, the exact compensation, matched). #29730 gavegetMetaTypes()a named return type, and on the merged base the import stands in the import block withindex.d.tsbyte-identical. The leak no longer constrains later E2 cuts.Serial
Merged
origin/maintwice: over #29730 (thegetMetaTypes()return type) and over #29753 (seat 4's flow-read docblock lines), both landed during the freeze as the seat's post allowed.git mergewas clean both times, andhost-split checkwas re-run against the merged main for all four members. Seat 2's #29673 edits members outside this section and this diff does not touch them.Verification
On
ae528b8277:VERDICT command-exit 0; Test Files 310 passed, 4 skipped (314); Tests 22301 passed, 26 skipped (22327).eslint packages/metadata-protocol scripts/check-engine-double-contract.mjs --no-inline-configexits 0;pnpm check:query-options-erasureholds (44 sites in 15 files, none new).node scripts/pm/dispatch-gates.mjs --commandsderived 74 commands;--ranreports 74 derived, 73 run, 1 NOT-MEASURED, 0 UNRUN. Each run family exits 0 (check:pm-dispatch-gates1945 fast-tier cases). The NOT-MEASURED one ischeck:dual-build-cjs-loads, which needs every package built (exit 3, PREREQUISITE NOT MET), so its reading is CI's.Human Minimum
packages/specholds no runtime logic. (untouched)pnpm lintpasses (package and changed script locally; CI runs the whole).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code