From b6cbf53a54af2eb86dd0b95edd554c26c64a82a6 Mon Sep 17 00:00:00 2001 From: soul-probe Date: Wed, 30 Sep 2026 00:17:16 +0200 Subject: [PATCH] Odin: an invalid projection of Odin's own incarnation is a refused authority; sibling test uses another target Co-Authored-By: Claude Sonnet 5.5 --- crates/odin-daemon/src/lib.rs | 8 ++++++-- crates/odin-daemon/src/main.rs | 29 +++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/crates/odin-daemon/src/lib.rs b/crates/odin-daemon/src/lib.rs index d6e9d88..5124e6e 100644 --- a/crates/odin-daemon/src/lib.rs +++ b/crates/odin-daemon/src/lib.rs @@ -303,7 +303,9 @@ fn assemble_projection( activation, current_lease, }; - projection.validate()?; + projection + .validate() + .context(PresenceAuthorityRefused("Idunn's projection is invalid"))?; Ok(projection) } @@ -747,7 +749,9 @@ where projection: IdunnRuntimeProjection, incoming: Option<(&[u8], u64)>, ) -> Result> { - projection.validate()?; + projection + .validate() + .context(PresenceAuthorityRefused("Idunn's projection is invalid"))?; let now = self.clock.now_unix_millis()?; let (authority, projection_disagreements) = classify_runtime_authority(&projection, &self.idunn_anchor, now) diff --git a/crates/odin-daemon/src/main.rs b/crates/odin-daemon/src/main.rs index 200a81b..766b04a 100644 --- a/crates/odin-daemon/src/main.rs +++ b/crates/odin-daemon/src/main.rs @@ -1860,8 +1860,7 @@ mod tests { fn one_undecodable_incarnation_leaves_the_others_and_the_catalog_readable() -> Result<()> { let mut odin = activated_odin()?; let mut candidate = odin.state.borrow().authority_material.expected.clone(); - candidate.plan_id = digest('9'); - candidate.incarnation_id = "odin/generation-2".into(); + candidate.target = "sibling".into(); candidate.validate()?; let candidate_key = IncarnationRef::of(&candidate)?.key(); // "aaghost" sorts before "odin", so a refresh that stops at its first @@ -1940,6 +1939,32 @@ mod tests { Ok(()) } + /// Idunn's activation of Odin carries a signature Idunn's anchor does not + /// verify: the authority cannot be verified. + #[test] + fn an_activation_that_does_not_verify_ends_odin() -> Result<()> { + let mut odin = activated_odin()?; + odin.pass()?; + odin.tamper_projection(|entries| { + entries + .into_iter() + .map(|mut entry| { + if entry.r#type == IdunnRuntimeActivationRecord::TYPE { + let mut activation = + IdunnRuntimeActivationRecord::decode_canonical(&entry.payload) + .unwrap(); + activation.signature[0] ^= 1; + entry.payload = activation.canonical_bytes().unwrap(); + } + entry + }) + .collect() + })?; + odin.timers = ServingTimers::default(); + assert_refused(&odin.pass().unwrap_err()); + Ok(()) + } + /// The projected provider anchor names Odin's signer identity but carries /// a key that identity does not derive from: the authority cannot verify. #[test]