From fbf793fdbc673850388ca6c20adce6879a4c3319 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 22 Sep 2026 18:56:50 +0200 Subject: [PATCH] Un-degenerate the R5b/R5c gate-order fixtures The two fixtures pinning the epoch-first gate order used "epiphany.pipeline.campaign.v1" as their foreign type. That id is the pinned leaf's real, currently-registered campaign kind, so is_known_type accepts it and a gate-order mutant that ran the type gate first still passed both fixtures by accident (confirmed on Yggdrasil: both hand-applied mutants survived 70/70 before this fix). Re-point both at a new NEVER_A_KNOWN_TYPE constant that cannot collide with any real PipelineKind id at any epoch this leaf pin carries, so the fixtures actually exercise the epoch-first order. Co-Authored-By: Claude Sonnet 5 --- crates/huginn-mind/src/mind.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/huginn-mind/src/mind.rs b/crates/huginn-mind/src/mind.rs index 55335d6..44e9772 100644 --- a/crates/huginn-mind/src/mind.rs +++ b/crates/huginn-mind/src/mind.rs @@ -349,6 +349,16 @@ mod tests { const FOREIGN_EPOCH: &str = "epiphany.pipeline.epoch.v0"; + /// A type id that is foreign under every epoch, unlike + /// `"epiphany.pipeline.campaign.v1"`: that string names the pinned + /// leaf's real, currently-registered campaign kind, so `is_known_type` + /// accepts it and a gate-order mutant that runs the type gate first + /// still passes these fixtures by accident. `_never_a_kind_` cannot + /// collide with any real `PipelineKind` id at any epoch this leaf pin + /// will ever carry, so these fixtures actually exercise the epoch-first + /// order rather than getting lucky on a real id. + const NEVER_A_KNOWN_TYPE: &str = "epiphany.pipeline._never_a_kind_.v1"; + /// An epoch record under an arbitrary key naming an arbitrary epoch, so a /// key defect and a value defect can be planted apart. fn epoch_record(key: &str, schema_epoch: &str) -> CultCacheEnvelope { @@ -468,7 +478,7 @@ mod tests { /// Pinned by this test. #[test] fn a_foreign_type_with_no_epoch_record_is_missing_identity_not_foreign_store() { - let store = planted(vec![foreign("epiphany.pipeline.campaign.v1")]); + let store = planted(vec![foreign(NEVER_A_KNOWN_TYPE)]); assert_eq!(Mind::open_with(store, &slug(INSTANCE)).err(), Some(MindRefusal::MissingIdentity)); } @@ -481,7 +491,7 @@ mod tests { /// key. #[test] fn a_foreign_epoch_value_at_the_current_key_beside_a_foreign_type_is_foreign_epoch() { - let store = planted(vec![epoch_record(PIPELINE_SCHEMA_EPOCH, FOREIGN_EPOCH), foreign("epiphany.pipeline.campaign.v1")]); + let store = planted(vec![epoch_record(PIPELINE_SCHEMA_EPOCH, FOREIGN_EPOCH), foreign(NEVER_A_KNOWN_TYPE)]); assert_eq!( Mind::open_with(store, &slug(INSTANCE)).err(), Some(MindRefusal::ForeignEpoch { found: FOREIGN_EPOCH.into(), expected: PIPELINE_SCHEMA_EPOCH.into() })