diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 12060c85..2fc4564b 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -767,6 +767,13 @@ 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 MCP config path is now product-quarantined. `Config::to_mcp_config` keeps +user-declared MCP servers but no longer accepts a `PluginsManager`, folds +plugin-provided MCP servers into the runtime, enables Codex apps, enables skill +MCP dependency install, or advertises plugin capability summaries. MCP remains +a JSON-RPC protocol edge; Codex apps/skills/plugins no longer get smuggled +through that edge as if they were the protocol. + 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 1f246dad..89f7f5fe 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 944b7882..73935e1f 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -280,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, thirty 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, watcher invalidation adaptation, 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, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are now inert in the app-server compatibility path: list routes return empty lists, mutation/detail/import routes report disabled, `externalAgentConfig/detect` returns no import candidates, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `codex_message_processor.rs` is about 9,637 lines; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; `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. + summary: The Codex starvation pass has five typing receipts, thirty-one 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, watcher invalidation adaptation, 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, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are now inert in the app-server compatibility path: list routes return empty lists, mutation/detail/import routes report disabled, `externalAgentConfig/detect` returns no import candidates, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `Config::to_mcp_config` now keeps user-declared MCP servers but no longer accepts `PluginsManager`, folds plugin MCP servers into the runtime, enables Codex apps, enables skill MCP dependency install, or advertises plugin capability summaries. `codex_message_processor.rs` is about 9,637 lines; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; `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/app-server/src/codex_message_processor.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs index 967c99b7..afff7ed6 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 @@ -5888,9 +5888,7 @@ impl CodexMessageProcessor { return; } }; - let mcp_config = config - .to_mcp_config(self.thread_manager.plugins_manager().as_ref()) - .await; + let mcp_config = config.to_mcp_config(); let auth = self.auth_manager.auth().await; let environment_manager = self.thread_manager.environment_manager(); let runtime_environment = match environment_manager.default_environment() { @@ -6057,9 +6055,7 @@ impl CodexMessageProcessor { return; } }; - let mcp_config = config - .to_mcp_config(self.thread_manager.plugins_manager().as_ref()) - .await; + let mcp_config = config.to_mcp_config(); let auth = self.auth_manager.auth().await; let runtime_environment = { let environment_manager = self.thread_manager.environment_manager(); diff --git a/vendor/codex/codex-rs/core/src/config/config_tests.rs b/vendor/codex/codex-rs/core/src/config/config_tests.rs index 43471d7d..55f65db0 100644 --- a/vendor/codex/codex-rs/core/src/config/config_tests.rs +++ b/vendor/codex/codex-rs/core/src/config/config_tests.rs @@ -5,7 +5,6 @@ use crate::config::edit::ConfigEditsBuilder; use crate::config::edit::apply_blocking; use crate::config_loader::RequirementSource; use crate::config_loader::project_trust_key; -use crate::plugins::PluginsManager; use assert_matches::assert_matches; use codex_config::CONFIG_TOML_FILE; use codex_config::config_toml::AgentRoleToml; @@ -2594,7 +2593,7 @@ approval_mode = "approve" } #[tokio::test] -async fn to_mcp_config_preserves_apps_feature_from_config() -> std::io::Result<()> { +async fn to_mcp_config_quarantines_codex_product_surfaces() -> std::io::Result<()> { let codex_home = TempDir::new()?; let mut config = Config::load_from_base_config_with_overrides( ConfigToml::default(), @@ -2602,18 +2601,19 @@ async fn to_mcp_config_preserves_apps_feature_from_config() -> std::io::Result<( codex_home.abs(), ) .await?; - let plugins_manager = PluginsManager::new(codex_home.path().to_path_buf()); - let mcp_config = config.to_mcp_config(&plugins_manager).await; - assert!(mcp_config.apps_enabled); + let mcp_config = config.to_mcp_config(); + assert!(!mcp_config.apps_enabled); + assert!(!mcp_config.skill_mcp_dependency_install_enabled); + assert!(mcp_config.plugin_capability_summaries.is_empty()); let _ = config.features.disable(Feature::Apps); - let mcp_config = config.to_mcp_config(&plugins_manager).await; + let mcp_config = config.to_mcp_config(); assert!(!mcp_config.apps_enabled); let _ = config.features.enable(Feature::Apps); - let mcp_config = config.to_mcp_config(&plugins_manager).await; - assert!(mcp_config.apps_enabled); + let mcp_config = config.to_mcp_config(); + assert!(!mcp_config.apps_enabled); Ok(()) } diff --git a/vendor/codex/codex-rs/core/src/config/mod.rs b/vendor/codex/codex-rs/core/src/config/mod.rs index 93724aac..ca2f2913 100644 --- a/vendor/codex/codex-rs/core/src/config/mod.rs +++ b/vendor/codex/codex-rs/core/src/config/mod.rs @@ -806,31 +806,20 @@ impl Config { } } - pub async fn to_mcp_config( - &self, - plugins_manager: &crate::plugins::PluginsManager, - ) -> McpConfig { - let loaded_plugins = plugins_manager.plugins_for_config(self).await; - let mut configured_mcp_servers = self.mcp_servers.get().clone(); - for (name, plugin_server) in loaded_plugins.effective_mcp_servers() { - configured_mcp_servers.entry(name).or_insert(plugin_server); - } - + pub fn to_mcp_config(&self) -> McpConfig { McpConfig { chatgpt_base_url: self.chatgpt_base_url.clone(), codex_home: self.codex_home.to_path_buf(), mcp_oauth_credentials_store_mode: self.mcp_oauth_credentials_store_mode, mcp_oauth_callback_port: self.mcp_oauth_callback_port, mcp_oauth_callback_url: self.mcp_oauth_callback_url.clone(), - skill_mcp_dependency_install_enabled: self - .features - .enabled(Feature::SkillMcpDependencyInstall), + skill_mcp_dependency_install_enabled: false, approval_policy: self.permissions.approval_policy.clone(), codex_linux_sandbox_exe: self.codex_linux_sandbox_exe.clone(), use_legacy_landlock: self.features.use_legacy_landlock(), - apps_enabled: self.features.enabled(Feature::Apps), - configured_mcp_servers, - plugin_capability_summaries: loaded_plugins.capability_summaries().to_vec(), + apps_enabled: false, + configured_mcp_servers: self.mcp_servers.get().clone(), + plugin_capability_summaries: Vec::new(), } } diff --git a/vendor/codex/codex-rs/core/src/connectors.rs b/vendor/codex/codex-rs/core/src/connectors.rs index 7641b4cb..cfec9a20 100644 --- a/vendor/codex/codex-rs/core/src/connectors.rs +++ b/vendor/codex/codex-rs/core/src/connectors.rs @@ -244,7 +244,7 @@ pub async fn list_accessible_connectors_from_mcp_tools_with_environment_manager( }); } - let mcp_config = config.to_mcp_config(plugins_manager.as_ref()).await; + let mcp_config = config.to_mcp_config(); let mcp_servers = with_codex_apps_mcp(HashMap::new(), auth.as_ref(), &mcp_config); if mcp_servers.is_empty() { return Ok(AccessibleConnectorsStatus { diff --git a/vendor/codex/codex-rs/core/src/mcp.rs b/vendor/codex/codex-rs/core/src/mcp.rs index 0d4c2699..a74adf17 100644 --- a/vendor/codex/codex-rs/core/src/mcp.rs +++ b/vendor/codex/codex-rs/core/src/mcp.rs @@ -11,17 +11,15 @@ use codex_mcp::effective_mcp_servers; use codex_mcp::tool_plugin_provenance as collect_tool_plugin_provenance; #[derive(Clone)] -pub struct McpManager { - plugins_manager: Arc, -} +pub struct McpManager; impl McpManager { - pub fn new(plugins_manager: Arc) -> Self { - Self { plugins_manager } + pub fn new(_plugins_manager: Arc) -> Self { + Self } pub async fn configured_servers(&self, config: &Config) -> HashMap { - let mcp_config = config.to_mcp_config(self.plugins_manager.as_ref()).await; + let mcp_config = config.to_mcp_config(); configured_mcp_servers(&mcp_config) } @@ -30,12 +28,12 @@ impl McpManager { config: &Config, auth: Option<&CodexAuth>, ) -> HashMap { - let mcp_config = config.to_mcp_config(self.plugins_manager.as_ref()).await; + let mcp_config = config.to_mcp_config(); effective_mcp_servers(&mcp_config, auth) } pub async fn tool_plugin_provenance(&self, config: &Config) -> ToolPluginProvenance { - let mcp_config = config.to_mcp_config(self.plugins_manager.as_ref()).await; + let mcp_config = config.to_mcp_config(); collect_tool_plugin_provenance(&mcp_config) } } diff --git a/vendor/codex/codex-rs/core/src/session/mcp.rs b/vendor/codex/codex-rs/core/src/session/mcp.rs index 350d6505..129c8b36 100644 --- a/vendor/codex/codex-rs/core/src/session/mcp.rs +++ b/vendor/codex/codex-rs/core/src/session/mcp.rs @@ -210,9 +210,7 @@ impl Session { ) { let auth = self.services.auth_manager.auth().await; let config = self.get_config().await; - let mcp_config = config - .to_mcp_config(self.services.plugins_manager.as_ref()) - .await; + let mcp_config = config.to_mcp_config(); let tool_plugin_provenance = self .services .mcp_manager