Repository navigation
refactor(metadata-protocol): move getMetaDiagnostics out of protocol.ts into protocol-meta-diagnostics.ts (#25467 cut 2) - #25518
Conversation
…otocol.ts into protocol-meta-diagnostics.ts Move-only. The class keeps getMetaDiagnostics with its docblock, signature and position; its body moves unedited into the new module and is handed the five members it reads through a host literal (MetaDiagnosticsHost). ShippingPackages gains export in place; index.ts exports protocol.js by name, so it stays unpublished. Claude-Session: https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 18 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 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 411a906c7141ba4d4235f063ad4b9f23e9984f16 && git checkout 411a906c7141ba4d4235f063ad4b9f23e9984f16
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fa06169c3cfdb39d4b029963b20b5405e001e3d7 9f403be528c4070bc4deb856a6320460dcac419e && git checkout -B drift-repro fa06169c3cfdb39d4b029963b20b5405e001e3d7 && git merge --no-ff 9f403be528c4070bc4deb856a6320460dcac419e
node scripts/docs-audit/affected-docs.mjs --json fa06169c3cfdb39d4b029963b20b5405e001e3d7
|
|
os-dev-report |
席位核对 · ACCEPT · 2026-10-23T18:50Z
Generated by Claude Code |
Requested by Sales · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 2 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cut 1 landed as #25494. The claim is6370841668, amended in6371139599to the narrowed scope below, which the seat agreed before the amendment. OneObjectStackProtocolImplementationmethod body moves unedited into a new module,packages/metadata-protocol/src/protocol-meta-diagnostics.ts:getMetaDiagnostics, the sweep behindGET /api/v1/meta/diagnostics(216 lines at base, 26 of them from the last 30 days).It is move-only, and the card stays open for the later cuts. Branch:
claude/project-thread-uasfag, the harness-pinned branch for this session, restarted fromorigin/mainat5188e7f18fafter cut 1 merged. It names no issue, so the claim comment is the identity record.Serial with the file's in-flight PRs. At claim, none of the 12 open PRs touched
protocol.ts(each PR's file list read; the Version Packages PR #24876 paged through all 395 files, which touch onlyCHANGELOG.mdandpackage.jsonin this package). Re-measured at 17:54Z, just before this PR was opened, on all 13 open PRs: none touchesprotocol.ts;origin/main(fa06169c3c) has not touched this package since the base, andgit merge-treewith it is clean.Narrowed from the claim:
getDiscoverystaysThe claim named
getDiscovery,listLiveMetadataTypes,getMetaDiagnosticsandSERVICE_CONFIG.getDiscoverycannot move under the series'.d.tsbar, measured on a trial of the full claimed scope (not pushed):getDiscoveryis public and its return type is inferred (async getDiscovery() {), sodist/index.d.tsprints the type the compiler infers for it..d.tschanged in two ways that are not union-member order. It dropped a property docblock (@deprecated Use name. Removed in protocol 18 (#4828).). It also spliced about 100 lines of an unrelatedprotocol.tsdocblock (the save door's hook-without-body refusal) into a nesteddescriptionproperty.fc33e319…against base8e1a224c…; normalised different from base's5b98a8e8…, with a 111-line normalised diff. Under ruling6348891160that is a stop.listLiveMetadataTypes' body is barely longer than its stub would be, andSERVICE_CONFIGis read only bygetDiscovery, so both stay with it.Carry-forward for later cuts. A public member whose return type is inferred stays in
protocol.tsin this series. Annotating its type would be a signature edit, and that needs a ruling. Measured on5188e7f18f, these 15 public members declare no type, so later cuts skip them:getDiscovery,getMetaTypes,getMetaItems,getMetaItemsForExecution,getMetaItem,getMetaItemForExecution,getUiView,findData,getData,validateData,createData,cloneData,updateData,deleteData,saveMetaItem.The shape (#23050 shape B, as cut 1 applies it)
getMetaDiagnosticswith its name, signature, docblock and position, because tsup emits members with their JSDoc into the.d.ts. Its body is now one host literal plusgetMetaDiagnostics.call(host, request), marked[#25467 cut 2]. The method dropsasyncand returns the moved function's promise.MetaDiagnosticsHosttypes every member as the class member itself (ObjectStackProtocolImplementation['m']). The moved function types itsthisas thePickof the host over exactly the members its body reads (measured by AST), and the stub annotates its literal asThisParameterType<typeof getMetaDiagnostics>. There is no cast, and no member becomes public or protected.(...a) => this.m(...a)), so a spy or double set on the instance is still the one the body reaches:getMetaItems,shippingPackagesOf,artifactLockLayerAt,servedLockState,isArtifactBacked. The body reads no field.Module-level declarations.
type ShippingPackagesis also read by code that stays. It stays inprotocol.tsand gainsexportin place, the only edit to it; the module imports it back as a type.src/index.tsexports from./protocol.jsby name, so it is not published (measured below).resolveItemLock(./item-lock.js),DEFAULT_METADATA_TYPE_REGISTRYandgetMetadataTypeSchema(@objectstack/spec/kernel), andcomputeMetadataDiagnosticsandtype MetadataDiagnostics(./metadata-diagnostics.js), from the same specifiersprotocol.tsuses.protocol.tskeeps all its imports, since each still has readers there. It gains one statement: the import of the new module.The published
.d.tsUnder the series bar (ruling
6348891160), measured on base5188e7f18fand on the head. Both were built against the same dependency tree:turbo run build --filter=@objectstack/metadata-protocol...at base (13/13), thenpnpm --filter @objectstack/metadata-protocol buildat head.dist/index.d.tsanddist/index.d.cts: base8e1a224c7d5a800c65c0174f9bc2245b70e0bab2106ab8dbf8a4b2dedd4ca35f(both files), headaf5c30c9cb32b251f9a1b075e6347f372fe4be2561bee9c97731155b5d0a62a7(both files).statusunion,"available" | "degraded" | "registered" | "unavailable" | "stub"at base and"registered" | "available" | "degraded" | "unavailable" | "stub"at head. That is a union-member order swap, the kind the ruling names.5b98a8e857554959f7561563d6a0742110c5d3d8ad6119065ed5a69b0bc06f95. The normaliser, run frompackages/metadata-protocol:dist/index.d.ts: line 1348,private engine;, made public (engine;), gives rawcbb86beef64be20057c3950401bc2d49d8cf9eefbcea52c02b59d47efa0e3bafand normalisedf40390e5c426e0c6e24523cd6908726d3f3cab87f9a4ac36df20992bec04da95. Both differ from the real hashes.import()andrequireof the built bundles). The sorted list hashese47ac7c753bcb8bee1e79c1a5f79f7394cf030bd526de81ea8bcbfcb71fa024aon all four, as at cut 1.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
getChildrenleaves): the moved function's parameters (less the addedthis), return type and body have the same token sequence as the base method, and each body line is the base line with four leading spaces removed;asyncmatches. 626 tokens compared, 0 differ. Negative control: one changed token makes the check report a difference.async.protocol.ts: 254 of the 255 base statements other than the class are byte-identical; the other isShippingPackages, which gainsexport. The one new statement is the import of the new module.protocol.tsgoes from 32,468 to 32,309 lines;protocol-meta-diagnostics.tshas 250.Readers of the moved lines
None needed editing; each was read:
protocol.tsentry inscripts/adr-anchors/describes this body. The paragraphs cover ADR-0029 D9.8/D9.9 hydration seams, ADR-0119batchData, ADR-0005/0087 view storage and ADR-0126 flow Regime C;getMetaDiagnosticscallsgetMetaItems, which stays. So no entry is added.catch.check:adr-anchors: 82 → 82 anchored files; decision-letter citations on the anchored surface 1,979 → 1,978, measured at both ends.docs/qa/platform-checklist/areas/studio-authoring.jsonanchorsprotocol.ts#getMetaDiagnostics. The method shell stays, so it still resolves; it is not edited, as cut 1 leftprotocol.ts#batchData.check-platform-checklistexits 0 at both ends with identical output.new Error(, soprotocol.bracketed-refusal-opener-absence.test.ts'sPRODUCERSfloor forprotocol.ts(5) is unaffected.isSystemread:check-system-context-censusshows 149 sites at both ends, identical output. No enginefind/findOne/count/aggregatecall, so thescripts/query-options-erasure-baseline.jsoncount forprotocol.tsis unaffected. No engine write:check-tenant-audit-censusshows 238 sites at both ends, identical output, no--write. No engine-double contract seam../protocol.ts(register-item,lookup-artifact-itemandview-expansion-reconcilecall-site pins,hydrate-overlay-canonical-type,object-registry-write-through-spelling,query-transport-dialect,read-verb-canonical-fold, the two recovery-door pins): none of their patterns occurs in the moved text, and all pass at head.getMetaDiagnostics(diagnostics-store-outage,lock-one-resolution,lock-door-read-agree) pass at head.Verification
tsc --noEmit(package) exit 0;eslinton both source files exit 0.packages/metadata-protocolsuite.protocol.tsby path, run at head, all pass:corerow-serving-door-exposure.pinandsecond-object-read-exposure.pin(7)objectqlcore-boundary.ratchet(2)specmetadata-type-registry-allow-org-override-absenceandscripts/liveness/evidence(44)clientandrestdiscovery-double-retired-key(3 + 2)check-adr-symbol-anchors(2,384 anchors resolve at both, identical output),check-adr-anchors,check-tenant-audit-census,check-system-context-census,check-platform-checklist.dispatch-gates --commands --changedderives 51 gates; all 51 exit 0 and--ranreconciles 51 of 51 with 0 NOT-MEASURED, each run at head with its exit code. The full list and the--ranreconcile are in the report on this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C