db: persist jupes across restart (event-source them)
All checks were successful
CI / check (push) Successful in 3m50s

A fold-parity property test caught it: jupes were plain in-memory Db fields
that logged no event, so after any services restart every juped server was
silently un-juped and could relink. Moved jupes into NetData (like akills/
forbids/groups) and event-sourced them with JupeAdded/JupeRemoved (Local
scope), so a jupe now replays from the log. Adds the round-trip property test
(live state == replayed state) as a permanent guard against this bug class.
This commit is contained in:
Jean Chevronnet 2026-07-16 10:56:22 +00:00
parent 61005f52f5
commit 90167dd46f
No known key found for this signature in database
6 changed files with 119 additions and 13 deletions

View file

@ -1300,6 +1300,8 @@ fn audit_summary(event: &db::Event) -> Option<String> {
AkillRemoved { kind, mask } => format!("lifted the {} on \x02{mask}\x02", ban_kind_label(kind)),
ForbidAdded { kind, mask, reason, .. } => format!("forbade {} \x02{mask}\x02 ({reason})", kind.to_ascii_lowercase()),
ForbidRemoved { kind, mask } => format!("un-forbade {} \x02{mask}\x02", kind.to_ascii_lowercase()),
JupeAdded { name, reason, .. } => format!("juped server \x02{name}\x02 ({reason})"),
JupeRemoved { name } => format!("lifted the jupe on \x02{name}\x02"),
AccountOperNoteSet { account, note } => match note {
Some(_) => format!("set a staff note on \x02{account}\x02"),
None => format!("cleared the staff note on \x02{account}\x02"),