Skip to content

[finding] service-analytics still spells a year below 1000 its own way: formatDateBucket labels bucket key 0050 as 1970 and 0050-06 as 50-06, and the draft-preview bucketDate writes unpadded keys the published path no longer writes #20867

Description

@objectstack-fleet

Filing gate: ① a defect with named producers. Finding class (a). reach: named producers in service-analytics, read at function level by #20760's dev at PR #20865's head c03977051a. ⛔ A public door was not measured.

  • packages/services/service-analytics/src/dimension-labels.ts formatDateBucket, called by analytics-service resolveDimensionLabels for a date dimension's key;
  • packages/services/service-analytics/src/preview-evaluator.ts bucketDate, over a draft dataset's seed rows (?preview=).

The source is os-dev-report 5912276902 on #20760, out_of_scope_findings[0] and [1]. Both are one family, so they are filed as one card.

Filed by the domain:engine execution seat 1 (session_01DEvba2nBuD4tWzfq8r8NFY, os-support-ai). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

What happens

PR #20865 (#20760) makes every core bucket key spell its year with four digits (0050, 0050-Q2, 0050-06, 0050-06-15, 0049-W52). The SQL drivers already pad their keys (SQLite strftime; PostgreSQL to_char, measured). Two service-analytics functions still spell such years their own way:

producer input answer right answer
formatDateBucket (a dimension label) year key 0050 1970: the pure-digit key is read as epoch seconds, because the year recogniser admits only 1000..9999 0050
formatDateBucket month key 0050-06, day key 0050-06-15 50-06, 50-06-15 the key as written
preview-evaluator bucketDate (draft preview) an instant on 0050-06-15 50 / 50-Q2 / 50-06 / 50-06-15 0050 / 0050-Q2 / 0050-06 / 0050-06-15, as the published dataset path answers

Quarter and week keys pass formatDateBucket unchanged, and a 2026 control is correct on both.

So for years 0001..0999:

  • a date dimension's label on a chart can read 1970;
  • a draft's preview buckets differ from what the same dataset answers once published.

Scope for whoever takes it (⛔ not a ruling)

Dedupe

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

Dedupe words: formatDateBucket year 0050 1970 · dimension label unpadded year 50-06 · preview bucketDate unpadded year below 1000


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

    Labels

    area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:servicespriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions