From f72393d3b1aed1202f263f812d736a9a4ec68ba2 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 09:12:17 +0100 Subject: [PATCH] Delete Codex core Epiphany reexport husks --- notes/fresh-workspace-handoff.md | 6 +++ state/ledgers.msgpack | Bin 89070 -> 89368 bytes state/map.yaml | 2 +- .../codex/codex-rs/core/src/codex_thread.rs | 13 +++---- .../core/src/epiphany_distillation.rs | 3 -- .../codex-rs/core/src/epiphany_promotion.rs | 3 -- .../codex-rs/core/src/epiphany_proposal.rs | 3 -- .../codex-rs/core/src/epiphany_retrieval.rs | 9 ----- vendor/codex/codex-rs/core/src/lib.rs | 36 ++++++++---------- 9 files changed, 29 insertions(+), 46 deletions(-) delete mode 100644 vendor/codex/codex-rs/core/src/epiphany_distillation.rs delete mode 100644 vendor/codex/codex-rs/core/src/epiphany_promotion.rs delete mode 100644 vendor/codex/codex-rs/core/src/epiphany_proposal.rs delete mode 100644 vendor/codex/codex-rs/core/src/epiphany_retrieval.rs diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 38c56660..7ef407d9 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -605,6 +605,12 @@ shadow `open_native_job` / `maybe_complete_native_job` compensator is deleted: there is one runtime job for the worker, owned by runtime-spine, and the worker runner completes that job. +The Codex-core re-export husks for `epiphany_distillation`, `epiphany_promotion`, +`epiphany_proposal`, and `epiphany_retrieval` have also been deleted. +`codex-core` now re-exports those native types/functions directly from +`epiphany-core`, and `CodexThread` calls `epiphany_core::retrieve_workspace` / +`index_workspace` / `retrieval_state_for_workspace` directly. + The runtime-spine job-opening mechanism for heartbeat/specialist launches has also been pulled into `epiphany-core` as `open_runtime_spine_heartbeat_job`. Vendored `codex_core::CodexThread::epiphany_launch_job` still validates, diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index d14f2136479e2e87ec5a18b06256505c56aa97e1..9bc995fafe833e1a31a78d4a2c7ca71c2626947c 100644 GIT binary patch delta 291 zcmZ9Hu}VWh5Jg!brKMtFF(87?`ZfuQzSb`gBt;OyvODqyH@nO3yqHu9`TsRafVC(w({qRMI#p7Je=0fcEcb?uje|A*oRH_r% z?p~?0Qk_rRM?&5&E`r6eG$A2Wb-o2ta|sq5GFlj+w~b=~BgIPl$-q)(a!xY^U&IuK zVKc>$wJQ>GA{=Q42_=qWNDRYZYlj)Mw-5vQCE2WFFPFLNwOp*U0appNZO%6!qn*oO lDWPFE0nLAHR<)0zhly^ef!+~U)9s$v+kN=>|8Ch;{a=`=X+8h| delta 49 zcmbQSi}l@h)(Of?(OWjEPGe+z*1U&t`yNI{nJBS_Ek*`LX1WHZx`xIf2If|#7FMPv FQ2@!~58D6$ diff --git a/state/map.yaml b/state/map.yaml index 1da8c58a..68d6f6ea 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -279,5 +279,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, eighteen processor cuts, a real physical extraction in `epiphany-codex-bridge`, 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 service in `epiphany-codex-bridge`. 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, 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. The processor is about 10,339 lines, `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` 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` 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, 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. `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. + summary: The Codex starvation pass has five typing receipts, eighteen processor cuts, a real physical extraction in `epiphany-codex-bridge`, 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 service in `epiphany-codex-bridge`. 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, 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. The processor is about 10,339 lines, `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` 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` 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, 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 those native surfaces from `epiphany-core` directly, and `CodexThread` calls core retrieval functions without a vendored wrapper. `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: Move remaining coordinator/runtime execution and operator surfaces off app-server JSON-RPC where possible, then shrink the surviving Codex dependency surface to credential refresh, provider/model routing, and the smallest OpenAI Responses call required for Codex subscription compatibility. diff --git a/vendor/codex/codex-rs/core/src/codex_thread.rs b/vendor/codex/codex-rs/core/src/codex_thread.rs index 04b456b7..9b3f336f 100644 --- a/vendor/codex/codex-rs/core/src/codex_thread.rs +++ b/vendor/codex/codex-rs/core/src/codex_thread.rs @@ -1,8 +1,5 @@ use crate::agent::AgentStatus; use crate::config::ConstraintResult; -use crate::epiphany_retrieval; -use crate::epiphany_retrieval::EpiphanyRetrieveQuery; -use crate::epiphany_retrieval::EpiphanyRetrieveResponse; use crate::file_watcher::WatchRegistration; use crate::session::Codex; use crate::session::SessionSettingsUpdate; @@ -56,6 +53,8 @@ use codex_protocol::protocol::TokenUsageInfo; use codex_protocol::protocol::W3cTraceContext; use codex_protocol::user_input::UserInput; use codex_utils_absolute_path::AbsolutePathBuf; +use epiphany_core::EpiphanyRetrieveQuery; +use epiphany_core::EpiphanyRetrieveResponse; use epiphany_core::EpiphanyStateUpdate; use epiphany_core::EpiphanyWorkerLaunchDocument; use epiphany_core::RuntimeSpineHeartbeatJobOptions; @@ -596,11 +595,11 @@ impl CodexThread { let fallback_workspace_root = workspace_root.clone(); let fallback_codex_home = codex_home.clone(); tokio::task::spawn_blocking(move || { - epiphany_retrieval::retrieval_state_for_workspace(&workspace_root, codex_home.as_path()) + epiphany_core::retrieval_state_for_workspace(&workspace_root, codex_home.as_path()) }) .await .unwrap_or_else(|_| { - epiphany_retrieval::retrieval_state_for_workspace( + epiphany_core::retrieval_state_for_workspace( &fallback_workspace_root, fallback_codex_home.as_path(), ) @@ -624,7 +623,7 @@ impl CodexThread { let workspace_root = config.cwd.to_path_buf(); let codex_home = self.codex.session.codex_home().await; tokio::task::spawn_blocking(move || { - epiphany_retrieval::index_workspace( + epiphany_core::index_workspace( &workspace_root, codex_home.as_path(), force_full_rebuild, @@ -642,7 +641,7 @@ impl CodexThread { let workspace_root = config.cwd.to_path_buf(); let codex_home = self.codex.session.codex_home().await; tokio::task::spawn_blocking(move || { - epiphany_retrieval::retrieve_workspace(&workspace_root, codex_home.as_path(), query) + epiphany_core::retrieve_workspace(&workspace_root, codex_home.as_path(), query) }) .await .map_err(|err| anyhow::anyhow!("epiphany retrieval worker failed: {err}"))? diff --git a/vendor/codex/codex-rs/core/src/epiphany_distillation.rs b/vendor/codex/codex-rs/core/src/epiphany_distillation.rs deleted file mode 100644 index cfdec610..00000000 --- a/vendor/codex/codex-rs/core/src/epiphany_distillation.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub use epiphany_core::EpiphanyDistillInput; -pub use epiphany_core::EpiphanyDistillProposal; -pub use epiphany_core::distill_observation; diff --git a/vendor/codex/codex-rs/core/src/epiphany_promotion.rs b/vendor/codex/codex-rs/core/src/epiphany_promotion.rs deleted file mode 100644 index 9822817a..00000000 --- a/vendor/codex/codex-rs/core/src/epiphany_promotion.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub use epiphany_core::EpiphanyPromotionDecision; -pub use epiphany_core::EpiphanyPromotionInput; -pub use epiphany_core::evaluate_promotion; diff --git a/vendor/codex/codex-rs/core/src/epiphany_proposal.rs b/vendor/codex/codex-rs/core/src/epiphany_proposal.rs deleted file mode 100644 index c1a438f3..00000000 --- a/vendor/codex/codex-rs/core/src/epiphany_proposal.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub use epiphany_core::EpiphanyMapProposal; -pub use epiphany_core::EpiphanyMapProposalInput; -pub use epiphany_core::propose_map_update; diff --git a/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs b/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs deleted file mode 100644 index a4c969ac..00000000 --- a/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub use epiphany_core::EPIPHANY_RETRIEVAL_DEFAULT_LIMIT; -pub use epiphany_core::EPIPHANY_RETRIEVAL_MAX_LIMIT; -pub use epiphany_core::EpiphanyRetrieveQuery; -pub use epiphany_core::EpiphanyRetrieveResponse; -pub use epiphany_core::EpiphanyRetrieveResult; -pub use epiphany_core::EpiphanyRetrieveResultKind; -pub use epiphany_core::index_workspace; -pub use epiphany_core::retrieval_state_for_workspace; -pub use epiphany_core::retrieve_workspace; diff --git a/vendor/codex/codex-rs/core/src/lib.rs b/vendor/codex/codex-rs/core/src/lib.rs index 3248d123..8febe708 100644 --- a/vendor/codex/codex-rs/core/src/lib.rs +++ b/vendor/codex/codex-rs/core/src/lib.rs @@ -17,32 +17,28 @@ pub(crate) mod session; pub use session::SteerInputError; mod codex_thread; mod compact_remote; -mod epiphany_distillation; -mod epiphany_promotion; -mod epiphany_proposal; -mod epiphany_retrieval; mod epiphany_rollout; pub use codex_thread::CodexThread; pub use codex_thread::CodexThreadTurnContextOverrides; pub use codex_thread::EpiphanyJobInterruptRequest; pub use codex_thread::EpiphanyJobLaunchRequest; -pub use epiphany_core::EpiphanyStateUpdate; pub use codex_thread::ThreadConfigSnapshot; -pub use epiphany_distillation::EpiphanyDistillInput; -pub use epiphany_distillation::EpiphanyDistillProposal; -pub use epiphany_distillation::distill_observation; -pub use epiphany_promotion::EpiphanyPromotionDecision; -pub use epiphany_promotion::EpiphanyPromotionInput; -pub use epiphany_promotion::evaluate_promotion; -pub use epiphany_proposal::EpiphanyMapProposal; -pub use epiphany_proposal::EpiphanyMapProposalInput; -pub use epiphany_proposal::propose_map_update; -pub use epiphany_retrieval::EPIPHANY_RETRIEVAL_DEFAULT_LIMIT; -pub use epiphany_retrieval::EPIPHANY_RETRIEVAL_MAX_LIMIT; -pub use epiphany_retrieval::EpiphanyRetrieveQuery; -pub use epiphany_retrieval::EpiphanyRetrieveResponse; -pub use epiphany_retrieval::EpiphanyRetrieveResult; -pub use epiphany_retrieval::EpiphanyRetrieveResultKind; +pub use epiphany_core::EPIPHANY_RETRIEVAL_DEFAULT_LIMIT; +pub use epiphany_core::EPIPHANY_RETRIEVAL_MAX_LIMIT; +pub use epiphany_core::EpiphanyDistillInput; +pub use epiphany_core::EpiphanyDistillProposal; +pub use epiphany_core::EpiphanyMapProposal; +pub use epiphany_core::EpiphanyMapProposalInput; +pub use epiphany_core::EpiphanyPromotionDecision; +pub use epiphany_core::EpiphanyPromotionInput; +pub use epiphany_core::EpiphanyRetrieveQuery; +pub use epiphany_core::EpiphanyRetrieveResponse; +pub use epiphany_core::EpiphanyRetrieveResult; +pub use epiphany_core::EpiphanyRetrieveResultKind; +pub use epiphany_core::EpiphanyStateUpdate; +pub use epiphany_core::distill_observation; +pub use epiphany_core::evaluate_promotion; +pub use epiphany_core::propose_map_update; pub use epiphany_rollout::latest_epiphany_state_from_rollout_items; mod agent; mod codex_delegate;