Delete test-only state readers

This commit is contained in:
Meta Vens 2026-08-25 03:21:15 +02:00
commit fca516f54f
4 changed files with 14 additions and 22 deletions

View file

@ -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()?;

View file

@ -179,15 +179,6 @@ impl EpiphanyRepoModelBasis {
Ok(())
}
pub fn validate_current(&self, store_path: impl AsRef<Path>) -> 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();

View file

@ -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<Option<ResidentProviderReadiness>> {
fn load_resident_provider_readiness(store: &Path) -> Result<Option<ResidentProviderReadiness>> {
Ok(readiness_snapshot(store)?.1)
}

View file

@ -2533,13 +2533,6 @@ pub fn cancel_resident_self_turn(
Ok(terminal)
}
pub fn resident_self_terminal_receipts(path: &Path) -> Result<Vec<ResidentSelfTerminalReceipt>> {
Ok(state_cache(path)?
.get_all::<ResidentSelfTerminalReceipt>()?
.into_iter()
.collect())
}
pub fn retain_resident_self_lifecycles(
path: &Path,
retain_closed: usize,