Skip to content

Investigate: can a custom-SQL aggregation measure reach the ObjectQL aggregate bridge? (the nine-vs-six function mismatch behind #11833) #12053

Description

@os-support-ai

Chartered in #11833's ruling (maintainer, 2026-08-25, verbatim 「其他接受」; full record = #11833 comment 5406725658). Filed by PM session session_01KWRU3s15AJz7PGW7a7wdCh per the confirmed checklist.

The measured mismatch

Measured on #11833's PR #12011 investigation:

  • service-analytics's consumer-local type declares aggregations[].function as string;
  • IDataEngine.aggregate declares a six-value enum: count | sum | avg | min | max | count_distinct;
  • the authorable AggregationMetricType carries nine values — those six plus number / string / boolean (custom SQL expressions).

⇒ The analytics bridge can, on its declared types, forward a method the engine contract does not admit. The local string widening is what hides the gap today.

The question to answer (measurement first, ⛔ no fix before the answer)

Can an authored custom-SQL measure (number/string/boolean) actually reach the ObjectQL aggregate path at runtime, or is it routed to NativeSQLStrategy before it gets there?

Non-negotiables

Do not close this by widening the local type back to string — that is the concealment, not the fix. ⛔ Do not widen the contract enum from the consumer side (that is a spec-seat contract change if it turns out to be wanted — fork it back). Positive control required: prove the probe reaches the bridge with a measure that is admitted, before concluding anything about one that is not.

Acceptance criterion: a written verdict — routed-away or reachable — with the runtime evidence and the named routing site, plus (if reachable) the observed mishandling; #11833's analytics half consumes the answer.

Refs: #11833 (parent finding, fork 2) · PR #12011 · #4157 (the closed prior instance) · #10576 (the per-aggregation filter)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions