Skip to content

fix(telemetry): a sink record's day comes from the moment it parses to, never from its text #825

Closed

Description

@blafourcade

Description

telemetrySinkRecordDayKey picks the UTC day a stored record belongs to. After checking that event_timestamp parses, it takes a shortcut: any string of 10 characters or more that ends in Z is sliced to its first 10 characters instead of being read through the parsed date. A timestamp that parses but is not in canonical ISO form gets a wrong day, or a key that is no day at all.

Affected file(s)

cli/src/contexts/telemetry/domain/telemetry-sink-record.ts, telemetrySinkRecordDayKey (the at.endsWith("Z") branch).

Expected

The key is the UTC day of the moment the string parses to: parsed.toISOString().slice(0, 10).

Observed

Node 24, same logic as the function:

event_timestamp key returned actual UTC day
2026-09-10T24:00:00Z 2026-09-10 2026-09-11
Thu, 10 Sep 2026 23:00:00 Z Thu, 10 Se 2026-09-10
10 Sep 2026 23:30 Z 10 Sep 202 2026-09-10
+002026-09-10T10:00:00Z +002026-09 2026-09-10

A key like Thu, 10 Se falls outside every period, so the record drops out of a report without being counted as undated. The function's own comments name that failure as the one to avoid.

AI tool

Any. The sink is tool-independent.

aidd-cli version

5.3.0, and next.

OS

Any.

Additional context

Latent: this CLI writes canonical toISOString() timestamps itself. A sink shared through AIDD_TELEMETRY_DIR can still hold lines another writer produced. Found by the #799 mutation pass on the telemetry context.

Activity

  1. added theissue type on Sep 10, 2026
  2. moved this from Ideation to In Progress in AIDD Roadmapon Sep 10, 2026
  3. moved this from In Progress to In review in AIDD Roadmapon Sep 10, 2026
  4. added a commit that references this issue on Sep 10, 2026
    70f9bca
  5. moved this from In review to Done in AIDD Roadmapon Sep 10, 2026
  6. closed this as completedby moving to Done in AIDD Roadmapon Sep 10, 2026
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

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions