Date a record by the collector's clock, and keep the gate's beside it under its own name #9

Merged
LNK merged 1 commit from claude/occurrence-time into main 2026-09-04 19:47:10 +00:00
Contributor

Every record had one timestamp and it was the wrong one: the gate's clock at write time, sent as time under a description that said "when the event occurred". A record that waited in the queue was dated late by exactly the wait. The collector's own stamp was there all along in the payload, at whole seconds from a different formatter.

What changes. The record is dated by the collector: ts_utc is the payload's at, which every schema requires and every collector takes before sending. The gate's clock goes in a new column, received_at, and on the envelope as gate_time, named for what it is. Retention, digests, ordering and the timeline all go by ts_utc, which now means what it says. A stamp that does not parse, or one from an unset clock stamping 1970, is replaced by the gate's, because a record dated fifty years ago is one fusion would believe. One formatter at one resolution: the collectors' clock now stamps microseconds.

Proof. With the gate's clock five seconds ahead, the stored time is the collector's stamp and the gate's is beside it; 1970 and garbage are replaced; the envelope carries both under their names; microseconds format exactly; stamps sort in order. The first fails against a gate that dates by its own clock, checked by making it one. Linux verifier green on the pinned toolchain. Not run here: the Windows verifier and the end-to-end suite.

Every record had one timestamp and it was the wrong one: the gate's clock at write time, sent as `time` under a description that said "when the event occurred". A record that waited in the queue was dated late by exactly the wait. The collector's own stamp was there all along in the payload, at whole seconds from a different formatter. **What changes.** The record is dated by the collector: `ts_utc` is the payload's `at`, which every schema requires and every collector takes before sending. The gate's clock goes in a new column, `received_at`, and on the envelope as `gate_time`, named for what it is. Retention, digests, ordering and the timeline all go by `ts_utc`, which now means what it says. A stamp that does not parse, or one from an unset clock stamping 1970, is replaced by the gate's, because a record dated fifty years ago is one fusion would believe. One formatter at one resolution: the collectors' clock now stamps microseconds. **Proof.** With the gate's clock five seconds ahead, the stored time is the collector's stamp and the gate's is beside it; 1970 and garbage are replaced; the envelope carries both under their names; microseconds format exactly; stamps sort in order. The first fails against a gate that dates by its own clock, checked by making it one. Linux verifier green on the pinned toolchain. Not run here: the Windows verifier and the end-to-end suite.
Every record had one timestamp and it was the wrong one. `ts_utc` — and `time` on the
envelope, whose description said "when the event occurred on the device" — was the gate's
clock at the moment it wrote the row. A record that waited twelve seconds in the queue was
dated twelve seconds late, and a reader fusing on `time` was fusing on the queue's delay.
The collector's own stamp was there all along, as `at` in every payload, but at whole seconds
from a different formatter — so the two stamps for one instant could be told apart by their
shape, and never by their meaning.

Now the record is dated by the collector. `ts_utc` is the payload's `at`, which every schema
requires and every collector takes before the record is sent; the gate's clock goes in a
second column, `received_at`, and on the envelope as `gate_time`, named for what it is.
Retention, digests, ordering and the timeline all go by `ts_utc`, which now means what it
says. Two stamps are refused and replaced by the gate's: one that does not parse, and one
from a clock that has not been set — a CMOS-reset machine stamps 1970 on every record until
NTP catches up, and a record dated fifty years ago is one fusion would believe, where a
record dated a queue's delay late is not.

One formatter now, at one resolution. `here_os::now_rfc3339` stamps microseconds instead of
truncating to the second, so two records taken in the same second are two instants, and the
collector's stamp and the gate's are the same shape. Rows from before this carry no second
stamp; the envelope leaves `gate_time` out rather than inventing one.

Tests: with the gate's clock five seconds ahead of the collector's stamp, the stored time is
the stamp and the gate's clock is beside it; 1970 and an unparseable stamp are replaced by
the gate's; the envelope carries `time` as the collector's and `gate_time` as the gate's;
microseconds format exactly and never vanish; two stamps in a row sort in order. The first
fails against a gate that dates by its own clock — checked, by making it one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
LNK merged commit a0cef9a69a into main 2026-09-04 19:47:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mikebrandon/here-telemetry-rnd!9
No description provided.