From 5a0479446ebf86301174aed592614bd30d96492c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 24 Aug 2026 04:20:27 +0200 Subject: [PATCH] Delete callerless helper APIs --- epiphany-core/src/agent_launch.rs | 43 ------------------------------ epiphany-core/src/lib.rs | 4 --- epiphany-core/src/resident_self.rs | 14 ---------- epiphany-core/src/state_ledger.rs | 29 -------------------- 4 files changed, 90 deletions(-) diff --git a/epiphany-core/src/agent_launch.rs b/epiphany-core/src/agent_launch.rs index b9031d72..20932392 100644 --- a/epiphany-core/src/agent_launch.rs +++ b/epiphany-core/src/agent_launch.rs @@ -13,35 +13,6 @@ pub const EPIPHANY_VERIFICATION_OWNER_ROLE: &str = "epiphany-verifier"; pub const EPIPHANY_REORIENT_LAUNCH_BINDING_ID: &str = "reorient-worker"; pub const EPIPHANY_REORIENT_OWNER_ROLE: &str = "epiphany-reorient"; -pub fn epiphany_role_binding_id(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> { - match role_id { - EpiphanyRoleResultRoleId::Imagination => Ok(EPIPHANY_IMAGINATION_ROLE_BINDING_ID), - EpiphanyRoleResultRoleId::Research => Ok(EPIPHANY_RESEARCH_ROLE_BINDING_ID), - EpiphanyRoleResultRoleId::Modeling => Ok(EPIPHANY_MODELING_ROLE_BINDING_ID), - EpiphanyRoleResultRoleId::Verification => Ok(EPIPHANY_VERIFICATION_ROLE_BINDING_ID), - EpiphanyRoleResultRoleId::Implementation => Err( - "implementation is owned by the main coding agent; no role specialist launch template exists" - .to_string(), - ), - EpiphanyRoleResultRoleId::Reorientation => Err( - "reorientation uses epiphany.coordinator.reorient.launch and epiphany.coordinator.reorient.result.read" - .to_string(), - ), - } -} - -pub fn epiphany_role_owner(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> { - match role_id { - EpiphanyRoleResultRoleId::Imagination => Ok(EPIPHANY_IMAGINATION_OWNER_ROLE), - EpiphanyRoleResultRoleId::Research => Ok(EPIPHANY_RESEARCH_OWNER_ROLE), - EpiphanyRoleResultRoleId::Modeling => Ok(EPIPHANY_MODELING_OWNER_ROLE), - EpiphanyRoleResultRoleId::Verification => Ok(EPIPHANY_VERIFICATION_OWNER_ROLE), - EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => { - Err(epiphany_role_binding_id(role_id).unwrap_err()) - } - } -} - pub fn epiphany_role_label(role_id: EpiphanyRoleResultRoleId) -> &'static str { match role_id { EpiphanyRoleResultRoleId::Implementation => "implementation", @@ -760,17 +731,3 @@ pub fn epiphany_reorient_launch_output_schema() -> serde_json::Value { "additionalProperties": true }) } - -pub fn unique_strings(values: impl IntoIterator) -> Vec { - let mut unique = Vec::new(); - extend_unique_strings(&mut unique, values); - unique -} - -fn extend_unique_strings(target: &mut Vec, values: impl IntoIterator) { - for value in values { - if !target.iter().any(|existing| existing == &value) { - target.push(value); - } - } -} diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 7b875e9f..3cdc9dd4 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -71,11 +71,8 @@ pub use agent_launch::epiphany_frontier_verdict_modeling_output_schema; pub use agent_launch::epiphany_imagination_consideration_output_schema; pub use agent_launch::epiphany_proposal_modeling_output_schema; pub use agent_launch::epiphany_reorient_launch_output_schema; -pub use agent_launch::epiphany_role_binding_id; pub use agent_launch::epiphany_role_label; pub use agent_launch::epiphany_role_launch_output_schema; -pub use agent_launch::epiphany_role_owner; -pub use agent_launch::unique_strings; pub use atlas::*; pub use causal_work_identity::*; pub use continuity_gateway::*; @@ -347,7 +344,6 @@ pub use state_ledger::add_state_branch; pub use state_ledger::append_state_evidence; pub use state_ledger::close_state_branch; pub use state_ledger::load_state_ledger; -pub use state_ledger::state_ledger_status; pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION; pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE; pub use substrate_gate::SubstrateGateRepoAccessGrantReceipt; diff --git a/epiphany-core/src/resident_self.rs b/epiphany-core/src/resident_self.rs index a516b73e..aee8a9a6 100644 --- a/epiphany-core/src/resident_self.rs +++ b/epiphany-core/src/resident_self.rs @@ -2333,20 +2333,6 @@ pub fn validate_resident_self_prepared_objective( )) } -pub fn validate_resident_self_coordinator_receipt( - lease: &ResidentSelfTurnLease, - coordinator: &crate::EpiphanyCoordinatorRunReceipt, -) -> Result<()> { - validate_resident_self_coordinator_receipt_binding(lease, coordinator)?; - if !matches!( - coordinator.status.as_str(), - "planned" | "needsReview" | "completed" - ) { - return Err(anyhow!("coordinator terminal receipt is not successful")); - } - Ok(()) -} - pub fn validate_resident_self_coordinator_receipt_binding( lease: &ResidentSelfTurnLease, coordinator: &crate::EpiphanyCoordinatorRunReceipt, diff --git a/epiphany-core/src/state_ledger.rs b/epiphany-core/src/state_ledger.rs index ed5c1f93..ac9f88a9 100644 --- a/epiphany-core/src/state_ledger.rs +++ b/epiphany-core/src/state_ledger.rs @@ -8,7 +8,6 @@ use serde::Serialize; use serde_json::Value; use std::path::Path; -pub const STATE_LEDGER_STORE_TYPE: &str = "epiphany.state_ledger"; pub const STATE_LEDGER_KEY: &str = "default"; pub const STATE_LEDGER_SCHEMA_VERSION: &str = "epiphany.state_ledger.v0"; @@ -43,34 +42,6 @@ pub struct EpiphanyLedgerEvidenceRecord { pub branch: Option, } -pub fn state_ledger_status(store_path: impl AsRef) -> Result { - let store_path = store_path.as_ref(); - if !store_path.exists() { - return Ok(serde_json::json!({ - "ok": false, - "present": false, - "store": store_path, - "entryType": STATE_LEDGER_STORE_TYPE, - })); - } - let entry = load_state_ledger(store_path)?; - let active = entry - .branches - .iter() - .filter(|branch| branch.status == "active") - .count(); - Ok(serde_json::json!({ - "ok": true, - "present": true, - "store": store_path, - "entryType": STATE_LEDGER_STORE_TYPE, - "branches": entry.branches.len(), - "activeBranches": active, - "evidence": entry.evidence.len(), - "latestEvidence": entry.evidence.iter().rev().take(8).collect::>(), - })) -} - pub fn load_state_ledger(store_path: impl AsRef) -> Result { let store_path = store_path.as_ref(); let mut cache = state_ledger_cache(store_path)?;