From e0ac14bc26670d5c84af0959e1f00080e8634cc7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 20 May 2026 08:12:18 +0100 Subject: [PATCH] Keep coordinator result status core-shaped --- epiphany-codex-bridge/src/coordinator.rs | 30 +++-------------------- epiphany-codex-bridge/src/view.rs | 2 +- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 140230 -> 140469 bytes state/map.yaml | 4 ++- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/epiphany-codex-bridge/src/coordinator.rs b/epiphany-codex-bridge/src/coordinator.rs index e012af6c..e62c0450 100644 --- a/epiphany-codex-bridge/src/coordinator.rs +++ b/epiphany-codex-bridge/src/coordinator.rs @@ -118,30 +118,6 @@ fn map_core_crrc_reorient_action( } } -pub fn map_core_crrc_result_status( - status: ThreadEpiphanyReorientResultStatus, -) -> CoreEpiphanyCrrcResultStatus { - match status { - ThreadEpiphanyReorientResultStatus::MissingState => { - CoreEpiphanyCrrcResultStatus::MissingState - } - ThreadEpiphanyReorientResultStatus::MissingBinding => { - CoreEpiphanyCrrcResultStatus::MissingBinding - } - ThreadEpiphanyReorientResultStatus::BackendUnavailable => { - CoreEpiphanyCrrcResultStatus::BackendUnavailable - } - ThreadEpiphanyReorientResultStatus::BackendMissing => { - CoreEpiphanyCrrcResultStatus::BackendMissing - } - ThreadEpiphanyReorientResultStatus::Pending => CoreEpiphanyCrrcResultStatus::Pending, - ThreadEpiphanyReorientResultStatus::Running => CoreEpiphanyCrrcResultStatus::Running, - ThreadEpiphanyReorientResultStatus::Completed => CoreEpiphanyCrrcResultStatus::Completed, - ThreadEpiphanyReorientResultStatus::Failed => CoreEpiphanyCrrcResultStatus::Failed, - ThreadEpiphanyReorientResultStatus::Cancelled => CoreEpiphanyCrrcResultStatus::Cancelled, - } -} - fn map_protocol_coordinator_source_signals( signals: EpiphanyCoordinatorSourceSignals, ) -> ThreadEpiphanyCoordinatorSignals { @@ -287,7 +263,7 @@ pub async fn derive_epiphany_coordinator_status( recommendation: &CoreEpiphanyCrrcRecommendation, roles: Vec, reorient_decision: Option<&CoreEpiphanyReorientDecision>, - reorient_result_status: ThreadEpiphanyReorientResultStatus, + reorient_result_status: CoreEpiphanyCrrcResultStatus, reorient_finding: Option<&CoreEpiphanyReorientFinding>, checkpoint_present: bool, ) -> EpiphanyCoordinatorStatus { @@ -383,7 +359,7 @@ pub async fn derive_epiphany_coordinator_status( crrc_action: recommendation.action, modeling_result_status, verification_result_status, - reorient_result_status: map_core_crrc_result_status(reorient_result_status), + reorient_result_status, }; let decision = map_epiphany_coordinator( state_status, @@ -561,7 +537,7 @@ pub async fn select_epiphany_coordinator_automation( &crrc_recommendation, roles.roles, Some(&reorient_decision), - map_protocol_crrc_result_status(reorient_result.status), + reorient_result.status, reorient_result.finding.as_ref(), input.state.investigation_checkpoint.as_ref().is_some(), ) diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 578ab067..62824996 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -345,7 +345,7 @@ pub async fn map_epiphany_view_response( recommendation, roles.roles.clone(), core_reorient_decision.as_ref(), - reorient_result_status, + reorient_result.status, reorient_result.finding.as_ref(), checkpoint_present, ) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 7f90d0be..b471b588 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -72,6 +72,7 @@ remembers doctrine; the branch remembers the blade. - Role/reorient result response inputs now use core `EpiphanySurfaceSource`; `ThreadEpiphanyRolesSource` / `ThreadEpiphanyReorientSource` are response projection only. - Changed-field derivation now inspects typed `EpiphanyRoleStatePatchDocument` directly. The bridge no longer converts typed patches back into `ThreadEpiphanyUpdatePatch` merely to calculate changed fields. - View-lens orchestration now uses bridge-native `EpiphanyViewLens` selectors. App-server converts `ThreadEpiphanyViewLens` at the request wall, and the bridge maps back only for the legacy response echo. +- Coordinator status derivation now receives core `EpiphanyCrrcResultStatus` for reorient result state; `ThreadEpiphanyReorientResultStatus` is projection-only for coordinator/view responses. - MCP remains JSON because MCP is a JSON protocol. The latest processor cut only moved MCP refresh/OAuth/status/resource/tool-call route handling into `codex_message_processor/mcp_routes.rs`, reducing the root processor to about 8,977 lines; it did not claim MCP payloads are CultNet or make MCP an Epiphany-owned runtime contract. - Codex account auth route handling remains in vendored Codex but now lives in `codex_message_processor/auth_routes.rs`: API-key login, ChatGPT browser/device-code/external-token login, logout, auth status, account, rate limits, and add-credits nudge handling. This preserves Codex ownership of subscription auth while cutting the root processor to about 8,094 lines. - One-off command execution and command stream write/resize/terminate route handling now live in `codex_message_processor/command_routes.rs`; `CommandExecManager` remains the lifecycle owner, while the root processor is about 7,800 lines. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 7ab30195ae8ff568ead5923cca409123dc9e6864..2a74f396b38cd8c62933a984dc2e1d003f0a07a3 100644 GIT binary patch delta 247 zcmX?hoMY=rjtR<4D%BfR3mF+_G*4%2pU%j*eL5qPl#e2If|V zhE}GNH%^q2Kj567UzC!WmspZtq)=RvSW;T7kX%|~rI3 zl$x9h6bCBGFG^K#Eyyg$NX)BrE-Fe6N-ZwUDG7!ckp?uaC^f$*Gc~US$N