diff --git a/epiphany-codex-bridge/src/mutation_service.rs b/epiphany-codex-bridge/src/mutation_service.rs index 53af4f7a..95b4cf13 100644 --- a/epiphany-codex-bridge/src/mutation_service.rs +++ b/epiphany-codex-bridge/src/mutation_service.rs @@ -261,7 +261,7 @@ async fn apply_modeling_memory_patch_candidates( let Some(runtime_job_id) = finding.runtime_job_id.as_deref() else { return Ok(Vec::new()); }; - let runtime_store_path = thread.epiphany_runtime_spine_store_path().await; + let runtime_store_path = runtime_spine_store_path(thread).await; let Some(runtime_result) = runtime_role_worker_result(runtime_store_path.as_path(), runtime_job_id).map_err(|err| { CodexErr::InvalidRequest(format!( diff --git a/epiphany-codex-bridge/src/runtime_results.rs b/epiphany-codex-bridge/src/runtime_results.rs index 05cd3c5d..36916b46 100644 --- a/epiphany-codex-bridge/src/runtime_results.rs +++ b/epiphany-codex-bridge/src/runtime_results.rs @@ -23,6 +23,7 @@ use crate::results::map_protocol_reorient_finding; use crate::results::map_protocol_role_finding; use crate::results::render_epiphany_reorient_result_note; use crate::results::render_epiphany_role_result_note; +use crate::state::runtime_spine_store_path; pub fn role_finding_runtime_result_id(finding: &ThreadEpiphanyRoleFinding) -> Option { finding.runtime_result_id.clone() @@ -276,7 +277,7 @@ pub async fn load_completed_epiphany_role_finding( binding_id: &str, ) -> CodexResult { if let Some(link) = latest_epiphany_runtime_link_for_binding(state, binding_id) { - let runtime_store_path = thread.epiphany_runtime_spine_store_path().await; + let runtime_store_path = runtime_spine_store_path(thread).await; let (status, finding, _note) = load_epiphany_role_result_from_runtime_spine_job( link.runtime_job_id.as_str(), Some(runtime_store_path.as_path()), @@ -360,7 +361,7 @@ pub async fn load_completed_epiphany_reorient_finding( binding_id: &str, ) -> CodexResult { if let Some(link) = latest_epiphany_runtime_link_for_binding(state, binding_id) { - let runtime_store_path = thread.epiphany_runtime_spine_store_path().await; + let runtime_store_path = runtime_spine_store_path(thread).await; let (status, finding, _note) = load_epiphany_reorient_result_from_runtime_spine_job( link.runtime_job_id.as_str(), Some(runtime_store_path.as_path()), diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index b13ffaa1..c2d9113a 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -59,7 +59,7 @@ remembers doctrine; the branch remembers the blade. - Thread start route handling and its async lifecycle task now live in `codex_message_processor/thread_start_routes.rs`; root no longer owns `thread_start_task`. - Thread config helpers now live in `codex_message_processor/thread_config.rs`: instruction-source loading, thread config override construction, config-load error shaping, and dynamic-tool validation. The pure dynamic-tool validation contract has module-local unit tests. - Turn control routes now live in `codex_message_processor/turn_routes.rs`: turn start, thread item injection, app-server client info setting, turn steer, turn interrupt, mode normalization, and input-limit validation with module-local unit tests. -- Epiphany read-route memory graph loading now belongs to `epiphany-codex-bridge::state::load_thread_memory_graph_snapshot`. Vendored app-server read routes may decide whether a loaded thread exists, but they no longer own the memory graph store path or load mechanics. +- Epiphany memory graph loading and runtime-spine path derivation now belong to `epiphany-codex-bridge::state`. Vendored app-server read routes may decide whether a loaded thread exists, but they no longer own memory graph or runtime-spine store path/load mechanics. - Epiphany job launch/interrupt policy now belongs to `epiphany-codex-bridge::mutation_service`: heartbeat launch planning, runtime-spine job opening, binding/runtime-link mutation, and interrupt binding cleanup are out of vendored `CodexThread`. `CodexThread` still owns the narrow Codex-session read/update seam for Epiphany state until that persistence seam can be replaced cleanly. - Heartbeat durable document/schema types now live in `epiphany-core/src/heartbeat_state/heartbeat_documents.rs`, role/default construction lives in `epiphany-core/src/heartbeat_state/heartbeat_roles.rs`, persistence/validation lives in `epiphany-core/src/heartbeat_state/heartbeat_store.rs`, and status/artifact JSON projection lives in `epiphany-core/src/heartbeat_state/heartbeat_projection.rs`. The root `heartbeat_state.rs` keeps scheduling and Void cognition orchestration for the next cuts. Focused heartbeat tests and `epiphany-core` check pass after the splits. - Heartbeat role/default and store seams now have module-local unit tests: fixed lane catalog, Ghostlight scene role projection, and typed state/cognition CultCache round-trip. Keep future heartbeat cuts aligned to those seam tests instead of growing root integration-only coverage. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 51d46c15..2b678dd9 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index e611fa67..9e34cb41 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -23,10 +23,10 @@ objective: JSON may survive only at schema/wire/forensic/quarantine boundaries; and vendored Codex must be reduced to the smallest OpenAI subscription auth/model-transport adapter needed to preserve the user's Codex - compatibility. Read-route memory graph loading and runtime-spine path - derivation now live in `epiphany-codex-bridge::state`; vendored - app-server route code calls that bridge instead of owning the store - path/load mechanics itself. Job launch/interrupt policy now lives in + compatibility. Memory graph loading and runtime-spine path derivation now + live in `epiphany-codex-bridge::state`; vendored app-server route code + calls that bridge instead of owning store path/load mechanics itself. Job + launch/interrupt policy now lives in `epiphany-codex-bridge::mutation_service`; vendored `CodexThread` remains the narrow Codex-session persistence seam for Epiphany state read/update. diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs index 31fc74c6..be40d55e 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs @@ -19,6 +19,7 @@ use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_job; use epiphany_codex_bridge::pressure::map_epiphany_pressure; use epiphany_codex_bridge::pressure::render_epiphany_pre_compaction_checkpoint_intervention; use epiphany_codex_bridge::pressure::should_run_epiphany_pre_compaction_checkpoint_intervention; +use epiphany_codex_bridge::state::runtime_spine_store_path; use tokio::sync::Mutex; use tracing::warn; @@ -46,7 +47,7 @@ pub(crate) async fn maybe_run_epiphany_coordinator_automation_for_turn_boundary( .snapshot(&thread_id_text) .await; let token_usage_info = thread.token_usage_info().await; - let runtime_store_path = thread.epiphany_runtime_spine_store_path().await; + let runtime_store_path = runtime_spine_store_path(thread.as_ref()).await; let verdict = select_epiphany_coordinator_automation(EpiphanyCoordinatorAutomationInput { thread_id: &thread_id_text, diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs index 0d0e01ba..5f885505 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs @@ -5,6 +5,7 @@ use epiphany_codex_bridge::launch::EPIPHANY_REORIENT_LAUNCH_BINDING_ID; use epiphany_codex_bridge::launch::epiphany_role_binding_id; use epiphany_codex_bridge::retrieve::map_epiphany_retrieve_response; use epiphany_codex_bridge::state::load_optional_thread_memory_graph_snapshot; +use epiphany_codex_bridge::state::runtime_spine_store_path; use epiphany_codex_bridge::view::EpiphanyFreshnessResponseInput; use epiphany_codex_bridge::view::EpiphanyReorientResultResponseInput; use epiphany_codex_bridge::view::EpiphanyRoleResultResponseInput; @@ -123,7 +124,7 @@ impl CodexMessageProcessor { }; let runtime_store_path = if epiphany_view_needs_runtime_store(&lenses) { if let Some(loaded_thread) = loaded_thread.as_ref() { - Some(loaded_thread.epiphany_runtime_spine_store_path().await) + Some(runtime_spine_store_path(loaded_thread).await) } else { None } @@ -202,7 +203,7 @@ impl CodexMessageProcessor { } let runtime_store_path = if let Some(loaded_thread) = loaded_thread.as_ref() { - Some(loaded_thread.epiphany_runtime_spine_store_path().await) + Some(runtime_spine_store_path(loaded_thread).await) } else { None }; @@ -423,7 +424,7 @@ impl CodexMessageProcessor { ThreadEpiphanyReorientSource::Stored }; let runtime_store_path = if let Some(loaded_thread) = loaded_thread.as_ref() { - Some(loaded_thread.epiphany_runtime_spine_store_path().await) + Some(runtime_spine_store_path(loaded_thread).await) } else { None }; diff --git a/vendor/codex/codex-rs/core/src/codex_thread.rs b/vendor/codex/codex-rs/core/src/codex_thread.rs index e63a3806..86ca91bd 100644 --- a/vendor/codex/codex-rs/core/src/codex_thread.rs +++ b/vendor/codex/codex-rs/core/src/codex_thread.rs @@ -401,15 +401,6 @@ impl CodexThread { }) } - pub async fn epiphany_runtime_spine_store_path(&self) -> PathBuf { - self.config_snapshot() - .await - .cwd - .join("state") - .join("runtime-spine.msgpack") - .to_path_buf() - } - pub async fn epiphany_index( &self, force_full_rebuild: bool,