Collapse prepared heartbeat job wrapper

This commit is contained in:
Meta Vens 2026-08-23 22:31:09 +02:00
commit 27c8389c38
6 changed files with 13 additions and 23 deletions

View file

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

View file

@ -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;

View file

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

View file

@ -850,12 +850,6 @@ pub struct RuntimeSpineHeartbeatJobOptions {
pub created_at: String,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PreparedRuntimeSpineHeartbeatJob {
pub job: EpiphanyRuntimeJob,
pub envelopes: Vec<CultCacheEnvelope>,
}
#[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<PreparedRuntimeSpineHeartbeatJob> {
) -> Result<Vec<CultCacheEnvelope>> {
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(

View file

@ -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(())
}

View file

@ -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(())
}