Delete test-only runtime writers

This commit is contained in:
Meta Vens 2026-08-24 11:43:37 +02:00
commit fdefb8898a
5 changed files with 31 additions and 127 deletions

View file

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

View file

@ -962,38 +962,6 @@ pub fn bind_runtime_to_swarm(
}
}
pub fn create_runtime_session(
store_path: impl AsRef<Path>,
options: RuntimeSpineSessionOptions,
) -> Result<EpiphanyRuntimeSession> {
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::<EpiphanyRuntimeSession>(&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<Path>,
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<Path>,
options: RuntimeSpineJobOptions,
) -> Result<EpiphanyRuntimeJob> {
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::<EpiphanyRuntimeSession>(&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::<EpiphanyRuntimeJob>(&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<Path>,
session_options: RuntimeSpineSessionOptions,

View file

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

View file

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

View file

@ -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",