From d6d3d383754aff3e248698c563e5bac9bab30169 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 20 May 2026 14:18:28 +0100 Subject: [PATCH] Move result projection to protocol edge --- epiphany-codex-bridge/src/mutation.rs | 25 ---- epiphany-codex-bridge/src/protocol_edge.rs | 128 ++++++++++++++++++ epiphany-codex-bridge/src/results.rs | 123 ----------------- epiphany-codex-bridge/src/view.rs | 13 +- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 144181 -> 144433 bytes state/map.yaml | 4 + .../epiphany_mutation_routes.rs | 16 +-- .../epiphany_read_routes.rs | 4 +- 9 files changed, 150 insertions(+), 164 deletions(-) diff --git a/epiphany-codex-bridge/src/mutation.rs b/epiphany-codex-bridge/src/mutation.rs index a8b6fbb9..f7d98581 100644 --- a/epiphany-codex-bridge/src/mutation.rs +++ b/epiphany-codex-bridge/src/mutation.rs @@ -1,7 +1,6 @@ use codex_app_server_protocol::ThreadEpiphanyStateUpdatedField; use codex_app_server_protocol::ThreadEpiphanyStateUpdatedNotification; use codex_app_server_protocol::ThreadEpiphanyStateUpdatedSource; -use codex_app_server_protocol::ThreadEpiphanyUpdatePatch; use epiphany_core::EpiphanyReorientAcceptanceFinding; use epiphany_core::EpiphanyReorientFindingInterpretation as CoreEpiphanyReorientFinding; use epiphany_core::EpiphanyRoleAcceptanceFinding; @@ -42,30 +41,6 @@ pub fn parse_core_role_finding_state_patch( .ok_or_else(|| "completed role finding did not include a reviewable statePatch".to_string()) } -pub fn protocol_patch_from_core( - patch: EpiphanyRoleStatePatchDocument, -) -> ThreadEpiphanyUpdatePatch { - ThreadEpiphanyUpdatePatch { - objective: patch.objective, - active_subgoal_id: patch.active_subgoal_id, - subgoals: patch.subgoals, - invariants: patch.invariants, - graphs: patch.graphs, - graph_frontier: patch.graph_frontier, - graph_checkpoint: patch.graph_checkpoint, - scratch: patch.scratch, - investigation_checkpoint: patch.investigation_checkpoint, - job_bindings: patch.job_bindings, - acceptance_receipts: patch.acceptance_receipts, - runtime_links: patch.runtime_links, - observations: patch.observations, - evidence: patch.evidence, - churn: patch.churn, - mode: patch.mode, - planning: patch.planning, - } -} - pub fn state_update_from_core_patch( expected_revision: Option, patch: EpiphanyRoleStatePatchDocument, diff --git a/epiphany-codex-bridge/src/protocol_edge.rs b/epiphany-codex-bridge/src/protocol_edge.rs index d9d796b4..75f8f2c0 100644 --- a/epiphany-codex-bridge/src/protocol_edge.rs +++ b/epiphany-codex-bridge/src/protocol_edge.rs @@ -34,6 +34,7 @@ use codex_app_server_protocol::ThreadEpiphanyPressureStatus; use codex_app_server_protocol::ThreadEpiphanyReorientAction; use codex_app_server_protocol::ThreadEpiphanyReorientCheckpointStatus; use codex_app_server_protocol::ThreadEpiphanyReorientDecision; +use codex_app_server_protocol::ThreadEpiphanyReorientFinding; use codex_app_server_protocol::ThreadEpiphanyReorientReason; use codex_app_server_protocol::ThreadEpiphanyReorientResultStatus; use codex_app_server_protocol::ThreadEpiphanyReorientSource; @@ -41,7 +42,11 @@ use codex_app_server_protocol::ThreadEpiphanyReorientStateStatus; use codex_app_server_protocol::ThreadEpiphanyReorientWorkerLaunchDocument; use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshness; use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshnessStatus; +use codex_app_server_protocol::ThreadEpiphanyRoleFinding; +use codex_app_server_protocol::ThreadEpiphanyRoleId; use codex_app_server_protocol::ThreadEpiphanyRoleResultStatus; +use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceReview; +use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceStatus; use codex_app_server_protocol::ThreadEpiphanyRoleWorkerLaunchDocument; use codex_app_server_protocol::ThreadEpiphanyUpdatePatch; use codex_app_server_protocol::ThreadEpiphanyViewLens; @@ -57,7 +62,12 @@ use epiphany_core::EpiphanyPressure; use epiphany_core::EpiphanyPressureBasis; use epiphany_core::EpiphanyPressureLevel; use epiphany_core::EpiphanyPressureStatus; +use epiphany_core::EpiphanyReorientFindingInterpretation; use epiphany_core::EpiphanyReorientWorkerLaunchDocument; +use epiphany_core::EpiphanyRoleFindingInterpretation; +use epiphany_core::EpiphanyRoleResultRoleId; +use epiphany_core::EpiphanyRoleSelfPersistenceReview; +use epiphany_core::EpiphanyRoleSelfPersistenceStatus; use epiphany_core::EpiphanyRoleStatePatchDocument; use epiphany_core::EpiphanyRoleWorkerLaunchDocument; use epiphany_core::EpiphanyViewLens; @@ -180,6 +190,103 @@ pub fn protocol_update_patch_to_core( } } +pub fn protocol_patch_from_core( + patch: EpiphanyRoleStatePatchDocument, +) -> ThreadEpiphanyUpdatePatch { + ThreadEpiphanyUpdatePatch { + objective: patch.objective, + active_subgoal_id: patch.active_subgoal_id, + subgoals: patch.subgoals, + invariants: patch.invariants, + graphs: patch.graphs, + graph_frontier: patch.graph_frontier, + graph_checkpoint: patch.graph_checkpoint, + scratch: patch.scratch, + investigation_checkpoint: patch.investigation_checkpoint, + job_bindings: patch.job_bindings, + acceptance_receipts: patch.acceptance_receipts, + runtime_links: patch.runtime_links, + observations: patch.observations, + evidence: patch.evidence, + churn: patch.churn, + mode: patch.mode, + planning: patch.planning, + } +} + +pub fn protocol_role_id_to_core(role_id: ThreadEpiphanyRoleId) -> EpiphanyRoleResultRoleId { + match role_id { + ThreadEpiphanyRoleId::Implementation => EpiphanyRoleResultRoleId::Implementation, + ThreadEpiphanyRoleId::Imagination => EpiphanyRoleResultRoleId::Imagination, + ThreadEpiphanyRoleId::Modeling => EpiphanyRoleResultRoleId::Modeling, + ThreadEpiphanyRoleId::Verification => EpiphanyRoleResultRoleId::Verification, + ThreadEpiphanyRoleId::Reorientation => EpiphanyRoleResultRoleId::Reorientation, + } +} + +pub fn protocol_role_id_from_core(role_id: EpiphanyRoleResultRoleId) -> ThreadEpiphanyRoleId { + match role_id { + EpiphanyRoleResultRoleId::Implementation => ThreadEpiphanyRoleId::Implementation, + EpiphanyRoleResultRoleId::Imagination => ThreadEpiphanyRoleId::Imagination, + EpiphanyRoleResultRoleId::Modeling => ThreadEpiphanyRoleId::Modeling, + EpiphanyRoleResultRoleId::Verification => ThreadEpiphanyRoleId::Verification, + EpiphanyRoleResultRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation, + } +} + +pub fn protocol_reorient_finding( + finding: EpiphanyReorientFindingInterpretation, +) -> ThreadEpiphanyReorientFinding { + ThreadEpiphanyReorientFinding { + mode: finding.mode, + summary: finding.summary, + next_safe_move: finding.next_safe_move, + checkpoint_still_valid: finding.checkpoint_still_valid, + files_inspected: finding.files_inspected, + frontier_node_ids: finding.frontier_node_ids, + evidence_ids: finding.evidence_ids, + artifact_refs: finding.artifact_refs, + runtime_result_id: finding.runtime_result_id, + runtime_job_id: finding.runtime_job_id, + job_error: finding.job_error, + item_error: finding.item_error, + } +} + +pub fn protocol_role_finding( + role_id: ThreadEpiphanyRoleId, + finding: EpiphanyRoleFindingInterpretation, +) -> ThreadEpiphanyRoleFinding { + let state_patch = finding.state_patch.map(protocol_patch_from_core); + ThreadEpiphanyRoleFinding { + role_id, + verdict: finding.verdict, + summary: finding.summary, + next_safe_move: finding.next_safe_move, + checkpoint_summary: finding.checkpoint_summary, + scratch_summary: finding.scratch_summary, + files_inspected: finding.files_inspected, + frontier_node_ids: finding.frontier_node_ids, + evidence_ids: finding.evidence_ids, + artifact_refs: finding.artifact_refs, + runtime_result_id: finding.runtime_result_id, + runtime_job_id: finding.runtime_job_id, + open_questions: finding.open_questions, + evidence_gaps: finding.evidence_gaps, + risks: finding.risks, + state_patch, + self_patch: finding.self_patch.map(|patch| { + serde_json::to_value(patch) + .expect("AgentSelfPatch is a serializable protocol projection") + }), + self_persistence: finding + .self_persistence + .map(protocol_self_persistence_review), + job_error: finding.job_error, + item_error: finding.item_error, + } +} + pub fn protocol_freshness_response_from_surface( surface: EpiphanyFreshnessSurface, ) -> ThreadEpiphanyFreshnessResponse { @@ -581,3 +688,24 @@ fn protocol_reorient_reason(reason: EpiphanyReorientReason) -> ThreadEpiphanyReo } } } + +fn protocol_self_persistence_review( + review: EpiphanyRoleSelfPersistenceReview, +) -> ThreadEpiphanyRoleSelfPersistenceReview { + ThreadEpiphanyRoleSelfPersistenceReview { + status: match review.status { + EpiphanyRoleSelfPersistenceStatus::Missing => { + ThreadEpiphanyRoleSelfPersistenceStatus::Missing + } + EpiphanyRoleSelfPersistenceStatus::Accepted => { + ThreadEpiphanyRoleSelfPersistenceStatus::Accepted + } + EpiphanyRoleSelfPersistenceStatus::Rejected => { + ThreadEpiphanyRoleSelfPersistenceStatus::Rejected + } + }, + target_agent_id: review.target_agent_id, + target_path: review.target_path, + reasons: review.reasons, + } +} diff --git a/epiphany-codex-bridge/src/results.rs b/epiphany-codex-bridge/src/results.rs index c94d6402..ba0e742b 100644 --- a/epiphany-codex-bridge/src/results.rs +++ b/epiphany-codex-bridge/src/results.rs @@ -1,9 +1,3 @@ -use codex_app_server_protocol::ThreadEpiphanyReorientFinding; -use codex_app_server_protocol::ThreadEpiphanyRoleFinding; -use codex_app_server_protocol::ThreadEpiphanyRoleId; -use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceReview; -use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceStatus; -use codex_app_server_protocol::ThreadEpiphanyUpdatePatch; use epiphany_core::EpiphanyCoordinatorRoleResultStatus as CoreEpiphanyCoordinatorRoleResultStatus; use epiphany_core::EpiphanyCrrcResultStatus as CoreEpiphanyCrrcResultStatus; use epiphany_core::EpiphanyReorientFindingInterpretation; @@ -11,123 +5,6 @@ use epiphany_core::EpiphanyRoleFindingInterpretation; use epiphany_core::EpiphanyRoleResultRoleId; use epiphany_core::EpiphanyRoleSelfPersistenceReview as CoreEpiphanyRoleSelfPersistenceReview; use epiphany_core::EpiphanyRoleSelfPersistenceStatus as CoreEpiphanyRoleSelfPersistenceStatus; -use epiphany_core::EpiphanyRoleStatePatchDocument; - -pub fn map_protocol_reorient_finding( - finding: EpiphanyReorientFindingInterpretation, -) -> ThreadEpiphanyReorientFinding { - ThreadEpiphanyReorientFinding { - mode: finding.mode, - summary: finding.summary, - next_safe_move: finding.next_safe_move, - checkpoint_still_valid: finding.checkpoint_still_valid, - files_inspected: finding.files_inspected, - frontier_node_ids: finding.frontier_node_ids, - evidence_ids: finding.evidence_ids, - artifact_refs: finding.artifact_refs, - runtime_result_id: finding.runtime_result_id, - runtime_job_id: finding.runtime_job_id, - job_error: finding.job_error, - item_error: finding.item_error, - } -} - -pub fn map_protocol_role_finding( - role_id: ThreadEpiphanyRoleId, - finding: EpiphanyRoleFindingInterpretation, -) -> ThreadEpiphanyRoleFinding { - let state_patch = finding.state_patch.map(map_protocol_update_patch); - ThreadEpiphanyRoleFinding { - role_id, - verdict: finding.verdict, - summary: finding.summary, - next_safe_move: finding.next_safe_move, - checkpoint_summary: finding.checkpoint_summary, - scratch_summary: finding.scratch_summary, - files_inspected: finding.files_inspected, - frontier_node_ids: finding.frontier_node_ids, - evidence_ids: finding.evidence_ids, - artifact_refs: finding.artifact_refs, - runtime_result_id: finding.runtime_result_id, - runtime_job_id: finding.runtime_job_id, - open_questions: finding.open_questions, - evidence_gaps: finding.evidence_gaps, - risks: finding.risks, - state_patch, - self_patch: finding.self_patch.map(|patch| { - serde_json::to_value(patch) - .expect("AgentSelfPatch is a serializable protocol projection") - }), - self_persistence: finding - .self_persistence - .map(map_protocol_role_self_persistence_review), - job_error: finding.job_error, - item_error: finding.item_error, - } -} - -fn map_protocol_update_patch(patch: EpiphanyRoleStatePatchDocument) -> ThreadEpiphanyUpdatePatch { - ThreadEpiphanyUpdatePatch { - objective: patch.objective, - active_subgoal_id: patch.active_subgoal_id, - subgoals: patch.subgoals, - invariants: patch.invariants, - graphs: patch.graphs, - graph_frontier: patch.graph_frontier, - graph_checkpoint: patch.graph_checkpoint, - scratch: patch.scratch, - investigation_checkpoint: patch.investigation_checkpoint, - job_bindings: patch.job_bindings, - acceptance_receipts: patch.acceptance_receipts, - runtime_links: patch.runtime_links, - observations: patch.observations, - evidence: patch.evidence, - churn: patch.churn, - mode: patch.mode, - planning: patch.planning, - } -} - -pub fn map_core_role_result_role_id(role_id: ThreadEpiphanyRoleId) -> EpiphanyRoleResultRoleId { - match role_id { - ThreadEpiphanyRoleId::Implementation => EpiphanyRoleResultRoleId::Implementation, - ThreadEpiphanyRoleId::Imagination => EpiphanyRoleResultRoleId::Imagination, - ThreadEpiphanyRoleId::Modeling => EpiphanyRoleResultRoleId::Modeling, - ThreadEpiphanyRoleId::Verification => EpiphanyRoleResultRoleId::Verification, - ThreadEpiphanyRoleId::Reorientation => EpiphanyRoleResultRoleId::Reorientation, - } -} - -pub fn map_protocol_role_result_role_id(role_id: EpiphanyRoleResultRoleId) -> ThreadEpiphanyRoleId { - match role_id { - EpiphanyRoleResultRoleId::Implementation => ThreadEpiphanyRoleId::Implementation, - EpiphanyRoleResultRoleId::Imagination => ThreadEpiphanyRoleId::Imagination, - EpiphanyRoleResultRoleId::Modeling => ThreadEpiphanyRoleId::Modeling, - EpiphanyRoleResultRoleId::Verification => ThreadEpiphanyRoleId::Verification, - EpiphanyRoleResultRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation, - } -} - -fn map_protocol_role_self_persistence_review( - review: CoreEpiphanyRoleSelfPersistenceReview, -) -> ThreadEpiphanyRoleSelfPersistenceReview { - ThreadEpiphanyRoleSelfPersistenceReview { - status: match review.status { - CoreEpiphanyRoleSelfPersistenceStatus::Missing => { - ThreadEpiphanyRoleSelfPersistenceStatus::Missing - } - CoreEpiphanyRoleSelfPersistenceStatus::Accepted => { - ThreadEpiphanyRoleSelfPersistenceStatus::Accepted - } - CoreEpiphanyRoleSelfPersistenceStatus::Rejected => { - ThreadEpiphanyRoleSelfPersistenceStatus::Rejected - } - }, - target_agent_id: review.target_agent_id, - target_path: review.target_path, - reasons: review.reasons, - } -} pub fn render_core_role_result_note( role_id: EpiphanyRoleResultRoleId, diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 88fb9abc..5176968a 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -37,14 +37,15 @@ use crate::pressure::derive_epiphany_pressure; use crate::pressure::map_epiphany_pressure; use crate::protocol_edge::protocol_job_from_surface; use crate::protocol_edge::protocol_reorient_decision; +use crate::protocol_edge::protocol_reorient_finding; use crate::protocol_edge::protocol_reorient_result_status; use crate::protocol_edge::protocol_reorient_state_status; +use crate::protocol_edge::protocol_role_finding; +use crate::protocol_edge::protocol_role_id_from_core; use crate::protocol_edge::protocol_role_result_status; use crate::reorient::EpiphanyFreshnessWatcherSnapshot; use crate::reorient::derive_epiphany_freshness_view; use crate::reorient::derive_epiphany_reorient; -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::scene::map_core_epiphany_scene_action; @@ -224,7 +225,7 @@ pub async fn map_epiphany_view_response( let reorient_finding = reorient_result .finding .clone() - .map(map_protocol_reorient_finding); + .map(protocol_reorient_finding); let reorient_result_note = reorient_result.note.clone(); let checkpoint_present = state .and_then(|state| state.investigation_checkpoint.as_ref()) @@ -450,7 +451,7 @@ 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 protocol_role_id = protocol_role_id_from_core(role_id); let protocol_source = map_protocol_roles_source(source); let Some(state) = state else { return ThreadEpiphanyRoleResultResponse { @@ -486,7 +487,7 @@ pub async fn map_epiphany_role_result_response( job, finding: result .finding - .map(|finding| crate::results::map_protocol_role_finding(protocol_role_id, finding)), + .map(|finding| protocol_role_finding(protocol_role_id, finding)), note: result.note, } } @@ -540,7 +541,7 @@ pub async fn map_epiphany_reorient_result_response( binding_id, status: protocol_reorient_result_status(result.status), job, - finding: result.finding.map(map_protocol_reorient_finding), + finding: result.finding.map(protocol_reorient_finding), note: result.note, } } diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 1bf4cf63..4abf58c7 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -84,6 +84,7 @@ remembers doctrine; the branch remembers the blade. - Runtime result loading is typed-only now. Role/reorient result status projection moved out of `runtime_results` and duplicate coordinator helpers into `protocol_edge`, so view and coordinator response builders share one Codex JSON-RPC status mapper. - Pressure projection is centralized too. `pressure.rs` derives typed `EpiphanyPressure`, coordinator consumes typed pressure signals, and `protocol_edge` owns the `ThreadEpiphanyPressure*` DTO mapping. - Reorientation derivation is typed-only too. `reorient.rs` no longer imports app-server protocol DTOs and no longer exposes the unused freshness DTO tuple; view/coordinator response builders call `protocol_edge` for reorient state/decision projection. +- Result projection moved to the edge. `results.rs` now renders typed result notes only; `protocol_edge` owns role-id request conversion plus role/reorient finding and state-patch projection for Codex JSON-RPC 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 f79f4dc5b01af79976002e7c1307d82960636711..67059169df9fca40d6499982233cedfc60c625b1 100644 GIT binary patch delta 259 zcmdn`jAP>qjtR<4#@{!p7BVs}Z=TNBKAn+q`*cR8PQ&S^6`6QB42`V}EvyX8CM%wi ztUnu+T3nh_qEJwjpOu?7mMhjPDpttLF9&k-Qc{8JlFEYA z6sROnq9nCgAwMst(i&t)Nq%yEPCVF%{PMhFg`)hNRNYLF>cZ00;u3}A{Jb)t86bNK za!QLQ2mTQAQ%KB9Q7A4+EJ@WZNGwUtKz2-8evyK6eoAVEf>*G=pKefqGsxnC{Ji4S WV!bU!21aJO2Bx}31|cwCMF9Yefn5>+ delta 52 zcmdn^f@AA5jtR<4M!z?z7BVs}Yo5;7KAn+q`*cR8PD9ZxMg~S^x(24YMg}2<##ROv IRwgD<0QxErW&i*H diff --git a/state/map.yaml b/state/map.yaml index 160ef735..2b1a7c81 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -414,6 +414,10 @@ current_status: `reorient.rs` no longer imports Codex app-server protocol DTOs, no longer exposes the unused freshness DTO tuple, and view/coordinator response builders use `protocol_edge` for reorient state/decision projection. + Result finding, role-id, and patch projection are now edge-owned too: + `results.rs` renders typed result notes only, while `protocol_edge` owns + role-id request conversion plus role/reorient finding and state-patch + projection for Codex JSON-RPC responses. 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 response/projection authority. Prioritize the next coordinator/view seam that still composes policy-shaped facts instead of merely loading host facts and projecting core surfaces; 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_mutation_routes.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs index de77ba44..0f3d5fcd 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs @@ -11,7 +11,6 @@ use epiphany_codex_bridge::launch::build_epiphany_job_launch_request; use epiphany_codex_bridge::launch::epiphany_role_binding_id; use epiphany_codex_bridge::mutation::epiphany_state_updated_notification; use epiphany_codex_bridge::mutation::map_protocol_state_updated_fields; -use epiphany_codex_bridge::mutation::protocol_patch_from_core; use epiphany_codex_bridge::mutation_service::EpiphanyThreadPromoteApplied; use epiphany_codex_bridge::mutation_service::apply_thread_epiphany_promote; use epiphany_codex_bridge::mutation_service::apply_thread_epiphany_reorient_accept; @@ -22,14 +21,15 @@ use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_job; use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_reorient; use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_role; use epiphany_codex_bridge::protocol_edge::protocol_job_from_surface; +use epiphany_codex_bridge::protocol_edge::protocol_patch_from_core; use epiphany_codex_bridge::protocol_edge::protocol_reorient_decision; +use epiphany_codex_bridge::protocol_edge::protocol_reorient_finding; use epiphany_codex_bridge::protocol_edge::protocol_reorient_source; use epiphany_codex_bridge::protocol_edge::protocol_reorient_state_status; +use epiphany_codex_bridge::protocol_edge::protocol_role_finding; +use epiphany_codex_bridge::protocol_edge::protocol_role_id_to_core; use epiphany_codex_bridge::protocol_edge::protocol_update_patch_to_core; use epiphany_codex_bridge::protocol_edge::protocol_worker_launch_document_to_core; -use epiphany_codex_bridge::results::map_core_role_result_role_id; -use epiphany_codex_bridge::results::map_protocol_reorient_finding; -use epiphany_codex_bridge::results::map_protocol_role_finding; use epiphany_codex_bridge::retrieve::epiphany_retrieval_state_for_paths; use epiphany_codex_bridge::retrieve::index_epiphany_retrieval_for_paths; use std::sync::Arc; @@ -104,7 +104,7 @@ impl CodexMessageProcessor { expected_revision, max_runtime_seconds, } = params; - let core_role_id = map_core_role_result_role_id(role_id); + let core_role_id = protocol_role_id_to_core(role_id); let (thread_uuid, loaded_thread) = match self.load_epiphany_thread(&request_id, &thread_id).await { @@ -176,7 +176,7 @@ impl CodexMessageProcessor { expected_revision, binding_id, } = params; - let core_role_id = map_core_role_result_role_id(role_id); + let core_role_id = protocol_role_id_to_core(role_id); let default_binding_id = match epiphany_role_binding_id(core_role_id) { Ok(binding_id) => binding_id, @@ -232,7 +232,7 @@ impl CodexMessageProcessor { accepted_observation_id: applied.accepted_observation_id, accepted_evidence_id: applied.accepted_evidence_id, applied_patch: protocol_patch_from_core(applied.applied_patch), - finding: map_protocol_role_finding(role_id, applied.finding), + finding: protocol_role_finding(role_id, applied.finding), }, ) .await; @@ -404,7 +404,7 @@ impl CodexMessageProcessor { accepted_receipt_id: applied.accepted_receipt_id, accepted_observation_id: applied.accepted_observation_id, accepted_evidence_id: applied.accepted_evidence_id, - finding: map_protocol_reorient_finding(applied.finding), + finding: protocol_reorient_finding(applied.finding), }, ) .await; 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 427324fb..30740361 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 @@ -15,8 +15,8 @@ use epiphany_codex_bridge::protocol_edge::protocol_context_params_to_core; use epiphany_codex_bridge::protocol_edge::protocol_distill_params_to_core; use epiphany_codex_bridge::protocol_edge::protocol_freshness_response_from_surface; use epiphany_codex_bridge::protocol_edge::protocol_graph_query_to_core; +use epiphany_codex_bridge::protocol_edge::protocol_role_id_to_core; use epiphany_codex_bridge::protocol_edge::protocol_view_lenses_to_core; -use epiphany_codex_bridge::results::map_core_role_result_role_id; use epiphany_codex_bridge::retrieve::epiphany_retrieval_state_for_paths; use epiphany_codex_bridge::retrieve::map_epiphany_retrieve_response; use epiphany_codex_bridge::retrieve::normalize_thread_epiphany_retrieve_query; @@ -159,7 +159,7 @@ impl CodexMessageProcessor { role_id, binding_id, } = params; - let core_role_id = map_core_role_result_role_id(role_id); + let core_role_id = protocol_role_id_to_core(role_id); let binding_id = match binding_id { Some(binding_id) => binding_id,