docs(runtime,metadata,rest): 摘除已失真的「structurally unreachable until the E7 flip」注释族 + 多租户 decline 分支补零覆盖 (#5399) - #5404
Merged
Conversation
…able until the E7 flip" comment family + cover the multi-tenant decline branch (#5399) The #5040 E7 publish flip landed (packages/spec/src/api/endpoint-publish-gate.ts opens with "This module is that flip"), and E8 moved endpoints back into the OpenAPI document. Thirteen comments across runtime/metadata/rest still asserted the pre-flip world -- "Structurally unreachable today", "Nothing calls this yet", "Today it emits nothing" -- which is exactly the #5078 defect: a comment that contradicts the code in front of it. Each site is rewritten to describe current reality and cite the authority (the publish gate, or the real-boot probe in packages/qa/dogfood/test/showcase-declarative-endpoints.dogfood.test.ts, whose /openapi.json case disproves "emits nothing" directly). Surrounding still-true prose is preserved. Pure comment change: the only non-comment line touched is a descriptive `note:` string in the route ledger. Also adds dispatcher-plugin.multi-tenant-endpoint.integration.test.ts, covering the E5b branch "multi-tenant resolution finds no environment -> decline + warn", which had zero test references repo-wide because the kernel-resolver PROVIDER ships in the cloud distribution. A stub resolver drives a real boot over a real socket: a placed request executes on its own tenant kernel; an unplaced one gets the transport's bare 404, the warn, and no probe of any declaration. The host kernel deliberately declares the same path too. Without that, the decline cases pass vacuously -- verified by deleting the branch and re-running: with tenant-only declarations only the warn assertion moved, because the step declined a second time for an unrelated reason. With the host copy in place, deleting the branch turns both decline cases red with "expected 200 to be 404", the cross-tenant answer the branch exists to prevent. Out of scope, filed as #5400: the sibling `else` branch still logs `debug` when an adapter exposes no setFallbackHandler. Its own comment scheduled a move to `warn` "when that flip lands" -- it has landed, so declared endpoints are now silently unservable there -- but changing the level is a behavior change, so this commit only makes the comment truthful and names the tracking issue. Refs #5231, #5040, #5078, #5230, #5385 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkPSGsX9o17MsGv3Lbxu2w
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 29 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
baozhoutao
marked this pull request as ready for review
August 5, 2026 08:14
baozhoutao
enabled auto-merge
August 5, 2026 08:14
This was referenced Aug 5, 2026
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.
Fixes #5399
父单 #5231 的实施子单(另一子单 #5244 已随 PR #5395 落地)。两节工作:纯注释修真(零行为变更) + E5b decline 分支补测。
前提复核(逐处按 origin/main 核对,行号已全部漂移)
issue 立案时给的行号无一命中,#5385 重排过 runtime。翻转本身也复核了:issue 写的
d21c001在本仓 无法解析(git log报 unknown revision),但翻转确已落地 —— 权威在packages/spec/src/api/endpoint-publish-gate.ts开篇自述 "This module is that flip",并写明 #4936 的整体拒绝已被逐条形状把关取代。route-ledger.ts:298endpoint-executor.ts:31-34## Nothing calls this yet标题)api-endpoint-step.ts:24-27endpoint-policy.ts:49-53dispatcher-plugin.ts:1430metadata-manager.ts:1551openapi-endpoints.ts:60,332openapi-endpoints.ts的「Today it emits nothing」确被 PR #5230 P9 反证:packages/qa/dogfood/test/showcase-declarative-endpoints.dogfood.test.ts:287-323以真实 boot 断言/openapi.json的paths含 showcase 两条声明端点。家族扫荡:7 处是抽样,实际 13 处
按 issue 要求做了全仓 grep(
E7 flip/Structurally unreachable/til the #5040),列表外又找到 6 处同族,一并闭环:packages/runtime/src/api-endpoint-step.test.ts:9packages/runtime/src/api-mapping.test.ts:17packages/runtime/src/dispatcher-plugin.endpoint-fallback.integration.test.ts:23packages/runtime/src/dispatcher-plugin.ts的else分支(:1434-1439,见下)packages/rest/src/openapi-endpoints.test.ts:13packages/rest/src/rest-openapi-route.test.ts:81packages/rest/src/rest-server.ts:2865核过但不改的两处(措辞已是过去时,本来就成立):
examples/app-showcase/src/coverage.ts:127(「the waiver stood from #4936 until the #5040 executor landed」)、packages/qa/dogfood/.../showcase-declarative-endpoints.dogfood.test.ts:8(「was built E1–E7 ... BEHIND a publish gate that made it structurally unreachable」)。改写口径:描述当前事实并给出权威出处(发布闸门文件 / 真实 boot 探针),周围仍成立的散文原样保留。
dispatcher-plugin.ts的else分支(适配器不暴露setFallbackHandler时)注释原文写着:这个条件句的触发条件已经发生。翻转后声明真实存在,该传输上它们静默不可服务,而唯一信号是默认
info级别根本不打印的debug。要让这条注释成真只有一条路 ——debug升warn—— 那是行为变更,超出本单(纯注释)范围。故本 PR 只把该注释改写为「当前仍是 debug、且这是低估、由 #5400 跟进」的真话,级别本身留给 #5400。相关:#5122(runtime 的
HttpServer包装器丢弃可选成员,使这个分支实践中更易走到)。第二节:E5b decline 分支补测
新增
packages/runtime/src/dispatcher-plugin.multi-tenant-endpoint.integration.test.ts(4 例)。零覆盖属实:isMultiTenantHost全仓仅data-path-object.test.ts以() =false 打桩,decline 分支无任何引用 —— 因为kernel-resolver提供方在 cloud,本仓只有消费者。照 #5385 姿态以桩 resolver 驱动,但上移一层:该分支活在 plugin 的
setFallbackHandler闭包里(不在 dispatcher 上),没有任何接缝能把它交出来,所以走 LiteKernel + 真 Hono + 真 socket,而不是复刻组合(ADR-0076「who serves this path」/ #4073 的教训)。已按 #5385 写在context.kernel的当前形状。X-Environment-Id的请求在自己的租户内核上执行,servedBy只可能来自该租户;反向验证(先定方向再跑,结果与预测一致)
第一版是伪绿,已修正并记录在测试文件抬头。 初稿只在租户内核上声明端点;删掉 decline 分支重跑,预测「全红」而实际只有 warn 断言变红:宿主没有
metadata槽位,该步会因另一个无关原因再次弃权,于是 404 与「未探测」两条断言恒真、什么也没证明。改成宿主也声明同一条路径(并占住
automation)后再删分支重跑:红的正是该分支要挡的那件事 —— 无法归属的请求被从宿主内核答成了 200。恢复分支后 4/4 全绿。
验证
重活全走
flock /tmp/os-heavy-verify.lock+ 4G 堆上限、scoped filter、--workspace-concurrency=2前置。消费半径:route-ledger 的
note:由packages/client的 ledger 覆盖测试消费(#5046 的教训:改动包之外的 fixture 才是漏网处),故一并跑了 client —— 首轮 3 个文件 collection 失败(Failed to resolve entry for package "@objectstack/runtime"),是新 worktree 未建依赖的 AGENTS.md §9 陷阱、非本改动;补'@objectstack/client^...'build 后 Test Files 17 passed / Tests 222 passed。changeset
未加 changeset,请打
skip-changeset标签 —— 与 PR #5395 同一口径。纯注释 + 纯测试,对包消费者零可见变更(AGENTS.md 也写明纯修正类不强制);不选空 frontmatter changeset 是因为release.yml记着 #4898:main 上只剩空 changeset 时 changesets 会打印 "All changesets are empty; not creating PR" 并白吃一轮发布。边界
content/docs/releases/、未改任何行为。note:字符串;无任何测试断言其文本。Generated by Claude Code