feat(runtime): /share-links 域 handler 体抽出 — ADR-0076 D11 步骤③ PR-4 (#2462)#3533
Merged
Conversation
… D11 step ③ PR-4 (#2462) The ADR-0047 capability-token surface moves to domains/share-links.ts. This is cloud's designed PRIMARY surface for per-env kernels (registerShareLinkRoutes:false; host dispatcher serves after kernel swap — the #2462 step-① re-scope finding), so behavior preservation is the whole game here. - DomainHandlerDeps grows getRequestKernelService: reads off the per-request RESOLVED kernel (this.kernel), NOT the default kernel and NOT the scoped-factory path — the token row and shared record must live in the same store as the shareLinks service's engine. The domain-side getEngine keeps the original try/fallback shape. - deps also grows routeNotFound (the shared 404 envelope, 4 call sites in the dispatcher). - Dispatcher keeps a thin handleShareLinks delegate; duplicated JSDoc removed in favor of the domain module's copy. Verified: seam suite 30 tests (5 new: 501 absent-service, segment boundary, UNAUTHENTICATED, public token-resolve with redaction, ROUTE_NOT_FOUND envelope), runtime 635 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 步骤③,系列第四刀)
抽出
/share-links(ADR-0047 capability-token 分享面)。这是 cloud per-env kernel 的设计主面(registerShareLinkRoutes: false,host dispatcher 在 kernel swap 后服务——步骤① re-scope 的关键发现),行为保真是本刀的全部意义。改动
domains/share-links.ts:186 行体逐字搬迁(公共 resolve/messages 的 token 即授权语义、SYSTEM_CTX 取记录 + redactFields 剥除、管理路由鉴权分层全保留)。DomainHandlerDeps扩两个方法:getRequestKernelService——从 per-request 已解析 kernel 读服务(非 defaultKernel、非 scoped-factory 路径):token 行与被分享记录必须和 shareLinks 服务绑定的 engine 同库。域侧 getEngine 保留原 try/fallback 形状。routeNotFound——共享 404 envelope(dispatcher 内 4 处使用)。验证
接缝套件 30 测试(新增 5:无服务 501 / segment 边界 / 匿名 UNAUTHENTICATED / 公共 token-resolve 含 redaction 剥除 / ROUTE_NOT_FOUND envelope);runtime 全量 635 绿;http-conformance 41 断言绿;下游闭包
--force含 DTS 全绿。关联 #2462(D11 步骤③ PR-4)。剩余域:/packages(下一刀)+ 大头(/automation /actions /auth /meta /data /mcp /ai)。
🤖 Generated with Claude Code