1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! `EventId`: a UUIDv7 identifier minted once by the emitting process.
//!
//! Why: `HarnessEvent.seq` is process-monotonic (per-session in trusty-code),
//! so two producers stamp colliding values, and it carries no causal
//! information. The dashboard's tree view (DOC-73 §5.2) needs an
//! identifier that stays globally unique and stable through every relay
//! hop, so events arriving out of order or over different transports
//! still assemble into one call graph (issue #6847, DOC-73 §3.1).
//! What: A newtype over `uuid::Uuid`. `EventId::new` mints a UUIDv7 —
//! time-ordered, so ids sort close to `seq`/`at` order even before a
//! central bus assigns a total order. Serializes as the standard
//! hyphenated UUID string via `#[serde(transparent)]`. Note: a UUIDv7's
//! embedded millisecond timestamp is redundant with `HarnessEvent.at`
//! (the envelope's own, explicitly-stamped time) — readers needing an
//! event's time should use `at`, not decode the id. The id's
//! time-ordering is a sort-friendliness property, not a second
//! timestamp source.
//! Test: `super::tests::event_id_round_trips`,
//! `super::tests::event_id_new_mints_distinct_ids`,
//! `super::tests::event_id_display_matches_serialized_string`.
// #6847: minting is a plain constructor callers invoke at emit time (DOC-73
// §3.1 — "id is a UUIDv7 minted by the emitting process"), never a bus or
// transport concern; `control_bus_declares_no_transport` in `tests.rs` holds
// this file to the same types-only boundary as the rest of the module.
use fmt;
use ;
use Uuid;
/// Globally-unique, transport-stable identifier for one `HarnessEvent`.
///
/// Why: See module docs — `seq` cannot serve as cross-process identity.
/// What: Wraps a `uuid::Uuid`. `Copy`/`Eq`/`Hash` so it is cheap to use as a
/// map key (the tree view indexes nodes by `id`).
/// Test: `super::tests::event_id_round_trips`.
;