From be611f2411fbb0a845fc15d34abbb6c82eb43025 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 24 Aug 2026 04:45:31 +0200 Subject: [PATCH] Delete dead Imagination review contract --- .../src/imagination_consideration.rs | 67 ------------------- epiphany-core/src/lib.rs | 3 +- epiphany-core/src/runtime_spine.rs | 3 +- 3 files changed, 2 insertions(+), 71 deletions(-) diff --git a/epiphany-core/src/imagination_consideration.rs b/epiphany-core/src/imagination_consideration.rs index 05f5548e..d6c2bcc4 100644 --- a/epiphany-core/src/imagination_consideration.rs +++ b/epiphany-core/src/imagination_consideration.rs @@ -8,7 +8,6 @@ pub const REQUEST_SCHEMA: &str = "epiphany.self.imagination_consideration_reques pub const REQUEST_CONTRACT: &str = "epiphany.imagination_consideration_request.v1"; pub const CANDIDATE_SCHEMA: &str = "epiphany.imagination.consideration_candidate.v1"; pub const CANDIDATE_CONTRACT: &str = "epiphany.imagination_consideration_candidate.v1"; -pub const REVIEW_REQUEST_SCHEMA: &str = "epiphany.self.imagination_consideration_review_request.v0"; #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] @@ -147,26 +146,6 @@ pub struct ImaginationConsiderationCandidate { pub data_classification: String, } -#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)] -#[cultcache( - type = "epiphany.self.imagination_consideration_review_request", - schema = "ImaginationConsiderationReviewRequest" -)] -pub struct ImaginationConsiderationReviewRequest { - #[cultcache(key = 0)] - pub schema_version: String, - #[cultcache(key = 1)] - pub review_request_id: String, - #[cultcache(key = 2)] - pub candidate_id: String, - #[cultcache(key = 3)] - pub candidate_sha256: String, - #[cultcache(key = 4)] - pub requested_review_route: String, - #[cultcache(key = 5)] - pub selected_at: String, -} - pub fn commit_request( runtime_store: &Path, persona_feedback_store: &Path, @@ -379,52 +358,6 @@ pub fn render_consideration_prompt(request: &ImaginationConsiderationRequest) -> )) } -pub fn request_candidate_modeling_review( - runtime_store: &Path, - request: &ImaginationConsiderationRequest, - candidate: &ImaginationConsiderationCandidate, - selected_at: &str, -) -> Result { - chrono::DateTime::parse_from_rfc3339(selected_at) - .map_err(|_| anyhow!("consideration selection timestamp must be RFC3339"))?; - let mut cache = crate::runtime_spine_cache(runtime_store)?; - cache.pull_all_backing_stores()?; - validate_current_request(&cache, request)?; - validate_candidate(request, candidate)?; - if candidate.disposition != ImaginationConsiderationDisposition::Suggest - || candidate.recommended_review_route != ImaginationConsiderationReviewRoute::ModelingReview - { - bail!("only an explicit suggest/modeling_review candidate may be selected"); - } - let candidate_sha256 = format!("sha256-{:x}", Sha256::digest(rmp_serde::to_vec(candidate)?)); - let review_request_id = format!( - "imagination-consideration-review-{:x}", - Sha256::digest(format!("{}:{candidate_sha256}", request.request_id).as_bytes()) - ); - let review = ImaginationConsiderationReviewRequest { - schema_version: REVIEW_REQUEST_SCHEMA.into(), - review_request_id: review_request_id.clone(), - candidate_id: candidate.candidate_id.clone(), - candidate_sha256, - requested_review_route: "modeling_review_proposal_only".into(), - selected_at: selected_at.into(), - }; - if let Some(existing) = - cache.get::(&review_request_id)? - { - let mut replay = review; - replay.selected_at = existing.selected_at.clone(); - return if replay == existing { - Ok(existing) - } else { - bail!("consideration review request collision") - }; - } - let (entry, _) = cache.prepare_entry(&review_request_id, &review)?; - SingleFileMessagePackBackingStore::new(runtime_store).push(&entry)?; - Ok(review) -} - #[cfg(test)] mod tests { use super::*; diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 8b830e23..2d523c9b 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -136,14 +136,13 @@ pub use imagination_consideration::{ CANDIDATE_SCHEMA as IMAGINATION_CONSIDERATION_CANDIDATE_SCHEMA_VERSION, ImaginationConsiderationCandidate, ImaginationConsiderationDisposition, ImaginationConsiderationQuestion, ImaginationConsiderationRequest, - ImaginationConsiderationReviewRequest, ImaginationConsiderationReviewRoute, + ImaginationConsiderationReviewRoute, ImaginationOptionDraft, QuotedPersonaFeedbackEvidence, REQUEST_CONTRACT as IMAGINATION_CONSIDERATION_REQUEST_CONTRACT, REQUEST_SCHEMA as IMAGINATION_CONSIDERATION_REQUEST_SCHEMA_VERSION, candidate_id_for_launch as imagination_consideration_candidate_id_for_launch, commit_request as commit_imagination_consideration_request, render_consideration_prompt as render_imagination_consideration_prompt, - request_candidate_modeling_review as request_imagination_consideration_modeling_review, validate_candidate as validate_imagination_consideration_candidate, validate_current_request as validate_current_imagination_consideration_request, }; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 2cf781ed..bff693be 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -88,7 +88,7 @@ pub const COORDINATOR_RUN_RECEIPT_TYPE: &str = "epiphany.coordinator_run_receipt pub const RUNTIME_IDENTITY_KEY: &str = "self"; pub const RUNTIME_SWARM_BINDING_KEY: &str = "runtime-swarm-binding"; pub const RUNTIME_SWARM_BINDING_SCHEMA_VERSION: &str = "epiphany.runtime.swarm_binding.v1"; -pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v21"; +pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v22"; pub const EPIPHANY_RUNTIME_ROOT_SESSION_ID: &str = "epiphany-main"; pub const RUNTIME_MODEL_EXECUTION_BINDING_SCHEMA_VERSION: &str = "epiphany.runtime.model_execution_binding.v0"; @@ -843,7 +843,6 @@ fn runtime_spine_schema_cache() -> Result { cache.register_entry_type::()?; cache.register_entry_type::()?; cache.register_entry_type::()?; - cache.register_entry_type::()?; cache.register_entry_type::()?; cache.register_entry_type::()?; cache.register_entry_type::()?;