feat(runtime): /keys /storage /ui 三域 handler 体抽出 — ADR-0076 D11 步骤③ PR-3 (#2462) - #3522
Merged
Merged
Conversation
…ADR-0076 D11 step ③ PR-3 (#2462) Batch 3 of the per-domain decomposition, same pattern as PR-2: - domains/keys.ts carries the zero-tolerance sys_api_key mint contract (user_id pinned, body whitelisted, raw key returned once); the legacy branch's '/keys?' query-string form is reproduced with a second registry entry next to the segment match. - domains/storage.ts drops the strictly-redundant `|| this.kernel.services?.['file-storage']` leg: resolveService's fallback chain already ends at the services map, and under Map-shaped services the index access returned undefined anyway. - domains/ui.ts is a straight move. - DomainHandlerDeps grows getObjectQL (env-scoped, registry-shape checked) — needed by /keys now and /data /meta when they migrate. - Unused generateApiKey import removed from the dispatcher. Verified: seam suite 25 tests, runtime 630 green, http-conformance 41 cross-adapter assertions green, 25-package 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:
|
6 tasks
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 步骤③,系列第三刀)
复制 PR-2(#3507)模式的第三批:
/keys、/storage、/ui三个 handler 体从 dispatcher 抽到domains/独立模块。改动
domains/keys.ts:完整搬迁sys_api_key铸造的零容忍安全契约(user_id 钉死调用者、body 白名单、raw key 仅返回一次、hash 不进日志)。旧分支的'/keys?'query-string 变体用第二条注册项精确复刻(segment 匹配 +/keys?prefix 两条)。domains/storage.ts:删除严格冗余的|| this.kernel.services?.['file-storage']第二腿——论证:resolveService的 fallback 链本就终于 services map;且当 services 为 Map 形态时索引访问恒 undefined(该腿本就是死的),object 形态时与 resolveService 末步重复。domains/ui.ts:直搬。DomainHandlerDeps扩展getObjectQL(env-scoped + registry 形状校验)——/keys 现用,/data /meta 迁移时必需。generateApiKeyimport。验证
--force含 DTS 全绿。关联 #2462(D11 步骤③ PR-3)。剩余域:/share-links /packages(小)、/automation /actions /auth /meta /data /mcp /ai(大头)。
🤖 Generated with Claude Code