Repository navigation
refactor(metadata-protocol): move the metadata-service code-layer read out of protocol.ts into protocol-metadata-service-read.ts (#25467 cut 20) - #26366
Conversation
…d out of protocol.ts (#25467 cut 20) Move the body of readItemFromMetadataService unedited into protocol-metadata-service-read.ts, behind a MetadataServiceReadHost that hands over the getServicesRegistry field as a getter. The class keeps the method, its docblock and declared signature; its body becomes a host literal plus a .call. Its callers keep calling the class method. Claude-Session: https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check4 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 — 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 134d886c2fc0f227fba21c71de2b3c0a59905fd5 && git checkout 134d886c2fc0f227fba21c71de2b3c0a59905fd5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e843b5b32071ec4ae4d30d3cfc618ae0203f3f95 54aaeba31e9f979fe1667717d9bc484b1cf5e5a8 && git checkout -B drift-repro e843b5b32071ec4ae4d30d3cfc618ae0203f3f95 && git merge --no-ff 54aaeba31e9f979fe1667717d9bc484b1cf5e5a8
node scripts/docs-audit/affected-docs.mjs --json e843b5b32071ec4ae4d30d3cfc618ae0203f3f95 |
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #25467 (cut 20), skip-changeset (no published behaviour moves), mergeable clean. |
| Files | 2 files, +101/−37. readItemFromMetadataService moves into protocol-metadata-service-read.ts (#23050 shape B), with getServicesRegistry handed over as a getter. The class member stays as a delegating stub, so all 4 callers still call the class method. Not governed. |
| Fix | A pure move. Seat probe: all 36 removed protocol.ts lines reappear in the new module, identical once the class indent is stripped, 0 missing. The module-level reads keep their other readers. canonicalMetaType is imported from ./protocol.js as an existing export, so nothing gains export and no import is dropped. Dev: AST compare 383 tokens, 0 differ (the negative control gives 1). Export tables are equal at 78 names. |
.d.ts bar |
Ruling 6348891160 is sorted-union identity, and it holds (normalised f7f9306e… at both ends). Raw identity does not hold this time. The one raw difference is the order of the same five status literals inside getDiscovery()'s inferred return type, which is exactly the reordering the sorted-union bar exists to absorb. The positive control moves it. Accepted under the series bar. |
| Order questions | No body constructs an error, so no PRODUCERS row is owed. The durability --list is identical once line numbers are stripped. check-adr-anchors gains one citation (ADR-0048 in the new module's header), and the gate exits 0. |
| Evidence | 36 check runs succeeded and 16 were expected skips on this head, 0 failed. The suite ran 21,568 tests at both ends, with 0 lost, 0 added and 0 changed. Derived gates: 51 of 51 exit 0, no STALE, and --ran reconciles. Overlap: #26244's and #26138's merge-tree conflicts are the ones they already have with main, and #26337 is clean. |
| Carried | The liveness pointer disclosure (manifest.json's dependencies row, seed.json's applySeedBodies) is unchanged from cut 19 and stays for the series' close-out. Cut 21 goes to the same thread once this lands: findServedOverlayRow paired with reportSealedOverlayRows, with findServedOverlayRow alone as the fallback. |
| 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 20 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–19 landed as #25494, #25518, #25538, #25589, #25601, #25623, #25642, #25719, #25731, #25740, #25797, #25939, #25972, #26014, #26104, #26168, #26264, #26317 and #26350. The claim is6429678924. The scope is the cut 20 proposal of the cut 19 report (6428860550), which the server seat approved in its dispatch order. The member passed the AST screen and moved unedited.One
ObjectStackProtocolImplementationmember moves unedited into a new module,packages/metadata-protocol/src/protocol-metadata-service-read.ts(#23050 shape B):readItemFromMetadataService: the code-layer read through themetadataservice. It reads one item, package-scoped (ADR-0048), and takes the service's diagnosis when the service gives one. It falls back to the singular/plural spelling. A stored object row's copy is not counted as a code layer (metadata-protocol: deleting a runtime object hydrated at boot answers "it no longer exists" but keeps it registered and served until a restart — the delete heal re-registers the boot baseline before its unregister limb (Part of #23514) #23645).protocol.tsloses 30 net lines (29,240 to 29,210). 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 frommaine2129cbf06after cut 19 merged. It names no issue, so the claim comment is the identity record. It holds the move commit1cb285a797and the merge ofmainc19ad22f62(54aaeba31e). That merge touches no file ofpackages/metadata-protocol/: the package'ssrc/tree is953bab7aat both ends.Serial with the file's in-flight PRs
Measured just before this PR was opened: of the 19 open PRs, three touch
packages/metadata-protocol/src/. None namesreadItemFromMetadataService. Each was checked withgit merge-treeagainst this branch's head (54aaeba31e) and againstorigin/mainalone.c33b95d89f) is the only one that editsprotocol.ts, at:163(imports) and:23178, far from:9328. Its merge-tree with this head conflicts inprotocol.tsandpackages/spec/src/type-alias-convention.pin.test.ts. Its merge-tree withmainalone conflicts in the same two files. Theprotocol.tsconflict is the import-line conflict with cut 18'sALL_CONVERSIONSdrop; refactor(metadata-protocol): move the flow save's retired-spelling replay verdict out of protocol.ts into protocol-flow-save-replay.ts (#25467 cut 18) #26317 spelled out the union resolution. This cut adds no conflict.protocol.*.test.tsfiles. Its two conflicts (scripts/sdui-manifest.sources/core.json,types.json) are likewise withmainalone.2448c0035a) edits threeprotocol.*.test.tsfiles. Its merge-tree with this head is clean.No open PR edits the new module.
The order's screen (private statics,
new Error()The member passed:
ObjectStackProtocolImplementationidentifier and none onthis.constructor.new Error(and no other error constructor, so noPRODUCERSrow is owed. It has notry, nocatchand no log line.What moves
readItemFromMetadataService:9328The proposal said 40.
The shape (#23050 shape B, as cuts 1–19 apply it)
[#25467 cut 20].MetadataServiceReadHosttypes its one member as the class member itself (ObjectStackProtocolImplementation['getServicesRegistry']). The function types itsthisasPick<MetadataServiceReadHost, 'getServicesRegistry'>. The stub annotates its literal asThisParameterType<typeof readItemFromMetadataService>. No member changes visibility.this, withascasts, parentheses and!stripped, and barethischecked too. The body readsgetServicesRegistryonly, asthis.getServicesRegistry?.().getServicesRegistryis an optional private FIELD holding the constructor-supplied callback, not a method. So it is handed over as a getter (get getServicesRegistry() { return readGetServicesRegistry(); }), and the body reads the protocol's field at call time.undefined, so the body's?.()short-circuits exactly as before.protocol-package-install.ts,protocol-record-reads.tsandprotocol-save-door-refusals.tsalready use for this field.:9262caller. There are fourthis.readItemFromMetadataService(sites inprotocol.ts(:9262,:11091,:11422,:18960at base), and none changes.Module-level declarations, by reader
Measured by an AST walk over the body's identifiers, against
protocol.ts's top-level declarations and import bindings (property names excluded):protocol.tshas itprotocol.tscanonicalMetaType:484./protocol.jsat runtime, asprotocol-lock-state.tsandprotocol-registry-materialize.tsdoisTenantAuthored@objectstack/metadata-coreimportPLURAL_TO_SINGULAR,SINGULAR_TO_PLURAL@objectstack/spec/sharedimportNothing gains
export, and no import ofprotocol.tschanges. 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. Its--listis identical once[@:][0-9]+is stripped (158 lines, and no entry changes file). The body has nocatchand makes no engine call. Its reads go through themetadataservice.The published
.d.tsThe series bar is ruling
6348891160: sorted-union identity, measured first, with raw identity reported when it holds. This cut holds the bar, and raw identity does NOT hold, for the reason below.Base
e2129cbf06and head1cb285a797were 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. Afterwardsgit diff HEADwas empty,git statuswas clean, and both touched blobs equalledHEAD's. The readings were taken on the pre-merge tree, and the head readings again after mergingmain(head54aaeba31e, closure rebuilt by a fullpnpm build, 119/119).f7f9306ed46a5605c5e4c59bbc212a7d5288061760ec85d473d2f3047a836ba5at both ends, ondist/index.d.tsanddist/index.d.cts. The normaliser sorted 80 string-literal union runs (the cut 12 normaliser). Sorted-union identity holds.a8f6adb6f9c56b8f441b7224ca8c4d43b84891bce0373446e1577a7884079dd8, head1b134685a474f83cfa85a743e49a811d607fcaeed53ae8856dd62db65ad132f5. Both files are 776,660 bytes at each end.dist/index.d.ts:2448, insidegetDiscovery()'s inferred return type:tscprints an inferred union in the order its literal types were first created in the program. Moving a body changes which file the checker visits first, which changes that order, and changes nothing else.readItemFromMetadataServicestays aprivate NAME;line.index.jshashes9495894cdf5ce39b…at base and7be270d93afd5f1e…at head..call(hostsite ofreadItemFromMetadataServiceoccurs 0 times in the base bundles and once in the head bundles (ESM and CJS alike).function readItemFromMetadataService(appears 0 times at base and once at head.privatewas dropped fromreadItemFromMetadataServiceon disk (restored fromHEADunder a trap) and the package rebuilt. Both.d.tsfiles move toc9acdc769a2b94ed…(normalisedc1ebd3ff0d127a7e…, which differs from the bar'sf7f9306e…) and printreadItemFromMetadataService(type: string, name: string, packageId?: string): Promise<{ data: unknown; degraded: boolean; errors: string[]; }>;. So the bar can see a change on this member.9f18a0177ac736ed…on all four. Neither the moved function norMetadataServiceReadHostappears.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
Body, 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.tsate2129cbf06against the head module:Negative control. One token was changed in an in-memory copy of the head module:
?? SINGULAR_TO_PLURALbecame|| SINGULAR_TO_PLURAL, one occurrence.protocol.ts. All 248 base statements are byte-identical, leading comments included. Head adds one statement, the new module's import.protocol-metadata-service-read.tshas 94 lines.Readers of the moved lines
Every test and script that reads
protocol.tsby path (70 files) was grepped for the member name and for its body's text:getDiagnosed,metadataService,isTenantAuthored,get('metadata')and the plural/singular fallback. So were the test files inpackages/andui/, anddocs/qa/.By path: none reads the moved body.
protocol.metadata-store-outage.test.tsmatchesgetDiagnosedin comments. It does not readprotocol.tsby path: it names the file in prose and drives the read through the protocol. It passes at both ends, in the package suite.Behaviour through the class method, no edit owed.
packages/objectql/src/protocol-delete-boot-hydrated-object-heal.test.tsnamesreadItemFromMetadataServicein its header and drives it through the delete door. Run at head after the full build: 1 file, 5 tests passed.The
@objectstack/specliveness ledgers. No row points atreadItemFromMetadataService. Carried forward from cut 19, two rows still holdprotocol.ts#memberevidence pointers whose quoted line has moved to a seam module:manifest.json'sdependenciesrow →protocol.ts#resolveWritePackageScope(cut 19);seed.json→protocol.ts#applySeedBodies(cut 14).check:livenesschecks only that the#symbolis named in the file, and both stubs keep it, so it passes. Re-pointing them is apackages/spec/**edit, outside this card.No hit in
docs/qa/.ADR anchors.
check-adr-anchorsexits 0 at both ends. The decision-letter count is unchanged at 1,879. The citation count goes 59,279 → 59,280 and the file count 8,356 → 8,357. TheADR-0048comment in the body moves with it, and the new module's header namesADR-0048once more. Theprotocol.tsanchor's governing ADRs are all still referenced.Engine-double contract (
check-engine-double-contract): exits 0 at both ends.updateData/deleteDataseams keep their entries at new line numbers (13926 → 13896, 13951 → 13921).productionFilesis 3,748 at base and 3,750 at head. One of the +2 is the new file. The other is the gitignoredpackages/spec/src/migrations/registry.tsthat the 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-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 ate2129cbf06.Governed surface.
check-governed-merges --branch claude/project-thread-ybjm3hfinds 0 of 2 paths in the register, so the PR is NOT governed. It has 138 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-protocolexits 0 with no output. It covers the whole touched package, which has nolintscript; these are 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, and both gaveVERDICT command-exit 0. The runs are on the pre-merge tree; the merge changed no file of the package.e2129cbf06: 21,568 tests (21,549 passed, 0 failed, 19 skipped), 270 files.1cb285a797: 21,568 tests (21,549 passed, 0 failed, 19 skipped), 270 files.src/swapped tree-only frome2129cbf06(the new module removed) and restored fromHEADunder a trap.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.dispatch-gates --commands --repo objectstack-ai/objectstackderives 51 gates on 2 changed paths from the merged tree54aaeba31e, with no stale-tree warning; all 51 exit 0 after the fullpnpm build(119/119).dispatch-gates --ran: 51 derived, 51 run, 0 NOT-MEASURED, 0 UNRUN, exit 0.Carry-forward
Unchanged from cut 19. These stay in
protocol.ts:probeRecord,getMetaItemCached,findReferencesToMeta,packagelessAddress,refuseUnmintableMetaType,metaTypeNamespaceExists,viewContainerNameCollisionRefusalwithoverlaidShippedContainerViewNames,reportPageRequiresAbsentAtLoad, the 7applyRegistryWriteThroughcallers,readCodeLayerForCarryForwardandensureObjectStorage.refusePackagedBaseRemoval,packagedBaseRefusal,runPublishSideEffects,promoteDraftForPublish,publishPackageDraftsanddiscardPackageDrafts.warnClosureReadUnavailable.🤖 Generated with Claude Code
https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6