Expand description
Time — one generation point for every persisted timestamp.
Three canonical forms exist in the wild (see
docs/TIMESTAMP_CONVENTIONS.md for the full per-surface registry):
- Epoch milliseconds (
now_unix_millis) — the default for new persisted event records (sessions, friction JSONL, the opencode corpus). Sub-second ordering matters for parallel sessions, and the opencode corpus we correlate against (Phase 4 archaeology) is millis. - Epoch seconds (
now_unix_secs) — legacy schemas already fixed to seconds (karma chain, write-audit journal, sangha locks). Do not migrate casually: readers exist. - RFC 3339 (
now_rfc3339) — human-facing coordination surfaces (lease ledgers, drill reports) where an agent reads the value with a bare eye.
Rules:
- Never hand-roll
SystemTime::now()orUtc::now().timestamp*()at a write site — go through this module so the convention has one implementation. - A persisted timestamp field’s doc comment names its unit.
- Cross-surface correlation converts through typed
chrono::DateTime, never by comparing raw integers (the 1000× ambiguity class).
Functions§
- new_
operation_ id - Generate a monotonic, time-ordered operation ID (UUIDv7 format) for end-to-end multi-step write sequence correlation and crash barrier detection (U6).
- now_
rfc3339 - Current time as RFC 3339 with second precision and
Zoffset — human-facing coordination surfaces (lease ledgers, drill reports). - now_
unix_ millis - Current Unix time in milliseconds — the default for new persisted event records.
- now_
unix_ secs - Current Unix time in seconds — legacy schemas fixed to seconds (karma chain, write-audit journal, sangha locks).