Story: Carry six-digit microseconds in every timestamp the platform writes

Table of Contents

This page documents a story in Sprint 28. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

1. Goal

Every timestamp the platform writes carries six digits of microseconds, and the parser reads them back, so a time_point survives a round trip through the database or the wire to the microsecond.

2. Status

Field Value
State DONE
Parent sprint Sprint 28
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-16

3. Acceptance

  • to_iso8601_utc writes six fractional digits and parse_utc_timestamp reads one to six back.
  • A time_point survives to_iso8601_utc then from_iso8601_utc to the microsecond.
  • The market observation test asserts the round trip and passes.

4. Tasks

Task State Start End Description
Scaffold story: Carry six-digit microseconds in every timestamp the platform writes DONE 2026-10-16 2026-10-17 Story scaffolding rides this task: documents, sprint wiring, and the scaffold PR. Close it before merging that PR.
Add six-digit microseconds to the formatter and its parser DONE 2026-10-16 2026-10-17 Initial task for: Carry six-digit microseconds in every timestamp the platform writes

5. Decisions

  • The writer and the reader change together. Reason: a writer that states a fraction the reader ignores looks fixed until the value is read back.
  • Six digits, always. Reason: PostgreSQL states none at zero microseconds, so the reader accepts an absent fraction, but a writer that varies its width makes the wire form unstable.
  • The market ingest assertion is tightened back to the millisecond. Reason: main had answered the same defect by weakening it to a whole second and recording the truncation as intended; the fix makes the millisecond true.
  • The platform and wire layers change; the entity layer does not. Reason: db_timestamp is rfl::Timestamp, which wraps a std::tm with no sub-second field, so no format string can give it a fraction.

6. Out of scope

  • Replacing db_timestamp so the entity layer's audit columns and its mappers also carry microseconds. That is a change to every entity and mapper, not a format string, and it needs its own story.

Emacs 29.3 (Org mode 9.6.15)