Repository navigation
refactor(metadata-protocol): move the metadata list reads, the audit read and the UI-view read through the protocol host (#25467 E2 cut 1a) - #29548
Conversation
…generic and plain stubs as stubs, and refuses to move a stub again Claude-Session: https://claude.ai/code/session_01ADHkmR4MjTzeUv5x6tNkbk Co-authored-by: Claude <noreply@anthropic.com>
…read and the UI-view read through the protocol host getMetaItems, getMetaItemsForExecution, getMetaItemsPerPackage and readFlattenedMetaItems move to protocol-meta-list-reads.ts; auditMetaItem and getUiView to protocol-meta-audit-ui-view.ts. Each method stays on the class as a stub. The lookupArtifactItem call-site pin reads the list read's site and envelope line in its new module, and the host factory's closure. Claude-Session: https://claude.ai/code/session_01ADHkmR4MjTzeUv5x6tNkbk Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmR4MjTzeUv5x6tNkbk Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmR4MjTzeUv5x6tNkbk Co-authored-by: Claude <noreply@anthropic.com>
…n reads moved bodies in the split's modules Claude-Session: https://claude.ai/code/session_01ADHkmR4MjTzeUv5x6tNkbk Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 56 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 721fad5347654765cd53c2db86f391820720b92c && git checkout 721fad5347654765cd53c2db86f391820720b92c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 390bd2aedca2aa46776ae52380eb11577f2bea87 ec53149fffdddb66737ecd919a00caf4586f3c8d && git checkout -B drift-repro 390bd2aedca2aa46776ae52380eb11577f2bea87 && git merge --no-ff ec53149fffdddb66737ecd919a00caf4586f3c8d
node scripts/docs-audit/affected-docs.mjs --json 390bd2aedca2aa46776ae52380eb11577f2bea87
|
|
domain:server#5 · os-steve · session_01ADHkmQKwKFCp1m6Pb6Q8c1 维护者速读
席位意见:与 E2 派发相符。被迫改动的两个按路径钉断言的内容不变,只是把读取范围扩到拆出的模块,并加了非空校验。 席位核对ACCEPT ·
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 41505246058 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Steve · project thread
Part of #25467
Clause-②: no
Metadata-protocol: none
维护者速读
protocol.ts里“元数据读取”一节的前半(列表读取getMetaItems及其两种变体、共享的readFlattenedMetaItems,外加auditMetaItem、getUiView)的方法体,经 E1 的宿主机制原样搬进两个新模块;6 个方法仍留在类上(签名与文档不变),方法体变成一行转发。src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 裁决 E 的 E2 第 1 节(按席位裁定拆成 1a/1b,每个 PR 1,000–3,000 行),在声明的protocol.ts冻结日落地;1b(单项读取、分层读取)随后另开。this.读作host.”之外 AST 与文本全同;对外index.d.ts(ESM 与 CJS)与 main 构建出的逐字节相同,getMetaTypes()的推断类型块也逐字节相同。回滚即整体 revert。packages/metadata-protocol/src/protocol-meta-list-reads.ts文件头;protocol.ts里 6 个方法的转发体与类static {}块新增的宿主条目;protocol.lookup-artifact-item-call-sites.test.ts的改动。cd packages/metadata-protocol && node scripts/host-split.mjs check origin/main readFlattenedMetaItems protocol-meta-list-reads.ts,预期"ok":true,"textIdentical":true。What changes
Step E2, section 1 "metadata reads", part 1a of ruling E (6537939895), on the
protocol.tsfreeze day seat 5 declared (#28677). Seat 5 split section 1 into 1a and 1b to keep each PR within ruling E's band of 1,000 to 3,000 lines. This is a pure application of the E1 host pattern: no logic changes, and no new rewrite kind.this.xtohost.x)getMetaItemsprotocol-meta-list-reads.tsgetMetaItemsForExecutionprotocol-meta-list-reads.tsgetMetaItemsPerPackageprotocol-meta-list-reads.tsreadFlattenedMetaItems(809 lines)protocol-meta-list-reads.tsauditMetaItemprotocol-meta-audit-ui-view.tsgetUiViewprotocol-meta-audit-ui-view.tsEach method keeps its docblock, modifiers and signature on the class; its body becomes
return fn(protocolHost(this), …).ProtocolHostand the class's static block gain 26 entries (the members those bodies read;engine,environmentIdandgetServicesRegistryare read-only getters, the rest are call-time closures).node scripts/host-split.mjs check origin/main MEMBER MODULEreadsok: true, textIdentical: truefor all six. Negative control, withlayer === 'effective'changed to!==inreadFlattenedMetaItems's moved body, then restored:protocol.tsdrops seven import names only the moved bodies used (ITEM_KEY_DISCRIMINATORS,decorateMetadataItems,soleShippingPackage,isActionWithheldByDisabledPackage,viewIdentityPatch,perPackageLayerEnvelope,storedEntryRow); each module imports what its bodies read from whereprotocol.tsimports it. No import comment was dropped: the one attached comment ([#7774]) also coversitemDiscriminator, which stays.The tool (
scripts/host-split.mjs). Measuring this section showed the survey misread two stub shapes, so its E1 note of "9 local named hosts" was wrong.stubKindOfnow recognises:fnwith an explicit type argument, then.call(host, …);return fn(…)passing exactly its own parameters, which is a body that read no member and moved earlier.movenow refuses a member that is already a stub. Before this, it would have "moved"throwMetadataServiceUnavailableandnamesWithOwnStoredRow, which are already plain stubs. The survey now reads 174 stubs and 4 refusals. Two of the refusals are mixed stubs (packagelessOverlayWriteRefusal,namedBaseOverlayWriteRefusal), and the other two arereconcileViewExpansions(a private static field) andpublishPackageDrafts(a barethis); none of the four is in section 1. Three new tests cover this, andhost-split.test.mjsreads 38 tests. Ablation, deleting the instantiation-expression unwrap, then restored: 2 failed (expected undefined to be 'call';refuses to move stubbedGeneric again).Forced test edits
Two by-path pins now read through the split. What each asserts is unchanged.
src/protocol.lookup-artifact-item-call-sites.test.ts:readFlattenedMetaItemssite row carriesfile: 'protocol-meta-list-reads.ts', where its body now stands.static {}block, and a row records the host factory'slookupArtifactItemclosure there. It has dispositionno, because it forwards the moved bodies' calls unchanged. This is the same reasoning as cut 15'sshippedArtifactsOf...arow.const itemPackageId = envelopePackageId(packageId, it);inprotocol-meta-list-reads.ts. It also requires that module to importenvelopePackageIdfromprotocol-package-bindings.tsand to define no copy.Ablation, with that line changed to
const itemPackageId = packageId;in the module, then restored:Tests 1 failed | 5 passed (6),expected '// Copyright …' to contain 'const itemPackageId = envelopePackage…'.src/protocol.hydrate-overlay-canonical-type.test.ts(#9111's closed caller set ofhydrateOverlayIntoRegistry): the full suite found it red after the move (expected [ …(2) ] to have a length of 3 but got 2), because one of the three calls now stands inreadFlattenedMetaItems's moved body ashost.hydrateOverlayIntoRegistry(. The pin now countsthis.calls in protocol.ts plushost.calls in everyprotocol-*.tsmodule, still exactly 3, and requires that at least one is read in a module. Ablation, planting a fourthhost.hydrateOverlayIntoRegistry(call inprotocol-meta-audit-ui-view.ts, then restored:Tests 1 failed | 10 passed (11),expected [ …(4) ] to have a length of 3 but got 4. A bare reference that is not a call (void host.hydrateOverlayIntoRegistry) does not count: 11 passed.The read-verb pin (
protocol.read-verb-canonical-fold.test.ts) and the read-seam census needed no edit: E1's resolution follows the new stubs. Read-verb ablation, dropping the fold fromgetMetaItemsForExecution's moved body, then restored:Tests 1 failed | 17 passed (18),expected [ 'getMetaItemsForExecution' ] to deeply equal []. The census reads 100 seams, the same as main 399df5b (read in a scratch worktree of main).The published
.d.tsBuilt from main 399df5b (this branch's merge of main) and from this head.
index.d.tsis byte-identical: raw sha256450c9334…5d744eon both sides, ESM equal to CJS, normaliser 28d160c2b…78065on both. The raw diff ofgetMetaTypes()'s emitted block (793 lines, its return type still inferred per the seat's E1 ruling) is empty.The declaration-emit comment leak into that inferred type struck once after the cut: the
[#23316]docblock printed insidekey?. It was cleared the way E0 and E1 cleared it, by the length of the new import comment above the leaking offset. A probe of +1 to +8 characters read raw-equal at +3 to +6; the comment carries +5 (the word "also").Serial
Re-read just before opening against main 390bd2a (6 commits past this branch's merge of main, none in
packages/metadata-protocol;git merge-treewith main is clean). Open PRs whose own diff touchesprotocol.tsor aprotocol-*.tsmodule:protocol.tsandprotocol-credential-carry-forward.ts): its hunks sit at main lines 355 (the import list), 3739 to 3742 (carryForwardRedactedCredentials) and 17167 onward (saveMetaItem), all outside the moved section (main lines about 3851 to 7057).git merge-treewith this head is clean.protocol-save-door-refusals.tsonly):git merge-treewith this head is clean.Seat 3's #29390 work (branch
claude/project-thread-gvqm55, head d776e25, no PR yet): its hunks sit at main lines 22104 and 22457 (the restore limb), outside the moved section.git merge-treewith this head is clean.Gates
On ec53149:
node scripts/pm/dispatch-gates.mjs --commandsderived 62 commands, and each recordsexit 0.--ranreports 62 derived, 62 run, 0 NOT-MEASURED, 0 UNRUN. The package's typecheck and test, through os-verify-lock, read Test Files 307 passed, 4 skipped; Tests 22232 passed, 26 skipped. The 11 direct dependents' typecheck exits 0. Lint (eslint packages/metadata-protocol --no-inline-config) exits 0. CI is not read.Generated by Claude Code