Repository navigation
refactor(metadata-protocol): move the stored-overlay row reads out of protocol.ts into protocol-stored-overlay-reads.ts (#25467 cut 16) - #26168
Conversation
… protocol.ts (#25467 cut 16) Move-only. The bodies of readActiveOverlayRows, storedOverlayEntries, namesWithOwnStoredRow and readItemActiveRows move into the new protocol-stored-overlay-reads.ts (host shape B: a live engine getter and protocol-bound closures for findEnvironmentRows and convertStoredItem; namesWithOwnStoredRow reads no member, so its method calls it directly, as cut 3's orderByFieldNames does). All four members keep their name, docblock and signature in the class as stubs that delegate. addressPackages and the StoredOverlayEntry interface gain export in place; the overlay-cache reads (metaOverlayCacheTtlMs, readMetaOverlayCache, readOverlayCacheGeneration, writeMetaOverlayCache, MetaOverlayCacheKey) leave protocol.ts' import with their last readers. Nothing re-exports the new module, so the published surface does not move. Claude-Session: https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 11 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 ab665751bbf9ea417fdb0a5429cf2f83047298ed && git checkout ab665751bbf9ea417fdb0a5429cf2f83047298ed
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 365fe5ecc4a1f7157186d8053cd721d2384e3f56 afd0fc7911a00636e8616fd237cb3439e5910df4 && git checkout -B drift-repro 365fe5ecc4a1f7157186d8053cd721d2384e3f56 && git merge --no-ff afd0fc7911a00636e8616fd237cb3439e5910df4
node scripts/docs-audit/affected-docs.mjs --json 365fe5ecc4a1f7157186d8053cd721d2384e3f56
|
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #25467 (cut 16), skip-changeset (no published behaviour moves), mergeable clean. |
| Files | 2 files, +241/−136. readActiveOverlayRows, storedOverlayEntries, namesWithOwnStoredRow and readItemActiveRows move into protocol-stored-overlay-reads.ts. Their class members stay as delegating stubs, so the 20 this. call sites and protocol-save-door-refusals.ts are unchanged. namesWithOwnStoredRow reads no member, so it becomes a plain function, as in cut 3. Not governed. |
| Fix | A pure move. Seat probe: all 136 removed protocol.ts lines reappear verbatim in the seam module except two, and those two are addressPackages and StoredOverlayEntry. Both stay in protocol.ts and only gain export (:2831, :6230). Dev: AST compare 829 tokens, 0 differ (the negative control gives 1). .d.ts is raw-identical at both ends, before and after the merge, and the positive control moves it. Export tables are equal at 78 names. |
| Order questions | The new Error( at base :10741 is in resolveAppPackageIdKey, which stays. No moved body constructs an error, so no PRODUCERS row is owed. The durability --list is identical once line numbers are stripped, because both reads go through findEnvironmentRows, which stays. Two ADR-0131 D6/D7 letter citations leave the anchored file. That is disclosure only, as in cuts 8 and 12–14. |
| Evidence | 36 check runs succeeded and 16 were expected skips on this head, 0 failed. The suite ran 21,558 tests at both ends, with 0 lost, 0 added and 0 changed. Derived gates: 53 of 53 exit 0, and --ran reconciles. |
| Carried | The cut 17 proposal in the report (classifyObjectContribution and releaseAdoptedObjectOwner, about 55 body lines, no pin edit) goes to the same thread once this lands. ensureObjectStorage stays out because of the write-through spelling pin. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, now that every check on this head is green or an expected skip. |
Generated by Claude Code
Requested by Leehom · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 16 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–15 landed as #25494, #25518, #25538, #25589, #25601, #25623, #25642, #25719, #25731, #25740, #25797, #25939, #25972, #26014 and #26104. The claim is6417245092; the scope is the cut 16 proposal of the cut 15 report (6415780867), as the server seat approved it in its dispatch order. All four members moved unedited, so no member was left behind.Four
ObjectStackProtocolImplementationmembers move unedited into a new module,packages/metadata-protocol/src/protocol-stored-overlay-reads.ts(#23050 shape B). They are the stored-overlay row reads:readActiveOverlayRows: a type's activesys_metadatarows, through the cross-request overlay cache.storedOverlayEntries: each row parsed as the list read parses it.namesWithOwnStoredRow: the names that have a stored row of their own.readItemActiveRows: one item's active rows.protocol.tsloses 113 net lines (29,440 to 29,327). The cut is move-only, and the card stays open for later cuts.Branch
claude/project-thread-ybjm3his the harness-pinned branch for this thread, restarted frommain95294be389after cut 15 merged. It names no issue, so the claim comment is the identity record. It holds the move commit2b680ef22and the merge ofmain601c77384(afd0fc791). That merge touches no file ofpackages/metadata-protocol/: the package'ssrc/tree isd9c112bcat both ends.Serial with the file's in-flight PRs. Measured just before this PR was opened: of the 36 open PRs, one touches
packages/metadata-protocol/src/. #26005 editsprotocol.meta-types-degenerate-derivation.test.ts, which does not overlap this cut. No open PR editsprotocol.tsor the new module.The order's
new Error(questionThe
new Error(near these members is at base line:10741, insideresolveAppPackageIdKey, which does not move. None of the four moved bodies constructs an error (0new Error(, no other error constructor), so noPRODUCERSrow is owed. The onlycatchin the range (:10497) is inresolveRowlessExpandedView, which also stays.What moves
readActiveOverlayRows:10262storedOverlayEntries:10349namesWithOwnStoredRow:10431readItemActiveRows:10662139 body lines (the proposal said about 139).
The shape (#23050 shape B, as cuts 1–15 apply it)
[#25467 cut 16].StoredOverlayReadHosttypes every member as the class member itself (an indexed access onObjectStackProtocolImplementation). Each moved function types itsthisas thePickof the host over exactly the members its body reads. Each stub annotates its literal asThisParameterTypeoftypeof fn. No member changes visibility.this, withascasts, parentheses and!stripped; barethischecked too):readActiveOverlayRowsandreadItemActiveRowsreadengine(a live getter; the overlay cache keys its bucket on the engine) andfindEnvironmentRows(a closure).storedOverlayEntriesreadsconvertStoredItem(a closure).namesWithOwnStoredRowreads no member. It is a plain function, and its method calls it directly, the way cut 3'sorderByFieldNamesandgroupByFieldNamesstubs do. There is no host and no.call.ObjectStackProtocolImplementationidentifier and none onthis.constructor, in any of the four bodies.protocol.ts(20this.call sites) andprotocol-save-door-refusals.ts, whose own host handsreadActiveOverlayRowsandstoredOverlayEntriesover as closures to the class methods.Module-level declarations, by reader
Two gain
exportin place, none moves.addressPackages(read bynamesWithOwnStoredRow; its other reader stays) and theStoredOverlayEntryinterface (the return type ofstoredOverlayEntries;RowlessExpandedViewstill names it). Neither is re-exported fromindex.ts, so the package's export table and.d.tsdo not change (below). The new module's import from./protocol.jsofaddressPackagesis a runtime import; earlier modules already use that cycle (protocol-publish-batch.ts,protocol-drafts.ts), and it reads only a function declaration, at call time.Imports in
protocol.ts. The overlay-cache reads lose their last readers and leave the./meta-overlay-cache.jsimport, which keepsbumpWriteEpoch:metaOverlayCacheTtlMsreadMetaOverlayCachereadOverlayCacheGenerationwriteMetaOverlayCacheMetaOverlayCacheKeyThe new module imports them from there, and
PLURAL_TO_SINGULAR/SINGULAR_TO_PLURALand the typeStoredOverlayRowfrom whereprotocol.tsdoes; those keep other readers inprotocol.ts. The one new statement inprotocol.tsis the import of the new module.The durability
--list(the order's re-measure)The order expected the members'
engine.findseams to change file. Measured, they do not. Neither read calls the engine directly: both route throughthis.findEnvironmentRows(...), which stays in the class and holds the find.check-durability-degradation-log-levelexits 0 at both ends with identical output, and its--listis identical once[@:][0-9]+is stripped (159 lines; no entry changes file).The published
.d.tsThe series bar is ruling
6348891160, sorted-union identity, measured first. Base95294be389and head2b680ef22were built withpnpm --filter @objectstack/metadata-protocol buildagainst one dependency tree. The closure was built at head by a fullpnpm build(119/119). For the base build, the package'ssrc/was swapped tree-only to base and restored fromHEADunder a trap;git diff HEADwas empty,git statusclean, and both touched blobs equal toHEAD's after. Measured twice: on the pre-merge tree (base95294be389, head2b680ef22) and after mergingmain(headafd0fc791, closure rebuilt by a fullpnpm build, 119/119). The readings below hold for both.08914e65f936a2b031c3f3f215481a97f53d132eefd869e4f42d928947ebe173at base and at head, on bothdist/index.d.tsanddist/index.d.cts, 775,874 bytes each. Raw identity holds, so sorted-union identity holds too. All four members stayprivate NAME;lines. The newly exportedaddressPackagesandStoredOverlayEntrydo not appear.46ccd7e5c4db673652513d1801ec9c9f06bf34a0a7fb6ba97fb2531ef0cc544bat both ends (80 string-literal union runs sorted; the cut 12 normaliser).index.jshashes5671669a82bc3837…at base andbfb1ef96fc8499bc…at head. The.call(hostsites ofreadActiveOverlayRows,storedOverlayEntriesandreadItemActiveRowsoccur 0 times in the base bundles and once in the head bundles (ESM and CJS alike);function namesWithOwnStoredRow(appears 0 times at base and once at head.privatewas dropped fromreadActiveOverlayRows(on disk, restored fromHEADunder a trap) and the package rebuilt. Both.d.tsfiles move to626578dcab46fa8f…and printreadActiveOverlayRows(request: { type: string; packageId?: string; }): Promise<any[]>;, so the bar can see a change on these members.9f18a0177ac736ed…on all four. No moved function, the host type,addressPackagesorStoredOverlayEntryappears.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
Bodies, by AST token (the TypeScript compiler's AST leaf tokens, JSDoc skipped, over parameters less the added
this, return type and body), baseprotocol.tsat95294be389against the head module:Negative control, one token changed in an in-memory copy of the head module (
overlayCacheTtlMs > 0 ?tooverlayCacheTtlMs >= 0 ?, one occurrence):Class side. 300 members at base and at head, in the same order. The 296 that did not move are byte-identical to base, leading comments included. Each of the 4 stubs sits at its base position and keeps its docblock and signature byte-identical (everything before the body's opening brace).
Top level of
protocol.ts. 241 of the 244 base statements are byte-identical, leading comments included. The other three:./meta-overlay-cache.jsimport, losing the five names above;addressPackages, gainingexport;StoredOverlayEntry, gainingexport.Head adds one statement, the new module's import.
Size. +241 / −136 over 2 files, 377 changed lines (the proposal's estimate was 400–480).
protocol-stored-overlay-reads.tshas 218 lines.Readers of the moved lines
Every test and script that reads
protocol.tsby path was grepped for the four member names and for the overlay-cache names their bodies use. So was every test file inpackages/andui/, anddocs/qa/.By path: none. No by-path reader names a moved member or reads a moved body's text.
scripts/docs-audit/affected-docs.mjsmatched only because its self-test carries inline excerpts (aMetaOverlayCacheKeystruct, anauditMetaItemsignature); it does not read the moved bodies.Behaviour through the class method, no edit owed:
protocol.platform-store-system-opt-in.test.tscallsprotocol.readActiveOverlayRows(...)at line 265.protocol.item-active-rows-one-read.test.tscallsp.readItemActiveRows(...)at lines 114 and 123.Both pass at both ends (in the package suite).
storedOverlayEntriesandnamesWithOwnStoredRoware named by no test.No hit in
docs/qa/.ADR anchors and decision letters.
check-adr-anchorsexits 0 at both ends: 88 anchored files, 59,105 citations, files 8,299 → 8,300, and 1,879 → 1,877 decision-letter citations. The two that leave the anchored file are the[ADR-0131 D6/D7]comments inreadActiveOverlayRows' andstoredOverlayEntries' bodies (protocol.tsADR-0131 D6113 → 111). Theprotocol.tsanchor entry does not cover ADR-0131, and no entry paragraph describes these reads, so the new module gets no entry (disclosure only, as cuts 8, 12, 13 and 14).Engine-double contract (
check-engine-double-contract): exits 0 at both ends. TheupdateData/deleteDataseams keep their entries at new line numbers (14087 → 13974, 14112 → 13999).productionFilesis 3,725 at base and 3,727 at head: +1 is the new file, +1 is the gitignoredpackages/spec/src/migrations/registry.tsthe spec build writes in the head tree.Identical output at both ends:
check-adr-symbol-anchors,check-system-context-census,check-tenant-audit-census,check-query-options-erasure-ratchet,check-filter-alias-parity,check-durability-degradation-log-level.check-nul-bytesdiffers only in the scanned file count, +1. The base-end readings were taken in a clean detached worktree at95294be389.Governed surface.
check-governed-merges --branch claude/project-thread-ybjm3h: 0 of 2 paths hit the register, NOT governed; 377 changed lines, under the 3,000-line human-merge bar.Verification
tsc --noEmitinpackages/metadata-protocolexits 0 before and after the merge.pnpm exec eslint --no-inline-config packages/metadata-protocol(the whole touched package; it has nolintscript, these are the rootlintscript's flags) exits 0, no output.packages/metadata-protocolsuite, base and head, compared per test name and status (vitest--maxWorkers=2, JSON reporter, each run under the shared verify lock,VERDICT command-exit 0both legs), on the pre-merge tree (the merge changed no file of the package):95294be389: 21,558 tests (21,539 passed, 0 failed, 19 skipped), 269 files.2b680ef22: 21,558 tests (21,539 passed, 0 failed, 19 skipped), 269 files.src/swapped tree-only from95294be389(the new module removed) and restored fromHEADunder a trap.check-platform-checklist --changed-from origin/main(merged tree): OK, 1 anchored file in the change set, 29 anchors judged, 0 lost.dispatch-gates --commands --repo objectstack-ai/objectstackderives 53 gates on 2 changed paths from the merged treeafd0fc791, with no stale-tree warning; all 53 exit 0 after the fullpnpm build(119/119).dispatch-gates --ran: 53 derived, 53 run, 0 NOT-MEASURED, 0 UNRUN, exit 0.Carry-forward
Unchanged from cut 15. These stay in
protocol.ts:probeRecord,getMetaItemCached,findReferencesToMeta,packagelessAddress,refuseUnmintableMetaType,metaTypeNamespaceExists,viewContainerNameCollisionRefusalwithoverlaidShippedContainerViewNames,reportPageRequiresAbsentAtLoad, the 7applyRegistryWriteThroughcallers, andreadCodeLayerForCarryForward.refusePackagedBaseRemoval,packagedBaseRefusal,runPublishSideEffects,promoteDraftForPublish,publishPackageDraftsanddiscardPackageDrafts.warnClosureReadUnavailable.The overlay-row family's other members stay for now:
overlayLockLayerAtis named by the by-path kitprotocol.lock-one-resolution.kit.test.ts.findServedOverlayRow,expandStoredViewContainersandresolveRowlessExpandedViewwere outside this order.🤖 Generated with Claude Code
https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6