From e5766b668aa18051b5ee76e1a2cc6cc88bc89ee9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 07:37:30 +0100 Subject: [PATCH] Delete extinct Codex bridge crate --- docs/epiphany_body_whitepaper.tex | 20 +- epiphany-codex-bridge/Cargo.toml | 16 -- epiphany-codex-bridge/src/invalidation.rs | 189 ------------------ epiphany-codex-bridge/src/lib.rs | 7 - .../src/bin/epiphany-mvp-coordinator.rs | 37 ++-- .../src/coordinator_launch_context.rs | 8 +- notes/epiphany-app-server-client-matrix.md | 7 +- notes/fresh-workspace-handoff.md | 8 +- notes/native-coordinator-liberation-map.md | 6 +- state/ledgers.msgpack | Bin 415240 -> 415660 bytes state/map.yaml | 10 +- vendor/codex/codex-rs/Cargo.lock | 21 -- vendor/codex/codex-rs/app-server/Cargo.toml | 2 - .../app-server/src/codex_message_processor.rs | 3 - .../listener_lifecycle.rs | 18 -- .../thread_start_routes.rs | 1 - 16 files changed, 41 insertions(+), 312 deletions(-) delete mode 100644 epiphany-codex-bridge/Cargo.toml delete mode 100644 epiphany-codex-bridge/src/invalidation.rs delete mode 100644 epiphany-codex-bridge/src/lib.rs diff --git a/docs/epiphany_body_whitepaper.tex b/docs/epiphany_body_whitepaper.tex index 3e5bc82a..63923aec 100644 --- a/docs/epiphany_body_whitepaper.tex +++ b/docs/epiphany_body_whitepaper.tex @@ -48,7 +48,7 @@ The practical definition in this repository is: \begin{itemize} \item the root checkout at \code{E:\Projects\EpiphanyAgent}; - \item Epiphany Rust crates such as \code{epiphany-core}, \code{epiphany-state-model}, \code{epiphany-codex-bridge}, model/tool adapters, and OpenAI transport crates; + \item Epiphany Rust crates such as \code{epiphany-core}, \code{epiphany-state-model}, model/tool adapters, and OpenAI transport crates; \item vendored substrate in \code{vendor/codex}, \code{vendor/cultcache-rs}, \code{vendor/cultnet-rs}, and \code{vendor/cultmesh-rs}; \item typed state stores under \code{state/}; \item schemas under \code{schemas/cultnet/}; @@ -70,7 +70,6 @@ auth and model transport. \hline Durable thread state & \code{epiphany-state-model}, \code{epiphany-core} & State shape is typed; prompt rendering is a projection, not authority. \\ Domain policy & \code{epiphany-core} & Verdicts, launch policy, acceptance rules, runtime lifecycle, and mutation law live here, not in bridge DTOs. \\ -Compatibility bridge & \code{epiphany-codex-bridge} & Translate Codex edge shapes; never become a second policy throne. \\ Vendored Codex & \code{vendor/codex} & Retain host/app-server/auth/model compatibility where useful; do not let Codex own Epiphany prompts, scheduler, or state. \\ Runtime spine & \code{epiphany-core/src/runtime_spine.rs} and \code{state/runtime-spine.cc} & Runtime identity, jobs, events, receipts, tool/model documents are typed CultCache records. \\ Organ memory & \code{state/agents.cc}; agent-memory CLI & Resident work organs use lean work-organ state; Persona uses portable Persona state. \\ @@ -82,7 +81,7 @@ Operator artifacts & \code{.epiphany-*}, \code{tools/epiphany_local_run.ps1} & A \section{Repository Body} -The checkout has ten primary Epiphany Rust crates: +The checkout has nine primary Epiphany Rust crates: \begin{itemize} \item \code{epiphany-core}: the main domain organ. It owns state-update @@ -92,9 +91,6 @@ The checkout has ten primary Epiphany Rust crates: \item \code{epiphany-state-model}: the durable \code{EpiphanyThreadState} type plus \code{render_epiphany_state}. This is the typed Mind surface that prompt fragments and views read. - \item \code{epiphany-codex-bridge}: the translation layer between typed - Epiphany documents and vendored Codex JSON-RPC/app-server shapes. Its own - crate header states that it is a bridge, not an authority organ. \item \code{epiphany-model-adapter}: provider-neutral model request, stream event, receipt, and status documents. \item \code{epiphany-openai-adapter}: OpenAI-shaped request/event/receipt and @@ -233,14 +229,12 @@ move through Substrate-Gate-scoped facts, Mind state, social stimulus, organ dependencies, Imagination as Projector, Persona as natural-language actor, and Mind as Interpreter. None of those steps grants Persona hidden state authority. -\section{Bridge And Codex Reliquary} +\section{Codex Reliquary} -\code{epiphany-codex-bridge} states its boundary plainly: it translates Codex -\code{ThreadEpiphany*} DTOs into Epiphany core documents, projects typed -Epiphany surfaces back into legacy Codex responses, and calls narrow host traits -while Codex still owns some thread persistence. It must not own verdicts, -launch policy, reorientation policy, acceptance rules, runtime-spine lifecycle, -or durable invariants. +Epiphany publishes no app-server JSON-RPC state surface. Vendored Codex owns +only Codex concerns and the retained OpenAI-compatible auth/model transport +machinery. Epiphany state, prompts, scheduling, interfaces, and durable +invariants remain native typed organs. The retained Codex body currently matters for: diff --git a/epiphany-codex-bridge/Cargo.toml b/epiphany-codex-bridge/Cargo.toml deleted file mode 100644 index 662eeea9..00000000 --- a/epiphany-codex-bridge/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "epiphany-codex-bridge" -version = "0.1.0" -edition = "2024" -publish = false -license-file = "../LICENSE" - -[lib] -name = "epiphany_codex_bridge" -path = "src/lib.rs" - -[dependencies] -codex-utils-absolute-path = { path = "../vendor/codex/codex-rs/utils/absolute-path" } -notify = "8.2.0" -tokio = { version = "1", features = ["rt", "sync"] } -tracing = "0.1" diff --git a/epiphany-codex-bridge/src/invalidation.rs b/epiphany-codex-bridge/src/invalidation.rs deleted file mode 100644 index 1e70c9fb..00000000 --- a/epiphany-codex-bridge/src/invalidation.rs +++ /dev/null @@ -1,189 +0,0 @@ -use codex_utils_absolute_path::AbsolutePathBuf; -use notify::RecursiveMode; -use notify::Watcher; -use std::collections::HashMap; -use std::path::PathBuf; -use std::sync::Arc; -use std::time::SystemTime; -use std::time::UNIX_EPOCH; -use tokio::sync::Mutex as AsyncMutex; -use tokio::sync::mpsc; -use tokio::sync::oneshot; -use tracing::warn; - -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct EpiphanyInvalidationSnapshot { - pub available: bool, - pub workspace_root: Option, - pub observed_at_unix_seconds: Option, - pub changed_paths: Vec, -} - -#[derive(Clone)] -pub struct EpiphanyInvalidationManager { - state: Arc>>, -} - -struct WatchEntry { - workspace_root: AbsolutePathBuf, - latest: Arc>, - terminate_tx: oneshot::Sender>, - _watcher: notify::RecommendedWatcher, -} - -#[derive(Clone, Debug, Default, PartialEq, Eq)] -struct LatestInvalidation { - observed_at_unix_seconds: Option, - changed_paths: Vec, -} - -impl EpiphanyInvalidationManager { - pub fn new() -> Self { - Self { - state: Arc::new(AsyncMutex::new(HashMap::new())), - } - } - - pub async fn ensure_thread_watch(&self, thread_id: &str, workspace_root: &AbsolutePathBuf) { - let existing_entry = { - let mut state = self.state.lock().await; - match state.get(thread_id) { - Some(entry) if &entry.workspace_root == workspace_root => return, - Some(_) => state.remove(thread_id), - None => None, - } - }; - - if let Some(entry) = existing_entry { - stop_watch_entry(entry).await; - } - - let latest = Arc::new(AsyncMutex::new(LatestInvalidation::default())); - let (event_tx, mut event_rx) = mpsc::unbounded_channel::>(); - let mut watcher = - match notify::recommended_watcher(move |result: notify::Result| { - match result { - Ok(event) => { - let _ = event_tx.send(event.paths); - } - Err(err) => warn!("epiphany invalidation watcher event failed: {err}"), - } - }) { - Ok(watcher) => watcher, - Err(err) => { - warn!("epiphany invalidation manager could not create watcher: {err}"); - return; - } - }; - if let Err(err) = watcher.watch(workspace_root.as_path(), RecursiveMode::Recursive) { - warn!( - "epiphany invalidation manager could not watch `{}`: {err}", - workspace_root.display() - ); - return; - } - let (terminate_tx, terminate_rx) = oneshot::channel(); - let workspace_root_path = workspace_root.to_path_buf(); - - let entry = WatchEntry { - workspace_root: workspace_root.clone(), - latest: Arc::clone(&latest), - terminate_tx, - _watcher: watcher, - }; - self.state.lock().await.insert(thread_id.to_string(), entry); - - tokio::spawn(async move { - let mut terminate_rx = terminate_rx; - let mut done_tx = None; - - loop { - let paths = tokio::select! { - biased; - result = &mut terminate_rx => { - done_tx = result.ok(); - break; - } - paths = event_rx.recv() => match paths { - Some(paths) => paths, - None => break, - }, - }; - - let observed_at_unix_seconds = unix_now(); - let mut latest = latest.lock().await; - latest.observed_at_unix_seconds = Some(observed_at_unix_seconds); - latest.changed_paths = - normalize_changed_paths(paths, workspace_root_path.as_path()); - } - - if let Some(done_tx) = done_tx { - let _ = done_tx.send(()); - } - }); - } - - pub async fn snapshot(&self, thread_id: &str) -> EpiphanyInvalidationSnapshot { - let (workspace_root, latest) = { - let state = self.state.lock().await; - match state.get(thread_id) { - Some(entry) => ( - Some(entry.workspace_root.clone()), - Some(Arc::clone(&entry.latest)), - ), - None => (None, None), - } - }; - - let Some(latest) = latest else { - return EpiphanyInvalidationSnapshot { - available: false, - workspace_root: None, - observed_at_unix_seconds: None, - changed_paths: Vec::new(), - }; - }; - - let latest = latest.lock().await.clone(); - EpiphanyInvalidationSnapshot { - available: true, - workspace_root, - observed_at_unix_seconds: latest.observed_at_unix_seconds, - changed_paths: latest.changed_paths, - } - } - - 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; - } - } -} - -async fn stop_watch_entry(entry: WatchEntry) { - let (done_tx, done_rx) = oneshot::channel(); - let _ = entry.terminate_tx.send(done_tx); - let _ = done_rx.await; -} - -fn unix_now() -> i64 { - SystemTime::now() - .duration_since(UNIX_EPOCH) - .map(|duration| duration.as_secs() as i64) - .unwrap_or_default() -} - -fn normalize_changed_paths(paths: Vec, workspace_root: &std::path::Path) -> Vec { - let mut normalized = paths - .into_iter() - .filter_map(|path| match path.strip_prefix(workspace_root) { - Ok(relative) if relative.as_os_str().is_empty() => None, - Ok(relative) => Some(relative.to_path_buf()), - Err(_) => Some(path), - }) - .collect::>(); - normalized.sort(); - normalized.dedup(); - normalized -} diff --git a/epiphany-codex-bridge/src/lib.rs b/epiphany-codex-bridge/src/lib.rs deleted file mode 100644 index 06770cdc..00000000 --- a/epiphany-codex-bridge/src/lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Codex-host watcher invalidation compatibility. -//! -//! Epiphany state, process, and interface authority is native. This crate may -//! adapt file-watcher facts while the OpenAI/Codex transport reliquary remains, -//! but it does not publish an Epiphany protocol or own durable state. - -pub mod invalidation; diff --git a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs index 1a9555c6..370a8ba7 100644 --- a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs +++ b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs @@ -924,14 +924,8 @@ fn hands_record_pass_command(runtime_store: &Path, artifact_dir: &Path) -> Value fn implementation_requested_paths(status: &Value) -> Vec { let mut paths = Vec::new(); for pointer in [ - "/read/thread/epiphanyState/investigationCheckpoint/codeRefs", - "/read/thread/epiphanyState/investigationCheckpoint/code_refs", - "/read/thread/epiphanyState/investigation_checkpoint/code_refs", "/scene/scene/investigationCheckpoint/codeRefs", "/scene/scene/investigationCheckpoint/code_refs", - "/read/thread/epiphanyState/graphFrontier/dirtyPaths", - "/read/thread/epiphanyState/graphFrontier/dirty_paths", - "/read/thread/epiphanyState/graph_frontier/dirty_paths", "/scene/scene/graphFrontier/dirtyPaths", "/scene/scene/graphFrontier/dirty_paths", ] { @@ -1709,13 +1703,8 @@ fn reset_artifact_dir(path: &Path) -> Result<()> { fn state_revision(status: &Value) -> Option { status - .pointer("/read/thread/epiphanyState/revision") + .pointer("/scene/scene/revision") .and_then(Value::as_i64) - .or_else(|| { - status - .pointer("/scene/scene/revision") - .and_then(Value::as_i64) - }) } fn push_event(step: &mut Value, event: Value) { @@ -1917,19 +1906,17 @@ mod tests { #[test] fn implementation_requested_paths_use_checkpoint_and_frontier_scope() { let status = json!({ - "read": { - "thread": { - "epiphanyState": { - "investigationCheckpoint": { - "codeRefs": [ - {"path": "src\\main.rs"}, - {"path": "src/main.rs"}, - {"path": " notes/demo.md "} - ] - }, - "graphFrontier": { - "dirtyPaths": ["tests/demo.rs"] - } + "scene": { + "scene": { + "investigationCheckpoint": { + "codeRefs": [ + {"path": "src\\main.rs"}, + {"path": "src/main.rs"}, + {"path": " notes/demo.md "} + ] + }, + "graphFrontier": { + "dirtyPaths": ["tests/demo.rs"] } } } diff --git a/epiphany-core/src/coordinator_launch_context.rs b/epiphany-core/src/coordinator_launch_context.rs index b5738936..d0a21cb1 100644 --- a/epiphany-core/src/coordinator_launch_context.rs +++ b/epiphany-core/src/coordinator_launch_context.rs @@ -182,7 +182,7 @@ pub fn append_verification_hands_receipt_context( context.push_str(" - epiphany-core/src/hands_gateway.rs\n"); context.push_str(" - epiphany-core/src/runtime_spine.rs\n"); context.push_str(" - epiphany-core/src/bin/epiphany-mvp-coordinator.rs\n"); - context.push_str(" - epiphany-codex-bridge/src/coordinator.rs\n"); + context.push_str(" - epiphany-core/src/coordinator_launch_context.rs\n"); context.push_str("- sourcePathProof:\n"); context.push_str( " - epiphany-hands-action `record-pass` records patch, command, and commit receipts through runtime-spine put functions.\n", @@ -191,7 +191,7 @@ pub fn append_verification_hands_receipt_context( " - runtime_spine registers Hands receipt document types, persists/rereads them through the shared CultCache runtime-spine store, and exposes latest-chain readback.\n", ); context.push_str( - " - mutation_service appends this packet only for Verification role launches after dynamic context assembly.\n", + " - native coordinator launch context appends this packet only for Verification role launches after dynamic context assembly.\n", ); context.push_str( " - coordinator treats a complete post-verification Hands chain as implementation evidence that requires a fresh Soul pass.\n", @@ -342,12 +342,12 @@ fn work_loop_telemetry_from_hands_chain( "epiphany-core/src/hands_gateway.rs".to_string(), "epiphany-core/src/runtime_spine.rs".to_string(), "epiphany-core/src/bin/epiphany-mvp-coordinator.rs".to_string(), - "epiphany-codex-bridge/src/coordinator.rs".to_string(), + "epiphany-core/src/coordinator_launch_context.rs".to_string(), ], source_path_proof: vec![ "epiphany-hands-action `record-pass` records patch, command, and commit receipts through runtime-spine put functions.".to_string(), "runtime_spine registers Hands receipt document types, persists/rereads them through the shared CultCache runtime-spine store, and exposes latest-chain readback.".to_string(), - "bridge launch context writes this typed packet to the internal CultMesh Verse before Soul receives the rendered projection.".to_string(), + "native coordinator launch context writes this typed packet to the internal CultMesh Verse before Soul receives the rendered projection.".to_string(), "coordinator treats a complete post-verification Hands chain as implementation evidence that requires a fresh Soul pass.".to_string(), ], soul_receipt_ids, diff --git a/notes/epiphany-app-server-client-matrix.md b/notes/epiphany-app-server-client-matrix.md index 40689d22..5793f921 100644 --- a/notes/epiphany-app-server-client-matrix.md +++ b/notes/epiphany-app-server-client-matrix.md @@ -1,9 +1,8 @@ # Epiphany App-Server Client Matrix -This map classifies the remaining experimental `thread/epiphany/*` JSON-RPC -surface by executable consumers in this repository. Definitions, generated -bindings, README prose, protocol serialization tests, archived notes, and the -handler itself do not count as clients. +This map records the deletion audit for the former experimental +`thread/epiphany/*` JSON-RPC surface. No such surface or executable client +remains. ## Living explicit compatibility clients diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 2aa0b139..449da5cf 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1969,8 +1969,12 @@ eight request methods, two notifications, dispatch/handlers, `ThreadEpiphany*` DTO slab, generated exports, Codex thread-state projection, and legacy rollout migration are gone. Schema fixture equivalence, full app-server compilation, and native status interruption tests pass. `epiphany-codex-bridge` now contains -only the file-watcher invalidation manager; move that host-owned organ into -app-server and delete the bridge crate next. +only the file-watcher invalidation manager. Its audit found no watch creator or +snapshot reader, only teardown calls, so the adapter and listener plumbing were +deleted instead of moved. The `epiphany-codex-bridge` crate and Codex dependency +edges are now gone. Native coordinator path selection also no longer reads +`/read/thread/epiphanyState`; scene/native state is the sole source. Next rewrite +the stale canonical algorithmic map around the live native pipeline. ## Immediate Re-entry Instruction diff --git a/notes/native-coordinator-liberation-map.md b/notes/native-coordinator-liberation-map.md index 0869157a..847798e6 100644 --- a/notes/native-coordinator-liberation-map.md +++ b/notes/native-coordinator-liberation-map.md @@ -399,5 +399,7 @@ Codex transport client. App-server request/notification registrations, dispatch, route modules, all `ThreadEpiphany*` DTOs, generated exports, generic Codex `Thread.epiphanyState`, and legacy rollout-state migration are deleted. `codex-app-server-protocol` no longer depends on `epiphany-state-model`. -`epiphany-codex-bridge` has collapsed to its only living consumer surface: the -Codex-hosted file-watcher invalidation manager. +The apparent final bridge consumer, the Codex-hosted file-watcher invalidation +manager, had no watch creator or snapshot reader after route deletion; only +no-op teardown calls survived. It and that listener plumbing were deleted. +`epiphany-codex-bridge` and both remaining Codex dependency edges are gone. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 73ce1e82728ca1de3bb7eb183885648a10a1096a..e595e4f975b7af4f0ed5462c82e2d553064b8d81 100644 GIT binary patch delta 426 zcmY+9ze)o^5XQZzhoIPMuoCV$6j)qBtH-H+T*;I zM3ufAwGy@ZIj^OmTND@RW_r{q$BO&!WM_@fDI+FXyzVAjGwd^YaNg$H3_x>$zBZVF zHaTWmB5P}4ga!w(O`!y1VS+3a2v5k?Lwv!Y3(7LYk|ci;ePnYgo14}F6MAVU23$5C z^-2yJ31?Q)w3xosHfAIT6k2fgHx;Qlfw0!gcuWcDW0v($3` developer fragment. - Clients read typed state through `Thread.epiphanyState`, read-only `thread/epiphany/view` lenses for scene/jobs/roles/planning/pressure/reorient/CRRC/coordinator, freshness through `thread/epiphany/freshness`, targeted state shards through `thread/epiphany/context`, bounded graph traversal through `thread/epiphany/graphQuery`, and reviewable role output through `thread/epiphany/roleResult`. The scene, jobs, roles, planning, pressure, reorient, CRRC, and coordinator read projections now live only as view lenses, not standalone protocol verbs. - Durable typed state writes route through `thread/epiphany/update`, accepted `thread/epiphany/promote`, `thread/epiphany/reorientAccept`, `thread/epiphany/roleAccept`, or the bounded `thread/epiphany/jobLaunch`, `thread/epiphany/jobInterrupt`, `thread/epiphany/reorientLaunch`, and `thread/epiphany/roleLaunch` authority surfaces when they mutate state or `job_bindings`. @@ -178,7 +178,7 @@ accepted_design: - Qdrant is the preferred persistent semantic backend; BM25 remains the bootstrap/fallback/control path. Qdrant's HTTP API and acknowledgements remain JSON wire edges, but Epiphany-owned retrieval point payloads are typed at the adapter boundary before serialization/deserialization. - `notes/epiphany-memory-graph-unified-plan.md` applies the mapped-fractal-domain/cache lesson to Epiphany and corrects the organ boundary: repo architecture/dataflow and agent memory are profiles over one `EpiphanyMemoryGraph`, not separate graph engines. The first native skeleton is landed: `epiphany-state-model` owns the public document vocabulary, `epiphany-core::memory_graph` owns stable ids/validation/freshness/context cuts/CultCache persistence, and `epiphany-memory-graph` exposes status/validate/context/smoke without Qdrant. `notes/archive/repo-fractal-dataflow-cache-plan.md` and `notes/archive/agent-memory-fractal-cache-plan.md` are profile-plan provenance beneath that substrate. If deleting Qdrant deletes understanding, the design is wrong; the fallback must be slower but still correct typed graph traversal. - `epiphany-state-model` owns the deterministic prompt-state renderer beside the typed `EpiphanyThreadState` document it serializes. `epiphany-core` re-exports that renderer for compatibility and owns rollout replay helpers, retrieval/indexing, distillation, proposal, promotion policy, scene projection, freshness derivation, pressure derivation, job/progress view derivation, planning view derivation, reorientation resume/regather verdict policy, pure CRRC recommendation policy, fixed-lane coordinator decision policy, role-board projection policy, and role-result interpretation/self-persistence review policy where possible. - - Vendored Codex keeps the thin typed host seam: protocol types, app-server protocol, request routing, notifications, rollout integration, and the `EpiphanyCodexThreadHost` wrapper that exposes current Epiphany state, reference turn id, workspace root, Codex home, and runtime store path through `EpiphanyMutationHost`. Vendored `codex-core` and `codex-app-server` must not import `epiphany-core` directly; Epiphany update law, retrieval/indexing, launch request construction, heartbeat launch/interrupt policy, invalidation, state mirroring, and mutation law belong in `epiphany-codex-bridge` / `epiphany-core`. + - Vendored Codex has no Epiphany protocol, thread-state projection, route, notification, rollout migration, host wrapper, watcher, scheduler, or mutation seam. It retains Codex-native app-server/auth/model machinery only. Epiphany update law, retrieval/indexing, launch/interrupt policy, state, interfaces, and physiology belong in native Epiphany crates. - The current algorithmic map is the source-grounded description of live control flow. - Compact-Rehydrate-Reorient-Continue is an architecture primitive; automatic runtime coordination is not landed yet. - Context pressure must become an explicit runtime signal for automatic CRRC; inference from transcript vibes, user warnings, or shrinking safe scope is useful only as a temporary human/agent heuristic. @@ -196,7 +196,7 @@ accepted_design: - The `reorient` view lens derives a bounded read-only `resume` versus `regather` verdict from checkpoint, freshness, watcher, and pressure signals without mutating state, compacting, scheduling, or silently continuing work. - The `crrc` view lens composes pressure, the reorientation verdict, fixed reorient-worker binding/result status, finding read-back, and available actions into one read-only recommendation without launching, accepting, compacting, scheduling, or mutating state. - A narrow auditable coordinator is central to the MVP because implementation, modeling/checkpoint, verification/review, and CRRC automation feed each other's machine-signals. CRRC itself is harness workflow automation, not a specialist-agent soul: it watches pressure/continuity, ensures persistence, triggers compaction/rehydration/reorientation when needed, and may launch a bounded reorient-worker specialist when semantic regathering is required. - - The `coordinator` view lens is the harness-native fixed-lane coordinator surface: it composes roles, pressure, reorient, CRRC, roleResult, and reorientResult into a read-only action recommendation with target role, source signals, review requirements, automation eligibility, reason, and current lane summaries without mutating state or launching work. Coordinator decision and source-signal authority now stays core-shaped inside `epiphany-codex-bridge`; `ThreadEpiphany*` projection is a legacy app-server emission step, not the internal decision model. + - Native coordinator status composes roles, pressure, reorientation, CRRC, role results, and reorientation results into an operator-safe action recommendation. It reads native thread/runtime stores; no `ThreadEpiphany*` projection or app-server emission step exists. - Coordinator implementation clearance is stricter than review acceptance: an accepted verification/review finding only opens the implementation gate when its verdict is `pass`; accepted `needs-evidence`, `needs-review`, or `fail` findings send the loop back toward modeling/checkpoint strengthening or reorientation instead of blessing a sick machine. - Coordinator regather handling is now fixed-lane first, not supervisor improvisation: `regatherManually` is a fallback only after reorient/modeling/verification review and launch lanes cannot advance the state, completed modeling findings must be reviewed before verification, and the CLI coordinator's explicit test-only `--auto-review` mode may accept modeling state patches before launching verification while production semantics remain review-gated. - Native `epiphany-mvp-coordinator` is the first auditable coordinator runner: it drives the fixed single-user lanes through app-server APIs, opens a native runtime-spine session, records native runtime job/result receipts for launched specialists and reorient workers when terminal results arrive, keeps semantic findings review-gated by default, and writes coordinator summaries, JSONL steps, rendered snapshots, transcript, stderr, runtime-spine status, and final next-action artifacts. Runtime-spine remains owner of `epiphany.coordinator_run_receipt.v0`, Hands/Substrate Gate remain owners of action permission, and thread-state acceptance receipts remain owners of role review/admission; local Verse now gets operator-safe `epiphany.cultmesh.coordinator_run_receipt.v0`, `epiphany.cultmesh.hands_action_gate.v0`, and `epiphany.cultmesh.role_review_event.v0` mirrors for discovery/readback. It refuses direct backend-completion mutation; full specialist completion smoke must use live workers while the execution path is cauterized into CultNet. @@ -356,7 +356,7 @@ rejected_paths: reason: making Epiphany cleaner inside Codex still preserves the wrong organ; Codex must be starved down to OpenAI subscription auth/model transport, while Epiphany data and subsystem communication move to typed CultCache/CultNet. current_status: - summary: The Codex starvation pass has five typing receipts, sixty-plus processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state plus prompt-state rendering, a source-grounded Codex auth spine inventory, the native `epiphany-openai-adapter` document boundary, a buildable Codex auth/model wrapper in `epiphany-openai-codex-spine`, the first native runtime caller in `epiphany-openai-runtime`, native heartbeat launch planning/job opening in `epiphany-core`, native state-update contract/validation/application in `epiphany-core`, native exact retrieval path matching in `epiphany-core`, core-owned Epiphany agent launch/prompt doctrine, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines durable `Epiphany*` state structs; it re-exports the native model and renderer for legacy rollout/API compatibility. `epiphany-core` and `epiphany-codex-bridge` have no direct `codex-core` dependency, and `codex-core` no longer depends on `epiphany-core`: pressure derives from native `EpiphanyTokenUsageSnapshot`, Codex rollout replay stays in the real Codex rollout adapter, prompt rendering lives in `epiphany-state-model`, bundled specialist prompt rendering lives in `epiphany-core`, and app-server owns the thin `EpiphanyCodexThreadHost` wrapper for host state/path/persistence facts. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing execution and projection, result projection, runtime-spine result adaptation, Codex-facing launch compatibility, mutation document mechanics, state update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application through `EpiphanyMutationHost`, pressure/pre-compaction bridge delegation, freshness/reorientation projection, CRRC/coordinator/role-board projection, native watcher invalidation, full `thread/epiphany/view` response construction, freshness/context/graph-query response construction, role/reorient result response construction, distill/propose patch-response construction, coordinator status/view construction, and acceptance/evidence signal helpers. Vendored app-server no longer retains root Epiphany modules; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, host wrapper construction, and notification emission. Codex product surfaces for apps, skills, plugins, marketplace, external agent config import, SDK scaffolding, connectors, ChatGPT app discovery, plugin provenance, and skill mention plumbing have been cut from the live path. `codex_thread.rs` is now about 449 lines and owns Codex thread hosting, not Epiphany policy. `epiphany-openai-codex-spine` owns the native OpenAI model transport path while intentionally reaching retained vendored `codex-login` only through `epiphany-openai-auth-spine`; auth identity, credential storage, and ChatGPT token refresh remain owned by the Codex-compatible auth organ. `epiphany-openai-runtime` writes typed OpenAI/runtime documents, loads durable worker launch requests, persists typed role/reorient worker result documents, and completes heartbeat/specialist runtime jobs without Codex worker execution. MCP itself is correctly JSON at its protocol edge; the target remains typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. + summary: Epiphany state, prompts, coordinator policy, runtime spine, receipts, and operator surfaces are native typed Rust/CultCache/CultMesh/CultNet organs. Vendored Codex retains Codex-native app-server plus OpenAI-compatible auth/model transport only. The ThreadEpiphany JSON-RPC surface, DTOs, Codex thread-state projection, legacy rollout migration, compatibility smokes, watcher adapter, and epiphany-codex-bridge crate are deleted. Native MVP status and interruption read the unified native state/runtime store. The next mapping debt is the stale algorithmic-map document, not surviving runtime authority. latest_cut: > The bridge host seam has been cut down: target-specific Hands prompt scar tissue was purged, bridge manifests carry the retained Codex websocket fork @@ -659,4 +659,4 @@ current_status: - Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass. - `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure. last_completed_repo_swarm_cut: Huginn live-fire has crossed the first real repo Body from Persona pressure to branch-local Hands commit and Soul/Mind closure, and now has repeatable closure and redacted-public-proof mouths. On `E:\Projects\Huginn` branch `epiphany/huginn/first-awakening`, `tools/epiphany_local_run.ps1 -Mode repo-persona-intake` accepted item `huginn-inspection-readback-livefire`, Weksa/Persona intake remained sealed, and `epiphany-work derive-plan` lowered it to model-authored safe family `repo.status_section` for `README.md` only. `tools/epiphany_local_run.ps1 -Mode repo-swarm-run` advanced four bounded pulses: run-from-plan, adopt-from-plan, execute-from-plan, and close-from-execute. Huginn commit `e9b07c38fceabbdc89ea35c2156326c80c0393a2` updated only `README.md`; closure receipt `.epiphany\work\work-close-huginn-inspection-readback-livefire.json` records status `closed`, Soul verdict `passed`, Mind state commit `repo-work-close-huginn-inspection-readback-livefire-mind-commit`, safe family `repo.status_section`, path scope `README.md`, Bifrost publication gate, and `privateStateExposed=false`. Verification also ran Huginn's TypeScript compiler through concrete Node path: `C:\Program Files\nodejs\node.exe E:\Projects\Huginn\node_modules\typescript\bin\tsc -p tsconfig.json` passed. Native verifier `epiphany-repo-livefire-closure-smoke --workspace E:\Projects\Huginn --item huginn-inspection-readback-livefire --expected-path README.md --expected-family repo.status_section --expected-gate awaiting-publication --expected-blocker bifrost-publication-missing` checks closure receipt, Mind map entry, overview gate/blocker, authority seals, and `git show` changed paths, returning `status=ok`, `soulVerdict=passed`, `publicationGate=Bifrost`, and `privateStateExposed=false`. Wrapper `tools/epiphany_local_run.ps1 -Mode repo-livefire-closure -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exposes the same read-only proof through the local operator mouth; artifact `local-20260621-190156-803-2f85ba15` printed commit, path, gate, blocker, Soul verdict, Mind commit receipt, and `privateStateExposed=False` without push, merge, publication, or target mutation. New wrapper `tools/epiphany_local_run.ps1 -Mode repo-work-public-proof -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exports the redacted proof bundle and repo-local Verse index without publishing; artifact `local-20260621-190645-345-4555b1dc` wrote `.epiphany\public\proof-bundles\repo-work-public-proof-huginn-inspection-readback-livefire.json`, proof id `repo-work-public-proof-huginn-inspection-readback-livefire`, SHA-256 `857545b199f3e37eb06c2e757e5cfc201958e46667bb1f8403fd333a22620f63`, nine artifact rows, zero publication rows, and `privateStateExposed=False`. Gjallar readback `local-20260621-190701-140-b9519ec6` sees the `REPO-WORK-PUBLIC-PROOF` row and action row from Huginn's repo-local Verse with the same SHA-256 while Bifrost publication remains missing. Launcher compact modes are now named compact operator-context modes instead of read-only modes, and `bifrost-public-proof` summaries print item, target public Verse, room, proof SHA-256, review receipts, and credit receipts so publication receipts are auditable without claiming upstream sync. - next_action: Move the sole surviving `epiphany-codex-bridge` organ, `EpiphanyInvalidationManager`, into the Codex app-server watcher lifecycle that owns it; then delete the bridge crate and dependency entirely. Update whitepaper/anatomy prose that still describes a general Codex translation layer. After that, audit native coordinator status for stale `/read/thread/epiphanyState` compatibility pointers. + next_action: Rewrite `notes/epiphany-current-algorithmic-map.md`, which still describes the deleted app-server/bridge architecture, into a source-grounded native pipeline map. Then audit current plans/handoffs for other live-looking references to deleted Codex authority and distinguish historical evidence from current mechanism. diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index 5b6ce751..930f3bd2 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -1872,8 +1872,6 @@ dependencies = [ "codex-utils-rustls-provider", "constant_time_eq 0.3.1", "core_test_support", - "epiphany-codex-bridge", - "epiphany-state-model", "futures", "gethostname", "hmac", @@ -4939,25 +4937,6 @@ dependencies = [ "log", ] -[[package]] -name = "epiphany-codex-bridge" -version = "0.1.0" -dependencies = [ - "codex-utils-absolute-path", - "notify", - "tokio", - "tracing", -] - -[[package]] -name = "epiphany-state-model" -version = "0.1.0" -dependencies = [ - "schemars 0.8.22", - "serde", - "ts-rs", -] - [[package]] name = "equivalent" version = "1.0.2" diff --git a/vendor/codex/codex-rs/app-server/Cargo.toml b/vendor/codex/codex-rs/app-server/Cargo.toml index 1c08e7ef..ad4620d0 100644 --- a/vendor/codex/codex-rs/app-server/Cargo.toml +++ b/vendor/codex/codex-rs/app-server/Cargo.toml @@ -60,8 +60,6 @@ codex-utils-absolute-path = { workspace = true } codex-utils-json-to-toml = { workspace = true } codex-utils-rustls-provider = { workspace = true } chrono = { workspace = true } -epiphany-codex-bridge = { path = "../../../../epiphany-codex-bridge" } -epiphany-state-model = { path = "../../../../epiphany-state-model" } clap = { workspace = true, features = ["derive"] } constant_time_eq = { workspace = true } futures = { workspace = true } diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs index ad029479..9e5d2790 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs @@ -333,7 +333,6 @@ use codex_thread_store::ThreadStoreError; use codex_thread_store::UpdateThreadMetadataParams as StoreUpdateThreadMetadataParams; use codex_utils_absolute_path::AbsolutePathBuf; use codex_utils_pty::DEFAULT_OUTPUT_BYTES_CAP; -use epiphany_codex_bridge::invalidation::EpiphanyInvalidationManager; use std::collections::HashMap; use std::collections::HashSet; use std::io::Error as IoError; @@ -389,7 +388,6 @@ pub(crate) struct CodexMessageProcessor { pending_thread_unloads: Arc>>, thread_state_manager: ThreadStateManager, thread_watch_manager: ThreadWatchManager, - epiphany_invalidation_manager: EpiphanyInvalidationManager, command_exec_manager: CommandExecManager, pending_fuzzy_searches: Arc>>>, fuzzy_search_sessions: Arc>>, @@ -502,7 +500,6 @@ impl CodexMessageProcessor { pending_thread_unloads: Arc::new(Mutex::new(HashSet::new())), thread_state_manager: ThreadStateManager::new(), thread_watch_manager: ThreadWatchManager::new_with_outgoing(outgoing), - epiphany_invalidation_manager: EpiphanyInvalidationManager::new(), command_exec_manager: CommandExecManager::default(), pending_fuzzy_searches: Arc::new(Mutex::new(HashMap::new())), fuzzy_search_sessions: Arc::new(Mutex::new(HashMap::new())), diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/listener_lifecycle.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/listener_lifecycle.rs index a0ae145c..2fe0efe6 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/listener_lifecycle.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/listener_lifecycle.rs @@ -17,7 +17,6 @@ pub(crate) struct ListenerTaskContext { pub(crate) analytics_events_client: AnalyticsEventsClient, pub(crate) general_analytics_enabled: bool, pub(crate) thread_watch_manager: ThreadWatchManager, - pub(crate) epiphany_invalidation_manager: EpiphanyInvalidationManager, pub(crate) fallback_model_provider: String, pub(crate) codex_home: PathBuf, } @@ -210,9 +209,6 @@ impl CodexMessageProcessor { self.thread_state_manager .remove_thread_state(thread_id) .await; - self.epiphany_invalidation_manager - .remove_thread(&thread_id.to_string()) - .await; self.thread_watch_manager .remove_thread(&thread_id.to_string()) .await; @@ -224,7 +220,6 @@ impl CodexMessageProcessor { pending_thread_unloads: Arc>>, thread_state_manager: ThreadStateManager, thread_watch_manager: ThreadWatchManager, - epiphany_invalidation_manager: EpiphanyInvalidationManager, thread_id: ThreadId, thread: Arc, ) { @@ -236,27 +231,18 @@ impl CodexMessageProcessor { .cancel_requests_for_thread(thread_id, /*error*/ None) .await; thread_state_manager.remove_thread_state(thread_id).await; - epiphany_invalidation_manager - .remove_thread(&thread_id.to_string()) - .await; tokio::spawn(async move { match Self::wait_for_thread_shutdown(&thread).await { ThreadShutdownResult::Complete => { if thread_manager.remove_thread(&thread_id).await.is_none() { info!("thread {thread_id} was already removed before teardown finalized"); - epiphany_invalidation_manager - .remove_thread(&thread_id.to_string()) - .await; thread_watch_manager .remove_thread(&thread_id.to_string()) .await; pending_thread_unloads.lock().await.remove(&thread_id); return; } - epiphany_invalidation_manager - .remove_thread(&thread_id.to_string()) - .await; thread_watch_manager .remove_thread(&thread_id.to_string()) .await; @@ -361,7 +347,6 @@ impl CodexMessageProcessor { analytics_events_client: self.analytics_events_client.clone(), general_analytics_enabled: self.config.features.enabled(Feature::GeneralAnalytics), thread_watch_manager: self.thread_watch_manager.clone(), - epiphany_invalidation_manager: self.epiphany_invalidation_manager.clone(), fallback_model_provider: self.config.model_provider_id.clone(), codex_home: self.config.codex_home.to_path_buf(), }, @@ -480,7 +465,6 @@ impl CodexMessageProcessor { analytics_events_client: self.analytics_events_client.clone(), general_analytics_enabled: self.config.features.enabled(Feature::GeneralAnalytics), thread_watch_manager: self.thread_watch_manager.clone(), - epiphany_invalidation_manager: self.epiphany_invalidation_manager.clone(), fallback_model_provider: self.config.model_provider_id.clone(), codex_home: self.config.codex_home.to_path_buf(), }, @@ -530,7 +514,6 @@ impl CodexMessageProcessor { analytics_events_client: _, general_analytics_enabled: _, thread_watch_manager, - epiphany_invalidation_manager, fallback_model_provider, codex_home, } = listener_task_context; @@ -644,7 +627,6 @@ impl CodexMessageProcessor { pending_thread_unloads.clone(), thread_state_manager.clone(), thread_watch_manager.clone(), - epiphany_invalidation_manager.clone(), conversation_id, conversation.clone(), ) diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/thread_start_routes.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/thread_start_routes.rs index 6b3d5e2e..474ce2ce 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/thread_start_routes.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/thread_start_routes.rs @@ -60,7 +60,6 @@ impl CodexMessageProcessor { analytics_events_client: self.analytics_events_client.clone(), general_analytics_enabled: self.config.features.enabled(Feature::GeneralAnalytics), thread_watch_manager: self.thread_watch_manager.clone(), - epiphany_invalidation_manager: self.epiphany_invalidation_manager.clone(), fallback_model_provider: self.config.model_provider_id.clone(), codex_home: self.config.codex_home.to_path_buf(), };