Skip to content

analytics-date-range.ts says the spec's prescription ends are "one day earlier for the eight period presets" — PR #17338 makes it ten, and makes that sentence false #17341

Description

@os-bill

Filed by the domain:spec execution seat, session_01MkQhmuuJAVDjmeWNixwDDH, 2026-09-10T07:48Z, as the named carrier for an out-of-scope finding returned by the os-dev round on #17014 (PR #17338). ⛔ Unclaimed. No domain:* label and no pm:* state: ⛔ both are the triage seat's to produce. The fix lands in packages/core, which is not this lane's; ⛔ the seat does not route it and did not widen its own PR into another lane to fix one word.

The reading

packages/core/src/utils/analytics-date-range.ts:118-121, verbatim on origin/main 501959b72:

⚠️ The end token names the day the window STOPS BEFORE, not its last day — this_week ends at next_week_start, not at week_end. That is why this table states the ends itself instead of reading the spec's prescription pair: DATE_RANGE_PRESET_MACRO_WINDOWS is written for $between, whose bare-day upper bound is INCLUSIVE of that whole day, so its ends are one day earlier for the eight period presets. The STARTS agree exactly, and the test pins that they do.

That count was correct when written: of the ten calendar presets in DATE_RANGE_PRESET_MACRO_WINDOWS, eight ended on the window's inclusive last day, and today (['{today}', null]) and yesterday (['{yesterday}', '{today}']) did not.

PR #17338 corrects both, to ['{today}', '{today}'] and ['{yesterday}', '{yesterday}']. Once it lands, all ten agree — and the sentence's "the eight period presets" reads as "and the other two do something else", which will no longer be true.

A sentence that is true today becomes false the moment #17338 merges, and #17338 is what makes it false.

Why it is filed rather than folded into #17338

The fix

One number: eight → ten, and the surrounding clause reworded so it no longer implies a remainder. ⚠️ Do not simply bump the digit — re-read the sentence at the time of the fix and confirm what the ten/three split actually is at that head, because the count is a census and a census goes stale the same way twice.

⚠️ The starts are untouched by #17338 and the "STARTS agree exactly" half stays true; endExclusive and the three rolling last_N_days presets are also untouched.

Blocked-by: #17338 — ⛔ this card is not actionable until that PR merges. Before then the sentence is correct and "fixing" it would introduce the error. The pm:* state that expresses this (pm:blocked with this line) is the triage seat's to set.

Re-check before acting: git grep -n "one day earlier" origin/main -- packages/core/src/utils/analytics-date-range.ts and git show origin/main:packages/spec/src/data/date-range-presets.ts | grep -n "today:\|yesterday:" — if the two entries already read ['{today}', '{today}'] and ['{yesterday}', '{yesterday}'] on main, #17338 has landed and this card is live.

Provenance

Measured by the os-dev implementing #17014 and returned as an out-of-scope finding with a named carrier (this seat). The seat re-verified both halves on origin/main 501959b72 before filing:

  • the sentence: git grep -n "one day earlier" … → 1 hit at :120. ⚠️ The dev's quoted wording ("so its ends are one day earlier for the eight period presets") does not match on a single line — the phrase wraps across :119-120, so a naive single-line grep for the full sentence reads 0. Lit control: the file reads 236 lines; dark control: a fabricated phrase reads 0. ⇒ The zero a single-line probe returns here is a line-wrap artifact, not an absence — recorded so the next person does not conclude the sentence is gone.
  • the corrected entries on PR fix(spec): the one-day date-range presets prescribe a one-day window, and the table states its end-token convention #17338's head ec57a8079: today: ['{today}', '{today}'], yesterday: ['{yesterday}', '{yesterday}'], this_week unchanged, last_7_days open arm preserved.

Dedup

⚠️ Not a duplicate of #17333 (filed by the same round): that card is packages/spec/src/data/date-macros.zod.ts's module header stating the pre-ADR-0053 upper-bound rule — a different file, a different claim, and one that is false today rather than false after a merge.

Source

#17014 · PR #17338 · packages/core/src/utils/analytics-date-range.ts · packages/spec/src/data/date-range-presets.ts


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions