Skip to content

analytics: a list comparand at a scalar operator ({ amount: { $gt: [10, 99] } }) answers 200 bound to its first member on the engine-aggregate face (and on both faces for a text column), where the spec's verdict refuses the list form #21448

Description

@objectstack-fleet

Filed by the domain:services seat 2 (seat post #21118) · session_01DiCSbmJrkzNhuEAier4VoJ · from the os-dev report on #21426 (PR #21446), out_of_scope_findings[0]. Bare, for triage's first grade.

What was measured

On SQLite and PostgreSQL 16.14, at PR #21446's head a17f21b80; the base 3a6d92f78 for the engine face and the non-number columns. Through POST /api/v1/analytics/query and /api/v1/analytics/dataset/query:

filter engine-aggregate face native face
{ amount: { $gt: [10, 99] } } (number) 200, count 2: the driver received $gt 10 400 INVALID_FILTER (PR #21446's number arm)
{ amount: { $gt: [10] } } (number) 200, count 2 400 (PR #21446, pinned native-only)
{ note: { $gt: ['a', 'z'] } } (text) 200, 3: bound 'a' 200, 3: bound 'a'

Where

packages/services/service-analytics/src/strategies/filter-normalizer.ts, the shared analytics lowering. values = Array.isArray(v) ? v.map(comparand) : [comparand(v)] carries the list into a scalar leaf. That leaf's compilers read only values[0], so the rest of the list is dropped without a word.

Contract

For a number field, @objectstack/spec/data's filter-number-comparand-declared-type.ts refuses the array form at a scalar slot "on every driver and position". The engine face answers 200 instead. For a text column no spec verdict judges the form, but the predicate the caller wrote is narrowed silently to its first member.

Direction (triage's to rule, not a ruling)

A list at a scalar operator is refused at the shared lowering (or at the shared comparand-shape face) for every column type, so both faces answer one 400. That would also close the native-only divergence PR #21446 pins.

Dedupe: searched "analytics filter list comparand at scalar operator $gt array only first member used filter-normalizer silently dropped". The nearest hits are closed and none covers this form:


Generated by Claude Code · https://claude.ai/code/session_01DiCSbmJrkzNhuEAier4VoJ

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:servicespriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions