WarpCausalClock
Mints causal Dots for spans and tracks the current happens-before frontier.
Call tick once per span, in the order the spans are created: it allocates the span's own Dot and records the frontier observed so far as that span's predecessors. The frontier then collapses to the new dot, so the next span's predecessors point back here — building the happens-before chain a SpanLink is later derived from.
The clock is span-scoped: it advances on span events only, which keeps inference total — every predecessor dot resolves to a span in the set. Cross-signal causality (a log or metric happening-before a span) is future work.
Recovery is mandatory
A restart that reset seq to 0 would re-mint dots already used by earlier spans and silently corrupt causality. Always recover from a DurableStore at startup, and persist after the spans of a batch are durably exported. tick itself stays pure (non-suspending) so the lock stays tight; persistence is the caller's explicit step.
Thread-safety
seq and the frontier are guarded by an explicit reentrant lock, so the clock is correct under a real multi-threaded dispatcher — not merely under a test dispatcher. limitedParallelism(1) confinement is BANNED (see CLAUDE.md).
Parameters
the stable ReplicaId for this device/process; namespaces every dot.
Functions
Mint the next span's CausalStamp: a fresh Dot whose predecessors are the current frontier (empty on the very first tick). Advances the frontier to the new dot.