diff --git a/epiphany-core/src/mind_documents.rs b/epiphany-core/src/mind_documents.rs index c3d35de7..e03a8974 100644 --- a/epiphany-core/src/mind_documents.rs +++ b/epiphany-core/src/mind_documents.rs @@ -3,17 +3,15 @@ use std::path::Path; use anyhow::{Result, anyhow}; use cultcache_rs::{CultCache, CultCacheEnvelope, DatabaseEntry}; use epiphany_state_model::{ - EpiphanyBacklogItem, EpiphanyEvidenceRecord, EpiphanyInvariant, - EpiphanyInvestigationCheckpoint, EpiphanyModeState, EpiphanyObjectiveDraft, - EpiphanyObservation, EpiphanyPlanningCapture, EpiphanyPlanningState, EpiphanyRoadmapStream, - EpiphanySubgoal, + EpiphanyEvidenceRecord, EpiphanyInvariant, EpiphanyInvestigationCheckpoint, + EpiphanyModeState, EpiphanyObservation, EpiphanySubgoal, }; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use crate::{EpiphanyMindDocumentVersion, runtime_spine_cache}; -pub const MIND_SCHEMA_EPOCH: &str = "epiphany.mind.epoch.v8"; +pub const MIND_SCHEMA_EPOCH: &str = "epiphany.mind.epoch.v9"; pub const MIND_OBJECTIVE_KEY: &str = "objective"; pub const MIND_FOCUS_KEY: &str = "focus"; pub const MIND_MODE_KEY: &str = "mode"; @@ -297,46 +295,6 @@ pub struct EpiphanyMindInvestigationCheckpointDocument { pub value: EpiphanyInvestigationCheckpoint, } -#[derive(Clone, Debug, PartialEq, DatabaseEntry)] -#[cultcache( - type = "epiphany.mind.planning_capture.v1", - schema = "EpiphanyMindPlanningCaptureDocument" -)] -pub struct EpiphanyMindPlanningCaptureDocument { - #[cultcache(key = 0)] - pub value: EpiphanyPlanningCapture, -} - -#[derive(Clone, Debug, PartialEq, DatabaseEntry)] -#[cultcache( - type = "epiphany.mind.backlog_item.v1", - schema = "EpiphanyMindBacklogItemDocument" -)] -pub struct EpiphanyMindBacklogItemDocument { - #[cultcache(key = 0)] - pub value: EpiphanyBacklogItem, -} - -#[derive(Clone, Debug, PartialEq, DatabaseEntry)] -#[cultcache( - type = "epiphany.mind.roadmap_stream.v1", - schema = "EpiphanyMindRoadmapStreamDocument" -)] -pub struct EpiphanyMindRoadmapStreamDocument { - #[cultcache(key = 0)] - pub value: EpiphanyRoadmapStream, -} - -#[derive(Clone, Debug, PartialEq, DatabaseEntry)] -#[cultcache( - type = "epiphany.mind.objective_draft.v1", - schema = "EpiphanyMindObjectiveDraftDocument" -)] -pub struct EpiphanyMindObjectiveDraftDocument { - #[cultcache(key = 0)] - pub value: EpiphanyObjectiveDraft, -} - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EpiphanyMindView { pub schema_epoch: String, @@ -356,7 +314,6 @@ pub struct EpiphanyMindView { pub agent_pass_admission_refusals: Vec, pub investigation_checkpoint: Option, pub mode: Option, - pub planning: EpiphanyPlanningState, pub repository_body_observation: Option, pub repo_model: Option, } @@ -376,10 +333,6 @@ pub(crate) fn register_mind_document_types(cache: &mut CultCache) -> 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::()?; cache.register_entry_type::()?; crate::repo_model_documents::register_repo_model_document_types(cache)?; cache.register_entry_type::()?; @@ -524,22 +477,6 @@ pub(crate) fn validate_mind_write_envelope(envelope: &CultCacheEnvelope) -> Resu rmp_serde::from_slice::(&envelope.payload)? .value .checkpoint_id - } else if envelope.r#type == EpiphanyMindPlanningCaptureDocument::TYPE { - rmp_serde::from_slice::(&envelope.payload)? - .value - .id - } else if envelope.r#type == EpiphanyMindBacklogItemDocument::TYPE { - rmp_serde::from_slice::(&envelope.payload)? - .value - .id - } else if envelope.r#type == EpiphanyMindRoadmapStreamDocument::TYPE { - rmp_serde::from_slice::(&envelope.payload)? - .value - .id - } else if envelope.r#type == EpiphanyMindObjectiveDraftDocument::TYPE { - rmp_serde::from_slice::(&envelope.payload)? - .value - .id } else if envelope.r#type == EpiphanyMindRepositoryBodyObservationDocument::TYPE { let value: EpiphanyMindRepositoryBodyObservationDocument = rmp_serde::from_slice(&envelope.payload)?; @@ -599,14 +536,6 @@ pub fn assemble_mind_view(store_path: impl AsRef) -> Result(&cache, |value| value.value)?; - let mut captures = - values::(&cache, |value| value.value)?; - let mut backlog_items = - values::(&cache, |value| value.value)?; - let mut roadmap_streams = - values::(&cache, |value| value.value)?; - let mut objective_drafts = - values::(&cache, |value| value.value)?; let mut body_observations = cache.get_all::()?; for observation in &body_observations { observation.validate()?; @@ -642,10 +571,6 @@ pub fn assemble_mind_view(store_path: impl AsRef) -> Result) -> Result, pub investigation_checkpoint: Option, pub mode: Option, - pub planning: epiphany_state_model::EpiphanyPlanningState, pub repository_body_observation: Option, pub repo_model: Option, } @@ -141,7 +140,6 @@ impl From for EpiphanyMindPromptProjection { agent_pass_admission_refusals: value.agent_pass_admission_refusals, investigation_checkpoint: value.investigation_checkpoint, mode: value.mode, - planning: value.planning, repository_body_observation: value.repository_body_observation, repo_model: value.repo_model.map(Into::into), } @@ -2005,7 +2003,6 @@ mod tests { agent_pass_admission_refusals: Vec::new(), investigation_checkpoint: None, mode: None, - planning: Default::default(), repository_body_observation: None, repo_model: None, }, diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index f5d31239..77da712f 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -86,7 +86,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.v23"; +pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v24"; 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"; diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index 40ec2e4a..e878e09e 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -2472,7 +2472,6 @@ mod tests { agent_pass_admission_refusals: Vec::new(), investigation_checkpoint: None, mode: None, - planning: Default::default(), repository_body_observation: None, repo_model: None, }; diff --git a/epiphany-state-model/src/lib.rs b/epiphany-state-model/src/lib.rs index d83a282d..5ad4f8af 100644 --- a/epiphany-state-model/src/lib.rs +++ b/epiphany-state-model/src/lib.rs @@ -389,262 +389,6 @@ pub enum EpiphanyModeKind { Default, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyPlanningState { - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub workspace_root: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub captures: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub backlog_items: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub roadmap_streams: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub objective_drafts: Vec, -} - -impl EpiphanyPlanningState { - pub fn is_empty(&self) -> bool { - self.workspace_root.is_none() - && self.captures.is_empty() - && self.backlog_items.is_empty() - && self.roadmap_streams.is_empty() - && self.objective_drafts.is_empty() - } -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyPlanningCapture { - pub id: String, - pub title: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub body: Option, - pub confidence: String, - pub status: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub speaker: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub tags: Vec, - pub source: EpiphanyPlanningSourceRef, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub created_at: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub updated_at: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyPlanningSourceRef { - pub kind: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub provider: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub uri: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub external_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub repo: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "number | null")] - pub issue_number: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub node_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "bigint | null")] - pub database_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub url: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub state: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub labels: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub milestone: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub assignees: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub author: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub created_at: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub updated_at: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub closed_at: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "boolean | null")] - pub is_pull_request: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub imported_at: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyBacklogItem { - pub id: String, - pub title: String, - pub kind: String, - pub summary: String, - pub status: String, - pub horizon: String, - pub priority: EpiphanyPlanningPriority, - pub confidence: String, - pub product_area: String, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub lane_hints: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub dependencies: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub blockers: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub acceptance_sketch: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub evidence_refs: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub source_refs: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub duplicate_of: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub updated_at: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyPlanningPriority { - pub value: String, - pub rationale: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub impact: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub urgency: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub confidence: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub effort: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub unblocks: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub blocks: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub reason: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyRoadmapStream { - pub id: String, - pub title: String, - pub purpose: String, - pub status: String, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub item_ids: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub near_term_focus: Option, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub blocked_by: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub review_cadence: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyObjectiveDraft { - pub id: String, - pub title: String, - pub summary: String, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub source_item_ids: Vec, - pub scope: EpiphanyObjectiveDraftScope, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub acceptance_criteria: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub evidence_required: Vec, - pub lane_plan: EpiphanyObjectiveDraftLanePlan, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub dependencies: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub risks: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub review_gates: Vec, - pub status: String, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyObjectiveDraftScope { - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub includes: Vec, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - #[ts(type = "Array")] - pub excludes: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] -pub struct EpiphanyObjectiveDraftLanePlan { - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub imagination: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub eyes: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub body: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub hands: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub soul: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(type = "string | null")] - pub life: Option, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] pub struct EpiphanyMemoryGraphSnapshot { pub graph_id: String,