diff --git a/epiphany-core/src/hands_gateway.rs b/epiphany-core/src/hands_gateway.rs index 0e0a6820..3e2866ea 100644 --- a/epiphany-core/src/hands_gateway.rs +++ b/epiphany-core/src/hands_gateway.rs @@ -1,7 +1,5 @@ use cultcache_rs::DatabaseEntry; -pub const HANDS_ACTION_INTENT_TYPE: &str = "epiphany.hands.action_intent"; -pub const HANDS_ACTION_REVIEW_TYPE: &str = "epiphany.hands.action_review"; pub const HANDS_COMMAND_RECEIPT_TYPE: &str = "epiphany.hands.command_receipt"; pub const HANDS_PATCH_RECEIPT_TYPE: &str = "epiphany.hands.patch_receipt"; pub const HANDS_COMMIT_RECEIPT_TYPE: &str = "epiphany.hands.commit_receipt"; diff --git a/epiphany-core/src/reasoning_context.rs b/epiphany-core/src/reasoning_context.rs index 7a638464..597001ba 100644 --- a/epiphany-core/src/reasoning_context.rs +++ b/epiphany-core/src/reasoning_context.rs @@ -21,10 +21,6 @@ pub const REASONING_BASIS_SCHEMA_VERSION: &str = "epiphany.reasoning_basis.v1"; pub const DECISION_CONTEXT_SCHEMA_VERSION: &str = "epiphany.decision_context.v2"; pub const MODEL_PASS_FAILURE_SCHEMA_VERSION: &str = "epiphany.model_pass_failure.v1"; pub const MIND_COMMIT_RECEIPT_SCHEMA_VERSION: &str = "epiphany.mind_commit_receipt.v1"; -pub const REASONING_BASIS_TYPE: &str = "epiphany.reasoning_basis.v1"; -pub const DECISION_CONTEXT_TYPE: &str = "epiphany.decision_context.v2"; -pub const MODEL_PASS_FAILURE_TYPE: &str = "epiphany.model_pass_failure.v1"; -pub const MIND_COMMIT_RECEIPT_TYPE: &str = "epiphany.mind_commit_receipt.v1"; pub const DECISION_AUDIT_PROJECTION_SCHEMA_VERSION: &str = "epiphany.decision_audit_projection.v1"; pub const DECISION_AUDIT_INDEX_SCHEMA_VERSION: &str = "epiphany.decision_audit_index.v1"; pub const WORKER_REASONING_PROJECTION_POLICY: &str = diff --git a/epiphany-core/src/soul_gateway.rs b/epiphany-core/src/soul_gateway.rs index b14fd0a2..0af3cce3 100644 --- a/epiphany-core/src/soul_gateway.rs +++ b/epiphany-core/src/soul_gateway.rs @@ -1,8 +1,5 @@ use cultcache_rs::DatabaseEntry; -pub const SOUL_VERDICT_RECEIPT_TYPE: &str = "epiphany.soul.verdict_receipt"; -pub const REPO_FRONTIER_VERIFICATION_REQUEST_TYPE: &str = - "epiphany.soul.repo_frontier_verification_request"; pub const REPO_FRONTIER_VERIFICATION_REQUEST_SCHEMA_VERSION: &str = "epiphany.soul.repo_frontier_verification_request.v2"; pub const REPO_FRONTIER_VERIFICATION_REQUEST_CONTRACT: &str = diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index e878e09e..8a22f6e4 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -254,12 +254,6 @@ pub async fn run_tool_followup_model_turn( run_model_turn(provider, options, request).await } -pub async fn run_worker_launch( - options: EpiphanyWorkerRuntimeOptions, -) -> Result { - run_worker_launch_observed(options, |_| {}).await -} - pub async fn run_worker_launch_observed( options: EpiphanyWorkerRuntimeOptions, on_model_request: F, @@ -858,16 +852,6 @@ pub fn ensure_openai_runtime_ready(options: &EpiphanyOpenAiRuntimeOptions) -> Re Ok(()) } -pub fn store_model_request( - store_path: impl AsRef, - request: &EpiphanyModelRequest, -) -> Result<()> { - let mut cache = runtime_spine_cache(store_path)?; - cache.pull_all_backing_stores()?; - cache.put(model_request_key(&request.request_id), request)?; - Ok(()) -} - pub fn assistant_text_from_openai_events( store_path: impl AsRef, request_id: &str, diff --git a/epiphany-state-model/src/lib.rs b/epiphany-state-model/src/lib.rs index 5ad4f8af..4f3be10c 100644 --- a/epiphany-state-model/src/lib.rs +++ b/epiphany-state-model/src/lib.rs @@ -5,44 +5,6 @@ use serde::Deserialize; use serde::Serialize; use ts_rs::TS; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyAcceptanceReceipt { - pub id: String, - pub result_id: String, - pub job_id: String, - pub binding_id: String, - pub surface: String, - pub role_id: String, - pub status: String, - pub accepted_at: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub accepted_observation_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub accepted_evidence_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub summary: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyRuntimeLink { - pub id: String, - pub binding_id: String, - pub surface: String, - pub role_id: String, - pub authority_scope: String, - pub runtime_job_id: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub runtime_result_id: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub linked_subgoal_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub linked_graph_node_ids: Vec, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] pub struct EpiphanySubgoal { pub id: String, @@ -63,86 +25,6 @@ pub struct EpiphanyInvariant { pub rationale: Option, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraphs { - #[serde(default, skip_serializing_if = "EpiphanyGraph::is_empty")] - pub architecture: EpiphanyGraph, - #[serde(default, skip_serializing_if = "EpiphanyGraph::is_empty")] - pub dataflow: EpiphanyGraph, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub links: Vec, -} - -impl EpiphanyGraphs { - pub fn is_empty(&self) -> bool { - self.architecture.is_empty() && self.dataflow.is_empty() && self.links.is_empty() - } -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraph { - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub nodes: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub edges: Vec, -} - -impl EpiphanyGraph { - pub fn is_empty(&self) -> bool { - self.nodes.is_empty() && self.edges.is_empty() - } -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraphNode { - pub id: String, - pub title: String, - pub purpose: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub mechanism: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub metaphor: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub status: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub code_refs: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraphEdge { - pub source_id: String, - pub target_id: String, - pub kind: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub label: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub mechanism: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub code_refs: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraphLink { - pub dataflow_node_id: String, - pub architecture_node_id: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub relationship: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub code_refs: Vec, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] pub struct EpiphanyCodeRef { pub path: PathBuf, @@ -160,112 +42,6 @@ pub struct EpiphanyCodeRef { pub note: Option, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraphFrontier { - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub active_node_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub active_edge_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub open_question_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub open_gap_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub dirty_paths: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyGraphCheckpoint { - pub checkpoint_id: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub summary: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub frontier_node_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub open_question_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub open_gap_ids: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyRetrievalState { - pub workspace_root: PathBuf, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub index_revision: Option, - #[serde(default)] - pub status: EpiphanyRetrievalStatus, - #[serde(default, skip_serializing_if = "std::ops::Not::not")] - #[ts(type = "boolean")] - pub semantic_available: bool, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "bigint | null")] - pub last_indexed_at_unix_seconds: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "number | null")] - pub indexed_file_count: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "number | null")] - pub indexed_chunk_count: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub shards: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub dirty_paths: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -#[serde(rename_all = "snake_case")] -#[ts(rename_all = "snake_case")] -pub enum EpiphanyRetrievalStatus { - #[default] - Unavailable, - Ready, - Stale, - Indexing, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyRetrievalShardSummary { - pub shard_id: String, - pub path_prefix: PathBuf, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "number | null")] - pub indexed_file_count: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "number | null")] - pub indexed_chunk_count: Option, - #[serde(default)] - pub status: EpiphanyRetrievalStatus, - #[serde(default, skip_serializing_if = "std::ops::Not::not")] - #[ts(type = "boolean")] - pub exact_available: bool, - #[serde(default, skip_serializing_if = "std::ops::Not::not")] - #[ts(type = "boolean")] - pub semantic_available: bool, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyScratchPad { - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub summary: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub hypothesis: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub next_probe: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub notes: Vec, -} - #[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, JsonSchema, TS, Default)] #[serde(rename_all = "snake_case")] #[ts(rename_all = "snake_case")] @@ -301,36 +77,6 @@ pub struct EpiphanyInvestigationCheckpoint { pub evidence_ids: Vec, } -#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, JsonSchema, TS)] -#[serde(rename_all = "snake_case")] -#[ts(rename_all = "snake_case")] -pub enum EpiphanyJobKind { - Indexing, - Remap, - Verification, - Specialist, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS)] -pub struct EpiphanyJobBinding { - pub id: String, - pub kind: EpiphanyJobKind, - pub scope: String, - pub owner_role: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub authority_scope: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub linked_subgoal_ids: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub linked_graph_node_ids: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub blocking_reason: Option, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] pub struct EpiphanyObservation { pub id: String, @@ -353,18 +99,6 @@ pub struct EpiphanyEvidenceRecord { pub code_refs: Vec, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyChurnState { - pub understanding_status: String, - pub diff_pressure: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub warning: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "number | null")] - pub unexplained_writes: Option, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] pub struct EpiphanyModeState { pub name: String,