From b5f9714563c5c0feb4c961c97025cc29c766d5be Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 19 May 2026 15:24:57 +0100 Subject: [PATCH] Point bridge state imports at native model --- epiphany-codex-bridge/Cargo.toml | 1 + epiphany-codex-bridge/src/context.rs | 8 ++++---- epiphany-codex-bridge/src/coordinator.rs | 6 +++--- epiphany-codex-bridge/src/jobs.rs | 6 +++--- epiphany-codex-bridge/src/launch.rs | 8 ++++---- epiphany-codex-bridge/src/mutation.rs | 10 +++++----- epiphany-codex-bridge/src/mutation_service.rs | 8 ++++---- epiphany-codex-bridge/src/reorient.rs | 4 ++-- epiphany-codex-bridge/src/retrieve.rs | 2 +- epiphany-codex-bridge/src/runtime_results.rs | 4 ++-- epiphany-codex-bridge/src/scene.rs | 2 +- epiphany-codex-bridge/src/state.rs | 2 +- epiphany-codex-bridge/src/view.rs | 4 ++-- vendor/codex/codex-rs/Cargo.lock | 1 + 14 files changed, 34 insertions(+), 32 deletions(-) diff --git a/epiphany-codex-bridge/Cargo.toml b/epiphany-codex-bridge/Cargo.toml index 53dc4360..08502d9e 100644 --- a/epiphany-codex-bridge/Cargo.toml +++ b/epiphany-codex-bridge/Cargo.toml @@ -16,6 +16,7 @@ codex-app-server-protocol = { path = "../vendor/codex/codex-rs/app-server-protoc codex-protocol = { path = "../vendor/codex/codex-rs/protocol" } codex-utils-absolute-path = { path = "../vendor/codex/codex-rs/utils/absolute-path" } epiphany-core = { path = "../epiphany-core" } +epiphany-state-model = { path = "../epiphany-state-model" } notify = "8.2.0" serde_json = "1" serde = { version = "1", features = ["derive"] } diff --git a/epiphany-codex-bridge/src/context.rs b/epiphany-codex-bridge/src/context.rs index 11223c56..0f7bf74f 100644 --- a/epiphany-codex-bridge/src/context.rs +++ b/epiphany-codex-bridge/src/context.rs @@ -9,10 +9,6 @@ use codex_app_server_protocol::ThreadEpiphanyGraphQueryKind; use codex_app_server_protocol::ThreadEpiphanyGraphQueryMatched; use codex_app_server_protocol::ThreadEpiphanyGraphQueryMissing; use codex_app_server_protocol::ThreadEpiphanyPlanningSummary; -use codex_protocol::protocol::EpiphanyGraphCheckpoint; -use codex_protocol::protocol::EpiphanyGraphFrontier; -use codex_protocol::protocol::EpiphanyPlanningState; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyContext as CoreEpiphanyContext; use epiphany_core::EpiphanyContextMissing as CoreEpiphanyContextMissing; use epiphany_core::EpiphanyContextParams as CoreEpiphanyContextParams; @@ -31,6 +27,10 @@ use epiphany_core::EpiphanyPlanningView; use epiphany_core::derive_context; use epiphany_core::derive_graph_query; use epiphany_core::derive_planning_view; +use epiphany_state_model::EpiphanyGraphCheckpoint; +use epiphany_state_model::EpiphanyGraphFrontier; +use epiphany_state_model::EpiphanyPlanningState; +use epiphany_state_model::EpiphanyThreadState; pub fn map_epiphany_context( state: Option<&EpiphanyThreadState>, diff --git a/epiphany-codex-bridge/src/coordinator.rs b/epiphany-codex-bridge/src/coordinator.rs index aa8b1c02..53100c8e 100644 --- a/epiphany-codex-bridge/src/coordinator.rs +++ b/epiphany-codex-bridge/src/coordinator.rs @@ -19,9 +19,6 @@ use codex_app_server_protocol::ThreadEpiphanyRoleStatus; use codex_app_server_protocol::ThreadEpiphanyRolesSource; use codex_app_server_protocol::ThreadEpiphanySceneAction; use codex_app_server_protocol::ThreadEpiphanyViewCoordinator; -use codex_protocol::protocol::EpiphanyAcceptanceReceipt; -use codex_protocol::protocol::EpiphanyRetrievalState; -use codex_protocol::protocol::EpiphanyThreadState; use codex_protocol::protocol::TokenUsageInfo; use epiphany_core::EpiphanyCoordinatorAction as CoreEpiphanyCoordinatorAction; use epiphany_core::EpiphanyCoordinatorAutomationAction as CoreEpiphanyCoordinatorAutomationAction; @@ -54,6 +51,9 @@ use epiphany_core::recommend_coordinator_action; use epiphany_core::recommend_crrc_action; use epiphany_core::render_role_board_note; use epiphany_core::select_coordinator_automation_action; +use epiphany_state_model::EpiphanyAcceptanceReceipt; +use epiphany_state_model::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyThreadState; use crate::launch::EPIPHANY_IMAGINATION_OWNER_ROLE; use crate::launch::EPIPHANY_IMAGINATION_ROLE_BINDING_ID; diff --git a/epiphany-codex-bridge/src/jobs.rs b/epiphany-codex-bridge/src/jobs.rs index 13aac18e..2d82af40 100644 --- a/epiphany-codex-bridge/src/jobs.rs +++ b/epiphany-codex-bridge/src/jobs.rs @@ -1,13 +1,13 @@ use codex_app_server_protocol::ThreadEpiphanyJob; use codex_app_server_protocol::ThreadEpiphanyJobKind; use codex_app_server_protocol::ThreadEpiphanyJobStatus; -use codex_protocol::protocol::EpiphanyJobKind as CoreEpiphanyJobKind; -use codex_protocol::protocol::EpiphanyRetrievalState; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyJobStatus as CoreEpiphanyJobStatus; use epiphany_core::EpiphanyJobView; use epiphany_core::EpiphanyJobsInput; use epiphany_core::derive_jobs; +use epiphany_state_model::EpiphanyJobKind as CoreEpiphanyJobKind; +use epiphany_state_model::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyThreadState; pub fn map_epiphany_jobs( state: Option<&EpiphanyThreadState>, diff --git a/epiphany-codex-bridge/src/launch.rs b/epiphany-codex-bridge/src/launch.rs index 367a32af..ac6a8f10 100644 --- a/epiphany-codex-bridge/src/launch.rs +++ b/epiphany-codex-bridge/src/launch.rs @@ -12,14 +12,14 @@ use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshnessStatus; use codex_app_server_protocol::ThreadEpiphanyRoleId; use codex_app_server_protocol::ThreadEpiphanyRoleWorkerLaunchDocument; use codex_app_server_protocol::ThreadEpiphanyWorkerLaunchDocument; -use codex_protocol::protocol::EpiphanyInvestigationCheckpoint; -use codex_protocol::protocol::EpiphanyInvestigationDisposition; -use codex_protocol::protocol::EpiphanyJobKind as CoreEpiphanyJobKind; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyJobLaunchRequest; use epiphany_core::EpiphanyReorientWorkerLaunchDocument; use epiphany_core::EpiphanyRoleWorkerLaunchDocument; use epiphany_core::EpiphanyWorkerLaunchDocument; +use epiphany_state_model::EpiphanyInvestigationCheckpoint; +use epiphany_state_model::EpiphanyInvestigationDisposition; +use epiphany_state_model::EpiphanyJobKind as CoreEpiphanyJobKind; +use epiphany_state_model::EpiphanyThreadState; pub const EPIPHANY_IMAGINATION_ROLE_BINDING_ID: &str = "planning-synthesis-worker"; pub const EPIPHANY_IMAGINATION_OWNER_ROLE: &str = "epiphany-imagination"; diff --git a/epiphany-codex-bridge/src/mutation.rs b/epiphany-codex-bridge/src/mutation.rs index 0d011548..70d36172 100644 --- a/epiphany-codex-bridge/src/mutation.rs +++ b/epiphany-codex-bridge/src/mutation.rs @@ -7,10 +7,6 @@ use codex_app_server_protocol::ThreadEpiphanyStateUpdatedField; use codex_app_server_protocol::ThreadEpiphanyStateUpdatedNotification; use codex_app_server_protocol::ThreadEpiphanyStateUpdatedSource; use codex_app_server_protocol::ThreadEpiphanyUpdatePatch; -use codex_protocol::protocol::EpiphanyCodeRef; -use codex_protocol::protocol::EpiphanyInvestigationCheckpoint; -use codex_protocol::protocol::EpiphanyInvestigationDisposition; -use codex_protocol::protocol::EpiphanyScratchPad; use epiphany_core::EpiphanyReorientAcceptanceFinding; use epiphany_core::EpiphanyRoleAcceptanceFinding; use epiphany_core::EpiphanyRoleStatePatchDocument; @@ -19,6 +15,10 @@ use epiphany_core::build_reorient_acceptance_bundle; use epiphany_core::build_role_acceptance_bundle; use epiphany_core::imagination_role_state_patch_policy_errors; use epiphany_core::modeling_role_state_patch_policy_errors; +use epiphany_state_model::EpiphanyCodeRef; +use epiphany_state_model::EpiphanyInvestigationCheckpoint; +use epiphany_state_model::EpiphanyInvestigationDisposition; +use epiphany_state_model::EpiphanyScratchPad; use crate::results::map_core_role_result_role_id; use crate::runtime_results::reorient_finding_runtime_job_id; @@ -106,7 +106,7 @@ pub fn epiphany_state_updated_notification( source: ThreadEpiphanyStateUpdatedSource, revision: u64, changed_fields: Vec, - epiphany_state: codex_protocol::protocol::EpiphanyThreadState, + epiphany_state: epiphany_state_model::EpiphanyThreadState, ) -> ThreadEpiphanyStateUpdatedNotification { ThreadEpiphanyStateUpdatedNotification { thread_id, diff --git a/epiphany-codex-bridge/src/mutation_service.rs b/epiphany-codex-bridge/src/mutation_service.rs index 4abd6fc1..b43bba68 100644 --- a/epiphany-codex-bridge/src/mutation_service.rs +++ b/epiphany-codex-bridge/src/mutation_service.rs @@ -14,10 +14,6 @@ use codex_app_server_protocol::ThreadEpiphanyRoleId; use codex_app_server_protocol::ThreadEpiphanyStateUpdatedField; use codex_app_server_protocol::ThreadEpiphanyUpdatePatch; use codex_protocol::error::CodexErr; -use codex_protocol::protocol::EpiphanyEvidenceRecord; -use codex_protocol::protocol::EpiphanyJobKind as CoreEpiphanyJobKind; -use codex_protocol::protocol::EpiphanyRetrievalState; -use codex_protocol::protocol::EpiphanyThreadState; use codex_protocol::protocol::TokenUsageInfo as CoreTokenUsageInfo; use epiphany_core::EpiphanyJobInterruptRequest; use epiphany_core::EpiphanyJobInterruptResult; @@ -34,6 +30,10 @@ use epiphany_core::evaluate_promotion; use epiphany_core::open_runtime_spine_heartbeat_job; use epiphany_core::plan_runtime_spine_heartbeat_launch; use epiphany_core::replace_or_append_epiphany_job_binding; +use epiphany_state_model::EpiphanyEvidenceRecord; +use epiphany_state_model::EpiphanyJobKind as CoreEpiphanyJobKind; +use epiphany_state_model::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyThreadState; use crate::jobs::epiphany_blocked_state_job; use crate::jobs::map_epiphany_jobs; diff --git a/epiphany-codex-bridge/src/reorient.rs b/epiphany-codex-bridge/src/reorient.rs index 6966f9c6..7a19a77f 100644 --- a/epiphany-codex-bridge/src/reorient.rs +++ b/epiphany-codex-bridge/src/reorient.rs @@ -11,8 +11,6 @@ use codex_app_server_protocol::ThreadEpiphanyReorientReason; use codex_app_server_protocol::ThreadEpiphanyReorientStateStatus; use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshness; use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshnessStatus; -use codex_protocol::protocol::EpiphanyRetrievalState; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyFreshnessInput; use epiphany_core::EpiphanyFreshnessView; use epiphany_core::EpiphanyFreshnessWatcherInput; @@ -31,6 +29,8 @@ use epiphany_core::EpiphanyRetrievalFreshness as CoreEpiphanyRetrievalFreshness; use epiphany_core::EpiphanyRetrievalFreshnessStatus as CoreEpiphanyRetrievalFreshnessStatus; use epiphany_core::derive_freshness; use epiphany_core::recommend_reorientation; +use epiphany_state_model::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyThreadState; use std::path::Path; use std::path::PathBuf; diff --git a/epiphany-codex-bridge/src/retrieve.rs b/epiphany-codex-bridge/src/retrieve.rs index 51d946e9..55446e0c 100644 --- a/epiphany-codex-bridge/src/retrieve.rs +++ b/epiphany-codex-bridge/src/retrieve.rs @@ -4,7 +4,6 @@ use codex_app_server_protocol::ThreadEpiphanyRetrieveResponse; use codex_app_server_protocol::ThreadEpiphanyRetrieveResult; use codex_app_server_protocol::ThreadEpiphanyRetrieveResultKind; use codex_app_server_protocol::ThreadEpiphanyRetrieveShardSummary; -use codex_protocol::protocol::EpiphanyRetrievalState; use codex_utils_absolute_path::AbsolutePathBuf; use epiphany_core::EpiphanyRetrieveQuery; use epiphany_core::EpiphanyRetrieveResponse as CoreEpiphanyRetrieveResponse; @@ -14,6 +13,7 @@ use epiphany_core::index_workspace; use epiphany_core::normalize_epiphany_retrieve_query; use epiphany_core::retrieval_state_for_workspace; use epiphany_core::retrieve_workspace; +use epiphany_state_model::EpiphanyRetrievalState; use std::path::PathBuf; pub fn map_epiphany_retrieve_response( diff --git a/epiphany-codex-bridge/src/runtime_results.rs b/epiphany-codex-bridge/src/runtime_results.rs index b4137426..06e0bfc9 100644 --- a/epiphany-codex-bridge/src/runtime_results.rs +++ b/epiphany-codex-bridge/src/runtime_results.rs @@ -7,8 +7,6 @@ use codex_app_server_protocol::ThreadEpiphanyRoleId; use codex_app_server_protocol::ThreadEpiphanyRoleResultStatus; use codex_protocol::error::CodexErr; use codex_protocol::error::Result as CodexResult; -use codex_protocol::protocol::EpiphanyRuntimeLink; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyRuntimeJobSnapshot; use epiphany_core::EpiphanyRuntimeJobStatus; use epiphany_core::interpret_runtime_reorient_worker_result; @@ -16,6 +14,8 @@ use epiphany_core::interpret_runtime_role_worker_result; use epiphany_core::runtime_job_snapshot; use epiphany_core::runtime_reorient_worker_result; use epiphany_core::runtime_role_worker_result; +use epiphany_state_model::EpiphanyRuntimeLink; +use epiphany_state_model::EpiphanyThreadState; use crate::results::map_core_role_result_role_id; use crate::results::map_protocol_reorient_finding; diff --git a/epiphany-codex-bridge/src/scene.rs b/epiphany-codex-bridge/src/scene.rs index 3e9fa8a5..2456cff8 100644 --- a/epiphany-codex-bridge/src/scene.rs +++ b/epiphany-codex-bridge/src/scene.rs @@ -10,7 +10,6 @@ use codex_app_server_protocol::ThreadEpiphanySceneSource; use codex_app_server_protocol::ThreadEpiphanySceneStateStatus; use codex_app_server_protocol::ThreadEpiphanySceneStatusCount; use codex_app_server_protocol::ThreadEpiphanySceneSubgoal; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyScene as CoreEpiphanyScene; use epiphany_core::EpiphanySceneAction as CoreEpiphanySceneAction; use epiphany_core::EpiphanySceneChurn as CoreEpiphanySceneChurn; @@ -25,6 +24,7 @@ use epiphany_core::EpiphanySceneStateStatus as CoreEpiphanySceneStateStatus; use epiphany_core::EpiphanySceneStatusCount as CoreEpiphanySceneStatusCount; use epiphany_core::EpiphanySceneSubgoal as CoreEpiphanySceneSubgoal; use epiphany_core::derive_scene; +use epiphany_state_model::EpiphanyThreadState; pub fn map_epiphany_scene( state: Option<&EpiphanyThreadState>, diff --git a/epiphany-codex-bridge/src/state.rs b/epiphany-codex-bridge/src/state.rs index ef8305a6..3ef3ca81 100644 --- a/epiphany-codex-bridge/src/state.rs +++ b/epiphany-codex-bridge/src/state.rs @@ -2,8 +2,8 @@ use std::fs; use std::path::Path; use std::path::PathBuf; -use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::write_thread_state; +use epiphany_state_model::EpiphanyThreadState; use tracing::warn; use crate::retrieve::epiphany_retrieval_state_for_paths; diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 2b83b3c3..6873fe1f 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -1,8 +1,6 @@ use std::path::Path; use codex_app_server_protocol::*; -use codex_protocol::protocol::EpiphanyRetrievalState; -use codex_protocol::protocol::EpiphanyThreadState; use codex_protocol::protocol::TokenUsageInfo as CoreTokenUsageInfo; use epiphany_core::EpiphanyDistillInput; use epiphany_core::EpiphanyMapProposalInput; @@ -10,6 +8,8 @@ use epiphany_core::EpiphanySceneInput; use epiphany_core::derive_scene; use epiphany_core::distill_observation; use epiphany_core::propose_map_update; +use epiphany_state_model::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyThreadState; use crate::context::map_epiphany_context; use crate::context::map_epiphany_graph_query; diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index 2c6a8f15..1b78c8a9 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -5087,6 +5087,7 @@ dependencies = [ "codex-protocol", "codex-utils-absolute-path", "epiphany-core", + "epiphany-state-model", "notify", "serde", "serde_json",