From 3eca33949ae77ffef6cb822676cbdf1014abfaa0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 23 Aug 2026 22:23:04 +0200 Subject: [PATCH] Delete aggregate runtime status projection --- .../src/bin/epiphany-mvp-coordinator.rs | 8 -- epiphany-core/src/lib.rs | 3 +- epiphany-core/src/runtime_spine.rs | 90 +------------------ .../src/bin/epiphany-openai-runtime.rs | 8 +- epiphany-openai-runtime/src/lib.rs | 5 +- .../src/persona_executor.rs | 4 +- 6 files changed, 11 insertions(+), 107 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs index fbbac274..33f5f3e6 100644 --- a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs +++ b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs @@ -23,7 +23,6 @@ use epiphany_core::put_hands_action_intent; use epiphany_core::put_hands_action_review; use epiphany_core::put_repo_frontier_hands_authority; use epiphany_core::put_substrate_gate_repo_access_grant_receipt; -use epiphany_core::runtime_spine_status; use epiphany_core::select_and_commit_repo_frontier_route; use epiphany_core::substrate_gate_coordinator_implementation_grant; use epiphany_core::{ @@ -1331,7 +1330,6 @@ fn run_coordinator(args: &Args) -> Result { "coordinator-final-status.txt".to_string(), "coordinator-final-action.txt".to_string(), "agent-function-telemetry.json".to_string(), - "runtime-spine-status.json".to_string(), ]; let sealed_artifact_manifest = Vec::new(); let receipt_created_at = now(); @@ -1386,7 +1384,6 @@ fn run_coordinator(args: &Args) -> Result { final_runtime_job_id: final_action["runtimeJobId"].as_str().map(str::to_string), }; finalize_coordinator_run(&runtime_store, &coordinator_run_receipt)?; - let runtime_status = runtime_spine_status(&runtime_store)?; let summary = json!({ "objective": "Coordinate the Epiphany MVP lanes through native typed state and runtime organs.", "artifactDir": artifact_dir, @@ -1397,7 +1394,6 @@ fn run_coordinator(args: &Args) -> Result { "codexHome": codex_home, "mcpConfig": mcp_config, "runtimeStore": runtime_store, - "runtimeSpine": runtime_status, "workspace": cwd, "threadId": operator_final_status["threadId"], "mode": args.mode, @@ -1419,10 +1415,6 @@ fn run_coordinator(args: &Args) -> Result { &artifact_dir.join("coordinator-final-status.json"), &summary["finalStatus"], )?; - write_json( - &artifact_dir.join("runtime-spine-status.json"), - &summary["runtimeSpine"], - )?; fs::write( artifact_dir.join("coordinator-final-status.txt"), final_rendered, diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index d26626c5..74c5d591 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -248,7 +248,6 @@ pub use runtime_spine::EpiphanyRuntimeReorientWorkerResult; pub use runtime_spine::EpiphanyRuntimeRoleWorkerResult; pub use runtime_spine::EpiphanyRuntimeSession; pub use runtime_spine::EpiphanyRuntimeSessionStatus; -pub use runtime_spine::EpiphanyRuntimeSpineStatus; pub use runtime_spine::EpiphanyRuntimeSwarmBinding; pub use runtime_spine::EpiphanyRuntimeToolExecutionBinding; pub use runtime_spine::EpiphanyRuntimeWorkerLaunchRequest; @@ -332,6 +331,7 @@ pub use runtime_spine::runtime_hands_commit_receipt; pub use runtime_spine::runtime_hands_patch_receipt; pub use runtime_spine::runtime_has_actionable_hands_frontier; pub use runtime_spine::runtime_job_snapshot; +pub use runtime_spine::runtime_identity; pub use runtime_spine::runtime_registered_document_types; pub use runtime_spine::runtime_reorient_worker_result; pub use runtime_spine::runtime_repo_frontier_planning_lifecycle; @@ -339,7 +339,6 @@ pub use runtime_spine::runtime_repo_frontier_research_lifecycle; pub use runtime_spine::runtime_requested_public_source_refs_for_worker; pub use runtime_spine::runtime_role_worker_result; pub use runtime_spine::runtime_spine_cache; -pub use runtime_spine::runtime_spine_status; pub use runtime_spine::runtime_typed_request_attempt_exists; pub use runtime_spine::runtime_typed_request_fulfillment; pub use runtime_spine::runtime_worker_launch_request; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 1b7d19f2..1519221b 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -773,23 +773,6 @@ pub enum EpiphanyRuntimeJobStatus { Cancelled, } -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct EpiphanyRuntimeSpineStatus { - pub store: String, - pub present: bool, - pub runtime_id: Option, - pub display_name: Option, - pub sessions: usize, - pub active_sessions: usize, - pub jobs: usize, - pub open_jobs: usize, - pub job_results: usize, - pub tool_invocation_intents: usize, - pub tool_invocation_receipts: usize, - pub pending_tool_invocations: usize, - pub supported_document_types: Vec, -} - #[derive(Clone, Debug, PartialEq, Eq)] pub struct RuntimeSpineInitOptions { pub runtime_id: String, @@ -9917,83 +9900,16 @@ pub fn complete_runtime_job( Ok(result) } -pub fn runtime_spine_status(store_path: impl AsRef) -> Result { +pub fn runtime_identity(store_path: impl AsRef) -> Result> { let store_path = store_path.as_ref(); if !store_path.exists() { - return Ok(EpiphanyRuntimeSpineStatus { - store: store_path.display().to_string(), - present: false, - runtime_id: None, - display_name: None, - sessions: 0, - active_sessions: 0, - jobs: 0, - open_jobs: 0, - job_results: 0, - tool_invocation_intents: 0, - tool_invocation_receipts: 0, - pending_tool_invocations: 0, - supported_document_types: Vec::new(), - }); + return Ok(None); } let mut cache = runtime_spine_cache(store_path)?; cache .pull_all_backing_stores() .with_context(|| format!("failed to read runtime spine {}", store_path.display()))?; - let identity = cache.get::(RUNTIME_IDENTITY_KEY)?; - let sessions = cache.get_all::()?; - let jobs = cache.get_all::()?; - let job_results = cache.get_all::()?; - let tool_intents = cache.get_all::()?; - let tool_receipts = cache.get_all::()?; - let receipt_intent_ids = tool_receipts - .iter() - .map(|receipt| receipt.intent_id.as_str()) - .collect::>(); - let active_sessions = sessions - .iter() - .filter(|session| { - matches!( - session.status, - EpiphanyRuntimeSessionStatus::Active - | EpiphanyRuntimeSessionStatus::WaitingForReview - ) - }) - .count(); - let open_jobs = jobs - .iter() - .filter(|job| { - matches!( - job.status, - EpiphanyRuntimeJobStatus::Queued - | EpiphanyRuntimeJobStatus::Running - | EpiphanyRuntimeJobStatus::WaitingForReview - ) - }) - .count(); - let supported_document_types = if identity.is_some() { - runtime_registered_document_types()? - } else { - Vec::new() - }; - Ok(EpiphanyRuntimeSpineStatus { - store: store_path.display().to_string(), - present: identity.is_some(), - runtime_id: identity.as_ref().map(|item| item.runtime_id.clone()), - display_name: identity.as_ref().map(|item| item.display_name.clone()), - sessions: sessions.len(), - active_sessions, - jobs: jobs.len(), - open_jobs, - job_results: job_results.len(), - tool_invocation_intents: tool_intents.len(), - tool_invocation_receipts: tool_receipts.len(), - pending_tool_invocations: tool_intents - .iter() - .filter(|intent| !receipt_intent_ids.contains(intent.intent_id.as_str())) - .count(), - supported_document_types, - }) + cache.get::(RUNTIME_IDENTITY_KEY) } pub fn runtime_registered_document_types() -> Result> { diff --git a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs index 381d4433..85740481 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs @@ -76,10 +76,8 @@ async fn main() -> Result<()> { other => return Err(anyhow!("unknown preflight argument: {other}")), } } - let status = epiphany_core::runtime_spine_status(&store)?; - if !status.present { - return Err(anyhow!("runtime spine is absent at {}", store.display())); - } + let identity = epiphany_core::runtime_identity(&store)? + .ok_or_else(|| anyhow!("runtime spine is absent at {}", store.display()))?; let registered_document_types = epiphany_core::runtime_registered_document_types()?; let missing: Vec = required_document_types .iter() @@ -111,7 +109,7 @@ async fn main() -> Result<()> { "schemaCatalogSha256": schema_catalog_sha256, "preflightWitnessId": preflight_witness_id, "runtimeStore": store, - "runtimeId": status.runtime_id, + "runtimeId": identity.runtime_id, "requiredDocumentTypes": required_document_types, "registeredDocumentTypes": registered_document_types, "schemaPreflightPassed": true, diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index fe5c4ab5..cbf53286 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -23,8 +23,8 @@ use epiphany_core::open_runtime_model_execution; use epiphany_core::put_runtime_reorient_worker_result; use epiphany_core::put_runtime_role_worker_result; use epiphany_core::put_runtime_tool_execution_intent; +use epiphany_core::runtime_identity; use epiphany_core::runtime_spine_cache; -use epiphany_core::runtime_spine_status; use epiphany_model_adapter::EpiphanyModelInputItem; use epiphany_model_adapter::EpiphanyModelReceipt; use epiphany_model_adapter::EpiphanyModelRequest; @@ -876,8 +876,7 @@ pub fn fail_model_backed_worker_job( } pub fn ensure_openai_runtime_ready(options: &EpiphanyOpenAiRuntimeOptions) -> Result<()> { - let status = runtime_spine_status(&options.store_path)?; - if status.present { + if runtime_identity(&options.store_path)?.is_some() { return Ok(()); } initialize_runtime_spine( diff --git a/epiphany-openai-runtime/src/persona_executor.rs b/epiphany-openai-runtime/src/persona_executor.rs index 1c2afdaa..bcb707ff 100644 --- a/epiphany-openai-runtime/src/persona_executor.rs +++ b/epiphany-openai-runtime/src/persona_executor.rs @@ -680,7 +680,7 @@ mod tests { ) -> Pin> + Send + 'a>> { self.calls.push(stage.to_string()); Box::pin(async move { - if !epiphany_core::runtime_spine_status(store_path)?.present { + if epiphany_core::runtime_identity(store_path)?.is_none() { epiphany_core::initialize_runtime_spine( store_path, epiphany_core::RuntimeSpineInitOptions { @@ -752,7 +752,7 @@ mod tests { cultmesh_store: PathBuf, allowed_channel_ids: Vec, ) -> Result { - if !epiphany_core::runtime_spine_status(store)?.present { + if epiphany_core::runtime_identity(store)?.is_none() { epiphany_core::initialize_runtime_spine( store, epiphany_core::RuntimeSpineInitOptions {