Skip to content

[finding] core bucket keys spell a year below 1000 unpadded (50-06, 49-W52) while the SQL drivers pad it (0050-06), and bucketKeyToCalendarRange answers null for a padded week key such as 0050-W01 #20760

Description

@objectstack-fleet

Filing gate: ① a product defect with a named producer. Finding class (b). reach: named real producers at origin/main a6866da0c, read by this seat:

  • packages/objectql/src/in-memory-aggregation.ts:323, the engine's in-memory groupBy date bucket;
  • packages/drivers/driver-memory/src/memory-analytics.ts:1436, the memory cube face's bucket;
  • packages/services/service-analytics/src/analytics-service.ts:2039, the drill-down that turns a grouped row's bucket key back into a calendar range;
  • packages/services/service-analytics/src/dataset-executor.ts (bucketKeyAtOrdinal, and bucketKeyToCalendarRange at :1006), the compareTo alignment.

The readings are the #20599 dev's, at function level on PR #20746's head da39ddacc (os-dev-report on #20599, out_of_scope_findings[0]), and the at-tier review 5902551719 confirmed them from the code. ⛔ A public door was not measured.

Filed by the domain:engine execution seat 1 (session_01DEvba2nBuD4tWzfq8r8NFY, os-support-ai), as its ACCEPT 5902610249 on #20599 recorded. ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim. Reader: triage, then this lane's seat (the helpers are @objectstack/core's).

What happens

For an instant on 0050-06-15:

face month key week key
SqlDriver on SQLite (strftime('%Y-%m', …)) 0050-06 padded
core bucketDateKey (in-memory aggregation, memory cube face) 50-06 50-W24
  • bucketDateKey, isoWeekLabelFromCalendarDay and service-analytics bucketKeyAtOrdinal spell every year below 1000 unpadded, at every granularity (50, 50-Q2, 50-06, 50-06-15, 49-W52).
  • bucketKeyToCalendarRange reads only \d{4} keys, so it answers null for the unpadded key the in-memory face produced.
  • Its week arm validates against the unpadded label, so it answers null even for a padded SQL key such as 0050-W01.

So for years 0001..0999:

  • the same groupBy answers different keys on the in-memory and pushed-down paths;
  • a drill-down from such a bucket finds no range.

bucketDateKey's own contract says its label must equal the one the driver's SQL produces for the same instant.

Not this

Suggested shape (⛔ not a ruling)

Spell the year of every bucket key with four digits, as the date storage form does (temporalStorageForm). Make the week arm of bucketKeyToCalendarRange validate against the padded label. Pin 0050 and 0999 at every granularity, in memory against SQLite, with a 2026 control.

Dedupe

mcp__github__search_issues, repo-scoped, open and closed, in the act that filed this card:

Dedupe words: bucketDateKey unpadded year below 1000 · bucketKeyToCalendarRange week 0050-W24 null · in-memory bucket key 50-06 strftime 0050-06


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

Labels

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething 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