refactor(spec)!: 退役 HttpServerConfigSchema —— 九个键零 reader 且没有任何作者面入口 (#4938) - #5293
Open
os-zhuang wants to merge 2 commits into
Open
refactor(spec)!: 退役 HttpServerConfigSchema —— 九个键零 reader 且没有任何作者面入口 (#4938)#5293os-zhuang wants to merge 2 commits into
HttpServerConfigSchema —— 九个键零 reader 且没有任何作者面入口 (#4938)#5293os-zhuang wants to merge 2 commits into
Conversation
#4938) `system/http-server.zod.ts` 的 `HttpServerConfigSchema` 声明九个键 (`port` / `host` / `cors` / `requestTimeout` / `bodyLimit` / `compression` / `security` / `static` / `trustProxy`),`authorable-surface.json` 全部在册、 `content/docs/references/` 全部渲染成协议文档。两头都是空的: 1. **零 runtime reader** —— 三个仓(objectstack / cloud / objectui)里没有任何 包用它解析过文档或读过它的键;spec 之外唯一的命中是 `shared/http.zod.ts` 里指回来的 "Used by:" 注释。 2. **零作者面入口** —— 比普通的「写得下去、不生效」更彻底。`stack.zod.ts` 没有 `server:` 键,`config-schema.json` 里零命中,也没有 settings manifest 承载它,所以文档承诺的这套配置连**写下去**都做不到。 按 ADR-0049 enforce-or-remove 与 2026-08-04 裁决,退役这个不可达面。 退役形态是**容器,不是整个文件**:`RouteHandlerMetadata`(`packages/rest` 消费)与 `MiddlewareType` / `MiddlewareConfig`(`packages/runtime` 消费) 留下;`shared/http.zod.ts` 的 `CorsConfigSchema` / `RateLimitConfigSchema` / `StaticMountSchema` 各自另有 live consumer,也未被孤立。 **不打 `retiredKey()` tombstone**(playbook 路线 3,#4834 / PR #4878 同形): tombstone 是给「写下这个键的人」的话,而唯一能写 server 键的面是 #5006 的 `StackServerConfigSchema`,它是 `strictObject`,七个键早已按名拒绝并各带处方 —— 本 PR 把那些处方从「no runtime reads it」刷新为指明退役与替代。**不注册 D2 conversion**:没有任何作者源需要改写。代码消费者的通道是 `api-surface.json` (−3)接 release-time 的 `spec-changes.json` diff,加上 changeset。 `cors` 按裁决登记为 `server:` 窄形状的**首个逐键准入候选**(嵌入是真场景), 届时按 #4910 范式键与执行器一并到位,不以死键形态占导出面。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ErbEDVAg1No9gdg1pgDAGB
…p-server-config-retirement
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 107 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This was referenced Aug 4, 2026
system/HttpServerConfigSchema 九个键全仓零 reader,且没有任何作者面入口(defineStack 无 server:,不在 config-schema)
#4938
Open
os-zhuang
marked this pull request as ready for review
August 4, 2026 17:14
This was referenced Aug 4, 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 #4938
按 2026-08-04 维护者裁决(A —— 退役不可达面,
cors登记为窄形状首个准入候选)执行。前提复核(立单基线是 #5006 之前,已在当前
origin/main@3905c00重测)前提成立。零命中结果按要求做了反向对照:
阳性对照 —— 窄形状的
trustProxy确实有大量 live reader,证明测法本身有效:stack.zod.ts:374的窄server:键存在(StackServerConfigSchema),其guidance文本确实按名拒绝另外七个键。作者面另两项也复核过:config-schema.json里HttpServerConfig零命中,service-settings/src/manifests/无 http/server manifest。一处与派单预期不符:退役的是容器,不是整个文件
派单说明预期「whole-file retirement of
system/http-server.zod.ts(参照 #4834/#4878 形态)」。这个形态会破坏两个 live consumer,证据:裁决原文写的是「
HttpServerConfigSchema不可达面(七死键连同容器)」—— 容器,不是文件。所以本 PR 删的是HttpServerConfigSchema/HttpServerConfig/HttpServerConfigInput与HttpServerConfig.create()helper,文件本身与其余导出留下。同文件里的ServerEvent*/ServerCapabilities/ServerStatus也零消费者,但它们是响应/能力形状而非 authorable 配置,不在本裁决范围内,未动。路线:不打 tombstone,也不注册 D2 conversion
playbook 路线 3(「nothing parses it → neither」),
#4834/ PR #4878 同形。理由不是省事:StackServerConfigSchema,它是strictObject,七个键早已按名拒绝并各带处方。本 PR 把那些处方从「Not authorable — no runtime reads it (system/HttpServerConfigSchema九个键全仓零 reader,且没有任何作者面入口(defineStack无server:,不在 config-schema) #4938)」刷新为指明退役与替代,并在stack-server.test.ts里加了一条统一断言(七条处方都必须含retired in v17),让处方不会悄悄漂离它所代表的那次删除。os migrate meta无事可做,conversion fixture 只能凭空捏一个从未存在过的文档。代码消费者的通道是api-surface.json(−3)接 release-time 的spec-changes.jsondiff,加上 changeset。gate 侧也是这样判的,输出留在这里当路线证据:
四张 ratchet 的读数符合 playbook 里「整 def 删除 → 必须变化」那一栏:
api-surface.json−3、authorable-surface.json−9、json-schema.manifest.json−1。api-surface-signatures.json无变化(它哈希的是defineX工厂签名,本次没有工厂参与);spec-changes.json/protocol-upgrade-guide.md无变化,因为提交态副本的added/removed只在 release 时用--previous-surface填充,这是设计而非漏跑。反向验证(方向在跑之前就定了)
预测:把删掉的肢体粘回去,新 pin 应当转红(普通的红向,不是 #5046 那种「诊断变多」也不是 #5018 那种倒置)。实测一致 ——
一条要如实说明的:我最初还写了两条类型层
@ts-expect-errorpin 来守HttpServerConfigInput(type-only,运行时in看不见)。它是幽灵检查 —— 把指令行删掉,typecheck仍然绿,两种状态都不报错,因为packages/spec/tsconfig.json的exclude含**/*.test.ts,而该包的typecheck就是裸tsc --noEmit。据此撤掉了那两条,改在注释里写明该类型的见证是api-surface.json。这个 tsconfig 问题另行立单(见下),因为树上已有约 14 条同类退役 pin 正躺在同一个盲区里。验证
pnpm --filter @objectstack/spec build/typecheck— 通过pnpm --filter @objectstack/spec test—308 passed (308)/7946 passed (7946)check:liveness/check:empty-state/check:authorable-surface/check:docs/check:api-surface/check:spec-changes/check:upgrade-guide/check:skill-refs/check:skill-docs/check:skill-examples/check:strictness-ledger@objectstack/runtimetypecheck 通过,@objectstack/restbuild(含 DTS)通过node scripts/check-nul-bytes.mjs通过,并对改动文件做了越过 gate 盲区的自扫([\x00-\x08\x0b\x0c\x0e-\x1f],零命中)http_server不是 metadata type,packages/spec/liveness/里零命中);无.form.ts输入需要剪,故无 i18n 变化gen:strictness-ledger(未手改任何数字):system/368 → 366,triaged 的 484 sites / authorable 15 不受影响(system/属未 triage 目录)顺带发现(未在本 PR 修)
@ts-expect-error退役 pin 在packages/spec里是幽灵检查:tsconfig 把**/*.test.ts排除出唯一的tsc --noEmit#5286 ——packages/spec的@ts-expect-error退役 pin 是幽灵检查(tsconfig 把**/*.test.ts排除出唯一的tsc --noEmit),object.test.ts里守compactLayout/detail退役的那几条同样从未被求值。🤖 Generated with Claude Code
https://claude.ai/code/session_01ErbEDVAg1No9gdg1pgDAGB
Generated by Claude Code