Repository navigation
refactor(metadata-protocol): move the runtime authoring gate and the restored-body doors out of protocol.ts into protocol-authoring-gate.ts (#25467 cut 8) - #25719
Conversation
…restored-body doors out of protocol.ts into protocol-authoring-gate.ts Five ObjectStackProtocolImplementation methods (runAuthoringGate, assertRuntimeAuthoringRules and the restored-body derivation, writer and save-door refusal) move unedited into a new module under the shape-B host pattern. The objects-tolerance spelling pin reads both files, since the collection pair it counts moved with assertRuntimeAuthoringRules. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C
…header The cut 8 module carried a placeholder where the header belongs; the host interface's docblock points at the header for which members are getters. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vzV3bUKh27BRiihG8aCqR
📓 Docs Drift CheckThis PR changes 1 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 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 d2b967d4ffe38c6d053b306401b0f5acea6437e1 && git checkout d2b967d4ffe38c6d053b306401b0f5acea6437e1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f6ba1343ba41cb173baadfc36e6069123d3f2cfd 6cbd26bd7d18e6288c8e13e8694adb6833f76956 && git checkout -B drift-repro f6ba1343ba41cb173baadfc36e6069123d3f2cfd && git merge --no-ff 6cbd26bd7d18e6288c8e13e8694adb6833f76956
node scripts/docs-audit/affected-docs.mjs --json f6ba1343ba41cb173baadfc36e6069123d3f2cfd
|
|
os-dev-report Generated by Claude Code |
席位核对 · 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, +468/−250) | protocol.ts, the new protocol-authoring-gate.ts, the [#8862] pin. Exactly the claim's surface. Not governed (check-governed-merges --pr 25719), 718 changed lines. |
| Move-only, seat's own read | every non-blank line deleted from protocol.ts (240) appears in the new module except 7, and each of the 7 is a signature or import the move rewrites: the three private async method heads (now stubs), the two function … Refusal( heads (now export function in place, as the scope ruled), one narrowed IObjectQLEngine, IPubSub import and one evaluateRuntimeAuthoringGate import specifier. The lines added to protocol.ts are the module import, the two export keywords and the five host-delegating stubs. |
| Pin | reads protocol.ts and the module as one text and keeps the exact one-'objects'-literal assertion; both controls reproduce on this head per the report (blanked module got +0, added literal got 2). |
.d.ts |
raw identity at base and head (325970c1…, .d.ts and .d.cts) with a positive control, so ruling 6348891160's sorted-union bar holds; export tables 78 names on all four. |
| Gates | dev union 59 derived, 58 exit 0, check:dual-build-cjs-loads NOT MEASURED (CI). CI at this act: 15 success, 12 skipped, 16 in progress, 0 failed. Lint & Repo Gates and Type Check owed success before ready. |
| Letters | 1,847 → 1,846 (ADR-0090 D11 leaves with the body; not anchored on protocol.ts, no entry), disclosed. |
| Out of scope | cut 7's protocol-package-install.ts on main still carries its header placeholder line: carrier #25467, the next cut fixes it in the same file family. |
| Landing | ready + auto-merge through the relay once every check on this head is green or an expected skip. Cut 9 (the carry-forward credential group) 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 8 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–7 landed as #25494, #25518, #25538, #25589, #25601, #25623 and #25642. The claim is6390712113; it resumes the work handed over in Release6385903828(claude/project-thread-uasfag@65b6d71d38), whose scope the server seat approved.Five
ObjectStackProtocolImplementationmembers, the runtime authoring gate and the restored-body doors, move unedited into a new module,packages/metadata-protocol/src/protocol-authoring-gate.ts(#23050 shape B; gettersengine,authoringChannel,authoringGates).protocol.tsloses 189 net lines (30,010 to 29,821). The cut is move-only, and the card stays open for later cuts.Branch
claude/project-thread-dxdvqfis the harness-pinned branch for this thread. It names no issue, so the claim comment is the identity record. It holds two commits onmain47af3dde4: the picked-up commit65b6d71d38(cherry-picked unchanged), and one that writes the new module's header, which the picked-up commit had left as a placeholder line.Serial with the file's in-flight PRs. Measured just before this PR was opened: none of the 18 open PRs touches
protocol.ts,protocol-authoring-gate.tsor the[#8862]pin (each PR's file list read in full; #25718's 9,205-file list was checked bygit diff --name-onlyagainst its merge base, since the files API caps at 3,000).git log 47af3dde4..origin/main -- packages/metadata-protocol/is empty atf6ba1343ba.What moves
restoredBodyDerivation:6876restoredBodyWriter:6913refuseRestoredBodyTheSaveDoorRefuses:6983runAuthoringGate:7022assertRuntimeAuthoringRules:7085The shape (#23050 shape B, as cuts 1–7 apply it)
async. Each body is now one host literal plusfn.call(host, …), marked[#25467 cut 8].AuthoringGateHosttypes 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 asThisParameterType<typeof fn>. No cast, and no member changes visibility.engine,authoringChannelandauthoringGates, as getters; the methodsanonymousElevatedFlowRefusal,assertRuntimeAuthoringRules,credentialChannelFor,defaultRecordPageSaveRefusal,externalBindingSaveRefusal,foldStoredCollection,isArtifactBacked,orgWallEnforced,refuseRestoredBodyTheSaveDoorRefuses,resolveSduiManifest,resolveWritePackageScope,restoredBodyDerivation,rlsMembershipResolverKeys,runAuthoringGateandtenancyPostureInForce, as late-bound closures. No field is assigned.Module-level declarations, by reader
protocol.tsand gainexportin place (the only edit to each):permissionSetOwnerBindingRefusalandruntimeHookWithoutBodyRefusal, both read by code that stays (the save door).src/index.tsexports from./protocol.jsby name, so neither is published (measured below).protocol.ts,evaluateRuntimeAuthoringGateand the typeIObjectQLEnginelose their last reader and are dropped from their import lists. 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 on merged main as the seat asked. Base47af3dde4and head6cbd26bd7dwere built withpnpm --filter @objectstack/metadata-protocol buildagainst the same dependency tree (turbo run build --filter='@objectstack/metadata-protocol^...'once, then the package'ssrc/swapped tree-only between the two builds and restored fromHEAD,git diff HEADempty after).325970c1661efaa6a3762ce7de9e6bb205ea16099784f2b6c5950d62d175b331at base and at head, on bothdist/index.d.tsanddist/index.d.cts, 772,838 bytes each.diffexits 0. Raw identity holds, so sorted-union identity holds too.aa05995b9d9a32f69b3416eac92ef86b46d79593001a37bf1bb529ed7a9f8952at both ends, both files.index.jshashes8ef7591738381e3e…at base and12c3ff329045d303…at head, andrestoredBodyDerivation.calloccurs 0 times in the base bundle and once in the head bundle.index.d.ts, the firstprivate engine;changed toengine;: raw3c2a24456c659dbf…, normalised86fb565ea19f9768…. Both move.e47ac7c753bcb8be…on all four (the same hash cut 7 reported). NeitherpermissionSetOwnerBindingRefusal,runtimeHookWithoutBodyRefusalnor any moved function appears.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: 1,112 tokens compared, 0 differ. The body and parameter text, comments included, is also equal with whitespace collapsed, for all five. Negative control: one changed token inassertRuntimeAuthoringRules's body makes the check reportdiffer=1.async.protocol.ts. 231 of the 235 base statements other than the class are byte-identical, leading comments included. The other 4 are the two import statements that lose a name and the two declarations that gainexport. Head adds one statement, the new module's import.protocol-authoring-gate.tshas 404 lines.Readers of the moved lines
[#8862]pin (protocol.object-registry-write-through-spelling.test.ts).assertRuntimeAuthoringRulesholds the collection pair it counts, so the scan now readsprotocol.tsandprotocol-authoring-gate.tsas one text and keeps the exact "one executable'objects'literal" assertion. That is the only edit outside the move. The diff:Both controls, re-run on this head through
scripts/ablation-replace.mjs(mutation proven on disk, restored to theHEADblob7d8b3ff36eba,git diff HEADempty after each):AssertionError: expected [] to have a length of 1 but got +0(the file's 12 tests: 7 fail, because the other suites import the blanked module too);'objects'literal (listCollection('permission', 'permissions')spelled with'objects'):expected [ '\'objects\'', '\'objects\'' ] to have a length of 1 but got 2, 1 failed, 11 passed.this.applyRegistryWriteThrough(sites inprotocol.tsstay at 7.PRODUCERS): the new module has nonew Error((0), so it gets no row.check:adr-anchors: 85 → 85 anchored files. Decision-letter citations on the anchored surface go 1,847 → 1,846: the one that leaves isADR-0090 D11inassertRuntimeAuthoringRules's[#7674]comment. ADR-0090 is not amongprotocol.ts's anchored ADRs, and no paragraph of that anchor entry describes the authoring gate, so the new module gets no entry (disclosure only, as cut 7 did).check-durability-degradation-log-level --list): identical at both ends once[@:][0-9]+is stripped (159 lines). None of the five members holds a seam. The gate itself 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 (14254 → 14065, 14279 → 14090).productionFilesis 3,682 at base and 3,684 at head: +1 is the new file, +1 is the gitignoredpackages/spec/src/migrations/registry.ts, which the spec build writes and the base tree had not built.check-adr-symbol-anchors,check-platform-checklist,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-governed-merges --branch claude/project-thread-dxdvqf: 0 of 3 paths hit the register, NOT governed; 718 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:47af3dde4: 21,504 tests (21,485 passed, 0 failed, 19 skipped), 266 files.6cbd26bd7d: 21,504 tests (21,485 passed, 0 failed, 19 skipped), 266 files.protocol.runtime-authoring-gate.test.ts, whichmainchanged after the picked-up commit was cut.dispatch-gates --commands --repo objectstack-ai/objectstackderives 59 gates on the final tree (3 changed paths). 58 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 those were fetched and built.check:dual-build-cjs-loadsis NOT MEASURED locally: it needs every package'sdist/(72 absent here) and is left to CI; the CJS bundle of this package was loaded directly above.--ranreconciles 59 of 59: 58 run, 1 NOT-MEASURED, 0 UNRUN.Acceptance notes
packages/metadata-protocol/src/protocol-package-install.ts(cut 7, onmain) still carries its placeholder header line ([#25467 cut 7] HEADER PLACEHOLDER), while its host interface's docblock says "See the module header for which members are getters". This PR writes the cut 8 module's header and does not touch cut 7's file, which is outside this claim's file surface. Carrier: [maintainer] refactor(metadata-protocol): splitsrc/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467.Carry-forward
Unchanged from cut 7: public members whose return type is inferred, the bodies kept by a reader (
probeRecord,getMetaItemCached,findReferencesToMeta,packagelessAddress,refuseUnmintableMetaType,metaTypeNamespaceExists,viewContainerNameCollisionRefusalwithoverlaidShippedContainerViewNames,reportPageRequiresAbsentAtLoad, the 7applyRegistryWriteThroughcallers), and the private-static readers stay inprotocol.ts.Generated by Claude Code