From 27c8389c385b30c9df238aee963242f08f99fe18 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 23 Aug 2026 22:31:09 +0200 Subject: [PATCH] Collapse prepared heartbeat job wrapper --- epiphany-core/src/current_work.rs | 19 ++++++++----------- epiphany-core/src/lib.rs | 1 - epiphany-core/src/reorientation_work.rs | 2 +- epiphany-core/src/runtime_spine.rs | 10 ++-------- .../src/bin/epiphany-openai-runtime.rs | 2 +- epiphany-openai-runtime/src/lib.rs | 2 +- 6 files changed, 13 insertions(+), 23 deletions(-) diff --git a/epiphany-core/src/current_work.rs b/epiphany-core/src/current_work.rs index e5e96544..9b0fd6a3 100644 --- a/epiphany-core/src/current_work.rs +++ b/epiphany-core/src/current_work.rs @@ -1207,7 +1207,6 @@ pub fn launch_current_frontier_planning_work( }, )?; let launch = prepared - .envelopes .iter() .find(|envelope| { envelope.r#type == crate::EpiphanyRuntimeWorkerLaunchRequest::TYPE @@ -1267,7 +1266,7 @@ pub fn launch_current_frontier_planning_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![cache.prepare_entry(&binding.binding_record_id, &binding)?.0], "frontier Planning", )?; @@ -1393,7 +1392,6 @@ pub fn launch_current_frontier_plan_mind_work( }, )?; let worker_envelope = prepared - .envelopes .iter() .find(|envelope| { envelope.r#type == crate::EpiphanyRuntimeWorkerLaunchRequest::TYPE @@ -1471,7 +1469,7 @@ pub fn launch_current_frontier_plan_mind_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![cache.prepare_entry(&binding.binding_record_id, &binding)?.0], "frontier plan Mind", )?; @@ -1640,7 +1638,7 @@ pub fn launch_current_frontier_verification_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![cache.prepare_entry(&grant.receipt_id, &grant)?.0], "frontier Verification", )?; @@ -1769,7 +1767,7 @@ pub fn launch_current_frontier_research_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![cache.prepare_entry(&grant.receipt_id, &grant)?.0], "frontier Research", )?; @@ -2924,7 +2922,6 @@ fn launch_consideration_work( let mut companions = Vec::new(); if let ConsiderationLaunch::PersonaFeedback(request) = launch { let worker = prepared - .envelopes .iter() .find(|envelope| { envelope.r#type == crate::EpiphanyRuntimeWorkerLaunchRequest::TYPE @@ -2964,7 +2961,7 @@ fn launch_consideration_work( store_path, &cache, expected, - prepared.envelopes, + prepared, companions, "consideration", )?; @@ -3158,7 +3155,7 @@ pub fn launch_current_body_modeling_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![ cache.prepare_entry(&binding.binding_record_id, &binding)?.0, cache.prepare_entry(&grant.receipt_id, &grant)?.0, @@ -3344,7 +3341,7 @@ pub fn launch_current_proposal_modeling_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![ cache.prepare_entry(&binding.binding_record_id, &binding)?.0, cache.prepare_entry(&grant.receipt_id, &grant)?.0, @@ -3492,7 +3489,7 @@ pub fn launch_current_frontier_verdict_modeling_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![cache.prepare_entry(&grant.receipt_id, &grant)?.0], "frontier verdict Modeling", )?; diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 74c5d591..151ce558 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -253,7 +253,6 @@ pub use runtime_spine::EpiphanyRuntimeToolExecutionBinding; pub use runtime_spine::EpiphanyRuntimeWorkerLaunchRequest; pub use runtime_spine::EpiphanyRuntimeWorkerProcessClaim; pub use runtime_spine::ModelPassFailureTerminalOptions; -pub use runtime_spine::PreparedRuntimeSpineHeartbeatJob; pub use runtime_spine::RUNTIME_IDENTITY_KEY; pub use runtime_spine::RUNTIME_IDENTITY_TYPE; pub use runtime_spine::RUNTIME_JOB_RESULT_TYPE; diff --git a/epiphany-core/src/reorientation_work.rs b/epiphany-core/src/reorientation_work.rs index 7982db6d..588f5441 100644 --- a/epiphany-core/src/reorientation_work.rs +++ b/epiphany-core/src/reorientation_work.rs @@ -470,7 +470,7 @@ pub fn launch_current_reorientation_work( store_path, &cache, expected, - prepared.envelopes, + prepared, vec![cache.prepare_entry(&binding.binding_id, &binding)?.0], "reorientation", )?; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 1519221b..3292021e 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -850,12 +850,6 @@ pub struct RuntimeSpineHeartbeatJobOptions { pub created_at: String, } -#[derive(Clone, Debug, PartialEq)] -pub struct PreparedRuntimeSpineHeartbeatJob { - pub job: EpiphanyRuntimeJob, - pub envelopes: Vec, -} - #[derive(Clone, Debug, PartialEq)] pub struct EpiphanyRuntimeJobSnapshot { pub job: EpiphanyRuntimeJob, @@ -2552,7 +2546,7 @@ fn archive_completed_model_session( pub fn prepare_runtime_spine_heartbeat_job( cache: &CultCache, options: RuntimeSpineHeartbeatJobOptions, -) -> Result { +) -> Result> { validate_non_empty(&options.runtime_id, "runtime id")?; validate_non_empty(&options.session_id, "session id")?; validate_non_empty(&options.objective, "objective")?; @@ -2703,7 +2697,7 @@ pub fn prepare_runtime_spine_heartbeat_job( cache.prepare_entry(&job.job_id, &job)?.0, cache.prepare_entry(&request.job_id, &request)?.0, ]; - Ok(PreparedRuntimeSpineHeartbeatJob { job, envelopes }) + Ok(envelopes) } fn validate_repo_frontier_verdict_modeling_launch_authority( diff --git a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs index 85740481..ca4c25e2 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs @@ -1219,7 +1219,7 @@ mod tests { let mut cache = epiphany_core::runtime_spine_cache(store)?; cache.pull_all_backing_stores()?; let prepared = epiphany_core::prepare_runtime_spine_heartbeat_job(&cache, options)?; - cache.put_prepared_batch(prepared.envelopes)?; + cache.put_prepared_batch(prepared)?; Ok(()) } diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index cbf53286..0e452527 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -2484,7 +2484,7 @@ mod tests { let mut cache = epiphany_core::runtime_spine_cache(store)?; cache.pull_all_backing_stores()?; let prepared = epiphany_core::prepare_runtime_spine_heartbeat_job(&cache, options)?; - cache.put_prepared_batch(prepared.envelopes)?; + cache.put_prepared_batch(prepared)?; Ok(()) }