Skip to content

conformance(Stage A / #3877):notification 族响应体一致性测试 —— 双断言口径,预期违规率按 2/2 双向查 #5792

Description

@os-zhuang

Part of #3877(维护者批文见该单 2026-08-06 裁决评论:Stage A 逐族推进,notification 为下一族)。devx 车道 PM 按跨分片协议立单转 cli 座位(notification emit 面属 runtime/rest 线),未认领

任务

给 notification 族(#3877 测量:8 条薄 emit 路由,inline literal,已有声明)上响应体一致性测试,照 PR #5682(discovery 族)的成套做法:

  1. 双断言口径(Response bodies are never checked against the schemas that declare them — staged plan, not a repo-wide sweep #3877 已裁定为 Stage D 棘轮定义,本族即按此实施):
    • schema.parse(body)(必填键、枚举);
    • 发出键集 ⊆ 声明键集,判(单一 parse 断言对「多发未声明键」永远绿);允许集从 schema shape 推导,⛔ 不手写数组。
  2. 宽松响应 schema 与严格生产者 schema 若并存,加等价性钉子(feat(spec,runtime,metadata-protocol)!: discovery 两个生产者统一到一个 schema —— capabilities 正名、features/endpoints 退役、scoping 声明 (#4828) #5682 先例),防两边单独长键。
  3. 两个方向都要查:discovery 族实测 2/2 违规且方向相反(漏发必填 + 多发未声明)——按此心理预期排,不按 i18n 的 4/5。
  4. 违规修复是判断题(GetTranslationsRequest declares namespace / keys that no server reads — declared ≠ enforced #3676 删声明 vs GetFieldLabelsResponse declares rich label entries; both surfaces emit bare strings #3847 改实现,方向相反)——方向不明时报 needs_decision,⛔ 不许猜。

验收

关联

#3877、PR #5682(模板)、#5679(嵌套键盲区,本族如遇同形状照记不修)。

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions