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
// Pruned 2026-06 (dead in both layers — aspirational governance with no runtime// consumer; encryption/masking implied at-rest protection that never happened —// the real channel is type:'secret'). See// docs/audits/2026-06-dead-surface-disposition-plan.md (P0/P2 field prune):// encryptionConfig, maskingRule, auditTrail, cached, dataQuality.
一句话说明
dataQuality字段键在 2026-06 的 dead-surface 剪除里被删掉了,但DataQualityRulesSchema及其两个类型仍留在@objectstack/spec的公开 API 面上。没有任何东西引用它们 —— 它是那批剪除里唯一的残留。在 #3696 排查
unique语义时顺带发现(PR #3717),按 Prime Directive #10 单独跟踪。事实核实
剪除的 tombstone 注释就在
packages/spec/src/data/field.zod.ts:543-546:dataQuality作为FieldSchema的键确实没了:只剩注释里那一处。但 schema 本体和类型还活着,而且在公开 API 快照里(
packages/spec/api-surface.json:254-256):定义在
field.zod.ts:183-215(含一段@example)+645-646的类型导出。全仓消费者:零(除自身定义与类型导出外无引用)。这批剪除里只有它残留
核对了 tombstone 列出的五个:
encryptionConfigEncryptionConfigSchema仍在,但那是system/encryption.zod.ts里另一个独立的系统级加密配置,有自己的测试,不是字段级键的残留maskingRuleauditTrailcacheddataQualityDataQualityRulesSchema+ 2 个类型仍公开为什么值得修(虽然很小)
误导作者。
DataQualityRules出现在公开 API 和生成的参考文档里,带着uniqueness/completeness/accuracy三个看起来很实在的治理选项。作者据此以为可以写dataQuality: { uniqueness: true }—— 而FieldSchema是.strict()的,这会直接 parse 报错;就算不报错也不会有任何执行。uniqueness与刚厘清的unique语义打架。多租户缺陷:unique 物化为全局唯一索引、无视 tenancy,与按租户分裂的 autonumber 序列自相矛盾(跨租户必然撞号 + 存在性探测泄露) #3696 刚把unique的作用域讲清楚(true= 租户内、'global'= 全平台)。同时还飘着一个描述为 "Enforce unique values across all records" 的死uniqueness字段,正是最容易被误选的那个 —— 它的措辞听起来恰好像"全平台唯一"。剪除本身没做完。tombstone 声明这些是 "dead in both layers",但其中一个的 schema 还在对外发布。
建议处置
删掉
DataQualityRulesSchema、DataQualityRules、DataQualityRulesInput,与其余四项一致。这会是一次公开 API 的移除(api-surface.json少 3 条),需要走pnpm --filter @objectstack/spec gen:api-surface更新快照并配 changeset。若判断该保留(比如打算真做数据质量治理),那就走另一半:接上真实消费者,并把
dataQuality键加回FieldSchema—— 即 enforce-or-remove(ADR-0049)的 enforce 那一侧。当前这种"schema 公开、键不存在、无人消费"的中间态是三者里最差的一种。关联
docs/audits/2026-06-dead-surface-disposition-plan.md(P0/P2 field prune)unique作用域厘清)