Move Epiphany runtime result bridge
This commit is contained in:
parent
71a5d6fb43
commit
beb525b935
7 changed files with 62 additions and 37 deletions
|
|
@ -6,4 +6,5 @@ pub mod pressure;
|
|||
pub mod reorient;
|
||||
pub mod retrieve;
|
||||
pub mod results;
|
||||
pub mod runtime_results;
|
||||
pub mod scene;
|
||||
|
|
|
|||
|
|
@ -1,28 +1,47 @@
|
|||
use super::*;
|
||||
use std::path::Path;
|
||||
|
||||
pub(super) fn role_finding_runtime_result_id(
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientFinding;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientResultStatus;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleFinding;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleId;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleResultStatus;
|
||||
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::runtime_job_snapshot;
|
||||
|
||||
use crate::results::map_core_role_result_role_id;
|
||||
use crate::results::map_protocol_reorient_finding;
|
||||
use crate::results::map_protocol_role_finding;
|
||||
use crate::results::render_epiphany_reorient_result_note;
|
||||
use crate::results::render_epiphany_role_result_note;
|
||||
|
||||
pub fn role_finding_runtime_result_id(
|
||||
finding: &ThreadEpiphanyRoleFinding,
|
||||
) -> Option<String> {
|
||||
finding.runtime_result_id.clone()
|
||||
}
|
||||
|
||||
pub(super) fn role_finding_runtime_job_id(finding: &ThreadEpiphanyRoleFinding) -> Option<String> {
|
||||
pub fn role_finding_runtime_job_id(finding: &ThreadEpiphanyRoleFinding) -> Option<String> {
|
||||
finding.runtime_job_id.clone()
|
||||
}
|
||||
|
||||
pub(super) fn reorient_finding_runtime_result_id(
|
||||
pub fn reorient_finding_runtime_result_id(
|
||||
finding: &ThreadEpiphanyReorientFinding,
|
||||
) -> Option<String> {
|
||||
finding.runtime_result_id.clone()
|
||||
}
|
||||
|
||||
pub(super) fn reorient_finding_runtime_job_id(
|
||||
pub fn reorient_finding_runtime_job_id(
|
||||
finding: &ThreadEpiphanyReorientFinding,
|
||||
) -> Option<String> {
|
||||
finding.runtime_job_id.clone()
|
||||
}
|
||||
|
||||
pub(super) fn load_epiphany_role_result_from_runtime_spine_job(
|
||||
pub fn load_epiphany_role_result_from_runtime_spine_job(
|
||||
job_id: &str,
|
||||
runtime_store_path: Option<&Path>,
|
||||
role_id: ThreadEpiphanyRoleId,
|
||||
|
|
@ -73,7 +92,7 @@ pub(super) fn load_epiphany_role_result_from_runtime_spine_job(
|
|||
(status, finding, note)
|
||||
}
|
||||
|
||||
pub(super) fn load_epiphany_reorient_result_from_runtime_spine_job(
|
||||
pub fn load_epiphany_reorient_result_from_runtime_spine_job(
|
||||
job_id: &str,
|
||||
runtime_store_path: Option<&Path>,
|
||||
) -> (
|
||||
|
|
@ -161,7 +180,7 @@ fn map_runtime_reorient_result_status(
|
|||
}
|
||||
}
|
||||
|
||||
pub(super) async fn load_epiphany_role_result_snapshot(
|
||||
pub async fn load_epiphany_role_result_snapshot(
|
||||
state: &EpiphanyThreadState,
|
||||
runtime_store_path: Option<&Path>,
|
||||
role_id: ThreadEpiphanyRoleId,
|
||||
|
|
@ -197,7 +216,7 @@ pub(super) async fn load_epiphany_role_result_snapshot(
|
|||
)
|
||||
}
|
||||
|
||||
pub(super) async fn load_epiphany_reorient_result_snapshot(
|
||||
pub async fn load_epiphany_reorient_result_snapshot(
|
||||
state: Option<&EpiphanyThreadState>,
|
||||
runtime_store_path: Option<&Path>,
|
||||
binding_id: &str,
|
||||
|
|
@ -238,7 +257,7 @@ pub(super) async fn load_epiphany_reorient_result_snapshot(
|
|||
)
|
||||
}
|
||||
|
||||
pub(super) fn latest_epiphany_runtime_link_for_binding<'a>(
|
||||
pub fn latest_epiphany_runtime_link_for_binding<'a>(
|
||||
state: &'a EpiphanyThreadState,
|
||||
binding_id: &str,
|
||||
) -> Option<&'a EpiphanyRuntimeLink> {
|
||||
|
|
@ -476,6 +476,14 @@ code from `vendor/codex`, but `codex_message_processor.rs` is still about
|
|||
10,445 lines and still owns route dispatch, mutation orchestration,
|
||||
runtime-result loading, state hydration, and child modules with parent
|
||||
visibility.
|
||||
The nineteenth cut moved runtime-spine role/reorient result adaptation out of
|
||||
`vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_runtime_results.rs`
|
||||
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`.
|
||||
|
||||
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.
|
|
@ -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, 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, runtime-result loading, state hydration, and child modules with parent visibility. The processor is about 10,445 lines after adding the watcher DTO bridge, but vendored Codex lost roughly 3.3k lines of Epiphany adapter/prompt ownership in this pass. 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 `codex_message_processor` child route modules into explicit bridge/service calls, then move route-independent state/runtime helpers out of the processor. The next measurable wound is parent-internal `use super::*` 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, 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.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
mod epiphany_automation;
|
||||
mod epiphany_mutation_routes;
|
||||
mod epiphany_read_routes;
|
||||
mod epiphany_runtime_results;
|
||||
mod epiphany_state_helpers;
|
||||
|
||||
pub(crate) use self::epiphany_automation::maybe_run_epiphany_coordinator_automation_for_turn_boundary;
|
||||
|
|
@ -9,21 +8,10 @@ pub(crate) use self::epiphany_automation::maybe_run_epiphany_pre_compaction_chec
|
|||
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::imagination_role_accept_patch_errors;
|
||||
use self::epiphany_mutation_routes::modeling_role_accept_patch_errors;
|
||||
use self::epiphany_mutation_routes::reorient_finding_code_refs;
|
||||
use self::epiphany_mutation_routes::reorient_finding_investigation_checkpoint;
|
||||
use self::epiphany_mutation_routes::reorient_finding_scratch;
|
||||
use self::epiphany_mutation_routes::role_finding_summary;
|
||||
use self::epiphany_runtime_results::latest_epiphany_runtime_link_for_binding;
|
||||
use self::epiphany_runtime_results::load_epiphany_reorient_result_from_runtime_spine_job;
|
||||
use self::epiphany_runtime_results::load_epiphany_reorient_result_snapshot;
|
||||
use self::epiphany_runtime_results::load_epiphany_role_result_from_runtime_spine_job;
|
||||
use self::epiphany_runtime_results::load_epiphany_role_result_snapshot;
|
||||
use self::epiphany_runtime_results::reorient_finding_runtime_job_id;
|
||||
use self::epiphany_runtime_results::reorient_finding_runtime_result_id;
|
||||
use self::epiphany_runtime_results::role_finding_runtime_job_id;
|
||||
use self::epiphany_runtime_results::role_finding_runtime_result_id;
|
||||
use self::epiphany_state_helpers::client_visible_live_thread_epiphany_state;
|
||||
use self::epiphany_state_helpers::core_state_patch_from_protocol;
|
||||
use self::epiphany_state_helpers::epiphany_imagination_finding_has_reviewable_state_patch;
|
||||
|
|
@ -378,7 +366,6 @@ use codex_core::find_archived_thread_path_by_id_str;
|
|||
use codex_core::find_thread_name_by_id;
|
||||
use codex_core::find_thread_names_by_ids;
|
||||
use codex_core::find_thread_path_by_id_str;
|
||||
use codex_core::latest_epiphany_state_from_rollout_items;
|
||||
use codex_core::path_utils;
|
||||
use codex_core::plugins::MarketplaceAddError;
|
||||
use codex_core::plugins::MarketplaceRemoveError;
|
||||
|
|
@ -457,7 +444,6 @@ use codex_protocol::protocol::EpiphanyInvestigationCheckpoint;
|
|||
use codex_protocol::protocol::EpiphanyInvestigationDisposition;
|
||||
use codex_protocol::protocol::EpiphanyRetrievalState;
|
||||
use codex_protocol::protocol::EpiphanyRetrievalStatus;
|
||||
use codex_protocol::protocol::EpiphanyRuntimeLink;
|
||||
use codex_protocol::protocol::EpiphanyScratchPad;
|
||||
use codex_protocol::protocol::EpiphanyThreadState;
|
||||
use codex_protocol::protocol::EventMsg;
|
||||
|
|
@ -552,29 +538,28 @@ use epiphany_codex_bridge::reorient::map_epiphany_reorient;
|
|||
use epiphany_codex_bridge::results::map_core_role_result_role_id;
|
||||
use epiphany_codex_bridge::results::map_epiphany_reorient_finding;
|
||||
use epiphany_codex_bridge::results::map_epiphany_role_finding;
|
||||
use epiphany_codex_bridge::results::map_protocol_reorient_finding;
|
||||
use epiphany_codex_bridge::results::map_protocol_role_finding;
|
||||
use epiphany_codex_bridge::results::render_epiphany_reorient_result_note;
|
||||
use epiphany_codex_bridge::results::render_epiphany_role_result_note;
|
||||
use epiphany_codex_bridge::retrieve::map_epiphany_retrieve_index_summary;
|
||||
use epiphany_codex_bridge::retrieve::map_epiphany_retrieve_response;
|
||||
use epiphany_codex_bridge::runtime_results::latest_epiphany_runtime_link_for_binding;
|
||||
use epiphany_codex_bridge::runtime_results::load_epiphany_reorient_result_from_runtime_spine_job;
|
||||
use epiphany_codex_bridge::runtime_results::load_epiphany_reorient_result_snapshot;
|
||||
use epiphany_codex_bridge::runtime_results::load_epiphany_role_result_from_runtime_spine_job;
|
||||
use epiphany_codex_bridge::runtime_results::load_epiphany_role_result_snapshot;
|
||||
use epiphany_codex_bridge::runtime_results::reorient_finding_runtime_job_id;
|
||||
use epiphany_codex_bridge::runtime_results::reorient_finding_runtime_result_id;
|
||||
use epiphany_codex_bridge::runtime_results::role_finding_runtime_job_id;
|
||||
use epiphany_codex_bridge::runtime_results::role_finding_runtime_result_id;
|
||||
use epiphany_codex_bridge::scene::map_core_epiphany_scene_action;
|
||||
use epiphany_codex_bridge::scene::map_epiphany_scene;
|
||||
use epiphany_core::EpiphanyReorientAcceptanceFinding;
|
||||
use epiphany_core::EpiphanyRoleAcceptanceFinding;
|
||||
use epiphany_core::EpiphanyRoleStatePatchDocument;
|
||||
use epiphany_core::EpiphanyRuntimeJobSnapshot;
|
||||
use epiphany_core::EpiphanyRuntimeJobStatus;
|
||||
use epiphany_core::EpiphanySceneInput;
|
||||
use epiphany_core::EpiphanyWorkerLaunchDocument;
|
||||
use epiphany_core::build_reorient_acceptance_bundle;
|
||||
use epiphany_core::build_role_acceptance_bundle;
|
||||
use epiphany_core::derive_scene;
|
||||
use epiphany_core::imagination_role_state_patch_policy_errors;
|
||||
use epiphany_core::interpret_reorient_runtime_job_result;
|
||||
use epiphany_core::interpret_role_runtime_job_result;
|
||||
use epiphany_core::modeling_role_state_patch_policy_errors;
|
||||
use epiphany_core::runtime_job_snapshot;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use std::io::Error as IoError;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,16 @@
|
|||
use super::*;
|
||||
use std::path::Path;
|
||||
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleFinding;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleId;
|
||||
use codex_app_server_protocol::ThreadEpiphanyUpdatePatch;
|
||||
use codex_core::CodexThread;
|
||||
use codex_core::latest_epiphany_state_from_rollout_items;
|
||||
use codex_protocol::protocol::EpiphanyThreadState;
|
||||
use epiphany_core::EpiphanyRoleStatePatchDocument;
|
||||
|
||||
use super::epiphany_mutation_routes::imagination_role_accept_patch_errors;
|
||||
use super::epiphany_mutation_routes::modeling_role_accept_patch_errors;
|
||||
use super::read_rollout_items_from_rollout;
|
||||
|
||||
pub(super) async fn live_thread_epiphany_state(
|
||||
thread: &CodexThread,
|
||||
|
|
|
|||
Reference in a new issue