You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
domain:cliRetired 2026-10-22, alias of domain:server (cli surface); in-flight cards keep it until they landenhancementNew feature or requestpm:dispatchedDispatched to a dev agent by /pm-dispatch
domain:cliRetired 2026-10-22, alias of domain:server (cli surface); in-flight cards keep it until they landenhancementNew feature or requestpm:dispatchedDispatched to a dev agent by /pm-dispatch
Activity
os-zhuang commentedon Aug 4, 2026
E4(#5091 / PR #5135)交接契约 —— 本单要接的那几根线
E4 已把策略链落在
packages/runtime/src/endpoint-policy.ts,并在api-endpoint-step.ts的命中分支里调用。按 R3 文件面切分,E4 不碰dispatcher-plugin.ts,所以下面这两根线留给本单接:1. 兜底器要把策略上下文喂给派发步。
AppEndpointStepInput.policy目前是可选的,兜底器没传 —— 没传时终态答复仍是 501,因此今天不存在「未经策略就被服务」的请求;但本单把 501 换成执行的同一次改动必须同时传它,否则执行会落在一个策略没跑过的分支上。上下文形状(EndpointPolicyContext):headers/remoteAddress:直接取兜底器的req(E3 已备好remoteAddress);resolvePrincipalId:用security/resolve-session-principal.ts的resolveSessionPrincipalId(authService, headers)—— 与 server 级限流器、dispatcher 具体路由挂载同一个查询,别新起一个;limiters:createEndpointRateLimiterRegistry({ resolveCache: () => safeGetService('cache'), logger })—— 在start()里建一次,不要每请求新建(每请求新建会让每端点桶的降级 warn 重复刷屏,且限流器缓存失效);trustProxy:透传config.rateLimit?.trustProxy === true,与 server 级读同一份声明,不造第二个信任开关。2. 兜底器要写出
answer.headers。AppEndpointStepAnswer新增了headers?(429 的Retry-After走这里);现在的兜底器只写status+ securityHeaders +json,会把它丢掉。一个丢了Retry-After的 429 对客户端等于没说话。3.
cacheTtl的头怎么用。 卡面问「E4 落地时如何暴露以其模块文档为准」——答案:不在 501 上应用,挂在裁决对象上。applyEndpointPolicies返回{ verdict: 'pass', principalId?, responseHeaders },responseHeaders即{'Cache-Control': 'private, max-age={秒数}'}(或no-store,或空对象)。理由:Cache-Control描述的是尚不存在的成功响应体,让客户端缓存一个 501 比什么都不说更糟。本单把执行结果的成功答复合成时,把responseHeaders并进去即可;verdict.principalId也顺带给了执行委派,不必再查一次会话。4. 落点位置是结构性的。 E4 把执行落点安排在策略链之后的分支里,而该分支在没有策略上下文时不可达 —— 本单加执行调用时没有别的地方可放,这正是「接了执行、忘了策略」不可能发生的原因。请保持这个形状,别把执行提到
applyEndpointPolicies之前或与之并列。5. 集成测试。
dispatcher-plugin.endpoint-fallback.integration.test.ts目前只有 E3 的否定断言(E4 未扩它 —— 兜底器没喂上下文,策略用例在真实 boot 里还构造不出来)。本单接上线后,401 / 429 短路两条真实 boot 用例是本单卡面第 3 条的应有之义。Generated by Claude Code
os-zhuang commentedon Aug 4, 2026
认领 —— PM 会话
session_01EYGdmvWP1ieZSLqvAW6uyd(执行器车道),分支claude/issue-5129-wire-endpoint-chain,即刻派发。前置齐备:E4(a70cd0a)/ E5(277eb36)均落 main,复核毕。文件面声明(#4604):
packages/runtime/src/dispatcher-plugin.ts(兜底器喂EndpointPolicyContext+ 写出answer.headers+ limiter registry 构建)、api-endpoint-step.ts(策略通过分支的 501 →executeEndpointTarget)、dispatcher-plugin.endpoint-fallback.integration.test.ts扩展、route-ledger.ts注记更新、changeset。移交契约以本单此前 E4 评论 + PR #5136 正文「接线单」段为准。Generated by Claude Code
feat(runtime): 端点链接线 —— 策略 → 执行,兜底器全上下文 (objectstack-ai#5129) (object…