Aggregation queries cannot express bounded date ranges
Prompt: "Which CI jobs in gitlab-org/gitlab have the highest failure rate? Show me job name , failure rate per month and and total failure count over last 6 months" Session id: 3738995 The Orbit query DSL does not support bounded range filters on a single property (e.g. `finished_at >= X AND finished_at < Y`), and `group_by` on date-typed fields returns raw timestamps rather than truncated buckets (month, week, day). Together these gaps make any time-windowed analytics query either impossible or silently incorrect. The failure is silent. The DSL accepts only the last filter on a repeated property and returns plausible-looking results, so the agent (or downstream consumer) sees data that appears valid but is actually unbounded on one side of the intended range. #### Steps to Reproduce 1. Run an aggregation against the `Job` entity intending to count failures in a single month: ```yaml query_type: aggregation entity: Job filters: - { field: status, op: eq, value: failed } - { field: finished_at, op: gte, value: "2025-11-01" } - { field: finished_at, op: lt, value: "2025-12-01" } group_by: [name] aggregate: count ``` 2. Observe that the result is not constrained to November — it includes all jobs from `2025-11-01` onward (or all before `2025-12-01`, depending on which filter the engine kept). 3. Attempt the alternative: ask the engine to bucket by month directly: ```yaml group_by: [name, finished_at] ``` 4. Observe that `finished_at` groups by raw second-resolution timestamps, producing thousands of one-row groups instead of monthly buckets. #### Expected - The DSL should accept either a `between` operator or repeated comparison filters on the same property, treated as a logical AND. - `group_by` on date/datetime fields should support truncation, e.g. `{ field: finished_at, truncate: month }`, returning one row per (entity, month) pair. - If a filter combination is unsupported, the query should fail with a clear error rather than silently dropping one of the conditions. #### Actual - Repeated filters on `finished_at` are silently deduplicated — only one bound is applied, the other is dropped without warning. - `group_by` on `finished_at` returns raw timestamps with no truncation option, making per-period aggregation impossible in a single query. - Net effect: agents cannot produce "failures per month by job" or any analogous time-bounded ranking in one query. Multi-query workarounds (one query per month) are blocked by the same filter limitation because each query still needs a bounded range.
issue