Repository navigation
refactor(metadata-protocol): move package install and update out of protocol.ts into protocol-package-install.ts (#25467 cut 7) - #25642
objectstack-fleet[bot] wants to merge 1 commit into
Conversation
…rotocol.ts into protocol-package-install.ts Four ObjectStackProtocolImplementation methods (installPackage, updatePackage and their private persist helpers) move unedited into a new module under the shape-B host pattern, with the three manifest-persist declarations only they read. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
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 b751d6d8d53e9612dab34bd3968256f746f2c46f && git checkout b751d6d8d53e9612dab34bd3968256f746f2c46f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ca80f05ec5c6aab22f31553cb5f8737a17450563 2163cff5c06a84cc723a81e8b2ae61d77f9cbe9b && git checkout -B drift-repro ca80f05ec5c6aab22f31553cb5f8737a17450563 && git merge --no-ff 2163cff5c06a84cc723a81e8b2ae61d77f9cbe9b
node scripts/docs-audit/affected-docs.mjs --json ca80f05ec5c6aab22f31553cb5f8737a17450563
|
|
os-dev-report |
席位核对 · ACCEPT · 2026-10-24T13:06Z
Generated by Claude Code |
Requested by Sales · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 7 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–6 landed as #25494, #25518, #25538, #25589, #25601 and #25623. The claim is6384152373. The seat agreed the scope before it and made two calls (the.d.tsand the letters), both answered in the claim and below.Four
ObjectStackProtocolImplementationmembers, package install and update, move unedited into a new module,packages/metadata-protocol/src/protocol-package-install.ts, together with the three manifest-persist declarations that only they read. They are the tail of the class.protocol.tsloses 302 net lines.The cut is move-only, and the card stays open for later cuts. Branch:
claude/project-thread-uasfag, the harness-pinned branch for this session, restarted fromorigin/mainat9d9a06ea38after cut 6 merged. The branch names no issue, so the claim comment is the identity record.Serial with the file's in-flight PRs. Measured just before this PR was opened, on main
ca80f05ec5:protocol.ts,protocol-package-install.tsor the bracketed-refusal pin (each PR's diff read against its merge base).git merge-treeof this head with each of them, and with main, is clean.packages/metadata-protocolsince9d9a06ea38.What moves
installPackage:29853updatePackage:30106packagePersistService:30137packageInstallUndo:30165installPackageandupdatePackageare public, but their return types are annotated. That keeps them off the series' skip list, which holds public members with inferred return types. The class keeps both signatures byte-identical, so the published.d.tsstill lists them as before.The shape (#23050 shape B, as cuts 1–6 apply it)
async. Each body is now one host literal plusfn.call(host, …), marked[#25467 cut 7].PackageInstallHosttypes every member as the class member itself (ObjectStackProtocolImplementation['m']). Each moved function types itsthisas thePickof the host over exactly the members its body reads, measured by AST. Each stub annotates its literal asThisParameterType<typeof fn>. There is no cast, and no member changes visibility.engineandgetServicesRegistry, as getters;packagePersistServiceandpackageInstallUndo, as late-bound closures.Module-level declarations, by reader
Each declaration below was checked by an AST reader walk over the whole of base
protocol.ts.Move with the bodies, byte-identical and unexported. Each is read only by moved code and carries exactly its own docblock:
persistPackageManifest,snapshotPackageRow,restorePackageRow.Stay in
protocol.tsand gainexportin place. That is the only edit to each:packagePersistFailureErrordeletePackagePackagePersistService(interface)packagePersistServicestub's signaturesrc/index.tsexports from./protocol.jsby name, so neither is published (measured below).Import moved. In
protocol.ts, thePackageInstallManifestSchemaimport loses its last reader. Its 2-line[#24086]comment moves with it onto the new module's import of the same name. The one new statement inprotocol.tsis the import of the new module.The published
.d.tsThe series bar is ruling
6348891160, sorted-union identity. Measured first on merged main, as the seat asked, at base9d9a06ea38and at head. Both ends were built withpnpm --filter @objectstack/metadata-protocol buildagainst the same dependency tree (turbo run build --filter='@objectstack/metadata-protocol^...'at base first).ff7d6892b9f1161da356208d51301816c48dc021051544b9c28a3aa14329d57eat base and at head, on bothdist/index.d.tsanddist/index.d.cts. Sorted-union identity holds. The normaliser, run frompackages/metadata-protocol:25da084d43455d125bfd41b85b1e70477ef7caf77f2cb7da23143b325e51a14e, head2d66df37f8e4614df880b46d57781c248549913f7d2279bbd30aa0aa6f1ab290. Both files match at each end, and both are 770,690 bytes on each side. Raw identity does not hold.diff base/index.d.ts head/index.d.ts;index.d.ctsis the same):It is one union reordered inside
getDiscovery's inferred return type.getDiscoveryis on the skip list and did not move. The declaration printer orders an inferred union by the order it first meets those types, and that order depends on where code sits inprotocol.ts. Cut 3 met the same effect.dist/index.d.ts: changing line 1361 fromprivate engine;toengine;gives rawfee7168c23001a389dfae3060f76008adba0aed9a02aa2632a6f9edbde94f1d8and normalisedbe0161971853121da3a941ad8936c6de5bdea6ad91bf0cc6072ded0c27054a58. Both differ from the real hashes, so the normalised hash moves on a real change.e47ac7c753bcb8bee1e79c1a5f79f7394cf030bd526de81ea8bcbfcb71fa024aon all four. NeitherpackagePersistFailureErrornorPackagePersistServiceappears.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
this), the return type and the body have the same token sequence as the base method. Each moved declaration has the same tokens, and its own docblock is byte-identical. 1,243 tokens compared, 0 differ. Negative control: one changed token makes the check report a difference.async.protocol.ts. 232 of the 238 base statements other than the class are byte-identical, leading comments included. The other 6 are:export;protocol.tsgoes from 30,312 to 30,010 lines, andprotocol-package-install.tshas 388.Readers of the moved lines
protocol.bracketed-refusal-opener-absence.test.ts,PRODUCERS). 3new Error(sites move. The new module is listed with its measured count as its floor,'protocol-package-install.ts': 3, as cuts 3, 5 and 6 listed theirs. That is the only edit outside the move. No moved site opens with a bracketed tag.check-durability-degradation-log-level --list). Identical at both ends apart from line numbers (159 lines). None of the four members holds a seam.check:adr-anchors: 85 → 85 anchored files. Decision-letter citations on the anchored surface go 1,868 → 1,866, measured exactly at both ends.ADR-0087 D1(the protocol handshake,assertProtocolCompat) andADR-0087 D2(the authoring door runs no forward conversion), both ininstallPackage's body.protocol.ts's anchor entry governs ADR-0087, but its ADR-0087 paragraph anchors addendum 2026-08-01b, which issaveMetaItem's storable view body (projectStorableViewBody,VIEW_CONSOLE_ROUND_TRIP_KEYS). It does not cover the install handshake.protocol.tskeeps 26 ADR-0087 citations. So the new module gets no entry: this is the cut 13 rule, disclosed here, as the seat ruled in the scope call.check-adr-symbol-anchors;check-platform-checklist(protocol.ts#installPackageand#updatePackageresolve on the shells, which stay and are not edited);check-system-context-censusandcheck-tenant-audit-census;check-query-options-erasure-ratchet;check-liveness.check-engine-double-contractdiffers only inproductionFiles+1 (the new file).check-governed-merges --branchon the final 3-path list: NOT governed. 766 changed lines, under the 3,000-line human-merge bar.scripts/symbol-anchors.mjs, specliveness/manifest.json, the platform checklist,corecapability-providers.ts,host-engine.ts, the runtimepackages.tsdomain, and the package tests. Each names a method in prose or by anchor name, or calls it through the instance. None reads the moved lines by path, and all pass.Verification
tsc --noEmit(package) exits 0.eslintonprotocol.tsandprotocol-package-install.tsexits 0.packages/metadata-protocolsuite, base and head, compared per test name and status:9d9a06ea38: 21,493 tests (21,474 passed, 0 failed, 19 skipped), 266 files.PRODUCERSrow (passed).protocol.tsby path or exercise these methods, run at head, all pass:corerow-serving-door-exposure.pinandsecond-object-read-exposure.pin(7, at both ends);runtimepackage domain and integration tests:packages-*,error-passthrough,package-dependencies-patch,package-promote-runtime-owner-refusal,package-uninstall-shared-object(190);objectqlcore-boundary.ratchet,protocol-publish-canonical-fold,default-record-page-save-doorandpackage-disable-enforcement(61);cloud-connectionmarketplace install tests (29);clientdiscovery-double-retired-keyandpackages-write-envelope(7),restdiscovery-double-retired-key(2);specliveness evidence and allow-org-override-absence (44).check-adr-anchors,check-adr-symbol-anchors,check-platform-checklist,check-system-context-census,check-tenant-audit-census,check-query-options-erasure-ratchet,check-durability-degradation-log-level --list, and speccheck-liveness.dispatch-gates --commands --changedderives 59 gates on the final tree (3 changed paths). All 59 exit 0 at head, and--ranreconciles 59 of 59 with 0 NOT-MEASURED.Carry-forward
These stay in
protocol.tsin this series:getDiscovery,getMetaTypes,getMetaItems,getMetaItemsForExecution,getMetaItem,getMetaItemForExecution,getUiView,findData,getData,validateData,createData,cloneData,updateData,deleteData,saveMetaItem.probeRecord, the per-file erasure-baseline site;getMetaItemCached, whose body the Three read-side/metaverbs (history, audit, references) never reachcanonicalizeMetaRequestType— they still derive their key from the MANIFEST map #9157 pin reads by path;packagelessAddress,refuseUnmintableMetaTypeandmetaTypeNamespaceExists, plus every container the durability read-seam census follows (the durability read-seam census);viewContainerNameCollisionRefusalandoverlaidShippedContainerViewNames, for thelookupArtifactItem(call-site pin.getDiscovery's inferred-return.d.tsdepends on byte offsets inprotocol.ts(shown above), so each cut measures it under the sorted-union bar.🤖 Generated with Claude Code
https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C