From 9d2b8540f51a1385afd1e6f23ed0440bed49dba8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 12:30:24 +0100 Subject: [PATCH] Move Epiphany invalidation into bridge --- epiphany-codex-bridge/Cargo.toml | 2 ++ .../src/invalidation.rs | 16 ++++++---------- epiphany-codex-bridge/src/lib.rs | 1 + notes/fresh-workspace-handoff.md | 7 +++++++ state/ledgers.msgpack | Bin 93320 -> 93771 bytes state/map.yaml | 2 +- vendor/codex/codex-rs/Cargo.lock | 2 ++ .../app-server/src/bespoke_event_handling.rs | 2 +- .../app-server/src/codex_message_processor.rs | 4 ++-- .../epiphany_automation.rs | 2 +- vendor/codex/codex-rs/app-server/src/lib.rs | 1 - 11 files changed, 23 insertions(+), 16 deletions(-) rename vendor/codex/codex-rs/app-server/src/epiphany_invalidation.rs => epiphany-codex-bridge/src/invalidation.rs (93%) diff --git a/epiphany-codex-bridge/Cargo.toml b/epiphany-codex-bridge/Cargo.toml index df96686e..330803c9 100644 --- a/epiphany-codex-bridge/Cargo.toml +++ b/epiphany-codex-bridge/Cargo.toml @@ -21,5 +21,7 @@ epiphany-openai-adapter = { path = "../epiphany-openai-adapter" } epiphany-openai-codex-spine = { path = "../epiphany-openai-codex-spine" } serde_json = "1" serde = { version = "1", features = ["derive"] } +tokio = { version = "1", features = ["rt", "sync"] } toml = "0.9" +tracing = "0.1" uuid = { version = "1", features = ["v4"] } diff --git a/vendor/codex/codex-rs/app-server/src/epiphany_invalidation.rs b/epiphany-codex-bridge/src/invalidation.rs similarity index 93% rename from vendor/codex/codex-rs/app-server/src/epiphany_invalidation.rs rename to epiphany-codex-bridge/src/invalidation.rs index 2af933a0..43cd9a2c 100644 --- a/vendor/codex/codex-rs/app-server/src/epiphany_invalidation.rs +++ b/epiphany-codex-bridge/src/invalidation.rs @@ -17,7 +17,7 @@ use tracing::warn; const INVALIDATION_WATCH_DEBOUNCE: Duration = Duration::from_millis(200); #[derive(Clone, Debug, PartialEq, Eq)] -pub(crate) struct EpiphanyInvalidationSnapshot { +pub struct EpiphanyInvalidationSnapshot { pub available: bool, pub workspace_root: Option, pub observed_at_unix_seconds: Option, @@ -25,7 +25,7 @@ pub(crate) struct EpiphanyInvalidationSnapshot { } #[derive(Clone)] -pub(crate) struct EpiphanyInvalidationManager { +pub struct EpiphanyInvalidationManager { available: bool, file_watcher: Arc, state: Arc>>, @@ -46,7 +46,7 @@ struct LatestInvalidation { } impl EpiphanyInvalidationManager { - pub(crate) fn new() -> Self { + pub fn new() -> Self { match FileWatcher::new() { Ok(file_watcher) => Self { available: true, @@ -64,11 +64,7 @@ impl EpiphanyInvalidationManager { } } - pub(crate) async fn ensure_thread_watch( - &self, - thread_id: &str, - workspace_root: &AbsolutePathBuf, - ) { + pub async fn ensure_thread_watch(&self, thread_id: &str, workspace_root: &AbsolutePathBuf) { if !self.available { return; } @@ -135,7 +131,7 @@ impl EpiphanyInvalidationManager { }); } - pub(crate) async fn snapshot(&self, thread_id: &str) -> EpiphanyInvalidationSnapshot { + pub async fn snapshot(&self, thread_id: &str) -> EpiphanyInvalidationSnapshot { if !self.available { return EpiphanyInvalidationSnapshot { available: false, @@ -174,7 +170,7 @@ impl EpiphanyInvalidationManager { } } - pub(crate) async fn remove_thread(&self, thread_id: &str) { + pub async fn remove_thread(&self, thread_id: &str) { let entry = self.state.lock().await.remove(thread_id); if let Some(entry) = entry { stop_watch_entry(entry).await; diff --git a/epiphany-codex-bridge/src/lib.rs b/epiphany-codex-bridge/src/lib.rs index 6c121446..28760345 100644 --- a/epiphany-codex-bridge/src/lib.rs +++ b/epiphany-codex-bridge/src/lib.rs @@ -1,5 +1,6 @@ pub mod context; pub mod coordinator; +pub mod invalidation; pub mod jobs; pub mod launch; pub mod mutation; diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index e36f92c9..12060c85 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -760,6 +760,13 @@ depends directly on `codex-chatgpt`, `codex-core-plugins`, or `codex-plugin`. `codex_message_processor.rs` is still too large, but it is no longer carrying the plugin marketplace altar in its chest cavity. +The watcher invalidation adapter has left the vendored app-server root too. +`epiphany-codex-bridge::invalidation` now owns `EpiphanyInvalidationManager` +and its snapshots around Codex's file watcher; app-server keeps only the +host-lifecycle calls that create, snapshot, and remove watches for loaded +threads. There is no longer a root `epiphany_invalidation.rs` module under +vendored app-server. + The Phase 6 freshness slice is landed. It exposes read-only `thread/epiphany/freshness` from live retrieval summaries plus graph frontier/churn state and, for loaded threads, watcher-backed invalidation diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 73be69db072f3192cb2beb0446b8d6807dd6d181..1f246dad018a7f1351345a4565999a712f363146 100644 GIT binary patch delta 344 zcmZ9Iy-EW?6onZv*eZgBq_`k5PS?Dz)i5S{x07==iGi(KEEq>8w<4ZviZQ+&&`y*PZ@jb6^}i(y4Xxw z$$k52E4ezdBUBJGgafBtCMbuoh%!SDnnuECC8D+j13@B1Up!y1YO#IHs!M;kXjj-; zR}Y-^G0a6BuT_d5lyI@s2vX2TbO9`x95Nds7~MsgOM@VVF`))$=yg}mlXyE!GuXEZ zCos0YADoc0JD=L(@`P2FIgc31U!0TWen`c~AzMd}1EDEE$5`1fMV)*e1}8d1O(~3! ol=UU}Z&v6^gd}rtv*r-JaJB2#M$*{h$u6%qPwVy8Y_Xm5UqL~7tN;K2 delta 49 zcmX?ohqdD->jY({9KVgK(-;{)H}7HGzK4-