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
//! Reclaiming what a retention policy marks stale.
use async_trait;
use ;
use crate;
/// Deletes the contexts and remembered facts a [`RetentionPolicy`] has expired.
///
/// A store implements this; nothing calls it on its own. There is no timer in
/// here and no background task: a sweep deletes data an operator can never get
/// back, so *when* it runs belongs to whoever assembled the agent, next to the
/// policy they chose. A supervisor calls [`sweep`](Self::sweep) nightly; a test
/// calls it with a `now` it picked.
///
/// Kept off [`AsyncTaskLifecycle`](crate::port::AsyncTaskLifecycle) and the
/// conversation and state ports deliberately. Those are what a *handler* needs
/// to serve a turn, and a handler has no business deleting a conversation. This
/// is an operator capability, so an assembly can hold the stores without
/// exposing it, and a store that cannot delete (a read-only replica, an audited
/// log) can decline to implement it rather than stubbing a method.