From fdefb8898a30d50da77fc7dedf96e30fd80437e9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 24 Aug 2026 11:43:37 +0200 Subject: [PATCH] Delete test-only runtime writers --- epiphany-core/src/lib.rs | 2 - epiphany-core/src/runtime_spine.rs | 71 ------------------- .../src/bin/epiphany-openai-runtime.rs | 9 --- epiphany-openai-runtime/src/lib.rs | 9 --- epiphany-tool-mcp-runtime/src/main.rs | 67 ++++++++--------- 5 files changed, 31 insertions(+), 127 deletions(-) diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index bcefb78f..64e07e45 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -253,8 +253,6 @@ pub use runtime_spine::commit_repo_frontier_plan_mind_request; pub use runtime_spine::complete_runtime_job; pub use runtime_spine::coordinator_run_receipts; pub use runtime_spine::coordinator_run_session_id; -pub use runtime_spine::create_runtime_job; -pub use runtime_spine::create_runtime_session; pub use runtime_spine::finalize_coordinator_run; pub use runtime_spine::initialize_runtime_spine; pub use runtime_spine::model_pass_failure_for_request; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index b3c55eed..29a238be 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -962,38 +962,6 @@ pub fn bind_runtime_to_swarm( } } -pub fn create_runtime_session( - store_path: impl AsRef, - options: RuntimeSpineSessionOptions, -) -> Result { - validate_non_empty(&options.session_id, "session id")?; - validate_non_empty(&options.objective, "objective")?; - validate_non_empty(&options.created_at, "created at")?; - let mut cache = runtime_spine_cache(store_path.as_ref())?; - cache.pull_all_backing_stores()?; - require_identity(&cache)?; - require_runtime_identity_not_archived(&cache, "session", &options.session_id)?; - if cache - .get::(&options.session_id)? - .is_some() - { - return Err(anyhow!( - "runtime session {:?} already exists", - options.session_id - )); - } - let session = EpiphanyRuntimeSession { - session_id: options.session_id.clone(), - objective: options.objective, - status: EpiphanyRuntimeSessionStatus::Active, - created_at: options.created_at.clone(), - updated_at: options.created_at, - coordinator_note: options.coordinator_note, - }; - cache.put(&options.session_id, &session)?; - Ok(session) -} - pub fn close_runtime_session( store_path: impl AsRef, options: RuntimeSpineSessionClosureOptions, @@ -1245,45 +1213,6 @@ pub fn model_pass_failure_for_request( Ok(Some(failure)) } -pub fn create_runtime_job( - store_path: impl AsRef, - options: RuntimeSpineJobOptions, -) -> Result { - validate_non_empty(&options.job_id, "job id")?; - validate_non_empty(&options.session_id, "session id")?; - validate_non_empty(&options.role, "role")?; - validate_non_empty(&options.created_at, "created at")?; - let mut cache = runtime_spine_cache(store_path.as_ref())?; - cache.pull_all_backing_stores()?; - require_identity(&cache)?; - require_runtime_identity_not_archived(&cache, "job", &options.job_id)?; - let session = cache - .get::(&options.session_id)? - .ok_or_else(|| anyhow!("runtime session {:?} does not exist", options.session_id))?; - if matches!( - session.status, - EpiphanyRuntimeSessionStatus::Completed | EpiphanyRuntimeSessionStatus::Archived - ) { - return Err(anyhow!( - "runtime session {:?} is not open for jobs", - options.session_id - )); - } - if cache.get::(&options.job_id)?.is_some() { - return Err(anyhow!("runtime job {:?} already exists", options.job_id)); - } - let job = EpiphanyRuntimeJob { - job_id: options.job_id.clone(), - session_id: options.session_id.clone(), - role: options.role, - status: EpiphanyRuntimeJobStatus::Queued, - created_at: options.created_at.clone(), - updated_at: options.created_at.clone(), - }; - cache.put(&options.job_id, &job)?; - Ok(job) -} - pub fn open_runtime_model_execution( store_path: impl AsRef, session_options: RuntimeSpineSessionOptions, diff --git a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs index 768e68ff..b42a6faf 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs @@ -819,15 +819,6 @@ mod tests { created_at: options.created_at.clone(), }, )?; - epiphany_core::create_runtime_session( - store, - epiphany_core::RuntimeSpineSessionOptions { - session_id: options.session_id.clone(), - objective: options.objective.clone(), - created_at: options.created_at.clone(), - coordinator_note: options.coordinator_note.clone(), - }, - )?; 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)?; diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index 05077fa6..ebef4818 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -2350,15 +2350,6 @@ mod tests { created_at: options.created_at.clone(), }, )?; - epiphany_core::create_runtime_session( - store, - epiphany_core::RuntimeSpineSessionOptions { - session_id: options.session_id.clone(), - objective: options.objective.clone(), - created_at: options.created_at.clone(), - coordinator_note: options.coordinator_note.clone(), - }, - )?; 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)?; diff --git a/epiphany-tool-mcp-runtime/src/main.rs b/epiphany-tool-mcp-runtime/src/main.rs index dc2ea72f..729f377d 100644 --- a/epiphany-tool-mcp-runtime/src/main.rs +++ b/epiphany-tool-mcp-runtime/src/main.rs @@ -218,6 +218,35 @@ mod tests { use epiphany_tool_adapter::EPIPHANY_TOOL_RUNTIME_ADAPTER_ID; use epiphany_tool_adapter::tool_invocation_receipt_key; + fn seed_test_tool_job(store: &Path, session_id: &str, job_id: &str) -> Result<()> { + let created_at = "2026-08-10T01:00:01Z"; + let mut cache = epiphany_core::runtime_spine_cache(store)?; + cache.pull_all_backing_stores()?; + cache.put( + session_id, + &epiphany_core::EpiphanyRuntimeSession { + session_id: session_id.into(), + objective: "Exercise the native tool boundary.".into(), + status: epiphany_core::EpiphanyRuntimeSessionStatus::Active, + created_at: created_at.into(), + updated_at: created_at.into(), + coordinator_note: "test fixture".into(), + }, + )?; + cache.put( + job_id, + &epiphany_core::EpiphanyRuntimeJob { + job_id: job_id.into(), + session_id: session_id.into(), + role: "tool-runtime".into(), + status: epiphany_core::EpiphanyRuntimeJobStatus::Queued, + created_at: created_at.into(), + updated_at: created_at.into(), + }, + )?; + Ok(()) + } + #[test] fn parses_production_cli_without_legacy_codex_flags() -> Result<()> { let options = parse_cli(vec![ @@ -269,24 +298,7 @@ mod tests { "prove provider-independent native tools", "now", ); - epiphany_core::create_runtime_session( - &store, - epiphany_core::RuntimeSpineSessionOptions { - session_id: "native-tool-session".into(), - objective: "Prove owned native tool execution.".into(), - created_at: "2026-08-10T01:00:01Z".into(), - coordinator_note: "test".into(), - }, - )?; - epiphany_core::create_runtime_job( - &store, - epiphany_core::RuntimeSpineJobOptions { - job_id: "native-tool-job".into(), - session_id: "native-tool-session".into(), - role: "tool-runtime".into(), - created_at: "2026-08-10T01:00:02Z".into(), - }, - )?; + seed_test_tool_job(&store, "native-tool-session", "native-tool-job")?; epiphany_core::put_runtime_tool_execution_intent( &store, "native-tool-session", @@ -354,24 +366,7 @@ mod tests { "prove grant-owned state observation", "now", ); - epiphany_core::create_runtime_session( - &runtime_store, - epiphany_core::RuntimeSpineSessionOptions { - session_id: "state-tool-session".into(), - objective: "Observe resident state.".into(), - created_at: "2026-08-11T00:00:00Z".into(), - coordinator_note: "test".into(), - }, - )?; - epiphany_core::create_runtime_job( - &runtime_store, - epiphany_core::RuntimeSpineJobOptions { - job_id: "state-tool-job".into(), - session_id: "state-tool-session".into(), - role: "tool-runtime".into(), - created_at: "2026-08-11T00:00:01Z".into(), - }, - )?; + seed_test_tool_job(&runtime_store, "state-tool-session", "state-tool-job")?; epiphany_core::put_runtime_tool_execution_intent( &runtime_store, "state-tool-session",