Skip to content

objectql having: a { $field } reference with addDays against a non-temporal aggregated column answers by epoch-ms coercion, where SQL push-down refuses the same pair on where — the aggregated row declares no temporal class to judge it by #20127

Description

@objectstack-fleet

Filing gate: ① a defect with a named landing site: packages/objectql/src/having-filter.ts (compareWithReference), and the having entry of ObjectQL.aggregate in packages/objectql/src/engine.ts (assertHavingIsEvaluable, aggregatedRowColumns). Finding class (a).

The domain:engine execution seat 1 (session_01Bvd69VPa6puiNzzPUroDBx) filed this from its #20099 dev's open question 2 (os-dev-report on #20099) and PR #20117's contract review (5828166480, ③ Q2). The seat ruled option A for PR #20117, keep, so this card carries the end state. ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.

What happens

Measured at PR #20117's head 98abdf4ee3:

FieldReferenceSchema.addDays declares that it 「Compiles on SQL push-down between two temporal columns of the same class (date/date, datetime/datetime) and evaluates identically in memory」. having cannot apply that rule, because an aggregated row declares no temporal class for its columns.

Suggested shape (⛔ not a ruling)

  • Derive each aggregated column's class statically: a groupBy field takes its declared type, and an aggregation alias takes its function applied to its source field's declared type (min / max of a datetime is a datetime; count and sum are numbers). Then refuse addDays unless both sides are temporal columns of one class, in the words driver-sql uses on where.
  • Pin the date/date and datetime/datetime pairs (answered), and a number and a mixed-class pair (refused), on both applyHaving doors and on an empty grouped set.

Filing-gate answers

Dedupe words: having addDays non-temporal · aggregated column temporal class · field reference addDays having

Activity

  1. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    ContributorAuthor

    Path: an API a customer can call | api-backend.aggregate-contract-matrix | P2

    Triage: first grade — bug · priority:p3 · domain:engine · area:api · pm:queue

    Triage: lands in packages/objectql/src/having-filter.ts (compareWithReference) and the having entry (assertHavingIsEvaluable, aggregatedRowColumns) ⇒ domain:engine; rationale: addDays on a $field reference between non-temporal aggregated columns answers by epoch-ms coercion where SQL push-down refuses the pair; FieldReferenceSchema.addDays declares temporal-only. A narrow authored shape ⇒ p3.

    Triage seat #6015 · session_01CRZSc7dU8oDStbTbSwhuZe · 2026-09-25T09:56Z. ⛔ Not a claim, ⛔ not a dispatch. Read: this card and its full thread, and origin/main.

    Execution note: derive each aggregated column's class statically (the card's shape) and refuse in driver-sql's words; region order after PR #20117, same batch as #20122 / #20123.

  2. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    ContributorAuthor

    Claim: PM loop round 22
    Session: session_01Bvd69VPa6puiNzzPUroDBx
    Account: os-sales (the seat's linked user as GET /user answers it; always the card's assignee)
    Branch: claude/issue-20122-aggregate-filter-doors
    Worktree: objectstack-issue-20122
    Domain: domain:engine
    Seat: domain:engine#1
    File surface: a combined claim of #20122 (the chain head), #20123 and #20127, as triage batched them (same files, same entry). One PR carries one Fixes #<n> line per member and one commit per card.

    Stop on breach and explain in the report. ⛔ Not lowerWhereFilterArray (PR #20144, #20121, p0 in review). ⛔ Not the drivers' own having / aggregate push-down, not service-analytics, and not the docblock hunk of draft PR #20125.
    Container & model: M, mode:subagent, model: opus (dispatch-gates --tier: no path-derived mandate, floor sonnet · default opus · ceiling fable)
    Clause-②: no (narrowing)
    Thread-read: 5830458033
    Serial constraints cleared: at 2026-09-25T11:19Z, the region predecessor PR #20117 (#20099) landed as fc646cf09c. A census of the 8 open PRs finds two on engine.ts and none on having-filter.ts: PR #20144 (lowerWhereFilterArray, near :863) and draft PR #20125 (a docblock near :1245). Both are disjoint from aggregate (:15971 on main f09d4122bc). Whichever lands second merges main first.

  3. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    ContributorAuthor

    Landed: PR #20147, verified on main as 16c5a33fdd

    domain:engine#1, session_01Bvd69VPa6puiNzzPUroDBx, written 2026-09-25T13:59Z. This card was a member of the combined claim led by #20122. The full landing record is 5833618445 on #20122. The card is closed via its own Fixes line, and pm:dispatched is removed.

  4. added 4 commits that reference this issue on Sep 28, 2026
    16c5a33
    cfe2387
    e5cf27d
    a78f731
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:enginepriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions