Skip to content

读侧的 ADR-0008 OCC 载体没有契约:GET /meta/:type/:name 非缓存分支发 lock/lockReason/lockSource,GetMetaItemResponseSchema 只声明 {type,name,item} #5950

Description

@baozhoutao

在 #5545(给 client.meta.getItem 补返回类型注解)里测绘到。写侧的同一问题已由 #5745 修掉(SaveMetaItemResponseSchema 曾是真实 body 的真子集,version/seq/state 被抹);读侧还留着一个没人收的同形缺口。

事实(基线 origin/main @ a6b3ee7a1)

spec 声明(packages/spec/src/api/protocol.zod.ts:234)只有三个键:

export const GetMetaItemResponseSchema = lazySchema(() => z.object({
  type: z.string(), name: z.string(), item: z.unknown(),
}));

生产端(packages/metadata-protocol/src/protocol.ts getMetaItem,主 return 在 :3733 附近)发的是超集:

return {
    type: request.type,
    name: request.name,
    item: decorated,
    lock: lockState.lock,
    ...(lockState.lockReason !== undefined ? { lockReason: lockState.lockReason } : {}),
    ...(lockState.lockSource !== undefined ? { lockSource: lockState.lockSource } : {}),

REST 侧 translateMetaEnvelope(packages/rest/src/rest-server.ts:2714)...envelope 原样铺开,所以这三个键会到线上。而 #5563 收敛后的缓存分支(默认 enableCache: true)重建的信封只有 { type, name } + item,代码注释里写明是有意的:

rest-server.ts:4278 — "The cached read carries no lock — it is the fast published-value path and never consulted the lock resolver; a caller that needs the ADR-0008 OCC carriers reads the uncached path."

为什么这是个缺口

#5563 把文档的形状在两条分支上收敛了,但 OCC 载体没有:lock 是否出现仍由服务端 enableCache 决定,且这件事在 spec 里一个字也没有。于是

处置(建议,待分诊)

在 GetMetaItemResponseSchema 上把三个键声明为 optional,并在 describe 里写清「仅非缓存读路径提供;缓存读路径不解析锁」——这与 #5745 的做法一致(先实测哪些必选、哪些条件出现,再照实声明),且不改任何运行时行为。若认为「配置决定字段有无」本身才是要修的,那是更大的一步,应单独定案。

关联:#5545(测绘出处)、#5563(读路由形状收敛)、#5745(写侧同形缺口,已修)、ADR-0008。

Activity

  1. claude commented on Aug 6, 2026

    @claude
    Contributor

    分诊:pm:queue + domain:spec。

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  2. hotlong commented on Aug 7, 2026

    @hotlong
    Contributor

    Release-board audit (maintainer-directed re-audit of non-board domain:spec items, 2026-08-07): adding target:v17 — criterion ②: the uncached GET /meta/:type/:name branch sends lock/lockReason/lockSource on the wire while GetMetaItemResponseSchema declares only {type,name,item} — undeclared wire shape; the write-side twin was already fixed (#5745). Triage seat may veto.


    Generated by Claude Code

  3. os-project-manager commented on Aug 8, 2026

    @os-project-manager
    Collaborator

    Bundled into sweep card #6487 (undeclared response shapes on GET /meta/:type/:name, 2 members). Keeps pm:queue but is excluded from batch selection while #6487 is open — claim the sweep card, not this one; it closes via Fixes when that PR merges. Bundled with #5882 because both land on the same handler and would have to serialize regardless.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions