From 45ad254bab5f44d64d7dd189fdc03e6c78af97ef Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 20 May 2026 07:46:37 +0100 Subject: [PATCH] Keep coordinator note core-shaped --- epiphany-codex-bridge/src/coordinator.rs | 12 +++++----- epiphany-codex-bridge/src/launch.rs | 28 +++++++++-------------- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 138610 -> 138826 bytes state/map.yaml | 4 ++++ 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/epiphany-codex-bridge/src/coordinator.rs b/epiphany-codex-bridge/src/coordinator.rs index 6fd7ed4a..e012af6c 100644 --- a/epiphany-codex-bridge/src/coordinator.rs +++ b/epiphany-codex-bridge/src/coordinator.rs @@ -404,12 +404,12 @@ pub async fn derive_epiphany_coordinator_status( reorient_finding_accepted, ); let note = render_epiphany_coordinator_note( - map_protocol_crrc_action(recommendation.action), - map_protocol_pressure_level(pressure.level), - map_protocol_coordinator_role_result_status(modeling_result_status), - map_protocol_coordinator_role_result_status(verification_result_status), - reorient_result_status, - map_protocol_coordinator_action(decision.action), + recommendation.action, + pressure.level, + modeling_result_status, + verification_result_status, + source_signals.reorient_result_status, + decision.action, ); EpiphanyCoordinatorStatus { diff --git a/epiphany-codex-bridge/src/launch.rs b/epiphany-codex-bridge/src/launch.rs index 521bf02d..2bede36b 100644 --- a/epiphany-codex-bridge/src/launch.rs +++ b/epiphany-codex-bridge/src/launch.rs @@ -1,11 +1,15 @@ use std::path::Path; use std::sync::OnceLock; -use codex_app_server_protocol::ThreadEpiphanyPressureLevel; use codex_app_server_protocol::ThreadEpiphanyReorientWorkerLaunchDocument; use codex_app_server_protocol::ThreadEpiphanyRoleWorkerLaunchDocument; use codex_app_server_protocol::ThreadEpiphanyWorkerLaunchDocument; +use epiphany_core::EpiphanyCoordinatorAction as CoreEpiphanyCoordinatorAction; +use epiphany_core::EpiphanyCoordinatorRoleResultStatus as CoreEpiphanyCoordinatorRoleResultStatus; +use epiphany_core::EpiphanyCrrcAction as CoreEpiphanyCrrcAction; +use epiphany_core::EpiphanyCrrcResultStatus as CoreEpiphanyCrrcResultStatus; use epiphany_core::EpiphanyJobLaunchRequest; +use epiphany_core::EpiphanyPressureLevel as CoreEpiphanyPressureLevel; use epiphany_core::EpiphanyReorientAction as CoreEpiphanyReorientAction; use epiphany_core::EpiphanyReorientDecision as CoreEpiphanyReorientDecision; use epiphany_core::EpiphanyReorientFreshnessStatus as CoreEpiphanyReorientFreshnessStatus; @@ -679,12 +683,12 @@ fn map_core_reorient_worker_launch_document( } pub fn render_epiphany_coordinator_note( - crrc_action: codex_app_server_protocol::ThreadEpiphanyCrrcAction, - pressure_level: ThreadEpiphanyPressureLevel, - modeling_result_status: codex_app_server_protocol::ThreadEpiphanyRoleResultStatus, - verification_result_status: codex_app_server_protocol::ThreadEpiphanyRoleResultStatus, - reorient_result_status: codex_app_server_protocol::ThreadEpiphanyReorientResultStatus, - coordinator_action: codex_app_server_protocol::ThreadEpiphanyCoordinatorAction, + crrc_action: CoreEpiphanyCrrcAction, + pressure_level: CoreEpiphanyPressureLevel, + modeling_result_status: CoreEpiphanyCoordinatorRoleResultStatus, + verification_result_status: CoreEpiphanyCoordinatorRoleResultStatus, + reorient_result_status: CoreEpiphanyCrrcResultStatus, + coordinator_action: CoreEpiphanyCoordinatorAction, ) -> String { let template = epiphany_agent_prompt_with_memory( &epiphany_specialist_prompt_config() @@ -790,13 +794,3 @@ fn reorient_freshness_status_label(status: CoreEpiphanyReorientFreshnessStatus) CoreEpiphanyReorientFreshnessStatus::Changed => "changed", } } - -pub fn pressure_level_label(level: ThreadEpiphanyPressureLevel) -> &'static str { - match level { - ThreadEpiphanyPressureLevel::Unknown => "unknown", - ThreadEpiphanyPressureLevel::Low => "low", - ThreadEpiphanyPressureLevel::Elevated => "elevated", - ThreadEpiphanyPressureLevel::High => "high", - ThreadEpiphanyPressureLevel::Critical => "critical", - } -} diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 78135f13..bdbb5cea 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -65,6 +65,7 @@ remembers doctrine; the branch remembers the blade. - Role launch, role accept, and role-result runtime lookup now use core `EpiphanyRoleResultRoleId` inside the bridge. App-server maps `ThreadEpiphanyRoleId` at the JSON-RPC boundary and keeps it only for legacy request/response shape. - Reorient launch service results now use typed `EpiphanySurfaceSource`; app-server projects it into `ThreadEpiphanyReorientSource` only for the legacy launch response. - Generic job launch now converts protocol `ThreadEpiphanyWorkerLaunchDocument` cargo at the app-server edge before building the core `EpiphanyJobLaunchRequest`; the bridge launch builder takes a typed `EpiphanyWorkerLaunchDocument`. +- Coordinator note rendering now consumes core CRRC/coordinator actions, pressure, and role/reorient result statuses. `ThreadEpiphany*` status/action DTOs are no longer the native shape for that prompt/text policy helper. - 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 fa71178ad06eba282ff9637cfb089c911b9b3d79..9fedf1feb65e74333ad52d06fd0b0e0f35980208 100644 GIT binary patch delta 213 zcmeygi{sQDjtR<4asnGw3mF+FHcw}4pU%j*eL5r4F=>%0JBkUzC!WmspZtq>z_ilB$qgT4JS8l$w{4S~NMqOw=bHESi^Ju8^Fc zS6rH#S`1_qr7AcF1v%>{BXsK*6r~mymlmb!1L@M75{2TD#FEltpz_ST;*!+F6ove> g>GK&GB{UThlS?x5^YkGK6kJ05i}ki(y3afc0Q)IO?f?J) delta 52 zcmX@LhvU;OjtR<4vKAXv3mF+FG*4%2pU%j*eL5r4F=^2)Mg~S^x(24YMg}1UW>zK! IR;C6~0M`N!m;e9( diff --git a/state/map.yaml b/state/map.yaml index 35c794a8..7c7b14b3 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -349,6 +349,10 @@ current_status: to `ThreadEpiphanyReorientSource` only for the legacy response. Generic job launch now converts protocol `ThreadEpiphanyWorkerLaunchDocument` cargo at the app-server edge before building the core `EpiphanyJobLaunchRequest`. + Coordinator note rendering now consumes core CRRC/coordinator actions, + pressure, and role/reorient result statuses instead of protocol + `ThreadEpiphany*` action/status DTOs, so prompt/text policy no longer + treats JSON-RPC enums as its native fact shape. The bridge still depends on vendored Codex for app-server protocol DTOs and absolute path validation, so the purification is not done. next_action: Continue Codex starvation and CultNet liberation by cutting bridge-internal `ThreadEpiphany*` authority. Prioritize role-result/reorient-result DTO coupling next: derive typed CultNet surfaces first, push JSON-RPC projection into app-server, and keep MCP/OpenAI JSON only at their true protocol/text edges. Do not add compatibility adapters unless they protect a named ownership invariant.