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
发现于 #6155 的前提核验(未在该 PR 内修,按 Prime Directive #10 单开)。
两处直接冲突
ADR-0005(accepted,docs/adr/0005-metadata-customization-overlay.md,§"Tenant-customizable type whitelist (shared-DB tenancy invariant)")的表格原文:
Domain
Type
Per-org override?
Why
automation
flow, workflow, approval
❌
Carry execution side-effects (events, jobs, audit). Per-org variants are a deployment, not an overlay.
同一节还写明「The authoritative whitelist lives on MetadataTypeRegistryEntry.allowOrgOverride」「The runtime validator (OVERLAY_ALLOWED_TYPES) derives its set from that flag — there is no parallel allowlist」。
Note: object, field, flow, workflow, agent, permission, role, and profile all flipped to allowOrgOverride: true in commit ba252da (feat: add project mode, metadata forms, and org overlays). The invariant now pins the execution/wiring-layer types that MUST stay false.
为什么是缺陷而不是文档陈旧
Prime Directive #13:「An accepted ADR binds until a superseding ADR says otherwise. Reversing a recorded decision is itself a decision: it needs a new ADR(或旧 ADR 上的修订状态行),not a changeset that quietly does the opposite.」这次反转把 ADR 表里点名为 ❌ 的 8 个类型(object/field/flow/workflow/agent/permission/role/profile,含 ADR 明确写「Authorization correctness; overlays would create silent privilege drift」的三个安全类型)一次性翻成 ✅,ADR 正文与状态行都没动。今天读 ADR-0005 的人得到的是与运行时相反的答案,而 ADR 自称是权威。
无论走哪条,给 DEFAULT_METADATA_TYPE_REGISTRY 的相关条目留下 ADR id(Prime Directive [WIP] Add Chinese version of the documentation #13 的推论:实现某个 ADR 决定时把 id 留在代码里),并考虑登记进 scripts/adr-anchors.json——本次反转之所以能悄悄发生,正是因为被编辑的那一行没有点名管辖它的 ADR。
发现于 #6155 的前提核验(未在该 PR 内修,按 Prime Directive #10 单开)。
两处直接冲突
ADR-0005(accepted,
docs/adr/0005-metadata-customization-overlay.md,§"Tenant-customizable type whitelist (shared-DB tenancy invariant)")的表格原文:flow,workflow,approval同一节还写明「The authoritative whitelist lives on
MetadataTypeRegistryEntry.allowOrgOverride」「The runtime validator (OVERLAY_ALLOWED_TYPES) derives its set from that flag — there is no parallel allowlist」。代码(
packages/spec/src/kernel/metadata-plugin.zod.ts,DEFAULT_METADATA_TYPE_REGISTRY):OVERLAY_ALLOWED_TYPES(metadata-protocol/src/protocol.ts:6860)照此派生,于是saveMetaItem({ type:'flow', organizationId })放行。仓内已有的packages/objectql/src/overlay-precedence.test.ts:18-22把这次反转当既成事实记了下来:为什么是缺陷而不是文档陈旧
Prime Directive #13:「An accepted ADR binds until a superseding ADR says otherwise. Reversing a recorded decision is itself a decision: it needs a new ADR(或旧 ADR 上的修订状态行),not a changeset that quietly does the opposite.」这次反转把 ADR 表里点名为 ❌ 的 8 个类型(object/field/flow/workflow/agent/permission/role/profile,含 ADR 明确写「Authorization correctness; overlays would create silent privilege drift」的三个安全类型)一次性翻成 ✅,ADR 正文与状态行都没动。今天读 ADR-0005 的人得到的是与运行时相反的答案,而 ADR 自称是权威。
已经付出的代价
建议(不越权,只列选项)
allowOrgOverride: false(需评估已在库的 overlay 行的迁移)。DEFAULT_METADATA_TYPE_REGISTRY的相关条目留下 ADR id(Prime Directive [WIP] Add Chinese version of the documentation #13 的推论:实现某个 ADR 决定时把 id 留在代码里),并考虑登记进scripts/adr-anchors.json——本次反转之所以能悄悄发生,正是因为被编辑的那一行没有点名管辖它的 ADR。Refs:#6155、#6190、ADR-0005、
packages/objectql/src/overlay-precedence.test.ts:18、commitba252da0b。