Repository navigation
refactor(metadata-protocol): move the legacy-organization row filters out of protocol.ts into protocol-legacy-organization-rows.ts (#25467 cut 29) - #27029
Conversation
… out of protocol.ts into protocol-legacy-organization-rows.ts (#25467 cut 29) Move-only, shape B. withoutLegacyOrganizationRows and legacyOrganizationRowsOf move, unedited, into one module. The engine field is handed over as a getter; withoutLegacyOrganizationRows's call to legacyOrganizationRowsOf is handed over as a closure, so it still reaches the class method. Claude-Session: https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 10 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 274108d9a1b5bf7de5a4bb3a90d1ff37d919779c && git checkout 274108d9a1b5bf7de5a4bb3a90d1ff37d919779c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a90163d4779204abb010767c2a092e52dbecafae ad684a0ce37258c42b9b5595fb761847642b8da0 && git checkout -B drift-repro a90163d4779204abb010767c2a092e52dbecafae && git merge --no-ff ad684a0ce37258c42b9b5595fb761847642b8da0
node scripts/docs-audit/affected-docs.mjs --json a90163d4779204abb010767c2a092e52dbecafae |
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #25467 (cut 29). 2 files: protocol.ts and one new module for the claimed theme, protocol-legacy-organization-rows.ts (withoutLegacyOrganizationRows, legacyOrganizationRowsOf). skip-changeset (move-only). Clause-②: no, Metadata-protocol: none. |
| Move check (seat) | All 9 non-blank lines the PR removes from protocol.ts are found verbatim (indent-stripped) in the new module. The added lines in protocol.ts are the import with its header comment and two stubs, each through LegacyOrganizationRowsHost: engine is handed over as a getter, withoutLegacyOrganizationRows reaches legacyOrganizationRowsOf through the class member, and the generic stub calls (withoutLegacyOrganizationRows<R>).call, the instantiation form cut 11 used. Callers and overrides still go through the class. findEnvironmentRow stays, as claimed. |
| Evidence | CI green on head ad684a0ce3 (34 success, 17 skipped, 0 failed). Governed check: NOT governed, 96 changed lines. The report gives an AST compare of 187 tokens with 0 differ (each negative control differs by 1), raw and sorted-union .d.ts identity (ruling 6348891160) at both ends and on merged vs main, the suite at 21,748 tests identical, the read-seam census at 89 with an identical --list at base, head and merged, and 46 of 46 derived gates. |
| Overlap | The claim named #26920. Its merge-tree with this head is clean, tsc on that merged tree exits 0, and the moved bodies still compare 187/0. All five open PRs touching the package are clean against it. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once every check on this head is green or an expected skip. |
Generated by Claude Code
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 40631228200 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Leehom · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 29 of the
protocol.tssplit (#24586 ruling A, recorded in6270097840). Cuts 1–28 landed as #25494, #25518, #25538, #25589, #25601, #25623, #25642, #25719, #25731, #25740, #25797, #25939, #25972, #26014, #26104, #26168, #26264, #26317, #26350, #26366, #26404, #26449, #26654, #26704, #26807, #26873, #26933 and #26980. The claim is6457847737. It takes the cut 29 proposal of the cut 28 report (6456729821), a themed pair. Both members passed the AST screen and the read-seam census, and both moved unedited.Two
ObjectStackProtocolImplementationmembers move unedited into one new module,packages/metadata-protocol/src/protocol-legacy-organization-rows.ts(#23050 shape B). They are the legacy-organization row filters. On a database the ADR-0131 ceremony has not migrated, these find the rows that still belong to one organization rather than to the environment:legacyOrganizationRowsOf: those rows of one table, read off the physical column through the table's driver. A read inside a transaction joins it.withoutLegacyOrganizationRows: a row list with those rows left out.findEnvironmentRowstays in the class, as the claim says: a census trial moving it dropped the count 88 → 81 in the cut 28 report.protocol.tsgrows by 4 net lines (29,384 to 29,388): 9 body lines left, and 11 stub lines plus the 2-line import came in. The cut is move-only, and the card stays open for later cuts.Branch
claude/project-thread-ybjm3his the harness-pinned branch for this thread. It was restarted frommain3271a0834c(after cut 28's merge). It names no issue, so the claim comment is the identity record. It holds the move commit0522e4d4eaand, as the claim asked, one merge ofmain,ad684a0ce3(7 commits). That merge touches nothing inpackages/metadata-protocol/. The merged tree was still measured againstmain(see "The merged tree againstmain").Serial with the file's in-flight PRs
The claim named #26920 as the open PR that also edits
protocol.tsand asked for agit merge-treeagainst it before this PR was opened.380f37a55a) editsprotocol.tsat:16153–16206and:20256(+54 / −17), plus other files of this package. It names neither moved member. This cut's hunks are at:425(the import) and:10212–10225.git merge-treeagainst this headad684a0ce3is clean.git merge-treeto a tree, thentsc --noEmitinpackages/metadata-protocolon that tree exits 0. On it, the moved bodies still compare 187 tokens, 0 differ.mainalone is clean too.All 30 open PRs were checked against this head as well. Five touch this package (#26937, #26920, #26831, #26556, #26517), none names either member, and every one is merge-tree clean against this head and against
main. #26831's earlier conflict withmainis gone.mainhas not moved since the merge (0 behind at the derivation).The order's screen (private statics,
new Error(, the read-seam census)Both members passed:
ObjectStackProtocolImplementationidentifier and none onthis.constructor.new Error(, so noPRODUCERSrow is owed.check-durability-degradation-log-level --listwas taken on the base and again on the cut. Both read89 read seam(s), the base the claim quotes, and the lists are identical once[@:][0-9]+is stripped. The full readings are under "The durability--list".What moves
withoutLegacyOrganizationRows<R>:10212legacyOrganizationRowsOf(method)legacyOrganizationRowsOf:10218engine(field); module-levelreadLegacyOrganizationRowsprotocol-legacy-organization-rows.tshas 74 lines.The shape (#23050 shape B, as cuts 1–28 apply it)
[#25467 cut 29].LegacyOrganizationRowsHosttypes the two members the bodies read as the class members themselves (ObjectStackProtocolImplementation['engine']and['legacyOrganizationRowsOf']). Each function'sthisis aPickof the members it reads.enginefield is handed over as a getter, so the read finds it at call time, as before.withoutLegacyOrganizationRows's call tolegacyOrganizationRowsOfis handed over as a closure,(...a) => this.legacyOrganizationRowsOf(...a), as the claim asked. So that call still reaches the class method (now its stub), not the moved function directly.(withoutLegacyOrganizationRows<R>).call(host, table, rows, context), as cut 11 did formaterializeFromRegistry<T>. So the stub still returnsPromise<R[]>, notPromise<unknown[]>.withoutLegacyOrganizationRows:findEnvironmentRows(:10185, base).legacyOrganizationRowsOf:findEnvironmentRows(:10190),findEnvironmentRow(:10206),withoutLegacyOrganizationRows(above) and:26506.Module-level declarations, by reader: no import leaves
protocol.tsMeasured by an AST walk over each body's identifiers, against
protocol.ts's top-level declarations and import bindings (property names excluded).The one module-level name the bodies read is
readLegacyOrganizationRows, from@objectstack/metadata-core. It has two other code readers inprotocol.ts(:21892and:28524, base), so it stays, and so does its[ADR-0131 D6/D7]import comment. The new module imports it from there too. So the top level ofprotocol.tschanges by the new module's import alone.The published
.d.tsThe series bar is ruling
6348891160: sorted-union identity, measured first, with raw identity reported when it holds. Both hold for this cut, including on the merged tree againstmain. The cut adds one import statement and its comment ahead of every class docblock, so the cut 25 comment-offset trap was watched. It did not fire: the raw hash is identical at both ends.Base
3271a0834cand head0522e4d4eawere built withpnpm --filter @objectstack/metadata-protocol buildagainst one dependency tree. The closure was built at head by a fullpnpm build(116/116). For the base build, the package'ssrc/was swapped tree-only to base (the new module removed) and restored fromHEADunder a trap. Afterwardsgit diff HEADwas empty,git statuswas clean, and both touched blobs equalledHEAD's.a9338265ddd795ccfd7fda56ee209f3c2e162f9153766351149994f20e92715fat both ends, ondist/index.d.tsanddist/index.d.cts. The normaliser sorted 80 string-literal union runs. Sorted-union identity holds.7307bcccb6026da6c004fa2daaca634d3419d202d6b742c122a7a3c64a552712at both ends, 781,687 bytes. Raw identity holds.index.jshashesa604e2fd4c5cb76c…at base and16b25c206072e2f3…at head (index.cjs5beb42aa247530b3…→7aec221248f758d4…).….call(hostgoes 0 → 1 for each of the two members in both bundles.function …(declaration goes 0 → 1.privatewas dropped fromlegacyOrganizationRowsOfon disk (restored fromHEADunder a trap) and the package rebuilt. Both.d.tsfiles move to38b33a942d07398f…(normaliseda0c35bd1e1a5b943…, which differs from the bar'sa9338265…) and printlegacyOrganizationRowsOf(table: string, context?: unknown): Promise<ReadonlyMap<string, string>>;. So the bar can see a change on these members.9f18a0177ac736ed…on all of them. Neither function, and notLegacyOrganizationRowsHost, appears.The merged tree against
mainThe merged tree
ad684a0ce3was measured againstmain7eb613c39f, its second parent, in the same way. The closure was rebuilt by a fullpnpm build(116/116), andmain's packagesrc/was swapped in tree-only and restored under a trap. The merged tree differs frommainonly by this cut: 2 files, +87 / −9..d.ts: raw7307bcccb6026da6…(781,687 bytes) and normaliseda9338265ddd795cc…, the same atmainand merged. Both identities hold.index.js:a604e2fd4c5cb76c…atmain,16b25c206072e2f3…merged. Export tables: 78 names,9f18a0177ac736ed…on both.main'sprotocol.tsagainst the merged one: 187 tokens, 0 differ.mainand merged both give 21,748 tests (21,722 passed, 0 failed, 26 skipped, 279 files), per test identical.No changeset:
skip-changeset, per ruling6348891160.The durability
--listcheck-durability-degradation-log-levelexits 0 at both ends with identical output:89 read seam(s)at both ends, the base the claim quotes. Its--listis identical once[@:][0-9]+is stripped (165 lines, and no entry changes file).try.legacyOrganizationRowsOfhands its read toreadLegacyOrganizationRows, and neither body calls the gate's read vocabulary (find/findOne/count).findEnvironmentRowsandfindEnvironmentRow, the seam members that call these two, stay in the class.89 read seam(s).Proof of move-only
Bodies, by AST token. The compare reads the TypeScript compiler's AST leaf tokens, with JSDoc skipped, over the parameters (less the added
this), the return type and the body. It compares baseprotocol.tsat3271a0834cagainst the head module:Negative controls, one per member. Each changed one token in an in-memory copy of the head module, and only the mutated member moved (differ 1; the other stayed 0):
protocol.ts. All 262 base statements are byte-identical, leading comments included. Head adds one statement, the new module's import.Readers of the moved lines
These were grepped for the two member names and for the bodies' distinctive text (
readLegacyOrganizationRows(,getDriverForObject):the 24 files that name
protocol.tsand callreadFileSync;the test files in
packages/,docs/qa/andscripts/;the
@objectstack/specliveness ledgers.By path: none reads a moved line.
Same names elsewhere, not readers.
sys-metadata-repository.tsandpackages/metadata/src/loaders/database-loader.tseach have their ownwithoutLegacyOrganizationRowsmethod on another class. As the claim says, those are not part of this cut.Behaviour, no edit owed. The doors that read through
findEnvironmentRows/findEnvironmentRoware driven by the package suite, which passes at both ends.readLegacyOrganizationRowsitself is tested inmetadata-core(legacy-organization-row.test.ts).The liveness ledgers. No row points at either member. Carried forward:
manifest.json'sdependenciesrow →protocol.ts#resolveWritePackageScope(cut 19), andseed.json→protocol.ts#applySeedBodies(cut 14). These arepackages/spec/**, outside this card.ADR anchors.
check-adr-anchorsexits 0 at both ends.Engine-double contract (
check-engine-double-contract): exits 0 at both ends.updateData/deleteDataseams keep their entries at new line numbers (14005 → 14009, 14030 → 14034).productionFilesis 3,819 at base and 3,821 at head. The +2 are the new file and the gitignoredpackages/spec/src/migrations/registry.tsthat the spec build writes in the head tree, as in cuts 20–28.Identical output at both ends:
check-adr-symbol-anchors,check-system-context-census,check-tenant-audit-census,check-query-options-erasure-ratchet,check-filter-alias-parityandcheck-durability-degradation-log-level.check-nul-bytesdiffers only in the scanned file count, +1. The base-end readings were taken in a clean detached worktree at3271a0834c.Verification
tsc --noEmitinpackages/metadata-protocolexits 0 at head, on the merged tree, and on the merge-tree with fix(metadata-protocol,runtime,app-shell)!: refuse a save or draft publish naming a package that is not installed #26920.pnpm exec eslint --no-inline-config packages/metadata-protocolexits 0 with no output (the whole touched package, with the rootlintscript's flags).packages/metadata-protocolsuite, compared per test name and status. Each leg ran vitest--maxWorkers=2with the JSON reporter under the shared verify lock.3271a0834c: 21,748 tests (21,722 passed, 0 failed, 26 skipped), 279 files.0522e4d4ea: 21,748 tests (21,722 passed, 0 failed, 26 skipped), 279 files.src/swapped tree-only from3271a0834c(the new module removed) and restored fromHEADunder a trap.ad684a0ce3andmain7eb613c39fboth give 21,748 tests, per test identical (0 lost, 0 added, 0 changed).check-platform-checklist --changed-from origin/main(merged tree): OK, 31 anchors judged, 0 lost.check-governed-merges --branch claude/project-thread-ybjm3hfinds 0 of 2 paths in the register (13 surfaces), so the PR is NOT governed. It has 96 changed lines, under the 3,000-line human-merge bar.dispatch-gates --commands --repo objectstack-ai/objectstackderives 46 gates on 2 changed paths fromad684a0ce3, with no stale-tree finding. All 46 exit 0 after the fullpnpm build(116/116).dispatch-gates --ranreports 46 derived, 46 run, 0 NOT-MEASURED and 0 UNRUN, and exits 0.Carry-forward
These stay in
protocol.ts:findEnvironmentRows,findEnvironmentRow,packagelessAddress,findServedOverlayRow,foldStoredCollection,applyObjectRegistryMutation,unmanagedImportCollisions,rollBackUnmanagedImport,readRevertableCommitandstoredFlowBindingAgrees.rethrowUnlessMetadataStoreUnprovisionedcannot move at all.probeRecord,getMetaItemCached,findReferencesToMeta,refuseUnmintableMetaTypeandmetaTypeNamespaceExists.viewContainerNameCollisionRefusalwithoverlaidShippedContainerViewNames, andreportPageRequiresAbsentAtLoad.applyRegistryWriteThroughcallers,readCodeLayerForCarryForward,ensureObjectStorage,dropObjectStorageandapplyRemoteMetadataMutation.emitMetadataMutation, andgetOverlayRepo.isArtifactBacked,isNestedArtifactFieldandpackagedArtifactBase(thelookupArtifactItemsite pins).refusePackagedBaseRemoval,packagedBaseRefusal,runPublishSideEffects,promoteDraftForPublish,publishPackageDraftsanddiscardPackageDrafts.warnClosureReadUnavailableandresolveSduiManifest.🤖 Generated with Claude Code
https://claude.ai/code/session_016SP1spj613tyGCgxoD1An6