From 058751fb32d06bc0ef376ed0c1826b9e94b41bd7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 23 Aug 2026 13:14:05 +0200 Subject: [PATCH] Delete arbitrary runtime event writer --- .../src/bin/epiphany-runtime-spine.rs | 82 +------------------ epiphany-core/src/lib.rs | 2 - epiphany-core/src/runtime_spine.rs | 46 ----------- 3 files changed, 1 insertion(+), 129 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-runtime-spine.rs b/epiphany-core/src/bin/epiphany-runtime-spine.rs index bb91a9a9..72343a90 100644 --- a/epiphany-core/src/bin/epiphany-runtime-spine.rs +++ b/epiphany-core/src/bin/epiphany-runtime-spine.rs @@ -8,13 +8,11 @@ use epiphany_core::EpiphanyRuntimeJob; use epiphany_core::EpiphanyRuntimeJobResult; use epiphany_core::EpiphanyRuntimeRoleWorkerResult; use epiphany_core::EpiphanyRuntimeSession; -use epiphany_core::RuntimeSpineEventOptions; use epiphany_core::RuntimeSpineInitOptions; use epiphany_core::RuntimeSpineJobOptions; use epiphany_core::RuntimeSpineJobResultOptions; use epiphany_core::RuntimeSpineSessionClosureOptions; use epiphany_core::RuntimeSpineSessionOptions; -use epiphany_core::append_runtime_event; use epiphany_core::close_runtime_session; use epiphany_core::complete_runtime_job; use epiphany_core::create_runtime_job; @@ -271,30 +269,6 @@ fn main() -> Result<()> { println!("runtime root session repaired"); println!("session: {}", session.session_id); } - Command::RecordEvent { - event_id, - event_type, - source, - session_id, - job_id, - summary, - } => { - let event = append_runtime_event( - &args.store, - RuntimeSpineEventOptions { - event_id, - occurred_at: now(), - event_type, - source, - session_id, - job_id, - summary, - }, - )?; - println!("runtime event recorded"); - println!("event: {}", event.event_id); - println!("type: {}", event.event_type); - } Command::OpenJob { job_id, session_id, @@ -396,14 +370,6 @@ enum Command { RepairRootSession { reason: String, }, - RecordEvent { - event_id: String, - event_type: String, - source: String, - session_id: Option, - job_id: Option, - summary: String, - }, OpenJob { job_id: String, session_id: String, @@ -505,52 +471,6 @@ fn parse_command(mut args: Vec) -> Result { coordinator_note, }) } - "record-event" => { - let mut event_id = format!("event-{}", Uuid::new_v4()); - let mut event_type = String::new(); - let mut source = "operator".to_string(); - let mut session_id = None; - let mut job_id = None; - let mut summary = String::new(); - parse_options(args, |name, value| match name { - "--event-id" => { - event_id = value; - Ok(()) - } - "--type" => { - event_type = value; - Ok(()) - } - "--source" => { - source = value; - Ok(()) - } - "--session-id" => { - session_id = Some(value); - Ok(()) - } - "--job-id" => { - job_id = Some(value); - Ok(()) - } - "--summary" => { - summary = value; - Ok(()) - } - _ => Err(anyhow!("unknown record-event argument: {name}")), - })?; - if event_type.trim().is_empty() { - return Err(anyhow!("record-event requires --type")); - } - Ok(Command::RecordEvent { - event_id, - event_type, - source, - session_id, - job_id, - summary, - }) - } "open-job" => { let mut job_id = format!("job-{}", Uuid::new_v4()); let mut session_id = String::new(); @@ -761,7 +681,7 @@ fn now() -> String { } fn usage() -> &'static str { - "usage: epiphany-runtime-spine [--store path] " + "usage: epiphany-runtime-spine [--store path] " } fn model_input_item_chars(item: &EpiphanyModelInputItem) -> usize { diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 81895863..26247d4f 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -434,7 +434,6 @@ pub use runtime_spine::RepoFrontierResearchLifecycle; pub use runtime_spine::RepoFrontierResearchLifecycleStage; pub use runtime_spine::RepoFrontierVerdictModelingLaunchAuthority; pub use runtime_spine::RuntimeHandsReceiptChainSummary; -pub use runtime_spine::RuntimeSpineEventOptions; pub use runtime_spine::RuntimeSpineHeartbeatJobOptions; pub use runtime_spine::RuntimeSpineInitOptions; pub use runtime_spine::RuntimeSpineJobOptions; @@ -444,7 +443,6 @@ pub use runtime_spine::RuntimeSpineSessionOptions; pub use runtime_spine::RuntimeTypedFulfillmentEvidence; pub use runtime_spine::abandon_unactivated_runtime_worker_process; pub use runtime_spine::activate_runtime_worker_process; -pub use runtime_spine::append_runtime_event; pub use runtime_spine::archive_completed_coordinator_session; pub use runtime_spine::archive_completed_model_session; pub use runtime_spine::archive_failed_runtime_worker_attempt; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 5ca3aeed..a29c6aeb 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -967,17 +967,6 @@ pub struct ModelPassFailureTerminalOptions { pub failed_at: String, } -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct RuntimeSpineEventOptions { - pub event_id: String, - pub occurred_at: String, - pub event_type: String, - pub source: String, - pub session_id: Option, - pub job_id: Option, - pub summary: String, -} - #[derive(Clone, Debug, PartialEq, Eq)] pub struct RuntimeSpineJobOptions { pub job_id: String, @@ -12584,41 +12573,6 @@ pub fn complete_runtime_job( Ok(result) } -pub fn append_runtime_event( - store_path: impl AsRef, - options: RuntimeSpineEventOptions, -) -> Result { - validate_non_empty(&options.event_id, "event id")?; - validate_non_empty(&options.occurred_at, "occurred at")?; - validate_non_empty(&options.event_type, "event type")?; - validate_non_empty(&options.source, "source")?; - let mut cache = runtime_spine_cache(store_path.as_ref())?; - cache.pull_all_backing_stores()?; - require_identity(&cache)?; - if cache - .get::(&options.event_id)? - .is_some() - { - return Err(anyhow!( - "runtime event {:?} already exists", - options.event_id - )); - } - let event = EpiphanyRuntimeEvent { - schema_version: RUNTIME_SPINE_SCHEMA_VERSION.to_string(), - event_id: options.event_id.clone(), - occurred_at: options.occurred_at, - event_type: options.event_type, - source: options.source, - session_id: options.session_id, - job_id: options.job_id, - summary: options.summary, - metadata: BTreeMap::new(), - }; - cache.put(&options.event_id, &event)?; - Ok(event) -} - pub fn runtime_spine_status(store_path: impl AsRef) -> Result { let store_path = store_path.as_ref(); if !store_path.exists() {