From fca516f54fcbe3117d6ae2ef967643fa8dc00cb2 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 25 Aug 2026 03:21:15 +0200 Subject: [PATCH] Delete test-only state readers --- epiphany-core/src/current_work.rs | 13 ++++++++++--- epiphany-core/src/repo_model_documents.rs | 12 ++---------- epiphany-core/src/resident_readiness.rs | 4 ++-- epiphany-core/src/resident_self.rs | 7 ------- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/epiphany-core/src/current_work.rs b/epiphany-core/src/current_work.rs index 1e654a51..be830ea6 100644 --- a/epiphany-core/src/current_work.rs +++ b/epiphany-core/src/current_work.rs @@ -11,6 +11,8 @@ use crate::{ #[cfg(test)] use crate::RepoFrontierResearchContinuationAction; +#[cfg(test)] +use cultcache_rs::{CacheBackingStore, SingleFileMessagePackBackingStore}; pub const BODY_MODELING_DECISION_RECEIPT_SCHEMA_VERSION: &str = "epiphany.mind.body_modeling_decision.v1"; @@ -3587,9 +3589,14 @@ mod tests { "a grant derived from the prior Mind projection must not launch" ); assert!(crate::pending_resident_self_grant(&resident_store)?.is_none()); - let terminal_receipts = crate::resident_self_terminal_receipts(&resident_store)?; - assert_eq!(terminal_receipts.len(), 1); - assert_eq!(terminal_receipts[0].terminal_status, "superseded"); + let terminal = SingleFileMessagePackBackingStore::new(&resident_store) + .pull_all()? + .into_iter() + .find(|entry| entry.r#type == crate::ResidentSelfTerminalReceipt::TYPE) + .expect("superseded grant must leave one terminal receipt"); + let terminal: crate::ResidentSelfTerminalReceipt = + rmp_serde::from_slice(&terminal.payload)?; + assert_eq!(terminal.terminal_status, "superseded"); assert_current_work_reentry_is_read_only(&store, &scheduled_work)?; let mut scheduled_cache = crate::runtime_spine_cache(&store)?; scheduled_cache.pull_all_backing_stores()?; diff --git a/epiphany-core/src/repo_model_documents.rs b/epiphany-core/src/repo_model_documents.rs index 5b66ca6e..ba47407c 100644 --- a/epiphany-core/src/repo_model_documents.rs +++ b/epiphany-core/src/repo_model_documents.rs @@ -179,15 +179,6 @@ impl EpiphanyRepoModelBasis { Ok(()) } - pub fn validate_current(&self, store_path: impl AsRef) -> Result<()> { - self.validate()?; - let current = assemble_repo_model_view(store_path)?.reasoning_basis(); - if current != *self { - return Err(anyhow!("RepoModel basis is stale")); - } - Ok(()) - } - pub fn validate_against_cache(&self, cache: &CultCache) -> Result<()> { self.validate()?; let live = cache.snapshot_envelopes(); @@ -2251,7 +2242,8 @@ mod tests { source.document_type == crate::AtlasSurfaceOffer::TYPE && source.document_key == offer_id.to_string() })); - offer_view.reasoning_basis().validate_current(&store)?; + cache.pull_all_backing_stores()?; + offer_view.reasoning_basis().validate_against_cache(&cache)?; let eve = crate::AtlasRepositoryIdentity::new("gamecult-local", "eve")?; let eve_surface = uuid::Uuid::new_v4(); diff --git a/epiphany-core/src/resident_readiness.rs b/epiphany-core/src/resident_readiness.rs index b9fdfb6f..fae352bd 100644 --- a/epiphany-core/src/resident_readiness.rs +++ b/epiphany-core/src/resident_readiness.rs @@ -214,7 +214,7 @@ pub struct ResidentProviderReadiness { } impl ResidentProviderReadiness { - pub fn validate(&self) -> Result<()> { + fn validate(&self) -> Result<()> { if self.schema_version != RESIDENT_PROVIDER_READINESS_SCHEMA_VERSION { bail!("resident provider readiness schema is unsupported"); } @@ -295,7 +295,7 @@ pub fn publish_resident_provider_readiness( Ok(readiness) } -pub fn load_resident_provider_readiness(store: &Path) -> Result> { +fn load_resident_provider_readiness(store: &Path) -> Result> { Ok(readiness_snapshot(store)?.1) } diff --git a/epiphany-core/src/resident_self.rs b/epiphany-core/src/resident_self.rs index cfbc5239..ef8d40a6 100644 --- a/epiphany-core/src/resident_self.rs +++ b/epiphany-core/src/resident_self.rs @@ -2533,13 +2533,6 @@ pub fn cancel_resident_self_turn( Ok(terminal) } -pub fn resident_self_terminal_receipts(path: &Path) -> Result> { - Ok(state_cache(path)? - .get_all::()? - .into_iter() - .collect()) -} - pub fn retain_resident_self_lifecycles( path: &Path, retain_closed: usize,