From c2c40d7fb0e119129b31fdb256b7525a94cab105 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 03:14:59 +0100 Subject: [PATCH] Clarify Epiphany automation dependencies --- notes/fresh-workspace-handoff.md | 8 +-- state/ledgers.msgpack | Bin 76382 -> 76632 bytes state/map.yaml | 4 +- .../app-server/src/codex_message_processor.rs | 1 - .../epiphany_automation.rs | 50 +++++++++++++++++- 5 files changed, 56 insertions(+), 7 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 5db432d3..e198e958 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -481,9 +481,11 @@ The nineteenth cut moved runtime-spine role/reorient result adaptation out of into `epiphany-codex-bridge/src/runtime_results.rs`, then removed `use super::*` from `epiphany_state_helpers.rs` so state hydration/patch helpers declare their dependencies instead of drinking the whole processor namespace. -The processor is about 10,430 lines. Remaining Epiphany child modules with -parent wildcard visibility are `epiphany_read_routes.rs`, -`epiphany_mutation_routes.rs`, and `epiphany_automation.rs`. +The processor is about 10,430 lines after that cut. +The twentieth cut removed `use super::*` from `epiphany_automation.rs` and made +the coordinator/pre-compaction automation dependencies explicit. The processor +is about 10,429 lines. Remaining Epiphany child modules with parent wildcard +visibility are `epiphany_read_routes.rs` and `epiphany_mutation_routes.rs`. 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 diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 9e5bd2274846cb23da834f6cd6eaffb282f64b7e..2d2ecf12efa299e7bb629992c05fe907b312901a 100644 GIT binary patch delta 154 zcmcb2h2_RImI=yC+HxCJr!g`fZ{EYWeGemJkH&O&O-2z$lgak0beL~$51M{YlTjtw zwIH(~BQdX1A+fY1KR2-?Ge1wED8IBMRUsoary#Y+TA?U4H!(9WGcR2MuC_cgCnY(t vC`BPRKczG$wOApsC>5wKF-0LU4=7k#0yby5p(3N%bayRAAyyMBQ}SeGemJkA_&o79#^AGhG8yT|?s#10yR#Ln}j* FC;-7)4~qZ* diff --git a/state/map.yaml b/state/map.yaml index d8e375c5..67301d4d 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -278,5 +278,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, seventeen processor cuts, and now a real physical extraction: `epiphany-codex-bridge` lives outside `vendor/codex` and owns the Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval, result projection, runtime-spine result adaptation, launch/prompt doctrine, 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, mutation orchestration, state hydration, and child modules with parent visibility. The processor is about 10,430 lines after moving runtime result adaptation and making state helpers explicit, but vendored Codex lost roughly 3.6k lines of Epiphany adapter/prompt/runtime-result ownership across the bridge extraction. This is progress, not absolution: the bridge is still Codex-facing compatibility, not the final CultNet runtime, and route/mutation authority still lives too close to the Codex processor. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. - next_action: Continue Codex starvation by turning the remaining Epiphany child route modules (`epiphany_read_routes`, `epiphany_mutation_routes`, `epiphany_automation`) into explicit service/bridge calls without `use super::*`, then move route-independent state helpers out of the processor. The next measurable wound is parent-internal wildcard visibility and mutation orchestration inside the Codex processor, not app/skill/marketplace expansion. + summary: The Codex starvation pass has five typing receipts, seventeen processor cuts, and now a real physical extraction: `epiphany-codex-bridge` lives outside `vendor/codex` and owns the Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval, result projection, runtime-spine result adaptation, launch/prompt doctrine, 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, mutation orchestration, and state hydration. The processor is about 10,429 lines after moving runtime result adaptation and making state/automation helpers explicit, but vendored Codex lost roughly 3.6k lines of Epiphany adapter/prompt/runtime-result ownership across the bridge extraction. This is progress, not absolution: the bridge is still Codex-facing compatibility, not the final CultNet runtime, and read/mutation routes still have parent wildcard visibility inside the Codex processor. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. + next_action: Continue Codex starvation by turning the remaining Epiphany route modules (`epiphany_read_routes`, `epiphany_mutation_routes`) into explicit service/bridge calls without `use super::*`, then move route-independent state helpers out of the processor. The next measurable wound is parent-internal wildcard visibility and mutation orchestration inside the Codex processor, not app/skill/marketplace expansion. 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 c3278e45..657bdfa7 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 @@ -5,7 +5,6 @@ mod epiphany_state_helpers; pub(crate) use self::epiphany_automation::maybe_run_epiphany_coordinator_automation_for_turn_boundary; pub(crate) use self::epiphany_automation::maybe_run_epiphany_pre_compaction_checkpoint_intervention_for_token_count; -use self::epiphany_mutation_routes::epiphany_job_launch_changed_fields; use self::epiphany_mutation_routes::epiphany_promote_changed_fields; use self::epiphany_mutation_routes::epiphany_update_patch_changed_fields; use self::epiphany_mutation_routes::reorient_finding_code_refs; diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs index bc97ec0d..e5861a85 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_automation.rs @@ -1,4 +1,52 @@ -use super::*; +use std::sync::Arc; + +use codex_app_server_protocol::ServerNotification; +use codex_app_server_protocol::ThreadEpiphanyCoordinatorSignals; +use codex_app_server_protocol::ThreadEpiphanyReorientStateStatus; +use codex_app_server_protocol::ThreadEpiphanyRoleId; +use codex_app_server_protocol::ThreadEpiphanyStateUpdatedNotification; +use codex_app_server_protocol::ThreadEpiphanyStateUpdatedSource; +use codex_core::CodexThread; +use codex_core::SteerInputError; +use codex_protocol::ThreadId; +use codex_protocol::protocol::Op; +use codex_protocol::protocol::TokenUsageInfo as CoreTokenUsageInfo; +use codex_protocol::user_input::UserInput as CoreInputItem; +use epiphany_codex_bridge::coordinator::EpiphanyCoordinatorAutomationAction; +use epiphany_codex_bridge::coordinator::epiphany_reorient_finding_already_accepted; +use epiphany_codex_bridge::coordinator::epiphany_role_finding_already_accepted; +use epiphany_codex_bridge::coordinator::epiphany_role_finding_cites_implementation_evidence; +use epiphany_codex_bridge::coordinator::epiphany_verification_finding_allows_implementation; +use epiphany_codex_bridge::coordinator::epiphany_verification_finding_covers_current_modeling; +use epiphany_codex_bridge::coordinator::epiphany_verification_finding_needs_evidence; +use epiphany_codex_bridge::coordinator::implementation_evidence_after_role_finding; +use epiphany_codex_bridge::coordinator::map_epiphany_coordinator; +use epiphany_codex_bridge::coordinator::map_epiphany_crrc_recommendation; +use epiphany_codex_bridge::coordinator::map_epiphany_roles; +use epiphany_codex_bridge::coordinator::role_finding_accepted_after; +use epiphany_codex_bridge::coordinator::select_epiphany_coordinator_automation_action; +use epiphany_codex_bridge::jobs::map_epiphany_jobs; +use epiphany_codex_bridge::launch::EPIPHANY_MODELING_ROLE_BINDING_ID; +use epiphany_codex_bridge::launch::EPIPHANY_REORIENT_LAUNCH_BINDING_ID; +use epiphany_codex_bridge::launch::EPIPHANY_VERIFICATION_ROLE_BINDING_ID; +use epiphany_codex_bridge::launch::build_epiphany_reorient_launch_request; +use epiphany_codex_bridge::pressure::map_epiphany_pressure; +use epiphany_codex_bridge::pressure::render_epiphany_pre_compaction_checkpoint_intervention; +use epiphany_codex_bridge::pressure::should_run_epiphany_pre_compaction_checkpoint_intervention; +use epiphany_codex_bridge::reorient::map_epiphany_freshness; +use epiphany_codex_bridge::reorient::map_epiphany_reorient; +use epiphany_codex_bridge::runtime_results::load_epiphany_reorient_result_snapshot; +use epiphany_codex_bridge::runtime_results::load_epiphany_role_result_snapshot; +use tokio::sync::Mutex; +use tracing::warn; + +use super::epiphany_freshness_watcher_snapshot; +use super::epiphany_mutation_routes::epiphany_job_launch_changed_fields; +use super::epiphany_state_helpers::client_visible_live_thread_epiphany_state; +use super::epiphany_state_helpers::epiphany_modeling_finding_has_reviewable_state_patch; +use crate::epiphany_invalidation::EpiphanyInvalidationManager; +use crate::outgoing_message::ThreadScopedOutgoingMessageSender; +use crate::thread_state::ThreadState; pub(crate) async fn maybe_run_epiphany_coordinator_automation_for_turn_boundary( thread_id: ThreadId,