Repository navigation
refactor(metadata-protocol): move the credential carry-forward group out of protocol.ts into protocol-credential-carry-forward.ts (#25467 cut 9) - #25731
Conversation
…out of protocol.ts into protocol-credential-carry-forward.ts (#25467 cut 9) credentialChannelFor, carryForwardRedactedCredentials, storedBodyForCarryForward and restoredCredentialPathsFor move unedited (shape B: getter credentialChannels; callbacks credentialChannelFor, getOverlayRepo, readCodeLayerForCarryForward, storedBodyForCarryForward). readCodeLayerForCarryForward stays in the class: the lookupArtifactItem call-site pin reads it in protocol.ts. Cut 7's module gets its written header in place of the placeholder line (comment only). Claude-Session: https://claude.ai/code/session_018R7PXvRqqGBhprFi6EWucU Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 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 dd9f5524476d83a654b84ad489b719da8502d96f && git checkout dd9f5524476d83a654b84ad489b719da8502d96f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f3fea0a03df3f4859dd389899df5a4ea036d1545 428f9aa930d5f07f58692bf4eb942921fcfa752b && git checkout -B drift-repro f3fea0a03df3f4859dd389899df5a4ea036d1545 && git merge --no-ff 428f9aa930d5f07f58692bf4eb942921fcfa752b
node scripts/docs-audit/affected-docs.mjs --json f3fea0a03df3f4859dd389899df5a4ea036d1545
|
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | draft, base main, Part of #25467 (no closing keyword), skip-changeset label, Clause-②: no and Metadata-protocol: none line-initial. |
| Files (3, +239/−60) | protocol.ts, the new protocol-credential-carry-forward.ts, and cut 7's protocol-package-install.ts (comment only: the header placeholder becomes a real module header). Exactly the claim's surface; no packages/spec/**, no docs/adr/**. Not governed (check-governed-merges --pr 25731: 0 of 3 paths), 299 changed lines. |
| Move-only | report's AST proof: 496 tokens, 0 differ; one-token negative control reads differ=1. Seat's read of the stubs: each host literal carries only callbacks to class members (storedBodyForCarryForward, readCodeLayerForCarryForward, credentialChannelFor, getOverlayRepo) plus credentialChannels through a live getter. Cut 8's module untouched. |
| Accepted deviation | readCodeLayerForCarryForward stays in the class: protocol.lookup-artifact-item-call-sites.test.ts reads its lookupArtifactItem(type, name, pkg) site in protocol.ts by path, the same stay rule the Release applies to viewContainerNameCollisionRefusal. The claim allowed credentialChannelFor only if it moved cleanly; it did. |
.d.ts |
raw identity at both ends (325970c1…, same as cut 8); export tables 78/78. Ruling 6348891160 holds. |
| Gates | dev 53 derived, 52 exit 0, check:dual-build-cjs-loads NOT MEASURED (CI); package suite 21,504 tests at both ends, 0 failed; letters 1,846 → 1,846. CI at this act: in progress. Lint & Repo Gates and Type Check owed success before ready. |
| Landing | ready + auto-merge through the relay once every check on this head is green or an expected skip. The cut 10 proposal in the report is the next claim on this card after this merges. |
Generated by Claude Code
Requested by Leehom · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 9 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–8 landed as #25494, #25518, #25538, #25589, #25601, #25623, #25642 and #25719. The claim is6391854672; the scope is the carry-forward credential group the cut 8 report (6391184870) proposed from Release6385903828, as the server seat approved it.Four
ObjectStackProtocolImplementationmembers move unedited into a new module,packages/metadata-protocol/src/protocol-credential-carry-forward.ts(#23050 shape B; one getter,credentialChannels).protocol.tsloses 26 net lines (29,821 to 29,795). A fifth member of the group,readCodeLayerForCarryForward, stays in the class (see "Readers of the moved lines"). The cut also replaces cut 7's placeholder header line inprotocol-package-install.tswith a written header (comment only). The cut is move-only, and the card stays open for later cuts.Branch
claude/project-thread-uly5kiis the harness-pinned branch for this thread. It names no issue, so the claim comment is the identity record. It holds one commit onmaine5cf9f049c.Serial with the file's in-flight PRs. Measured just before this PR was opened: none of the 19 open PRs touches
packages/metadata-protocol/src/(each PR's file list read in full; #25718's 9,209-file list was checked bygit diff --name-onlyagainst its merge base, since the files API caps at 3,000).git log e5cf9f049c..origin/main -- packages/metadata-protocol/is empty at43edf90b5;main's two new commits touch other packages, andgit merge-treeof this head withorigin/mainis clean.What moves
credentialChannelFor:6872carryForwardRedactedCredentials:9190storedBodyForCarryForward:9215restoredCredentialPathsFor:9264The shape (#23050 shape B, as cuts 1–8 apply it)
async. Each body is now one host literal plusfn.call(host, …), marked[#25467 cut 9].CredentialCarryForwardHosttypes every member as the class member itself (ObjectStackProtocolImplementation['m']). Each moved function types itsthisas thePickof the host over exactly the members its body reads. Each stub annotates its literal asThisParameterTypeoftypeof fn. No cast, and no member changes visibility.credentialChannels, as a getter; the methodscredentialChannelFor,getOverlayRepo,readCodeLayerForCarryForwardandstoredBodyForCarryForward, as late-bound closures. No field is assigned.credentialChannelFormoves cleanly, as the order asked to measure first. Its other readers (the cut 8 host literals inrestoredBodyDerivationandrefuseRestoredBodyTheSaveDoorRefuses,saveMetaItem,promoteDraftForPublish) still call the class method, which keeps its signature, so neitherprotocol-authoring-gate.tsnorAuthoringGateHostchanges. No pin reads it by path.Module-level declarations, by reader
export. No module-level declaration ofprotocol.tsis read by the moved bodies; everything they read comes from the moduleprotocol.tsimports it from (metadata-redaction.ts,@objectstack/spec/shared). Fromprotocol.tsthe new module imports types only (ObjectStackProtocolImplementation,MetadataCredentialChannel), so there is no runtime module cycle.protocol.ts.carryForwardRedactedValuesandredactedPathsCarriedForwardlose their last reader and leave themetadata-redaction.jsimport list (hasMetadataRedactorkeeps a reader and stays). The one new statement is the import of the new module.The published
.d.tsThe series bar is ruling
6348891160, sorted-union identity, measured first. Basee5cf9f049cand head428f9aa9were built withpnpm --filter @objectstack/metadata-protocol buildagainst one dependency tree (turbo run build --filter='@objectstack/metadata-protocol^...'once, then the package'ssrc/swapped tree-only to base for the base build and restored fromHEADunder a trap,git diff HEADempty after).325970c1661efaa6a3762ce7de9e6bb205ea16099784f2b6c5950d62d175b331at base and at head, on bothdist/index.d.tsanddist/index.d.cts, 772,838 bytes each (the hash cut 8 reported).diffexits 0. Raw identity holds, so sorted-union identity holds too.9562749edf7b8bba67ed2f1779799a68b3d6934a8605074934572d9507c55ba6at both ends, both files (109 string-literal union runs sorted). This run's normaliser is its own script, so the hash is not comparable with cut 8's normalised figure; the raw hashes are.index.jshashes12c3ff329045d303…at base (cut 8's head hash) anda41e81cf2349514e…at head;storedBodyForCarryForward.callandcredentialChannelFor.calleach occur 0 times in the base bundle and once in the head bundle.index.d.ts, the firstprivate engine;changed toengine;: raw3c2a24456c659dbf…, normalised66c9d4dcf48487eb…. Both move.9f18a0177ac736ed…on all four. None of the moved functions or the host type appears.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
this, return type and body): 496 tokens compared, 0 differ. The parameter and body text, comments included, is also equal with whitespace collapsed, for all four. Negative control: one changed token inrestoredCredentialPathsFor's body (held.length > 0to> 1, on a copy) makes the check reportdiffer=1.async.protocol.ts. 235 of the 236 base statements other than the class are byte-identical, leading comments included. The other one is themetadata-redaction.jsimport that loses two names. Head adds one statement, the new module's import.protocol-credential-carry-forward.tshas 164 lines.Readers of the moved lines
Every test and script that reads
protocol.tsby path (86 files) was grepped for each moved member's name and for the calls their bodies make.protocol.lookup-artifact-item-call-sites.test.tsrecordsreadCodeLayerForCarryForward: lookupArtifactItem(type, name, pkg)as a site it reads inprotocol.ts, keyed by a four-space class-member header. Moving that body would take the site out of the file the pin reads and leave a forwarding closure (this.lookupArtifactItem(...a)) in its place. Verdict:readCodeLayerForCarryForwardstays in the class, the same disposition the Release givesviewContainerNameCollisionRefusalfor the same pin.storedBodyForCarryForwardreaches it through the host. The pin is unchanged and green.protocol.view-expansion-reconcile-call-sites.test.tscensusesthis.getOverlayRepo()acquisitions inprotocol.ts.restoredCredentialPathsFor'sconst repo = this.getOverlayRepo();is the census's exempt spelling and leaves with the body (14 to 13 such lines), and the body makes no stored-row write. Verdict: no edit, as cuts 5 and 6 moved the same line. The census stays green and keeps its population of writes.docs/orcontent/page does.PRODUCERS): the new module has nonew Error((0), so it gets no row.check:adr-anchorsoutput is identical at both ends: 85 anchored files, 1,846 → 1,846 decision-letter citations. No paragraph of theprotocol.tsanchor entry describes the carry-forward, so the new module gets no entry.check-durability-degradation-log-level --list): identical at both ends once[@:][0-9]+is stripped (159 lines). The gate exits 0 at both ends with identical output.check-engine-double-contract): exits 0 at both ends. TheupdateData/deleteDataseams keep their entries at new line numbers (14065 → 14039, 14090 → 14064).productionFilesis 3,684 at base and 3,686 at head: +1 is the new file, +1 is the gitignoredpackages/spec/src/migrations/registry.ts, which the spec build writes in the head tree and the base tree had not built.check-adr-symbol-anchors,check-system-context-census,check-tenant-audit-census,check-query-options-erasure-ratchet,check-filter-alias-parity.check-nul-bytesdiffers only in the scanned file count, +1.check-platform-checklist --changed-from origin/main: OK, 29 anchors judged, 0 lost.check-governed-merges --branch claude/project-thread-uly5ki: 0 of 3 paths hit the register, NOT governed; 299 changed lines, under the 3,000-line human-merge bar.Verification
pnpm --filter @objectstack/metadata-protocol typecheckexits 0.eslint --no-inline-config packages/metadata-protocolexits 0.packages/metadata-protocolsuite, base and head, compared per test name and status (vitest--maxWorkers=2, JSON reporter, each run under the shared verify lock):e5cf9f049c: 21,504 tests (21,485 passed, 0 failed, 19 skipped), 266 files.428f9aa9: 21,504 tests (21,485 passed, 0 failed, 19 skipped), 266 files.src/swapped tree-only frome5cf9f049cand restored fromHEADunder a trap;git diff HEADempty andgit statusclean after. The suite includes both pins named above (15 tests, all passed at head).dispatch-gates --commands --repo objectstack-ai/objectstackderives 53 gates on 3 changed paths. 52 exit 0 at head.check-plugin-teardown-shape --self-testandcheck:lean-entry-closurefirst answered PREREQUISITE NOT MET (a pinned fixture commit outside the shallow clone; an unbuiltobjectql/dist) and exit 0 once the commit was fetched and objectql built.check:dual-build-cjs-loadsis NOT MEASURED locally: it needs every package'sdist/and is left to CI; this package's CJS bundle was loaded directly above.--ranreconciles 53 of 53: 52 run, 1 NOT-MEASURED, 0 UNRUN.Acceptance notes
protocol-package-install.ts(cut 7) now carries a written header in the shape of the other cut modules: which members are getters (engine,getServicesRegistry), which are callbacks (packagePersistService,packageInstallUndo), the three helpers that moved with the bodies, and the twoprotocol.tsdeclarations it imports. Comment only; that file has no other change.carryForwardRedactedCredentialskeeps its{@link carryForwardRedactedValues}, whichprotocol.tsno longer imports. The docblock is unchanged by design (move-only); the link names the function inmetadata-redaction.ts.Carry-forward
Unchanged from cut 8, plus one: public members whose return type is inferred, the bodies kept by a reader (
probeRecord,getMetaItemCached,findReferencesToMeta,packagelessAddress,refuseUnmintableMetaType,metaTypeNamespaceExists,viewContainerNameCollisionRefusalwithoverlaidShippedContainerViewNames,reportPageRequiresAbsentAtLoad, the 7applyRegistryWriteThroughcallers, and nowreadCodeLayerForCarryForward), and the private-static readers stay inprotocol.ts.Generated by Claude Code