Repository navigation
refactor(metadata-protocol): move the commit plan items parse out of protocol.ts into protocol-commit-items.ts (#25467 cut 32) - #27406
Conversation
… into protocol-commit-items.ts Move-only cut 32 of the protocol.ts split. The body of the private parseCommitItems member moves unedited into a new module as a plain function; it reads no class member, so the class method's body calls it directly. CommitPlanItem gains `export` in place so the new module can import it as a type; index.ts does not re-export it. Claude-Session: https://claude.ai/code/session_01L6bhgVaAsaDVwT6XfwB5yk Co-authored-by: Claude <noreply@anthropic.com>
… in the moved module's header Claude-Session: https://claude.ai/code/session_01L6bhgVaAsaDVwT6XfwB5yk Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. 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 8dd5fe91f4ae4460cf6643225a45c1c3d09868eb && git checkout 8dd5fe91f4ae4460cf6643225a45c1c3d09868eb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ad2c2869bb67fe24750021aa5b94c99c1ac7c957 a09398108fec88c52087aad000b5158de8109539 && git checkout -B drift-repro ad2c2869bb67fe24750021aa5b94c99c1ac7c957 && git merge --no-ff a09398108fec88c52087aad000b5158de8109539
node scripts/docs-audit/affected-docs.mjs --json ad2c2869bb67fe24750021aa5b94c99c1ac7c957 |
|
domain:server#1 · os-sales · session_01L6bhgXcN9HaZYSEUdJWEjw 维护者速读(席位终稿)
席位核对 — ACCEPT ·
|
|
domain:server#1 · os-sales · session_01L6bhgXcN9HaZYSEUdJWEjw Landed ·
|
| Reading | Value |
|---|---|
| PR #27406 | merged at 2026-10-29T06:02Z, merge commit 9f57dcc6d8, head a0939810 (the ACCEPTed head) |
| Card #25467 | open (Part of), released to pm:queue with a delivered/remaining note |
State change: #25467 pm:dispatched → pm:queue, assignee cleared. No card was closed by this PR's body.
Generated by Claude Code
Requested by Sales · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
维护者速读
protocol.ts里一个只有 10 行的私有方法parseCommitItems(把提交记录的items列读回成回滚计划)原样搬进新文件protocol-commit-items.ts,类上的方法保留并直接调用它。src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 拆分超大文件protocol.ts的第 32 刀,按裁决只搬不改,让这个文件继续变小、好读。.d.ts原始字节两端完全相同,包测试 21,800 条逐条一致;回滚就是还原这一个 PR。packages/metadata-protocol/src/protocol.ts的parseCommitItems方法体(现在只剩一行调用)与CommitPlanItem前新增的export;再看新文件protocol-commit-items.ts。pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol.recovery-doors-emit-mutation.test.ts,预期全部通过(它经revertCommit读回提交计划)。What changes
Cut 32 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–31 landed; cut 31 is #27181. The claim is6487683544. It takes the cut 32 proposal of the cut 31 report (6465513012): one member on its own. It passed the AST screen and the read-seam census and moved unedited.One
ObjectStackProtocolImplementationmember moves unedited into a new module,packages/metadata-protocol/src/protocol-commit-items.ts(#23050 shape B):parseCommitItems, which reads a storedsys_metadata_commitrow'sitemscolumn back as its revert plan. An array is the plan as stored; a string is parsed as JSON; anything else, or a string that is not a JSON array, reads as no items.parseCommitItems:26479CommitPlanItem[])CommitPlanItemreturn parseCommitItems(raw);, marked[#25467 cut 32].this), so the stub calls the plain function directly, as cut 26 did fororgWallEnforced.listCommits(this.parseCommitItems(r.items), base:26577) andrevertCommit(this.parseCommitItems(row.items), base:26693). Neither changes.protocol.tsgoes from 29,514 to 29,508 lines.protocol-commit-items.tshas 44 lines. The cut is move-only, and the card stays open for later cuts.Branch
claude/project-thread-xbievtis the harness-pinned branch for this thread; it names no issue, so the claim comment is the identity record. It holds the move commitdda5102340onmainc4c515ad3c, one merge ofmain9b33088b78(4 commits up to7e200b4a68, none inpackages/metadata-protocol/), anda09398108f, a comment-only fix to the new module's header (it named the callerlistPackageCommits; the method islistCommits).One top-level edit beyond the move:
CommitPlanItemgainsexportThe dispatch's correction holds:
CommitPlanItemis not an import. It isprotocol.ts's own non-exported module-level type alias (base:2751). The moved function's signature and body name it, so it gains theexportkeyword in place, with nothing else in its statement changed, and the new module imports it withimport type. This followsaddressPackages(cut 16),withDeclaredPageTypeDefault(cut 23) andnoPendingDraftError(cut 31).packages/metadata-protocol/src/index.tsnames its re-exports from./protocol.jsone by one and does not name it, so the published surface does not move: the.d.tsand export-table readings below are identical at both ends.protocol.ts(thecommitItemsplan built at publish, the commit-write argument type, both callers' results) and stays there.Tests
Nothing is added or changed under test; the cut is move-only. The package suite is compared per test at both ends (see Verification). The member is driven end to end through
revertCommitby the recovery-door suites (protocol.recovery-doors-*.test.ts,protocol.object-registry-write-through-spelling.test.ts), which servesys_metadata_commitrows from a fake driver, and throughlistCommitsby the commit-timeline suites (protocol-14038-list-commits-created-at-iso.test.ts,protocol.commit-timeline-instant-order.test.ts); all pass at both ends.Acceptance notes
this.constructorread (the body has nothisat all). Nonew Error(, so noPRODUCERSrow is owed. The body'stry/catchguardsJSON.parse, not a storage read, so it is outside the read-seam rule's vocabulary; the census does not move (below)..d.tsis byte-identical at both ends after the final byte layout, measured again after the comment-only commit.parseCommitItemsandCommitPlanItemacross the repository atHEAD(outside the two touched files): 0 hits. Of the 32 files that nameprotocol.tsand callreadFileSync, none names the member or its body text; three namesys_metadata_commitonly as behavioural fixtures run through the protocol. No@objectstack/specliveness row and nodocs/qa/platform-checklistanchor names the member.packages/spec/**, outside this card):manifest.json'sdependenciesrow →protocol.ts#resolveWritePackageScope(cut 19) andseed.json→protocol.ts#applySeedBodies(cut 14). No row points at this cut's member.pr_create, of the 23 open PRs none editsprotocol.tsor names the member. The only one touchingpackages/metadata-protocol/is chore: version packages #26517 (Version Packages:CHANGELOG.md,package.json). Probed in a throwaway bare clone with no merge driver, it conflicts with this head in exactly the 4ui/packages/*/package.jsonfiles it already conflicts with onmainad2c2869bb; none is in this package.mainmoved one commit after the merge (ad2c2869bb,plugin-grid);git merge-treeof this head with it is clean, somainwas not merged again.skip-changeset, per ruling6348891160.Verification
Proof of move-only
The compare reads the TypeScript compiler's AST leaf tokens, with JSDoc skipped, over the parameters, the return type and the body, base
protocol.tsatc4c515ad3cagainst the head module:Negative controls, one token changed in an in-memory copy of the head module:
CommitPlanItem, whose only change is the addedexport. Head adds the module import (with its one-line[#25467 cut 32]comment).The published
.d.ts(ruling6348891160)Base
c4c515ad3cand head were built withpnpm --filter @objectstack/metadata-protocol buildagainst one dependency tree (the closure built by a fullturbo run build, 115/115). For the base build the packagesrc/was swapped tree-only to base (the new module removed) and restored fromHEADunder a trap; afterwardsgit status --porcelainwas empty and both touched blobs hashed equal toHEAD's.c4c515ad3ca09398108fdist/index.d.ts=dist/index.d.cts4cb92b2e20135dd78d07fd2800b1d2a050a432b923cd511d5b50f3ed6de29a58(784,960 bytes)a4dcc2306638c29983bceaf7258df71a29a3020a3ec26904c9830a0cecd0c70eindex.js/index.cjssha256 (16)20239680cb0cf515/f3ac1e9bdd5b9e96e5abe0490663649f/1c36338d33aa16a5function parseCommitItems(in each bundlee47ac7c753bcb8beparseCommitItemsnorCommitPlanItemBoth identities hold: raw and sorted-union. The head reading was taken on the move commit, on the merged tree and again on
a09398108f; all give the same hashes.Normaliser, verbatim:
Positive control on the head tree:
privatedropped fromparseCommitItemson disk (restored fromHEADunder a trap) and the package rebuilt. Both.d.tsfiles move to rawca90763579860f2c…(785,652 bytes), normalisedb7639852d59f8343…(differs from the bar'sa4dcc230…), printingparseCommitItems(raw: unknown): CommitPlanItem[];. So the bar can see a change on this member.Gates and suites
Package suite, tsc, eslint
packages/metadata-protocolsuite, vitest--maxWorkers=2, JSON reporter, under the shared verify lock. Basec4c515ad3c(src swapped tree-only, restored fromHEADunder a trap), the move commitdda5102340and the final heada09398108f: all three 21,800 tests (21,774 passed, 0 failed, 26 skipped), 283 files. Per test name and status over 21,787 distinct names: 0 lost, 0 added, 0 changed.tsc --noEmitinpackages/metadata-protocol: exit 0.pnpm exec eslint --no-inline-config packages/metadata-protocol: exit 0, no output.Hand gates, base and head
Base readings in a clean detached worktree at
c4c515ad3c; head in the branch checkout.check-durability-degradation-log-level: exit 0 at both ends, output identical,89 read seam(s).--listidentical once[@:][0-9]+is stripped (165 lines); no entry changes file. 89 is the claim's base.check-adr-anchors,check-adr-symbol-anchors,check-system-context-census,check-tenant-audit-census,check-query-options-erasure-ratchet(50 unswept non-test sites in 15 files),check-filter-alias-parity.check-nul-bytes: exit 0 at both ends; scanned files +1 (the new module).check-engine-double-contract: exit 0 at both ends; theupdateData/deleteDataseams keep their entries at new line numbers (13997 → 13999 and 14022 → 14024: the import's two lines sit above them, and the move's eight removed lines below);productionFiles3,876 → 3,878 (the new file and the gitignored specregistry.tsthe build writes in the head tree, as in cuts 20–31).check-platform-checklist --changed-from origin/main: OK, 32 anchors judged, 0 lost.check-governed-merges --branch claude/project-thread-xbievt: 0 of 2 paths in the register (13 surfaces), NOT governed; 60 changed lines, under the 3,000-line bar.Derived gates
dispatch-gates --commands --repo objectstack-ai/objectstackona09398108fderives 46 gates on 2 changed paths (merge base7e200b4a6). All 46 exit 0 after a fullturbo run build(115/115).dispatch-gates --ranreports 46 derived, 46 run, 0 NOT-MEASURED, 0 UNRUN, and exits 0.On the final head the hand gates were re-read:
check-adr-anchorsoutput is identical tomain7e200b4a68's (60,467 citations, 1,900 decision letters; the +1 citation and file againstc4c515ad3ccome from the mergedmaincommits), andcheck-durability-degradation-log-levelis identical to base,--listincluded.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgVaAsaDVwT6XfwB5yk
Generated by Claude Code