Move runtime spine path derivation into bridge

This commit is contained in:
Meta Vens 2026-05-18 07:03:46 +01:00
commit 89514cf147
8 changed files with 15 additions and 21 deletions

View file

@ -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!(

View file

@ -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<String> {
finding.runtime_result_id.clone()
@ -276,7 +277,7 @@ pub async fn load_completed_epiphany_role_finding(
binding_id: &str,
) -> CodexResult<ThreadEpiphanyRoleFinding> {
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<ThreadEpiphanyReorientFinding> {
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()),

View file

@ -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.

Binary file not shown.

View file

@ -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.

View file

@ -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,

View file

@ -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
};

View file

@ -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,