You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while correcting the yesterday / today entries of DATE_RANGE_PRESET_MACRO_WINDOWS (#17014), out of that card's scope: it is a different file, a different contract statement, and correcting a module header on a file of Zod schemas pulls in the check:docs / gen:schema regeneration surface that card does not otherwise touch.
The contradiction
packages/spec/src/data/calendar-day.ts states the platform rule (ADR-0053 D-D), and its own table reads:
Operator
A bare YYYY-MM-DD on a datetime column means
$gte / $gt / $lt
that day's 00:00:00.000 — already correct as written
$lte, a $between max, a dateRange end
the WHOLE day, compiled half-open to the next calendar day
packages/spec/src/data/date-macros.zod.ts's module header, in its "Out of scope" block, still states the behaviour that rule replaced:
One property is worth stating here because it is authored against: a *_end token is the period's last calendar DAY ({current_year_end} -> 2026-12-31), so on a datetime column <= {current_year_end} stops at midnight on the 31st. Filter a timestamp with the half-open < {next_year_start}.
The first clause is correct and load-bearing — a *_end token IS the period's last calendar day. The rest is the pre-fix reading. On a datetime column today, <= {current_year_end} does not stop at midnight on the 31st: the bare-day upper bound is widened to the whole of Dec 31 by every backend, which is exactly what that widening exists to do. The advice that follows ("filter a timestamp with the half-open ...") is therefore no longer a correction of anything; it prescribes a detour around a rule that was already applied.
Why it is worth a card rather than a note
This header is the doc-comment on the vocabulary an AI author reaches for. It is the one place in the tree that tells an author what a *_end token does when it lands on the right-hand side of an operator, and it currently tells them the opposite of what the platform does. Both spellings run and return rows, so nothing downstream reports the mismatch — the author simply carries a wrong model of the operator into every subsequent filter.
Measurement
The rule is live at origin/main47863f4fb: the widening is implemented in driver-memory, in the SQL emitters, in formula's matchesFilterCondition, and in service-analytics's preview evaluator, and packages/spec/src/data/temporal-conformance.ts pins it cross-driver (d_mid and e_late, both stamped after midnight on the boundary day, are expected members of a bare-day $lte window).
Correct the sentence to state the rule as calendar-day.ts states it, and cite that file rather than restating it, so the two cannot drift again. The *_end-is-the-last-day half stays as it is.
Found while correcting the
yesterday/todayentries ofDATE_RANGE_PRESET_MACRO_WINDOWS(#17014), out of that card's scope: it is a different file, a different contract statement, and correcting a module header on a file of Zod schemas pulls in thecheck:docs/gen:schemaregeneration surface that card does not otherwise touch.The contradiction
packages/spec/src/data/calendar-day.tsstates the platform rule (ADR-0053 D-D), and its own table reads:YYYY-MM-DDon adatetimecolumn means$gte/$gt/$lt00:00:00.000— already correct as written$lte, a$betweenmax, adateRangeendpackages/spec/src/data/date-macros.zod.ts's module header, in its "Out of scope" block, still states the behaviour that rule replaced:The first clause is correct and load-bearing — a
*_endtoken IS the period's last calendar day. The rest is the pre-fix reading. On adatetimecolumn today,<= {current_year_end}does not stop at midnight on the 31st: the bare-day upper bound is widened to the whole of Dec 31 by every backend, which is exactly what that widening exists to do. The advice that follows ("filter a timestamp with the half-open ...") is therefore no longer a correction of anything; it prescribes a detour around a rule that was already applied.Why it is worth a card rather than a note
This header is the doc-comment on the vocabulary an AI author reaches for. It is the one place in the tree that tells an author what a
*_endtoken does when it lands on the right-hand side of an operator, and it currently tells them the opposite of what the platform does. Both spellings run and return rows, so nothing downstream reports the mismatch — the author simply carries a wrong model of the operator into every subsequent filter.Measurement
origin/main47863f4fb: the widening is implemented indriver-memory, in the SQL emitters, informula'smatchesFilterCondition, and inservice-analytics's preview evaluator, andpackages/spec/src/data/temporal-conformance.tspins it cross-driver (d_midande_late, both stamped after midnight on the boundary day, are expected members of a bare-day$ltewindow).domain:specissues, the termsdate-macros,current_year_end,stops at midnightandupper boundeach match 0. Controls on the same population:half-open,3777anddate-rangeeach match exactly 1 — spec: theyesterdayentry ofDATE_RANGE_PRESET_MACRO_WINDOWSprescribes a TWO-day window, so the refusal an author is handed selects today as well #17014 itself — and a fabricated control term matches 0.Suggested shape
Correct the sentence to state the rule as
calendar-day.tsstates it, and cite that file rather than restating it, so the two cannot drift again. The*_end-is-the-last-day half stays as it is.Generated by Claude Code
Generated by Claude Code