From bd3e3cbb706cfedec9835eb1323d2ac6acf2b531 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 03:57:22 +0100 Subject: [PATCH] Move Epiphany notification shaping to bridge --- epiphany-codex-bridge/src/mutation.rs | 18 ++++ notes/fresh-workspace-handoff.md | 7 +- state/ledgers.msgpack | Bin 79408 -> 79783 bytes state/map.yaml | 4 +- .../epiphany_mutation_routes.rs | 81 +++++++++--------- 5 files changed, 67 insertions(+), 43 deletions(-) diff --git a/epiphany-codex-bridge/src/mutation.rs b/epiphany-codex-bridge/src/mutation.rs index 6b5b0ef2..561f9bdf 100644 --- a/epiphany-codex-bridge/src/mutation.rs +++ b/epiphany-codex-bridge/src/mutation.rs @@ -3,6 +3,8 @@ use std::path::PathBuf; use codex_app_server_protocol::ThreadEpiphanyReorientFinding; use codex_app_server_protocol::ThreadEpiphanyRoleFinding; use codex_app_server_protocol::ThreadEpiphanyRoleId; +use codex_app_server_protocol::ThreadEpiphanyStateUpdatedNotification; +use codex_app_server_protocol::ThreadEpiphanyStateUpdatedSource; use codex_app_server_protocol::ThreadEpiphanyStateUpdatedField; use codex_app_server_protocol::ThreadEpiphanyUpdatePatch; use codex_core::EpiphanyStateUpdate; @@ -99,6 +101,22 @@ pub fn state_update_from_thread_patch( } } +pub fn epiphany_state_updated_notification( + thread_id: String, + source: ThreadEpiphanyStateUpdatedSource, + revision: u64, + changed_fields: Vec, + epiphany_state: codex_protocol::protocol::EpiphanyThreadState, +) -> ThreadEpiphanyStateUpdatedNotification { + ThreadEpiphanyStateUpdatedNotification { + thread_id, + source, + revision, + changed_fields, + epiphany_state, + } +} + pub fn imagination_role_accept_patch_errors(patch: &ThreadEpiphanyUpdatePatch) -> Vec { imagination_role_state_patch_policy_errors(&core_state_patch_from_protocol(patch)) } diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index eb6979a0..8f323e30 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -535,6 +535,10 @@ The twenty-eighth cut made reorient acceptance return its core `EpiphanyStateUpdate` from the bridge, so the route no longer assembles the scratch/checkpoint/receipt/evidence update fields after receiving the bridge bundle. `epiphany_mutation_routes.rs` is about 1,070 lines. +The twenty-ninth cut moved repeated Epiphany state-updated notification shaping +into `epiphany-codex-bridge/src/mutation.rs`. This did not materially shrink +the route file, but it removed another duplicated protocol-shape authority from +the mutation handlers. `epiphany_mutation_routes.rs` is about 1,071 lines. Also: MCP itself is allowed to be JSON. The target is not "replace MCP JSON"; the target is an Epiphany-owned boundary that speaks typed Epiphany @@ -542,7 +546,8 @@ intent/result/receipt documents internally and normal MCP JSON-RPC externally. Continue with the actual whale-carcass cut: carve remaining route-level mutation orchestration into explicit typed bridge/service calls, starting with launch -response/notification shaping and interrupt result projection. Success is a +response shaping and then reassessing whether the next clean cut is worth +making or whether the remaining code is honest Codex edge glue. Success is a visibly smaller processor and less mutation authority in Codex, not merely nicer payload names or another adapter reliquary. Do not resume Rider, Unity, Aquarium, Face, dogfood, planning, app, skill, marketplace, or bridge expansion diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index a8a8c01888916b79ed9c070bae87e89fea70e6fd..3d4fe99f5bacfe29c54d11f8d9175af0cca7b2e8 100644 GIT binary patch delta 216 zcmdn+hGqGCmI=yC=D8bHr!g{KXx_uPeGemJoXKHm!xMRgTQ uGExy1AuCcSNUY4sPfSrrElVw`EYC