Repository navigation
refactor(metadata-protocol): move the bulk data writes (batchData, the *ManyData verbs) out of protocol.ts into protocol-batch-data.ts (#25467 cut 1) - #25494
Conversation
…l.ts into protocol-batch-data.ts Sixteen ObjectStackProtocolImplementation method bodies (batchData and its atomic path, createManyData, insertManyData, updateManyData, deleteManyData, the three per-row loops and the response builders) move unedited into protocol-batch-data.ts, in the host shape rest-server.ts's split set. The class keeps every method, docblock and signature; each body becomes a literal of the members it reads plus a .call. mergeDroppedFieldEvents and rowOperationFailureFallback, read only by the moved bodies, move with them; byIdUpdateRecord, rowRequiredIdError, toRowApiError, BatchDataRowResult and BatchDataLoopOutcome gain `export` in place (index.ts exports from protocol.ts by name). Move-only: no behaviour change. Claude-Session: https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C Co-authored-by: Claude <noreply@anthropic.com>
…-refusal scan at protocol-batch-data.ts The batchData atomic path the protocol.ts ADR anchor entry's ADR-0119 paragraph describes now lives in protocol-batch-data.ts, so that module gets its own entry carrying the paragraph verbatim (the protocol.ts entry is unchanged; ADR-0119 is still cited there). The bracketed-refusal opener scan follows the moved throw sites with a per-file floor. Claude-Session: https://claude.ai/code/session_01J8pUyVs5eas1AjMdReJM7C Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 8 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 1e8ce95e439bc71ea15309f8c02217be6c10a526 && git checkout 1e8ce95e439bc71ea15309f8c02217be6c10a526
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ea33919f56a9879f95a00d45418385ff7dbb974f b55faf2162692c6ad242840692a7e00e29361487 && git checkout -B drift-repro ea33919f56a9879f95a00d45418385ff7dbb974f && git merge --no-ff b55faf2162692c6ad242840692a7e00e29361487
node scripts/docs-audit/affected-docs.mjs --json ea33919f56a9879f95a00d45418385ff7dbb974f
|
|
os-dev-report |
席位核对 · ACCEPT · 2026-10-23T16:53Z
Generated by Claude Code |
Requested by Sales · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 1 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840): the card's "batch and*Manydata" section, the seat's suggested first slice (1,067 lines, 33 of them from the last 30 days). The claim is6368300459. SixteenObjectStackProtocolImplementationmethod bodies move unedited into a new module,packages/metadata-protocol/src/protocol-batch-data.ts:batchData(with its ADR-0119 atomic path),createManyData,insertManyData,updateManyData,deleteManyData;runAtomicBatchData,runAtomicBatch,runBatchDataLoop,reconcileStoppedBatch,locateBatchCause,buildBatchDataResponse,buildRolledBackBatchResponse,runUpdateManyLoop,buildUpdateManyResponse,runDeleteManyLoop,buildDeleteManyResponse.triggerAutomationsits between them in the class but is not batch code, and stays.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, cut fromorigin/mainatab510f42e7(the claim'sab510f4c43is a typo for this commit). 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 21 open PRs touched
protocol.ts(each PR's file list read againstorigin/main; #25451 touches onlyprotocol.runtime-authoring-gate.test.ts). Re-measured just before this PR was opened, on all 18 open PRs: none touchesprotocol.ts(the Version Packages PR onlyCHANGELOG.mdandpackage.jsonin this package).The shape (#23050 shape B, as #25222, #25223 and #25224 apply it)
.d.ts. Each body is now one host literal plusfn.call(host, …), marked[#25467 cut 1];locateBatchCausereads no member and is called directly. Theasyncmethods dropasyncand return the moved function's promise.BatchDataHostis new. It types 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), and the stub annotates its literal asThisParameterType<typeof fn>. 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 a body reaches, and the moved bodies that call one another (batchData→runAtomicBatchData→runAtomicBatch→ the loop → the builders) do so through the protocol, as before. The members passed this way:assertObjectRegistered,assertRecordExists,probeRecord, and the moved methods themselves.engine, goes as a getter, so each read happens when the body makes it (tests replace it on a constructed protocol).applyPublishBackfill(this.updateManyData(), still calls the class method.Module-level declarations.
mergeDroppedFieldEventsandrowOperationFailureFallbackare read only by the moved bodies. They move with them, unedited, docblocks included, and stay unexported.byIdUpdateRecord,rowRequiredIdError,toRowApiError,type BatchDataRowResultandtype BatchDataLoopOutcomeare also read by code that stays, so they stay and gainexportin place, the only edit to each. The module imports them back from./protocol.js.src/index.tsexports from./protocol.jsby name, so none of them is published. Measured below: the.d.tsand the export lists do not move.engineCanRollBackandrecordNotFoundError(@objectstack/core),omitInternalFieldsFromWriteResponse(./write-response-internal-fields.js) and the spec types the bodies name, from the same specifiersprotocol.tsuses.protocol.tskeeps all its imports (each still has readers there).The published
.d.tsdoes not changeUnder the series bar (ruling
6348891160), measured on baseab510f42e7and on the head, both built against the same dependency tree (a fullturbo run buildat base, 77/77 tasks, thenpnpm --filter @objectstack/metadata-protocol buildat head):dist/index.d.tsanddist/index.d.cts, base and head, all four the same:8e1a224c7d5a800c65c0174f9bc2245b70e0bab2106ab8dbf8a4b2dedd4ca35f. The raw diff is 0 lines.5b98a8e857554959f7561563d6a0742110c5d3d8ad6119065ed5a69b0bc06f95. The normaliser, run frompackages/metadata-protocol:dist/index.d.ts: line 1348,private engine;, made public (engine;) gives raw66d80e4206a14b2b7e76dc37496d347d9dd39f53c66d016966844e707992e5acand normalisedf40390e5c426e0c6e24523cd6908726d3f3cab87f9a4ac36df20992bec04da95, both different from the real hashes.import()andrequireof the built bundles). The sorted list hashese47ac7c753bcb8bee1e79c1a5f79f7394cf030bd526de81ea8bcbfcb71fa024aon all four.No changeset:
skip-changeset, per ruling6348891160.Proof of move-only
getChildrenleaves, so template literals scan correctly): each 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 on all sixteen. The two moved declarations are token-identical and their docblocks byte-identical. 3,982 tokens compared, 0 differ. Negative control: one changed token inbatchDatamakes the check report a difference.async.protocol.ts: 249 of the 256 base statements other than the class are byte-identical. The others: the fiveexportadditions above, and the two declarations that moved. The one new statement is the import of the new module.protocol.tsgoes from 33,065 to 32,468 lines (each stub keeps its docblock and carries its host literal, so the file shrinks by less than the bodies' length);protocol-batch-data.tshas 944.Readers of the moved lines, migrated in this PR
protocol.tsentry inscripts/adr-anchors/carries an ADR-0119 paragraph that describesbatchData's atomic path, which now lives in the module. As in the [maintainer] refactor(plugin-security): splitsrc/security-plugin.ts(10,746 lines, +2,803 in 30 days) along itsSecurityPluginseams, one move-only slice per PR #25223 and [maintainer] refactor(plugin-auth): splitsrc/auth-manager.ts(10,338 lines, +1,867 in 30 days) along itsAuthManagerseams, one move-only slice per PR #25224 cuts, the module gets its own entry (packages__metadata-protocol__src__protocol-batch-data.ts.json) carrying ADR-0119 and that paragraph verbatim. Theprotocol.tsentry is unchanged, and ADR-0119 is still cited inprotocol.tsoutside the moved text.check:adr-anchors: 80 → 81 anchored files, decision-letter citations on the anchored surface 2,001 → 2,001.protocol.bracketed-refusal-opener-absence.test.ts. It scans each producer file's source for refusals opening with a bracketed tag, with a per-filenew Error(floor so a scan that finds nothing cannot pass for free. The moved text holds 4new Error(sites, so the module joinsPRODUCERSwith a floor of 4. Without it those throw sites would have left the scan silently.protocol.tskeeps its floor of 5.docs/adr/0119-…mdanchorsprotocol.ts#batchDatatwice. The method shell stays, so it still resolves (check-adr-symbol-anchorsat both ends below).protocol.write-response-internal-fields.tripwire.test.tsenumerates*Datamethods on the prototype at runtime; the stubs keep every name.protocol.read-verb-canonical-fold.test.tsand the other source scans that read./protocol.ts(register-item,lookup-artifact-itemandview-expansion-reconcilecall-site pins,query-transport-dialect,object-registry-write-through-spelling,hydrate-overlay-canonical-type, the two recovery-door pins): none of their patterns occurs in the moved text, and all pass at head.scripts/engine-double-contract.seams.jsonnamesprotocol.tsrows fordeleteDataandupdateDataonly, which stay.scripts/query-options-erasure-baseline.jsoncountsprotocol.tsat 6: the moved text has no enginefind/findOne/count/aggregatecall, so no counted site moves.isSystemread sits in the moved text (system-context census).metadata-protocolwrite site (238 sites at base and head, 0 in this package); it exits 0 at both ends with no--write.Verification
tsc --noEmit(package) exit 0;eslinton both source files exit 0.packages/metadata-protocolsuite: base 21,466 tests (21,447 passed, 0 failed, 19 skipped, 1,181 suites); head 21,467 (21,448 passed, 0 failed, 19 skipped, 1,181 suites). Compared per test name and status: no test lost, none changed status; the one added test is the newPRODUCERSrow's case.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-absence(2) andscripts/liveness/evidence(42),clientandrestdiscovery-double-retired-key(3 + 2);spec check:livenesspasses.check-adr-symbol-anchors(2,384 anchors resolve at both),check-adr-anchors,check-tenant-audit-census,check-platform-checklist.origin/mainatea33919f56(feat(lint)!: refuse a bulk action's confirmText hole over an unbound root, a single-brace token, a hole holding logic and a blank sentence at validate, compile and the publish gate #25451 had added a test file in this package; nothing else in the package moved): rebuilt the package closure (13/13), packagetscexit 0, suite 21,476 tests (21,457 passed, 0 failed, 19 skipped, 1,182 suites; the 10 added are feat(lint)!: refuse a bulk action's confirmText hole over an unbound root, a single-brace token, a hole holding logic and a blank sentence at validate, compile and the publish gate #25451's file and the newPRODUCERScase),dist/index.d.tsstill8e1a224c….dispatch-gates --commands --changed: 67 derived gates, 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