feat(runtime): /packages 域 handler 体抽出(最大单域)— ADR-0076 D11 步骤③ PR-5 (#2462)#3537
Merged
Conversation
…1 step ③ PR-5 (#2462) The largest extraction so far: handlePackages (~470 lines) plus its two EXCLUSIVE helpers assemblePackageManifest and applyPublishedSeeds (~190 more) move to domains/packages.ts. resolveActiveOrganizationId stays on the dispatcher (metadata-domain call sites share it) and is exposed through deps instead. DomainHandlerDeps grows: errorFromThrown (spec-validation issues carry through as field-anchored 422s), resolveActiveOrganizationId, announceKernelEvent (the metadata:reloaded publish announcement — the domain keeps the changed-list check, the deps side owns the trigger-existence check), and optional logger (seed-loader falls back to console as before). The dynamic './seed-loader.js' import moved to '../seed-loader.js' (the PR#2415 lesson: dynamic imports are the extraction landmine — this time the import moved WITH the caller). Step-② (#3142) single-pipeline behavior preserved; the '/packages' bare-startsWith match is reproduced as-is. Verified: seam suite 34 tests (4 new incl. the 409 duplicate-install guard + ?overwrite=true), runtime 639 green, http-conformance 41 green, dependent closure builds with DTS (--force). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机(#2462 D11 步骤③,系列第五刀)
抽出
/packages——迄今最大单域(~680 行):handlePackages 本体 + 两个独占 helper(assemblePackageManifest离线导出、applyPublishedSeeds发布后种子落地)。覆盖 list/install/enable/disable、ADR-0033 草稿 publish/discard、ADR-0067 commit 历史与回滚、ADR-0070 export/认领孤儿/复制、删除。改动
domains/packages.ts(679 行):体逐字搬迁;setPackageDisabled/PLURAL_TO_SINGULARimport 随体走;动态'./seed-loader.js'import 改'../seed-loader.js'(PR#2415 的教训——动态 import 是搬迁暗雷,这次随调用方一起搬)。resolveActiveOrganizationId留 dispatcher(metadata 域多处共用)经 deps 暴露。DomainHandlerDeps扩四项:errorFromThrown(spec 校验 issues 透传为字段锚定 422)、resolveActiveOrganizationId、announceKernelEvent(发布后metadata:reloaded广播——changed 判断留域侧、trigger 存在性判断进 deps)、可选logger。/packages裸 startsWith 匹配原样复刻。验证
接缝套件 34 测试(新增 4:列表 / 无 registry 503 / 409 重复安装护栏 + ?overwrite=true / 缺 id 400);runtime 全量 639 绿;http-conformance 41 断言绿;下游闭包
--force含 DTS 全绿。关联 #2462(D11 步骤③ PR-5)。小体量域至此全部迁完;剩余全是大头:/automation /actions /auth /meta /data /mcp /ai。
🤖 Generated with Claude Code