huskies: merge 889

This commit is contained in:
dave
2026-05-01 14:56:13 +00:00
parent 61cf7684de
commit f8a295eaec
7 changed files with 215 additions and 3 deletions
+8 -1
View File
@@ -6,7 +6,7 @@
//! - [`init`]: async startup and keypair persistence
//! - [`apply`]: write path (sign, apply, persist, broadcast)
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use std::sync::{Mutex, OnceLock};
use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp};
@@ -67,6 +67,12 @@ pub(super) struct CrdtState {
/// Newly-created registers (post-init) must have their Lamport clock
/// advanced to this floor so they don't re-emit low sequence numbers.
pub(super) lamport_floor: u64,
/// Story IDs permanently tombstoned via `evict_item`.
///
/// `write_item` consults this set before inserting a new CRDT entry so
/// that a concurrent or late-arriving write cannot resurrect a deleted
/// story. Rebuilt from the CRDT op log on restart.
pub(super) tombstones: HashSet<String>,
}
// ── Singleton and accessor ───────────────────────────────────────────
@@ -134,6 +140,7 @@ pub fn init_for_test() {
gateway_project_index: HashMap::new(),
persist_tx,
lamport_floor: 0,
tombstones: HashSet::new(),
};
let _ = lock.set(Mutex::new(state));
}