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
//! The result a coordination mode hands back to the kernel.
//!
//! The `Mode` *trait* itself lives in `macp-modes` (behavior), but this enum
//! (data) lives in core because [`crate::session::Session::apply_mode_response`]
//! consumes it — keeping it here avoids a `macp-core -> macp-modes` cycle.
/// The result of a Mode processing a message.
/// The runtime applies this response to mutate session state.
/// `#[non_exhaustive]`: downstream wildcard arms must treat unknown responses
/// as no-ops or rejections, never as resolutions.
/// Kernel-supplied context accompanying an accepted-for-processing message.
///
/// `accepted_at_ms` is the runtime's acceptance timestamp — the same value
/// recorded as the log entry's `received_at_ms`, so live processing and
/// replay observe the identical clock. Modes that need a trustworthy time
/// source (e.g. Handoff's implicit-accept timeout) must use this, never the
/// client-supplied `Envelope.timestamp_unix_ms`, which the sender can forge.
///
/// `#[non_exhaustive]`: construct via [`MessageContext::new`] so fields can be
/// added without breaking mode implementations.