From abfcf77f975bfe6a29c949134639f47c3785af03 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 11:37:33 +0100 Subject: [PATCH] Remove Codex file search from Epiphany core --- epiphany-core/Cargo.toml | 1 - epiphany-core/src/retrieval.rs | 122 ++++++++++++++++++++----------- notes/fresh-workspace-handoff.md | 18 ++--- state/ledgers.msgpack | Bin 92183 -> 92474 bytes state/map.yaml | 5 +- vendor/codex/codex-rs/Cargo.lock | 1 - 6 files changed, 92 insertions(+), 55 deletions(-) diff --git a/epiphany-core/Cargo.toml b/epiphany-core/Cargo.toml index 63d6b7e8..1df3917b 100644 --- a/epiphany-core/Cargo.toml +++ b/epiphany-core/Cargo.toml @@ -13,7 +13,6 @@ path = "src/lib.rs" anyhow = "1" bm25 = "2.3.2" chrono = "0.4.44" -codex-file-search = { path = "../vendor/codex/codex-rs/file-search" } cultcache-rs = { path = "../vendor/cultcache-rs" } cultnet-rs = { path = "../vendor/cultnet-rs" } epiphany-openai-adapter = { path = "../epiphany-openai-adapter" } diff --git a/epiphany-core/src/retrieval.rs b/epiphany-core/src/retrieval.rs index cb57d5a3..d8fe4718 100644 --- a/epiphany-core/src/retrieval.rs +++ b/epiphany-core/src/retrieval.rs @@ -3,7 +3,6 @@ use anyhow::Result; use bm25::Document; use bm25::Language; use bm25::SearchEngineBuilder; -use codex_file_search as file_search; use epiphany_state_model::EpiphanyRetrievalShardSummary; use epiphany_state_model::EpiphanyRetrievalState; use epiphany_state_model::EpiphanyRetrievalStatus; @@ -23,7 +22,6 @@ use std::cmp::Ordering; use std::collections::BTreeMap; use std::collections::BTreeSet; use std::fs; -use std::num::NonZero; use std::path::Component; use std::path::Path; use std::path::PathBuf; @@ -37,7 +35,6 @@ pub const EPIPHANY_RETRIEVAL_MAX_LIMIT: usize = 50; const EXACT_SEARCH_CANDIDATE_MULTIPLIER: usize = 5; const EXACT_SEARCH_MAX_CANDIDATES: usize = 250; -const FILE_SEARCH_MAX_THREADS: usize = 12; const QUERY_TIME_INDEX_REVISION: &str = "query-time-bm25-v1"; const QDRANT_INDEX_REVISION_PREFIX: &str = "qdrant-ollama-v1"; const SEMANTIC_MANIFEST_SCHEMA_VERSION: u32 = 1; @@ -490,49 +487,43 @@ fn run_exact_search( limit: usize, path_prefixes: &[PathBuf], ) -> Result> { - let candidate_limit = if path_prefixes.is_empty() { - limit - } else { - limit - .saturating_mul(EXACT_SEARCH_CANDIDATE_MULTIPLIER) - .min(EXACT_SEARCH_MAX_CANDIDATES) - }; - #[expect(clippy::expect_used)] - let candidate_limit = - NonZero::new(candidate_limit.max(1)).expect("candidate limit should be non-zero"); + let query_terms = exact_search_terms(query); + if query_terms.is_empty() { + return Ok(Vec::new()); + } - let search_results = file_search::run( - query, - vec![workspace_root.to_path_buf()], - file_search::FileSearchOptions { - limit: candidate_limit, - threads: search_threads(), - compute_indices: false, - ..Default::default() - }, - /*cancel_flag*/ None, - )?; + let mut walker = WalkBuilder::new(workspace_root); + walker.hidden(false).follow_links(true).require_git(true); - let mut results = search_results - .matches - .into_iter() - .filter_map(|file_match| { - let relative_path = file_match - .full_path() + let mut results = walker + .build() + .filter_map(Result::ok) + .filter_map(|entry| { + let relative_path = entry + .path() .strip_prefix(workspace_root) .ok()? .to_path_buf(); + if relative_path.as_os_str().is_empty() || should_skip_relative_path(&relative_path) { + return None; + } if !matches_path_prefixes(&relative_path, path_prefixes) { return None; } + let file_type = entry.file_type()?; + let kind = if file_type.is_file() { + EpiphanyRetrieveResultKind::ExactFile + } else if file_type.is_dir() { + EpiphanyRetrieveResultKind::ExactDirectory + } else { + return None; + }; + let score = score_exact_path_match(&relative_path, &query_terms)?; Some(EpiphanyRetrieveResult { - kind: match file_match.match_type { - file_search::MatchType::File => EpiphanyRetrieveResultKind::ExactFile, - file_search::MatchType::Directory => EpiphanyRetrieveResultKind::ExactDirectory, - }, + kind, path: relative_path, - score: file_match.score as f32, + score, line_start: None, line_end: None, excerpt: None, @@ -540,17 +531,64 @@ fn run_exact_search( }) .collect::>(); + sort_results(&mut results); results.truncate(limit); Ok(results) } -fn search_threads() -> NonZero { - let cores = std::thread::available_parallelism() - .map(NonZero::get) - .unwrap_or(1); - #[expect(clippy::expect_used)] - NonZero::new(cores.clamp(1, FILE_SEARCH_MAX_THREADS)) - .expect("file-search threads should be non-zero") +fn exact_search_terms(query: &str) -> Vec { + query + .split(|character: char| !character.is_alphanumeric()) + .filter(|term| !term.is_empty()) + .map(str::to_lowercase) + .collect() +} + +fn score_exact_path_match(relative_path: &Path, query_terms: &[String]) -> Option { + let normalized_path = normalize_payload_path(relative_path).to_lowercase(); + if !query_terms + .iter() + .all(|term| normalized_path.contains(term)) + { + return None; + } + + let file_name = relative_path + .file_name() + .map(|name| name.to_string_lossy().to_lowercase()) + .unwrap_or_default(); + let term_score = query_terms.iter().fold(0.0, |score, term| { + score + + if file_name.contains(term) { 30.0 } else { 0.0 } + + if normalized_path.contains(term) { + 20.0 + } else { + 0.0 + } + }); + let joined_query = query_terms.join(" "); + let joined_with_underscores = query_terms.join("_"); + let joined_with_hyphens = query_terms.join("-"); + let phrase_score = if file_name == joined_query + || file_name == joined_with_underscores + || file_name == joined_with_hyphens + { + 200.0 + } else if file_name.contains(&joined_query) + || file_name.contains(&joined_with_underscores) + || file_name.contains(&joined_with_hyphens) + { + 100.0 + } else if normalized_path.contains(&joined_query) + || normalized_path.contains(&joined_with_underscores) + || normalized_path.contains(&joined_with_hyphens) + { + 50.0 + } else { + 0.0 + }; + let depth_penalty = relative_path.components().count() as f32; + Some(term_score + phrase_score - depth_penalty) } #[derive(Clone, Debug)] diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 29cc1b6b..2e7eccd5 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -36,7 +36,7 @@ remembers doctrine; the branch remembers the blade. - The active foundation directive is now `notes/codex-starvation-and-cultnet-liberation-plan.md`. The previous Codex app-server control-plane rebuild made Epiphany less rotten inside Codex, but that is not the destination. Epiphany must become a native CultCache/CultNet runtime. Codex is a compatibility reliquary for OpenAI subscription auth and model transport, not the host brain. - `notes/codex-auth-spine-inventory.md` is the source-grounded keeper list for that reliquary: retain `codex-login` credential storage/refresh, `codex-model-provider` auth resolution, the model-transport subset of `codex-core::client`, and the narrow model-catalog subset of `models-manager`; do not treat Codex app-server, apps, skills, marketplace, plugin UX, MCP OAuth handlers, or collaboration-mode surfaces as auth-spine machinery. - Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced. -- Durable Epiphany state types now live in root crate `epiphany-state-model`. `codex-protocol` re-exports them only so old rollout/API callers keep compiling; do not add new durable `Epiphany*` state structs under `vendor/codex`. `epiphany-core` imports the native model directly and no longer depends on `codex-protocol`. Pressure derives from native `EpiphanyTokenUsageSnapshot`; Codex token telemetry is mapped at the bridge. Codex rollout/event reconstruction now lives in `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types belong. The remaining direct vendored Codex dependency in `epiphany-core` is `codex-file-search`. +- Durable Epiphany state types now live in root crate `epiphany-state-model`. `codex-protocol` re-exports them only so old rollout/API callers keep compiling; do not add new durable `Epiphany*` state structs under `vendor/codex`. `epiphany-core` imports the native model directly and no longer depends on `codex-protocol`. Pressure derives from native `EpiphanyTokenUsageSnapshot`; Codex token telemetry is mapped at the bridge. Codex rollout/event reconstruction now lives in `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types belong. Exact retrieval path matching is native to `epiphany-core`, so `epiphany-core` has no direct vendored Codex crate dependency. - The May 2026 foundation migration in `notes/epiphany-ideal-architecture-rebuild-plan.md` is complete enough to defend. Read `notes/epiphany-architectural-teardown.md` before touching Epiphany control-plane code, but do not treat it as an open-ended excuse to keep shaving the altar. The rebuild moved scene projection, freshness derivation, pressure policy, targeted context shards, bounded graph traversal, 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, role/reorient result interpretation, role self-persistence review policy, and role/reorient acceptance bundle policy into `epiphany-core`; typed acceptance receipts replaced summary-string identity for live accept paths, runtime links are dual-written on launch, and result read-back now prefers runtime links. - Read `notes/epiphany-ideal-architecture-rebuild-plan.md` immediately after the teardown. It defines the smallest coherent replacement architecture: durable `EpiphanyState`, runtime-spine-owned `RuntimeState`, separate role memory/heartbeat state, `epiphany-core` as policy owner, app-server as adapter, Aquarium as reflector, typed acceptance receipts, and derived view lenses instead of a protocol verb zoo. - Do not continue Aquarium UI, bridge, Face, or dogfood expansion until the teardown has a source-grounded cleanup slice plan. Epiphany is the foundation; patches on patches are not a purification rite, they are how the altar becomes load-bearing garbage. @@ -737,14 +737,14 @@ Also: MCP itself is allowed to be JSON. The target is not "replace MCP JSON"; the target is an Epiphany-owned boundary that speaks typed Epiphany intent/result/receipt documents internally and normal MCP JSON-RPC externally. -Continue with the actual whale-carcass cut: remove or isolate the last direct -vendored Codex dependency in `epiphany-core`, currently `codex-file-search`, -then keep starving the old model turn path out of `thread/epiphany/*` JSON-RPC -and `codex_message_processor.rs`. Success is Epiphany calling the model adapter -from its own CultCache/CultNet runtime boundary while Codex survives only as -subscription auth/model routing. Do not resume Rider, Unity, Aquarium, Face, -dogfood, planning, app, skill, marketplace, or bridge expansion until this -organ is being cut cleanly. +The whale-carcass cut reached native core: `epiphany-core` no longer depends on +vendored `codex-file-search`; exact retrieval path matching is owned by +retrieval itself. Keep starving the old model turn path out of +`thread/epiphany/*` JSON-RPC and `codex_message_processor.rs`. Success is +Epiphany calling the model adapter from its own CultCache/CultNet runtime +boundary while Codex survives only as subscription auth/model routing. Do not +resume Rider, Unity, Aquarium, Face, dogfood, planning, app, skill, +marketplace, or bridge expansion until this organ is being cut cleanly. The Phase 6 freshness slice is landed. It exposes read-only `thread/epiphany/freshness` from live retrieval summaries plus graph diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 777af47493efbe57435523c7443afa1c95da7fa3..6adb4216df52f48173a13d7bb94ae444567a1b15 100644 GIT binary patch delta 281 zcmZvXF-inM5Jhca?_jb}ASPnV%noa?f{E+}#K^4duGwjv>29l=-knH64#f_z7+y!k=s*@@ zSyrcIF{#Frs=WVx-@W=eq0S}J5F3KpSZqNXCKVx()sFM!*lAjTCZ7ees)w3g2jq=! z(DqVg6P)+J327(PGe;J(7cCn`yNI{*EF$)Ek*`LX1WHZx`xIfh6YwfW>y9U FQ2^J_5H|n- diff --git a/state/map.yaml b/state/map.yaml index b4d21149..2996215f 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -99,6 +99,7 @@ accepted_design: - `notes/epiphany-ideal-architecture-rebuild-plan.md` is the replacement blueprint: the smallest coherent architecture is durable `EpiphanyState`, runtime-spine-owned `RuntimeState`, separate role memory/heartbeat state, `epiphany-core` as policy owner, app-server as adapter, Aquarium as reflector, typed result acceptance receipts, and derived view lenses instead of a protocol verb zoo. - Epiphany is a fork-level modeling architecture, not merely a Codex collaboration mode. - Durable Epiphany state types live in the root `epiphany-state-model` crate. Codex protocol re-exports those types only for legacy rollout/API compatibility; it must not regain ownership of their meaning. + - `epiphany-core` must not depend directly on vendored Codex crates. Host-specific Codex concepts belong in `epiphany-codex-bridge`, `codex-core` compatibility adapters, or the thin OpenAI subscription auth/model-transport spine, while native retrieval/state/runtime policy stays in Epiphany crates. - The prompt reads typed state through a bounded `` 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`. @@ -279,5 +280,5 @@ 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, twenty-five processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, 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`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` also no longer depends on `codex-protocol`: pressure derivation now accepts native `EpiphanyTokenUsageSnapshot`, and Codex rollout replay moved to `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types actually belong. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, 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 now retains only `epiphany_invalidation.rs` as a root Epiphany module because watcher lifecycle is still app-server machinery; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry. `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 691 lines after the route-load/notification helper cut and index projection move; `epiphany_state_helpers.rs` is down to a 19-line rollout-state loader; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns all direct Codex auth/model-transport imports for the native OpenAI path: it exposes `default_codex_home` and `auth_manager`, projects `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, maps typed `EpiphanyOpenAiModelRequest` into Codex API `ResponsesApiRequest`, resolves auth/provider through keeper Codex crates, opens HTTP Responses streams through `codex-api`, maps deltas / completion into typed stream events and receipts, and no longer directly depends on `codex-app-server-protocol` just to name auth mode. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now prefer typed worker result documents and fall back only to generic job summaries for older receipts; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. The remaining direct Codex dependency in `epiphany-core` is `codex-file-search`, an exact-search adapter that should be replaced or isolated behind a native retrieval crate next. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI spine still pulls `codex-api` and a large transport dependency stack, so its next cut is dependency starvation after richer live callers move. - next_action: Cut or isolate the remaining `epiphany-core` dependency on vendored `codex-file-search`, then continue moving coordinator/runtime execution and operator surfaces off app-server JSON-RPC. + summary: The Codex starvation pass has five typing receipts, twenty-six processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, 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`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` now has no direct vendored Codex dependency: pressure derivation accepts native `EpiphanyTokenUsageSnapshot`, Codex rollout replay moved to `codex-core::epiphany_rollout`, and exact retrieval search uses Epiphany-owned workspace walking/path scoring instead of `codex-file-search`. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, 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 now retains only `epiphany_invalidation.rs` as a root Epiphany module because watcher lifecycle is still app-server machinery; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry. `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 691 lines after the route-load/notification helper cut and index projection move; `epiphany_state_helpers.rs` is down to a 19-line rollout-state loader; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns all direct Codex auth/model-transport imports for the native OpenAI path: it exposes `default_codex_home` and `auth_manager`, projects `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, maps typed `EpiphanyOpenAiModelRequest` into Codex API `ResponsesApiRequest`, resolves auth/provider through keeper Codex crates, opens HTTP Responses streams through `codex-api`, maps deltas / completion into typed stream events and receipts, and no longer directly depends on `codex-app-server-protocol` just to name auth mode. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now prefer typed worker result documents and fall back only to generic job summaries for older receipts; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI spine still pulls `codex-api` and a large transport dependency stack, so its next cut is dependency starvation after richer live callers move. + next_action: Continue starving coordinator/runtime execution and operator surfaces off app-server JSON-RPC and out of `codex_message_processor.rs`; keep the vestigial Codex organ narrowed to subscription auth/model transport. diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index 7023c00f..132db42b 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -5244,7 +5244,6 @@ dependencies = [ "anyhow", "bm25", "chrono", - "codex-file-search", "cultcache-rs", "cultnet-rs", "epiphany-openai-adapter",