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
//! Lifecycle deadlines: the hard TTL cap and idle detection (CORE-21/60).
//!
//! Two independent knobs, never conflated:
//!
//! - **TTL** (`ttl_deadline`) caps total lifetime regardless of activity and
//! always destroys — pausing does not apply, and a paused computer still
//! expires. `SetLifecycle` replaces the deadline from *now*.
//! - **Idle** (`idle_timeout_seconds` + `on_idle`) reacts to inactivity: the
//! window is armed on every `Ready` edge (boot ready, workload exit,
//! resume) and cancelled when a workload starts. Idle means "no running
//! workload" — file activity does NOT re-arm.
//!
//! Both live in the computer's actor: they are two `Sleep`s in its select
//! loop, armed and cancelled by the same transitions that publish. What is
//! left here is the verb that replaces them, because it also has a durable
//! record to write — the timers are in memory, so the record is the only
//! thing a restart can re-arm them from.
//!
//! The apparatus this module used to hold — epoch-stamped timer slots, a
//! `Weak` back to the instance a detached expiry task was armed for, a
//! monitor driving all of it off the event stream, and a lag resync — existed
//! only to answer "is this detached task still talking about the current
//! generation?". A per-computer actor *is* the generation.
use *;