Skip to content

[Decision] Two maintainer rulings collide on boolean aggregates — batch #59's "every other pair refused" would refuse avg(flag), which ruling #11152 pins on six backends as having no per-aggregate exception #16685

Description

@os-trump

Surfaced by the at-tier contract review of PR #16684 (card #16353, the spec half of #16099) and verified independently by the domain:spec seat. ⛔ Not the dev's to resolve and ⛔ not this seat's: it is a conflict between two maintainer rulings, so it goes to the decision box rather than being settled in a PR.

The collision, measured

Ruling A — decision batch #59 (2026-09-06), which card #16353 implements. Its rows: count/countDistinct any type; sum numeric only (excluding percent); avg numeric including percent; min/max numeric plus temporal; "every other pair: refused". boolean and toggle are not numeric, so that default refuses sum/avg/min/max over them. ⚠️ The ruling's text never names boolean — the refusal arrives via the sweeping default, not a considered call.

Ruling B — #11152 (2026-08-28), pinned in spec's own packages/spec/src/data/aggregation-conformance.ts and enrolled on six backends: sum(flag)=3, avg(flag)=0.5, min(flag)=0, max(flag)=1. Re-read on origin/main by this seat — :61 and :218 both say, in terms, "no per-aggregate exception".

Implementation agrees with B, not A: driver-sql emits a lowering cast for boolean aggregands on Postgres (sql-driver.ts:8497-8516, card #11635, closed).

A published compatibility table built from ruling A refuses a pair that ruling B requires every backend to answer, and that spec's own conformance suite pins.

⚠️ avg(flag) is not a corner case: it is the "win rate / SLA-violation rate" shape from #11065 — the reason AGGREGATION_CASES exists.

📋 四棱

四棱四条同向。⛔ 但这仍必须你裁:它是两条维护者裁决之争,置信门与代裁通道都够不到。

选项

⛔ 无论哪一边,PR #16684 的 TSDoc 与 changeset 里那句「布尔就是发散类」都必须改 —— 它在本树上是假的,而且会进 CHANGELOG。该修正已作为补丁轮发给 dev,与本裁决无关、不等它。

影响面


维护者速读

事情。 我们在给「聚合函数 × 字段类型」建一张兼容表(哪些组合允许、哪些拒收),依据是你 9 月 6 日批 #59 的裁决。那条裁决说「列出的允许,其余全拒」。

问题是「其余」里扫进了布尔字段 —— 而你 8 月 28 日的另一条裁决(#11152)明确规定:布尔在每一个数据库后端上都按数字聚合,不设例外,而且这条已经写进 spec 的一致性测试、在六个后端上跑着,驱动层也为 Postgres 专门做了转换。

两条裁决打架了。 新表会拒掉 avg(布尔字段) —— 也就是「胜率」「SLA 违约率」这类统计,而那正是当初 #11065 要的东西。

选项。

  • A — 布尔留着能聚合:承认 9 月 6 日那条的「其余全拒」是个笼统默认,没考虑到布尔;表里给布尔开四个口子。其它什么都不用动。
  • B — 按 9 月 6 日的字面拒掉布尔:那就得同时退役 8 月 28 日的裁决、删掉六后端的一致性用例、撤掉驱动层的转换,并且「胜率」这类统计从此写不出来。

席位意见:推荐 A。 四条评估轴罕见地全部同向。核心理由是:让一条笼统的默认推翻一条具名的、有 pin、有实现、六后端登记的裁决,方向反了。而且 B 是删除一个已经发布并且有保证的能力,不是收紧一个空声明。

风险与代价(含回滚)。 A 只改这张还没有人执行的表(加两个成员),回滚是一次 revert。B 要动三处已发布的东西,不可低成本回滚。⚠️ 有时限:执行这张表的两条消费腿正等着本卡;它们一落地,再改就是收窄一个已发布的拒收集,代价从「改一行」变成一次破坏性变更。

你要做的:选 A 还是 B?

Activity

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