From c27c1dcb9f4dd2c7833c15f403c16af753e48031 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 14 May 2026 06:15:33 +0100 Subject: [PATCH] Require typed runtime worker results --- epiphany-codex-bridge/src/runtime_results.rs | 178 ++++++++++++++++--- epiphany-core/src/lib.rs | 2 - epiphany-core/src/surfaces/mod.rs | 2 - epiphany-core/src/surfaces/role_result.rs | 47 ----- notes/fresh-workspace-handoff.md | 13 +- state/ledgers.msgpack | Bin 111970 -> 112209 bytes state/map.yaml | 18 +- 7 files changed, 173 insertions(+), 87 deletions(-) diff --git a/epiphany-codex-bridge/src/runtime_results.rs b/epiphany-codex-bridge/src/runtime_results.rs index 4076f4bb..05cd3c5d 100644 --- a/epiphany-codex-bridge/src/runtime_results.rs +++ b/epiphany-codex-bridge/src/runtime_results.rs @@ -12,8 +12,6 @@ use codex_protocol::protocol::EpiphanyRuntimeLink; use codex_protocol::protocol::EpiphanyThreadState; use epiphany_core::EpiphanyRuntimeJobSnapshot; use epiphany_core::EpiphanyRuntimeJobStatus; -use epiphany_core::interpret_reorient_runtime_job_result; -use epiphany_core::interpret_role_runtime_job_result; use epiphany_core::interpret_runtime_reorient_worker_result; use epiphany_core::interpret_runtime_role_worker_result; use epiphany_core::runtime_job_snapshot; @@ -94,24 +92,26 @@ pub fn load_epiphany_role_result_from_runtime_spine_job( &result, ), )), - Ok(None) => snapshot.result.as_ref().map(|result| { - map_protocol_role_finding( - role_id, - interpret_role_runtime_job_result( - map_core_role_result_role_id(role_id), - result, + Ok(None) => { + return ( + ThreadEpiphanyRoleResultStatus::BackendUnavailable, + None, + format!( + "Heartbeat runtime job {:?} completed without an EpiphanyRuntimeRoleWorkerResult typed document; generic lifecycle receipts are not reviewable findings.", + job_id ), - ) - }), - Err(_) => snapshot.result.as_ref().map(|result| { - map_protocol_role_finding( - role_id, - interpret_role_runtime_job_result( - map_core_role_result_role_id(role_id), - result, + ); + } + Err(err) => { + return ( + ThreadEpiphanyRoleResultStatus::BackendUnavailable, + None, + format!( + "Failed to read typed role worker result for heartbeat runtime job {:?}: {err}", + job_id ), - ) - }), + ); + } } } else { None @@ -165,12 +165,26 @@ pub fn load_epiphany_reorient_result_from_runtime_spine_job( Ok(Some(result)) => Some(map_protocol_reorient_finding( interpret_runtime_reorient_worker_result(&result), )), - Ok(None) => snapshot.result.as_ref().map(|result| { - map_protocol_reorient_finding(interpret_reorient_runtime_job_result(result)) - }), - Err(_) => snapshot.result.as_ref().map(|result| { - map_protocol_reorient_finding(interpret_reorient_runtime_job_result(result)) - }), + Ok(None) => { + return ( + ThreadEpiphanyReorientResultStatus::BackendUnavailable, + None, + format!( + "Heartbeat runtime job {:?} completed without an EpiphanyRuntimeReorientWorkerResult typed document; generic lifecycle receipts are not reviewable findings.", + job_id + ), + ); + } + Err(err) => { + return ( + ThreadEpiphanyReorientResultStatus::BackendUnavailable, + None, + format!( + "Failed to read typed reorientation worker result for heartbeat runtime job {:?}: {err}", + job_id + ), + ); + } } } else { None @@ -391,3 +405,119 @@ pub fn latest_epiphany_runtime_link_for_binding<'a>( .iter() .find(|link| link.binding_id == binding_id && !link.runtime_job_id.trim().is_empty()) } + +#[cfg(test)] +mod tests { + use std::fs; + use std::path::Path; + use std::path::PathBuf; + + use codex_app_server_protocol::ThreadEpiphanyReorientResultStatus; + use codex_app_server_protocol::ThreadEpiphanyRoleId; + use codex_app_server_protocol::ThreadEpiphanyRoleResultStatus; + use epiphany_core::RuntimeSpineInitOptions; + use epiphany_core::RuntimeSpineJobOptions; + use epiphany_core::RuntimeSpineJobResultOptions; + use epiphany_core::RuntimeSpineSessionOptions; + use epiphany_core::complete_runtime_job; + use epiphany_core::create_runtime_job; + use epiphany_core::create_runtime_session; + use epiphany_core::initialize_runtime_spine; + + use super::*; + + const NOW: &str = "2026-05-13T00:00:00Z"; + + #[test] + fn role_result_requires_typed_worker_document() { + let store = temp_store_path(); + seed_completed_lifecycle_result(&store, "role-job", "modeling"); + + let (status, finding, note) = load_epiphany_role_result_from_runtime_spine_job( + "role-job", + Some(store.as_path()), + ThreadEpiphanyRoleId::Modeling, + ); + + assert_eq!(status, ThreadEpiphanyRoleResultStatus::BackendUnavailable); + assert!(finding.is_none()); + assert!(note.contains("EpiphanyRuntimeRoleWorkerResult typed document")); + + let _ = fs::remove_file(store); + } + + #[test] + fn reorient_result_requires_typed_worker_document() { + let store = temp_store_path(); + seed_completed_lifecycle_result(&store, "reorient-job", "reorientation"); + + let (status, finding, note) = load_epiphany_reorient_result_from_runtime_spine_job( + "reorient-job", + Some(store.as_path()), + ); + + assert_eq!( + status, + ThreadEpiphanyReorientResultStatus::BackendUnavailable + ); + assert!(finding.is_none()); + assert!(note.contains("EpiphanyRuntimeReorientWorkerResult typed document")); + + let _ = fs::remove_file(store); + } + + fn temp_store_path() -> PathBuf { + std::env::temp_dir().join(format!( + "epiphany-runtime-results-{}.msgpack", + uuid::Uuid::new_v4() + )) + } + + fn seed_completed_lifecycle_result(store: &Path, job_id: &str, role: &str) { + initialize_runtime_spine( + store, + RuntimeSpineInitOptions { + runtime_id: "test-runtime".to_string(), + display_name: "Test Runtime".to_string(), + created_at: NOW.to_string(), + }, + ) + .expect("initialize runtime"); + create_runtime_session( + store, + RuntimeSpineSessionOptions { + session_id: "session-1".to_string(), + objective: "test typed result boundary".to_string(), + created_at: NOW.to_string(), + coordinator_note: "test".to_string(), + }, + ) + .expect("create session"); + create_runtime_job( + store, + RuntimeSpineJobOptions { + job_id: job_id.to_string(), + session_id: "session-1".to_string(), + role: role.to_string(), + created_at: NOW.to_string(), + summary: "generic lifecycle job".to_string(), + artifact_refs: Vec::new(), + }, + ) + .expect("create job"); + complete_runtime_job( + store, + RuntimeSpineJobResultOptions { + result_id: format!("result-{job_id}"), + job_id: job_id.to_string(), + completed_at: NOW.to_string(), + verdict: "completed".to_string(), + summary: "generic lifecycle result".to_string(), + next_safe_move: "do not review generic lifecycle receipts".to_string(), + evidence_refs: Vec::new(), + artifact_refs: Vec::new(), + }, + ) + .expect("complete job"); + } +} diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index c8398927..877c73f4 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -257,9 +257,7 @@ pub use surfaces::derive_role_board; pub use surfaces::derive_scene; pub use surfaces::imagination_role_state_patch_policy_errors; pub use surfaces::interpret_reorient_finding; -pub use surfaces::interpret_reorient_runtime_job_result; pub use surfaces::interpret_role_finding; -pub use surfaces::interpret_role_runtime_job_result; pub use surfaces::interpret_runtime_reorient_worker_result; pub use surfaces::interpret_runtime_role_worker_result; pub use surfaces::modeling_role_state_patch_policy_errors; diff --git a/epiphany-core/src/surfaces/mod.rs b/epiphany-core/src/surfaces/mod.rs index e0ee7fcf..6c7a4bff 100644 --- a/epiphany-core/src/surfaces/mod.rs +++ b/epiphany-core/src/surfaces/mod.rs @@ -105,9 +105,7 @@ pub use role_result::build_reorient_acceptance_bundle; pub use role_result::build_role_acceptance_bundle; pub use role_result::imagination_role_state_patch_policy_errors; pub use role_result::interpret_reorient_finding; -pub use role_result::interpret_reorient_runtime_job_result; pub use role_result::interpret_role_finding; -pub use role_result::interpret_role_runtime_job_result; pub use role_result::interpret_runtime_reorient_worker_result; pub use role_result::interpret_runtime_role_worker_result; pub use role_result::modeling_role_state_patch_policy_errors; diff --git a/epiphany-core/src/surfaces/role_result.rs b/epiphany-core/src/surfaces/role_result.rs index a14dbaf0..4641e456 100644 --- a/epiphany-core/src/surfaces/role_result.rs +++ b/epiphany-core/src/surfaces/role_result.rs @@ -195,33 +195,6 @@ pub fn interpret_reorient_finding( } } -pub fn interpret_role_runtime_job_result( - _role_id: EpiphanyRoleResultRoleId, - result: &EpiphanyRuntimeJobResult, -) -> EpiphanyRoleFindingInterpretation { - EpiphanyRoleFindingInterpretation { - verdict: Some(result.verdict.clone()), - summary: Some(result.summary.clone()), - next_safe_move: empty_string_as_none(&result.next_safe_move), - checkpoint_summary: None, - scratch_summary: None, - files_inspected: Vec::new(), - frontier_node_ids: Vec::new(), - evidence_ids: result.evidence_refs.clone(), - artifact_refs: result.artifact_refs.clone(), - runtime_result_id: Some(result.result_id.clone()), - runtime_job_id: Some(result.job_id.clone()), - open_questions: Vec::new(), - evidence_gaps: Vec::new(), - risks: Vec::new(), - state_patch: None, - self_patch: None, - self_persistence: None, - job_error: None, - item_error: None, - } -} - pub fn interpret_runtime_role_worker_result( role_id: EpiphanyRoleResultRoleId, result: &crate::EpiphanyRuntimeRoleWorkerResult, @@ -287,25 +260,6 @@ pub fn interpret_runtime_role_worker_result( } } -pub fn interpret_reorient_runtime_job_result( - result: &EpiphanyRuntimeJobResult, -) -> EpiphanyReorientFindingInterpretation { - EpiphanyReorientFindingInterpretation { - mode: Some(result.role.clone()), - summary: Some(result.summary.clone()), - next_safe_move: empty_string_as_none(&result.next_safe_move), - checkpoint_still_valid: Some(result.verdict != "fail"), - files_inspected: Vec::new(), - frontier_node_ids: Vec::new(), - evidence_ids: result.evidence_refs.clone(), - artifact_refs: result.artifact_refs.clone(), - runtime_result_id: Some(result.result_id.clone()), - runtime_job_id: Some(result.job_id.clone()), - job_error: None, - item_error: None, - } -} - pub fn interpret_runtime_reorient_worker_result( result: &crate::EpiphanyRuntimeReorientWorkerResult, ) -> EpiphanyReorientFindingInterpretation { @@ -1227,7 +1181,6 @@ use super::state_patch::EpiphanyRoleStatePatchDocument; use crate::agent_memory::AgentSelfPatch; use crate::agent_memory::decode_agent_self_patch; use crate::agent_memory::review_agent_self_patch_contract; -use crate::runtime_spine::EpiphanyRuntimeJobResult; use epiphany_state_model::EpiphanyAcceptanceReceipt; use epiphany_state_model::EpiphanyCodeRef; use epiphany_state_model::EpiphanyEvidenceRecord; diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index ca28f8e9..a852263f 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -598,8 +598,9 @@ storage route without network. Its `run-worker` command now reads a durable model request, calls the native runtime route, persists typed `EpiphanyRuntimeRoleWorkerResult` or `EpiphanyRuntimeReorientWorkerResult` documents, and completes the original heartbeat/specialist runtime job without -Codex worker execution. `roleResult` and `reorientResult` now prefer those typed -worker result documents and use generic job summaries only as legacy fallback. +Codex worker execution. `roleResult` and `reorientResult` now require those +typed worker result documents; generic runtime job summaries are lifecycle +receipts, not reviewable findings. The next cut is wiring coordinator/heartbeat automation to invoke `run-worker` for launched runtime job ids, then carving down the `codex-api` dependency weight. @@ -962,6 +963,14 @@ absolute-path, and template tests. A vendored-wide search for product-shaped test names now returns only external URLs, generic URL examples, and real package names such as `eslint-plugin`; not live Codex product machinery. +The typed worker-result boundary is now stricter. `roleResult` and +`reorientResult` read-back no longer falls back from +`EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` +CultCache documents to generic `EpiphanyRuntimeJobResult` lifecycle receipts. +If a job completed without the typed worker-result document, the bridge reports +backend-unavailable and names the missing document instead of laundering summary +strings into a reviewable finding. + That husk has now been cut from `codex-core`. The root core crate no longer exports `plugins`, no longer depends on `codex-core-plugins` or `codex-plugin`, and the core plugin manager / marketplace add-remove-sync modules and tests diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 5659aaa7e8b1181288cee77ae252e9c440de509c..a6c8dc86f52f1d363fb98ca53c1831638e6d114f 100644 GIT binary patch delta 251 zcmZ8cu}T9$6l5*(2V(m`f{mw_#E7H~)`D2sZFb*X9@%>v-|l*(QqT`brM>b!qUE{m@@f70E{3;$+21e9VbR+= zDTkxp;P&W2ZC`xcA198~Ac%LkE9ixgBM53+OthH+`!=()M1le0VvZJCFEf-P3&}+o zXBcZUMX=taCZ_{vwmAsSbBzLx=2U4D({F{~Ibo|O4xyq$w#0RSN_+z~G71@xzeSEJ WGz*iBf(B_G!_MXN{~M#h!RZf6p}SeGen!gw0|NTZ{~h%ybP*bq!5I3{0#{O|48U FqX5|H5J><4 diff --git a/state/map.yaml b/state/map.yaml index 36881533..949d59ba 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -280,15 +280,13 @@ 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, fifty-two 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/skill cache invalidation on config writes is gone, 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; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` is gone from `codex-protocol` / `codex-core` / TUI command routing, the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener, model turns no longer run skill mention collection, skill env-var prompts, skill MCP dependency installation, skill instruction injection, or implicit skill invocation analytics from shell tools, and the turn prompt/router path no longer loads plugin/app capability summaries, injects available-skill/available-plugin/plugin instruction fragments, parses plugin/app mentions, records app/plugin invocation telemetry, or filters MCP tools through Codex app connectors. Skill mutation/list/notification is gone from the app-server edge too: `skills/list`, `skills/config/write`, `skills/changed`, `Op::ListSkills`, `EventMsg::ListSkillsResponse`, `EventMsg::SkillsUpdateAvailable`, the app-server handlers, TUI slash/startup/list/manage-skill surfaces, generated schema entries, core skill-list suite, and fake live-reload/developer-message tests were deleted. Skill mention plumbing is also gone from the live TUI/protocol edge: no `UserInput::Skill` variant, app-server schema branch, TUI skill popup, `skills_all` cache, composer `set_skill_mentions`, skill mention insertion, `skill://` / `SKILL.md` history decoding, or stale skill popup snapshot remains. The `codex-core-skills` crate, core `skills` re-export shim, no-op `skills_watcher`, session `SkillsManager` service, and per-turn `TurnSkillsContext` are deleted; core/protocol no longer keep legacy `` or `` prompt compatibility, memory usage classification, snapshot normalization, or cleanup paths. Remaining product-shaped skill residue is also cut from memory templates, app-server docs/tests/warnings, TUI tooltips/placeholders/warnings/comments, app-server v1 docs, agent-tool schema text, stale `UserInput::Skill` test arms, and obsolete feature flags/schema entries. App-instruction prompt compatibility is cut too: no `APPS_INSTRUCTIONS` protocol constants, no `` snapshot canonicalization, and MCP fixture tests now use neutral `demo_mcp` / `calendar_mcp` names instead of `codex_apps` / `/api/codex/apps` branding. The TUI app connector product path is also deleted: no `/apps` slash command, app-link view, connector AppEvent variants, app connector cache/popup/refresh loop, app mention insertion, `app://` mention codec support, stale app-popup tests, or TUI browser-opening shim remains. The `app/list` route and `app/list/updated` notification are gone from app-server protocol, generated schemas, app-server dispatch, test helpers, and docs; `AppInfo`/app-list metadata schema structs are deleted; the orphaned `codex-connectors` crate and `core::connectors` shim are deleted from the workspace; Codex app analytics no longer tracks `codex_app_mentioned` / `codex_app_used` facts, events, reducer arms, client APIs, or dedupe cache state; `[apps.*]`, `Feature::Apps`, `include_apps_instructions`, app config/read schemas, app managed requirements, app prompt tests, and app file-MCP tests are gone; `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mentions, plugin instruction tags, and stale plugin popup snapshots are gone too; `[plugins]` / `[marketplaces]`, `PluginConfig`, `MarketplaceConfig`, marketplace edit helpers, stale plugin/external-agent README route claims, and generated schema entries are removed from config; and the bundled `codex-skills` sample-skill crate plus embedded imagegen/openai-docs/plugin-creator/skill-creator/skill-installer payloads are deleted from the workspace. Live MCP tool approval is named `McpToolApproval`, not `AppToolApproval`, and remains under MCP server config; live structured user-input mentions are MCP-shaped only. `codex_message_processor.rs` is about 9,482 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, fifty-two 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/skill cache invalidation on config writes is gone, 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; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` is gone from `codex-protocol` / `codex-core` / TUI command routing, the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener, model turns no longer run skill mention collection, skill env-var prompts, skill MCP dependency installation, skill instruction injection, or implicit skill invocation analytics from shell tools, and the turn prompt/router path no longer loads plugin/app capability summaries, injects available-skill/available-plugin/plugin instruction fragments, parses plugin/app mentions, records app/plugin invocation telemetry, or filters MCP tools through Codex app connectors. Skill mutation/list/notification is gone from the app-server edge too: `skills/list`, `skills/config/write`, `skills/changed`, `Op::ListSkills`, `EventMsg::ListSkillsResponse`, `EventMsg::SkillsUpdateAvailable`, the app-server handlers, TUI slash/startup/list/manage-skill surfaces, generated schema entries, core skill-list suite, and fake live-reload/developer-message tests were deleted. Skill mention plumbing is also gone from the live TUI/protocol edge: no `UserInput::Skill` variant, app-server schema branch, TUI skill popup, `skills_all` cache, composer `set_skill_mentions`, skill mention insertion, `skill://` / `SKILL.md` history decoding, or stale skill popup snapshot remains. The `codex-core-skills` crate, core `skills` re-export shim, no-op `skills_watcher`, session `SkillsManager` service, and per-turn `TurnSkillsContext` are deleted; core/protocol no longer keep legacy `` or `` prompt compatibility, memory usage classification, snapshot normalization, or cleanup paths. Remaining product-shaped skill residue is also cut from memory templates, app-server docs/tests/warnings, TUI tooltips/placeholders/warnings/comments, app-server v1 docs, agent-tool schema text, stale `UserInput::Skill` test arms, and obsolete feature flags/schema entries. App-instruction prompt compatibility is cut too: no `APPS_INSTRUCTIONS` protocol constants, no `` snapshot canonicalization, and MCP fixture tests now use neutral `demo_mcp` / `calendar_mcp` names instead of `codex_apps` / `/api/codex/apps` branding. The TUI app connector product path is also deleted: no `/apps` slash command, app-link view, connector AppEvent variants, app connector cache/popup/refresh loop, app mention insertion, `app://` mention codec support, stale app-popup tests, or TUI browser-opening shim remains. The `app/list` route and `app/list/updated` notification are gone from app-server protocol, generated schemas, app-server dispatch, test helpers, and docs; `AppInfo`/app-list metadata schema structs are deleted; the orphaned `codex-connectors` crate and `core::connectors` shim are deleted from the workspace; Codex app analytics no longer tracks `codex_app_mentioned` / `codex_app_used` facts, events, reducer arms, client APIs, or dedupe cache state; `[apps.*]`, `Feature::Apps`, `include_apps_instructions`, app config/read schemas, app managed requirements, app prompt tests, and app file-MCP tests are gone; `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mentions, plugin instruction tags, and stale plugin popup snapshots are gone too; `[plugins]` / `[marketplaces]`, `PluginConfig`, `MarketplaceConfig`, marketplace edit helpers, stale plugin/external-agent README route claims, and generated schema entries are removed from config; and the bundled `codex-skills` sample-skill crate plus embedded imagegen/openai-docs/plugin-creator/skill-creator/skill-installer payloads are deleted from the workspace. Live MCP tool approval is named `McpToolApproval`, not `AppToolApproval`, and remains under MCP server config; live structured user-input mentions are MCP-shaped only. `codex_message_processor.rs` is about 9,482 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 require typed worker result documents; generic job summaries are lifecycle receipts, not reviewable findings; `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. latest_cut: > - The product-label residue pass removed the CLI tombstone test that kept - `codex marketplace` / `codex plugin marketplace` command strings alive, - neutralized remaining "plugin-provided MCP" comments, and renamed - plugin/app fixture names in watcher, context, TUI mention, MCP inventory, - absolute-path, and template tests. A vendored-wide search for - product-shaped `marketplace`, `plugin`, `app://`, `plugin://`, - `codex_apps`, and stale Apps test names now returns only external URLs, - generic URL examples, and real package names such as `eslint-plugin`; not - live Codex product machinery. MCP remains JSON at the protocol edge. + Runtime role/reorient read-back no longer falls back from typed + `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` + documents to generic `EpiphanyRuntimeJobResult` lifecycle receipts. A + completed runtime job without the typed worker-result CultCache document now + reports backend-unavailable with a repair note instead of manufacturing a + reviewable finding from summary strings. Generic runtime job results remain + lifecycle receipts; reviewable specialist findings are typed documents. 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.