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
68
69
70
71
//! Optional, dependency-safe observation boundary for
//! [`super::KvStageIntegration`]'s resident-prefix cache decisions (plan
//! task 12, ยง8.11). Mirrors the `GenerationReceiptSink`/
//! `GenerationLifecycleIngress` shape in `frontend::generation_receipt`:
//! this crate defines the contract, a host runtime-event system implements
//! it, and `KvStageIntegration` never depends on host-runtime types.
//!
//! Implementations must return promptly: no I/O, no blocking, no panics.
//! A missing or slow observer never changes cache behavior -- every real
//! call site here calls `observe` best-effort AFTER the cache decision is
//! already made, never as a gate on it.
/// One resident-prefix KV cache decision, carrying bounded counts only.
/// Never a cache key, page id, namespace, token ID, or content of any kind.
/// Optional sink for [`KvLifecycleEvent`]s. `try_observe` never returns an
/// error to the caller: an observer that cannot accept an event degrades
/// silently, exactly like [`super::super::frontend::GenerationLifecycleIngress`].