Repository navigation
refactor(metadata-protocol): move the row-less expanded view read and the own-name container expansion out of protocol.ts into protocol-view-expansion-names.ts (#25467 cut 22) - #26449
Conversation
… the own-name container expansion out of protocol.ts (#25467 cut 22) Move the bodies of resolveRowlessExpandedView and expandUnderOwnName unedited into protocol-view-expansion-names.ts, behind a ViewExpansionNamesHost that hands over the six members they read as closures. RowlessExpandedView and servedViewExpansion gain export in place. The class keeps both methods, their docblocks and declared signatures; their callers keep calling the class methods. 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 81e98b5a46dfd409d8e0f824ee16dbe96306746e && git checkout 81e98b5a46dfd409d8e0f824ee16dbe96306746e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 26e7c75e9ae232237ae5f7caf6c23164652853b5 95673433d159caf29670a2584bc0b58d83047cf4 && git checkout -B drift-repro 26e7c75e9ae232237ae5f7caf6c23164652853b5 && git merge --no-ff 95673433d159caf29670a2584bc0b58d83047cf4
node scripts/docs-audit/affected-docs.mjs --json 26e7c75e9ae232237ae5f7caf6c23164652853b5
|
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #25467 (cut 22), skip-changeset (no published behaviour moves). |
| Files | 2 files, +143/−57. resolveRowlessExpandedView and expandUnderOwnName move into protocol-view-expansion-names.ts behind ViewExpansionNamesHost, with six closures handed over. RowlessExpandedView and servedViewExpansion gain export in place. The class members stay as delegating stubs, so all five callers still call the class members. Not governed. |
| Fix | A pure move. Seat probe at fresh origin/main: of the 57 removed protocol.ts lines, 55 reappear in the new module, identical once the class indent is stripped. The other 2 are the servedViewExpansion and RowlessExpandedView declaration lines, which stay in protocol.ts and only gain export. Dev: AST compare 529 tokens, 0 differ (two negative controls give 1 each). |
.d.ts bar |
Ruling 6348891160: both raw and sorted-union identity hold, pre-merge and merged. |
| Order questions | The claim's condition holds. The read-seam census is 82 at base, head and merged, and the durability --list is identical once line numbers are stripped. No body constructs an error, so no PRODUCERS row is owed. check-adr-anchors is fully identical. |
| Evidence | CI on head 9567343 is green: 36 checks succeeded, 16 were skipped, and none failed or are pending. The suite ran 21,584 of 21,584, with 0 lost, 0 added and 0 changed. Derived gates: 46 of 46 exit 0, --ran reconciles, and the tree is not stale. No other open PR touches protocol.ts. |
| Carried | The liveness pointer disclosure stays for the series' close-out. Cut 23 goes to the same thread once this lands: convertStoredItem (:6415) paired with convertStoredItemDetailed (:6451), with storedConversionWarned (a Set that is only read with .has and .add) handed over as a getter. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once 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 22 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–21 landed as #25494, #25518, #25538, #25589, #25601, #25623, #25642, #25719, #25731, #25740, #25797, #25939, #25972, #26014, #26104, #26168, #26264, #26317, #26350, #26366 and #26404. The claim is6432922305. The scope is the cut 22 proposal of the cut 21 report (6432160640), which the server seat approved in its dispatch order, with the order's condition that the read-seam census stays at 82 with an identical list. Both members passed the AST screen and the census trial, and both moved unedited.Two
ObjectStackProtocolImplementationmembers move unedited into a new module,packages/metadata-protocol/src/protocol-view-expansion-names.ts(#23050 shape B):resolveRowlessExpandedView: the by-name read's answer for a view name that no stored row holds but a stored view container expands (metadata-protocol: a view that a runtime view container expands is listed by GET /meta/view?object= but answers nothing by name on an environment-scoped kernel or for an org-scoped container — the by-name read expands no container #21442). It is the list read's own answer by construction: the same rows, parse, expansion and selection (finding(metadata-protocol): a saved env-wide copy of a view container leaves its own expansion alone per name in the env-wide view list, so the anonymous form doors can miss another package's withdrawal, saved or shipped (#21934 item 1's residual) #21967).expandUnderOwnName: the expansion of a container on another package's object under the container's own name (metadata: a view container with a bare list on another package's object silently replaces that object's packaged default view on GET /meta/view?object= — while the by-name read still serves the original #21334, finding(metadata-protocol): a stored copy of a view container a package ships on another package's object expands under its own name (#21334's arm), so a form withdrawn in that copy does not reach the package's shipped form of that name #21980).protocol.tsloses 39 net lines (29,193 to 29,154). 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. It was restarted frommain9a0108cdc2after cut 21 merged. It names no issue, so the claim comment is the identity record. It holds the move commitc2087b4c49and the merge ofmain(95673433d1). That merge touches no file ofpackages/metadata-protocol/: the package'ssrc/tree isac8309b0at the move commit and at the merge.Serial with the file's in-flight PRs
Measured just before this PR was opened, against the merged head
95673433d1: of the 20 open PRs, none editsprotocol.tsand none names either member. Two touchpackages/metadata-protocol/src/test files: #26337 (3 files) and #26138 (7 files). Each was checked withgit merge-tree: both are clean against this head and againstorigin/mainalone. No open PR edits the new module.The order's screen (private statics,
new Error(, the read-seam census)Both members passed:
ObjectStackProtocolImplementationidentifier and none onthis.constructor.new Error(, so noPRODUCERSrow is owed.check-durability-degradation-log-level --listre-run: 82 read seams and an identical list for each. The real cut measures the same; see "The durability--list".What moves
resolveRowlessExpandedView:10306expandUnderOwnName:18159The shape (#23050 shape B, as cuts 1–21 apply it)
[#25467 cut 22].ViewExpansionNamesHosttypes each of its six members as the class member itself (ObjectStackProtocolImplementation['…']). Each function types itsthisas thePickof the members it reads. Each stub annotates its literal asThisParameterType<typeof fn>. No member changes visibility.this, withascasts, parentheses and!stripped, and barethischecked too). All are methods, each handed over as a closure(...a) => this.x(...a):resolveRowlessExpandedViewreadsreadActiveOverlayRows,rethrowUnlessMetadataStoreUnprovisioned,namesWithOwnStoredRow,expandStoredViewContainersandstoredOverlayEntries. Three of these are themselves cut 16 stubs, so the call reachesprotocol-stored-overlay-reads.tsthrough the class, as before.expandStoredViewContainersis generic (<E …>); its closure is contextually typed by the class member, andtscaccepts it with no annotation.expandUnderOwnNamereadsisShippedByAnotherPackage.this.resolveRowlessExpandedView(sites (:11041,:11556,:22145,:27291at base) and onethis.expandUnderOwnName(site (:18008, insideexpandRuntimeViewContainer). None changes.Module-level declarations, by reader
Measured by an AST walk over each body's identifiers, against
protocol.ts's top-level declarations and import bindings (property names excluded):protocol.tshas itprotocol.tsRowlessExpandedView:6254exportin place; the new module imports it as a typeservedViewExpansion:2872exportin place; the new module imports it from./protocol.jsPLURAL_TO_SINGULAR@objectstack/spec/sharedimportexpandViewContainer@objectstack/spec/uiimportindex.tsnames its exports one by one, so the two in-placeexports do not reach the published surface (cuts 8, 11, 18 and 19 did the same). The one new statement inprotocol.tsis the import of the new module.The durability
--listcheck-durability-degradation-log-levelexits 0 at both ends with identical output:82 read seam(s)at both ends, the order's condition. Its--listis identical once[@:][0-9]+is stripped (158 lines, and no entry changes file). No entry of the base--listnames either member.resolveRowlessExpandedView'stryguardsthis.readActiveOverlayRows(...), which is already a cut 16 stub, and the gate did not count it as a read seam at base either. Itscatchrethrows throughrethrowUnlessMetadataStoreUnprovisioned(#5532), unedited. On the merged tree the verdict still reads82 read seam(s).The published
.d.tsThe series bar is ruling
6348891160: sorted-union identity, measured first, with raw identity reported when it holds. Both hold for this cut.Base
9a0108cdc2and headc2087b4c49were built withpnpm --filter @objectstack/metadata-protocol buildagainst one dependency tree. The closure was built at head by a fullpnpm build(118/118). For the base build, the package'ssrc/was swapped tree-only to base and restored fromHEADunder a trap. Afterwardsgit diff HEADwas empty,git statuswas clean, and both touched blobs equalledHEAD's.0a7694d518b570981c5cdcbcdd8fcb2dec9f1c7d74a7287299fe9e19e32a4183at both ends, ondist/index.d.tsanddist/index.d.cts. The normaliser sorted 80 string-literal union runs. Sorted-union identity holds.059fa1189ac13c65c36d3718584495bebaa48cc545e1526adb37cd95ef7dfaa3at both ends, 777,645 bytes. Raw identity holds.95673433d1(closure rebuilt by a fullpnpm build, 118/118): the same raw and normalised sha256 and the sameindex.js/index.cjshashes as the pre-merge head.index.jshashesdbff5f6c5cde69ca…at base and14cc3ee05da5713f…at head (index.cjs919b8129becaf027…→c75e50d7513a93c9…)..call(hostsite occurs 0 times in the base bundles and once in the head bundles (ESM and CJS alike), and eachfunction NAME(declaration goes 0 → 1.privatewas dropped fromexpandUnderOwnNameon disk (restored fromHEADunder a trap) and the package rebuilt. Both.d.tsfiles move to796c09174d25bb97…(normalised9f5a865eb21c4211…, which differs from the bar's0a7694d5…) and printexpandUnderOwnName(type: string, object: string, container: Record<string, any>, ownPackageId: string | undefined): Record<string, unknown>[];. So the bar can see a change on these members.9f18a0177ac736ed…on all of them. None of the moved functions,ViewExpansionNamesHost,servedViewExpansionorRowlessExpandedViewappears.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
Bodies, by AST token. The compare reads the TypeScript compiler's AST leaf tokens, with JSDoc skipped, over the parameters (less the added
this), the return type and the body. It compares baseprotocol.tsat9a0108cdc2against the head module:The two top-level statements that are not byte-identical are
servedViewExpansionandRowlessExpandedView, which gainedexportand nothing else.Negative controls, one per member, each one token changed in an in-memory copy of the head module:
protocol.ts. Of the 250 base statements, 248 are byte-identical, leading comments included; the other two gainedexport. Head adds one statement, the new module's import.protocol-view-expansion-names.tshas 125 lines.Readers of the moved lines
The tests and scripts that read
protocol.tsby path (33 files that nameprotocol.tsand callreadFileSync) were grepped for both member names and for the bodies' text:servedViewExpansion,RowlessExpandedView,expandViewContainer(,standInRows,underIsShipped,bareSpelled. So were the test files inpackages/,docs/qa/and the@objectstack/specliveness ledgers.manifest.json'sdependenciesrow →protocol.ts#resolveWritePackageScope(cut 19) andseed.json→protocol.ts#applySeedBodies(cut 14) still quote lines that moved to a seam module.check:livenesschecks only that the#symbolis named in the file, and both stubs keep it. Re-pointing them is apackages/spec/**edit, outside this card.check-adr-anchorsgives identical output at both ends (1,876 decision letters, 59,344 citations across 8,385 files). Neither body nor the new header cites an ADR.check-engine-double-contract): exits 0 at both ends. TheupdateData/deleteDataseams keep their entries at new line numbers (13898 → 13882, 13923 → 13907).productionFilesis 3,764 at base and 3,766 at head: the new file, and the gitignoredpackages/spec/src/migrations/registry.tsthe spec build writes in the head tree (as in cuts 20 and 21).check-adr-anchors,check-adr-symbol-anchors,check-system-context-census,check-tenant-audit-census,check-query-options-erasure-ratchet,check-filter-alias-parityandcheck-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 at9a0108cdc2.Verification
tsc --noEmitinpackages/metadata-protocolexits 0 at head and on the merged tree.pnpm exec eslint --no-inline-config packages/metadata-protocolexits 0 with no output (the whole touched package, with the rootlintscript's flags).packages/metadata-protocolsuite, base and head, compared per test name and status. Each leg ran vitest--maxWorkers=2with the JSON reporter under the shared verify lock.9a0108cdc2: 21,584 tests (21,565 passed, 0 failed, 19 skipped), 271 files.c2087b4c49: 21,584 tests (21,565 passed, 0 failed, 19 skipped), 271 files.src/swapped tree-only from9a0108cdc2(the new module removed) and restored fromHEADunder a trap.95673433d1gives the same 21,584 tests, per test identical to the pre-merge head (0 lost, 0 added, 0 changed).check-platform-checklist --changed-from origin/main(merged tree): OK. 1 anchored file is in the change set, 29 anchors were judged, and 0 were lost.check-governed-merges --branch claude/project-thread-ybjm3hfinds 0 of 2 paths in the register (13 surfaces), so the PR is NOT governed. It has 200 changed lines, under the 3,000-line human-merge bar.dispatch-gates --commands --repo objectstack-ai/objectstackderives 46 gates on 2 changed paths from the merged tree95673433d1, with no stale-tree warning; all 46 exit 0 after the fullpnpm build(118/118).dispatch-gates --ran: 46 derived, 46 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. When this PR was opened,mainwas one commit past the merge (ui/packages/app-shelland a changeset), with no stale-tree warning.check-durability-degradation-log-level --liston the merged tree:82 read seam(s), the list identical to the pre-merge head's.Carry-forward
These stay in
protocol.ts:protocol.tsread-seam entry ofcheck-durability-degradation-log-level --list, as guarded wrapper or guarding member, stays until the gate follows imported wrappers or a ruling accepts the loss. The census trial on this base measuredfindEnvironmentRows82 → 66,packagelessAddress→ 78,findServedOverlayRow→ 79, andfoldStoredCollection,applyObjectRegistryMutation,unmanagedImportCollisions,rollBackUnmanagedImport,readRevertableCommitandstoredFlowBindingAgrees→ 81.rethrowUnlessMetadataStoreUnprovisionedcannot move at all: moved alone, the gate exits 1 and finds 3 read seams.probeRecord,getMetaItemCached,findReferencesToMeta,refuseUnmintableMetaType,metaTypeNamespaceExists,viewContainerNameCollisionRefusalwithoverlaidShippedContainerViewNames,reportPageRequiresAbsentAtLoad, the 7applyRegistryWriteThroughcallers,readCodeLayerForCarryForwardandensureObjectStorage.refusePackagedBaseRemoval,packagedBaseRefusal,runPublishSideEffects,promoteDraftForPublish,publishPackageDraftsanddiscardPackageDrafts.warnClosureReadUnavailable.🤖 Generated with Claude Code
https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6