From 13731f632f41cacaa3c6b4b1e8610b1ae39310ae Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 20 May 2026 07:54:00 +0100 Subject: [PATCH] Keep role result readback core-shaped --- epiphany-codex-bridge/src/view.rs | 22 ++++++++---------- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 139091 -> 139321 bytes state/map.yaml | 4 +++- .../epiphany_read_routes.rs | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 70bdc720..2248444f 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -5,6 +5,7 @@ use epiphany_core::EpiphanyContextParams; use epiphany_core::EpiphanyDistillInput; use epiphany_core::EpiphanyGraphQuery; use epiphany_core::EpiphanyMapProposalInput; +use epiphany_core::EpiphanyRoleResultRoleId; use epiphany_core::EpiphanySceneInput; use epiphany_core::EpiphanyTokenUsageSnapshot; use epiphany_core::derive_scene; @@ -36,8 +37,8 @@ use crate::reorient::derive_epiphany_freshness_view; use crate::reorient::derive_epiphany_reorient; use crate::reorient::map_protocol_reorient_decision; use crate::reorient::map_protocol_reorient_state_status; -use crate::results::map_core_role_result_role_id; use crate::results::map_protocol_reorient_finding; +use crate::results::map_protocol_role_result_role_id; use crate::runtime_results::load_core_epiphany_reorient_result_snapshot; use crate::runtime_results::load_core_epiphany_role_result_snapshot; use crate::runtime_results::map_protocol_reorient_result_status; @@ -448,7 +449,7 @@ pub async fn map_epiphany_view_response( pub struct EpiphanyRoleResultResponseInput<'a> { pub thread_id: String, - pub role_id: ThreadEpiphanyRoleId, + pub role_id: EpiphanyRoleResultRoleId, pub source: ThreadEpiphanyRolesSource, pub binding_id: String, pub state: Option<&'a EpiphanyThreadState>, @@ -466,10 +467,11 @@ pub async fn map_epiphany_role_result_response( state, runtime_store_path, } = input; + let protocol_role_id = map_protocol_role_result_role_id(role_id); let Some(state) = state else { return ThreadEpiphanyRoleResultResponse { thread_id, - role_id, + role_id: protocol_role_id, source, state_status: ThreadEpiphanyReorientStateStatus::Missing, state_revision: None, @@ -485,17 +487,13 @@ pub async fn map_epiphany_role_result_response( .into_iter() .find(|job| job.id == binding_id) .map(map_core_epiphany_job_view); - let result = load_core_epiphany_role_result_snapshot( - state, - runtime_store_path, - map_core_role_result_role_id(role_id), - &binding_id, - ) - .await; + let result = + load_core_epiphany_role_result_snapshot(state, runtime_store_path, role_id, &binding_id) + .await; ThreadEpiphanyRoleResultResponse { thread_id, - role_id, + role_id: protocol_role_id, source, state_status: ThreadEpiphanyReorientStateStatus::Ready, state_revision: Some(state.revision), @@ -504,7 +502,7 @@ pub async fn map_epiphany_role_result_response( job, finding: result .finding - .map(|finding| crate::results::map_protocol_role_finding(role_id, finding)), + .map(|finding| crate::results::map_protocol_role_finding(protocol_role_id, finding)), note: result.note, } } diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 5da10bfa..0e4697f5 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -67,6 +67,7 @@ remembers doctrine; the branch remembers the blade. - 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. - Context and graph-query response builders now take core `EpiphanyContextParams` / `EpiphanyGraphQuery` documents. App-server read routes convert `ThreadEpiphanyContextParams` / `ThreadEpiphanyGraphQuery` at the JSON-RPC wall before invoking bridge derivation. +- Role-result response assembly now takes core `EpiphanyRoleResultRoleId`; `ThreadEpiphanyRoleId` is reconstructed only for the legacy response payload and finding projection. - 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 b2cf9a2607f86b28e39b74c3bf79837436d081d8..826c6e4d314c12e6108b3ef2a01890b5a8a480c9 100644 GIT binary patch delta 200 zcmcb-k7MTnjtMG^|2L`@GBQqXp3c}losn_-bVjD-vLaJ<8W|Xw=^B{o8X1Hbm|2+` zTbWE3{LCmNwLK_5Csns7wYW5=M4>1(F(oN6Ia?vQw8UzR zi9%j}xk7ScQBh`U@pNrzCOKtmg^&!8Cf9<@f{etxN|0fmDGHgzK%