todos: reopen an acked keyed row when the caller says so

This commit is contained in:
damocles 2026-08-13 12:54:18 +02:00
commit 1b72ed56ff
12 changed files with 158 additions and 45 deletions

View file

@ -41,6 +41,16 @@ pub enum Request {
/// subsystem-specific dedup key (a matrix room id, a bash task id).
/// A new-or-changed row signals the turn loop; an identical keyed
/// re-push is a silent no-op. Keyless todos always insert as one-offs.
///
/// `reopen_if_acked` (default `false`) governs what "changed" means
/// for an *acked* row with byte-identical `summary`/`source`: by
/// default it stays quiet — the right behavior for a reconciler
/// producer re-announcing a still-true condition (`disk_watch` polling
/// and finding the same problem). A producer whose keyed re-push
/// represents a genuinely new occurrence rather than a restatement
/// (a recurring scheduled prompt firing again with the same body) sets
/// this `true` so an acked row reopens and re-wakes instead of being
/// silently swallowed by the previous occurrence's ack.
UpsertTodo {
subsystem: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -48,6 +58,8 @@ pub enum Request {
summary: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
source: Option<String>,
#[serde(default)]
reopen_if_acked: bool,
},
/// Clear producer-resolved todo(s). `key = Some(k)` clears the one
/// keyed row; `key = None` clears the subsystem's keyless rows; `all