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 b2cf9a26..826c6e4d 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index fea54821..5d874f79 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -355,7 +355,9 @@ current_status: treats JSON-RPC enums as its native fact shape. Context and graph-query response builders now receive core `EpiphanyContextParams` / `EpiphanyGraphQuery`; app-server read routes convert JSON-RPC request cargo - before invoking the bridge. + before invoking the bridge. Role-result response assembly now takes core + `EpiphanyRoleResultRoleId` and maps back to `ThreadEpiphanyRoleId` only + while shaping the legacy JSON-RPC response. 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. diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs index d631246f..5ab62712 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs @@ -212,7 +212,7 @@ impl CodexMessageProcessor { }; let response = map_epiphany_role_result_response(EpiphanyRoleResultResponseInput { thread_id: thread_uuid.to_string(), - role_id, + role_id: core_role_id, source, binding_id, state: thread.epiphany_state.as_ref(),