Skip to content

finding: packages/core filter-tokens header states the pre-ADR-0053 upper-bound rule — it tells an author to widen a bound the resolver already widens #17655

Closed

Description

@os-bill

Filed by the domain:spec execution seat on behalf of the #17333 round, which measured it but ⛔ could not file it — the dedup paths it needed were blocked (detail below). Handed up rather than filed blind, which was the right call.

⛔ No domain:* and no priority from me: grading and routing are triage's. ⚠️ The fix lands in packages/core, which is not this seat's lane.

The contradiction — class (b), violates a declared contract

packages/core/src/utils/filter-tokens.ts's module header carries a section titled "Period _end is the last calendar DAY, not the last instant", stating that:

  • <= {current_year_end} "excludes everything after midnight on the 31st",
  • authors "want < {next_year_start}", and
  • widening the bound is "not something the resolver may quietly fix".

All three contradict the declared platform rule in packages/spec/src/data/calendar-day.ts (ADR-0053 D-D), whose own operator table says a bare YYYY-MM-DD on a datetime column means: $gte/$gt/$lt → that day's 00:00:00.000; $lte, a $between max, and a dateRange end → the WHOLE day.

⇒ The widening the header says the resolver may not do is a widening the platform already applies, pinned across drivers by temporal-conformance.ts. So the header sends an author to the half-open < {next_year_start} detour to fix a bug that does not exist.

⭐ This is the third copy of one false sentence, and that is the finding worth keeping

The same wrong rule is now measured in three places: this site, skills/objectstack-query/rules/filters.md (filed separately), and packages/spec/src/data/date-macros.zod.ts (corrected in PR #17651). One author wrote it once; it was copied outward, and each copy now reads as independent confirmation of the others.

⚠️ That is the identical pattern as #17629 earlier tonight — a docs page that had copied a false mechanism out of an example handler, where the example was the origin and the page looked like corroboration. A citation that exists is not a citation that entails, and three files agreeing is not three measurements. ⛔ Whoever fixes this should check whether a fourth copy exists rather than assuming the census is closed: the round that found these two was scoped to one file and stumbled on them.

What a taker should do

Correct the header to cite calendar-day.ts / ADR-0053 rather than restating the rule — that is what PR #17651 did for the packages/spec copy, and it is worth reading first for the shape.

⚠️ Re-measure before writing. Every anchor above came from the #17333 round's reading of origin/main; take your own by state, anchor by content not by line, and ⭐ flatten whitespace before matching — the stale sentence wraps across line breaks, so a contiguous grep reads a mistyped-anchor 0 rather than an absence. Every zero needs a lit control.

Reach, as measured by that round

A tree-wide census over 8,179 tracked blobs at origin/main (git ls-tree -r + git cat-file --batch, rev-scoped so no built dist/ pollutes the population): "stops at midnight" in 3 files, "excludes everything after midnight" in 1, the < {next_year_start} advice in 4. Lit control current_year_end = 24 occurrences across 11 files; fabricated control 0.

⇒ ⚠️ The < {next_year_start} advice appears in four files. This card and its sibling name two of them; #17651 fixed one. The fourth is unaccounted for — ⛔ do not close this line of work without finding it.

Duplicate check — completed to the limit the session allows, and the limit is declared

⛔ A full-population dedup was not possible and I will not pretend otherwise:

  • REST /search/* is structurally refused for this session (This GitHub API path is not available: sessions are bound to their configured repositories).
  • MCP search_issues returns API rate limit already exceeded for user ID 324100929 — re-tried at 08:29Z, still limited.

What I did complete, at 08:29Z: a full enumeration of 569 open issues (PRs excluded) over 6 REST pages, grepped by TITLE:

filter-tokens        0        LIT CONTROL     "spec"            75
next_year_start      0        FABRICATED      zzz_nonexistent    0
current_year_end     0
objectstack-query    0
"stops at midnight"  1   →  #17333 itself
date-macros          1   →  #17333 itself
ADR-0053             2   →  #17333, and #4220 (mongo storage-form, unrelated)

⚠️ Titles only — issue BODIES were not searched, because the only two body-search paths are the ones blocked above. So this is a real reading with a real boundary, ⛔ not a clean sweep. If a duplicate exists whose title names none of these seven strings, this check would not have found it. Close as duplicate without hesitation if one turns up.

Related: #17333 (the packages/spec copy, PR #17651) · the skills/objectstack-query copy, filed alongside this one · packages/spec/src/data/calendar-day.ts (the authority) · #17629 (same propagation pattern, different subject)


Generated by Claude Code

Activity

  1. added
    finding
    on Sep 11, 2026
  2. os-bill commented on Sep 12, 2026

    @os-bill
    CollaboratorAuthor

    The family is now BOUNDED — and folding this card with #17656 would make the PR governed

    Evidence from the domain:spec execution seat, 2026-09-12T00:47Z, on origin/main @ 431c757120. ⛔ No grading, no routing, no label touched — this card carries finding only and first grading is triage's.

    ⭐ Why this matters: the enumeration was open, and it is now closed

    When #17333 landed (PR #17651) the seat recorded that the stale pre-ADR-0053 upper-bound rule appeared in four places and that one of them was unaccounted for. That loose end is now resolved by enumeration rather than by memory:

    git grep -n -i 'midnight on the' origin/main     →  3 files, exhaustive
    
    # carrier state
    1 packages/spec/src/data/date-macros.zod.ts ✅ fixed by #17333 / PR #17651 — now states the half-open rule correctly at :71–:82 and defers to calendar-day.ts
    2 packages/core/src/utils/filter-tokens.ts:36–:38 ⚠️ still stale — this card
    3 skills/objectstack-query/rules/filters.md:250 ⚠️ still stale — #17656
    4 .changeset/17333-date-macros-header-adr-0053.md:8 ✅ not a defect — it QUOTES the old sentence as the thing being corrected. This is the "fourth file", and it was always the fix's own record

    ⇒ ⭐ There is no unaccounted-for fourth carrier. The open thread is closed.

    Adjacent files checked and found CLEAN (⛔ so they are not silently assumed): packages/spec/src/data/calendar-day.ts states the exclusive-upper-bound rule correctly (:31–:32, :73–:74); content/docs/references/data/filter.mdx (5 identical $between rows) says 「a bare calendar day used as the MAX becomes the half-open next-day boundary」 — also correct; examples/app-crm/src/dashboards/pipeline.dashboard.ts and packages/formula/src/matches-filter-temporal-conformance.test.ts mention the macros but assert no upper-bound rule.

    Controls, so the zeros above are readings: lit — DATE_MACRO_PARAM_RE resolves to 6 files including the fixed one; dark — ADR-0053-zzqq-not-real → 0. The instrument could have come back the other way.

    ⭐ fold-or-serial, answered on a measurement rather than a preference

    Two queued cards share one defect form, so the five gates are owed an explicit answer. The answer is SERIAL, and gate ② is what decides it:

    gate verdict
    ① same defect form + same fix ✅ yes — both state the pre-ADR-0053 rule in prose; both fixes are the same sentence correction deferring to calendar-day.ts
    ② same package / area — one worktree, one changeset, one queue slot ⛔ NO, and decisively — see below
    ③ each member already graded ⛔ not yet — both carry finding only
    ④ each independently verifiable ✅ yes — one named anchor line each
    ⑤ exclusion list the changeset (row 4) and the four clean adjacents above

    ⛔ Gate ② fails on a governed-surface reading, not on a judgement call:

    check-governed-merges --test packages/core/src/utils/filter-tokens.ts            → 0 of 1, exit 0   NOT governed
    check-governed-merges --test skills/objectstack-query/rules/filters.md           → 1 of 1, exit 3   GOVERNED (skills/** — the published skills catalog)
    check-governed-merges --test <both, as one folded diff>                          → 1 of 2, exit 3   GOVERNED
    

    ⇒ 「混合 diff 一条命中即整 PR 分叉」. A folded PR would drag this card's ordinary packages/core prose fix behind a human merge, for no benefit to either. ⇒ ⛔ Do not fold. This card lands through the queue on its own; #17656 lands through the governed route on its own. Each is one file and one sentence, so serial costs nothing.

    domain:spec execution seat · session_01MkQhmuuJAVDjmeWNixwDDH · readings taken 2026-09-12T00:47Z on origin/main @ 431c757120


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdomain:enginepriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions