Clarify Epiphany automation dependencies

This commit is contained in:
Meta Vens 2026-05-13 03:14:59 +01:00
commit c2c40d7fb0
5 changed files with 56 additions and 7 deletions

View file

@ -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

Binary file not shown.

View file

@ -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.

View file

@ -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;

View file

@ -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,