diff --git a/epiphany-codex-bridge/src/lib.rs b/epiphany-codex-bridge/src/lib.rs index 95d3fafd..8e701458 100644 --- a/epiphany-codex-bridge/src/lib.rs +++ b/epiphany-codex-bridge/src/lib.rs @@ -17,5 +17,6 @@ pub mod results; pub mod retrieve; pub mod runtime_results; pub mod scene; +pub mod scene_protocol; pub mod state; pub mod view; diff --git a/epiphany-codex-bridge/src/scene.rs b/epiphany-codex-bridge/src/scene.rs index 2456cff8..75ee35b0 100644 --- a/epiphany-codex-bridge/src/scene.rs +++ b/epiphany-codex-bridge/src/scene.rs @@ -1,212 +1,16 @@ -use codex_app_server_protocol::ThreadEpiphanyScene; -use codex_app_server_protocol::ThreadEpiphanySceneAction; -use codex_app_server_protocol::ThreadEpiphanySceneChurn; -use codex_app_server_protocol::ThreadEpiphanySceneGraph; -use codex_app_server_protocol::ThreadEpiphanySceneInvestigationCheckpoint; -use codex_app_server_protocol::ThreadEpiphanySceneRecord; -use codex_app_server_protocol::ThreadEpiphanySceneRecords; -use codex_app_server_protocol::ThreadEpiphanySceneRetrieval; -use codex_app_server_protocol::ThreadEpiphanySceneSource; -use codex_app_server_protocol::ThreadEpiphanySceneStateStatus; -use codex_app_server_protocol::ThreadEpiphanySceneStatusCount; -use codex_app_server_protocol::ThreadEpiphanySceneSubgoal; -use epiphany_core::EpiphanyScene as CoreEpiphanyScene; -use epiphany_core::EpiphanySceneAction as CoreEpiphanySceneAction; -use epiphany_core::EpiphanySceneChurn as CoreEpiphanySceneChurn; -use epiphany_core::EpiphanySceneGraph as CoreEpiphanySceneGraph; +use epiphany_core::EpiphanyScene; use epiphany_core::EpiphanySceneInput; -use epiphany_core::EpiphanySceneInvestigationCheckpoint as CoreEpiphanySceneInvestigationCheckpoint; -use epiphany_core::EpiphanySceneRecord as CoreEpiphanySceneRecord; -use epiphany_core::EpiphanySceneRecords as CoreEpiphanySceneRecords; -use epiphany_core::EpiphanySceneRetrieval as CoreEpiphanySceneRetrieval; -use epiphany_core::EpiphanySceneSource as CoreEpiphanySceneSource; -use epiphany_core::EpiphanySceneStateStatus as CoreEpiphanySceneStateStatus; -use epiphany_core::EpiphanySceneStatusCount as CoreEpiphanySceneStatusCount; -use epiphany_core::EpiphanySceneSubgoal as CoreEpiphanySceneSubgoal; use epiphany_core::derive_scene; use epiphany_state_model::EpiphanyThreadState; -pub fn map_epiphany_scene( +pub fn derive_epiphany_scene( state: Option<&EpiphanyThreadState>, loaded: bool, reorient_binding_id: &str, -) -> ThreadEpiphanyScene { - map_core_epiphany_scene(derive_scene(EpiphanySceneInput { +) -> EpiphanyScene { + derive_scene(EpiphanySceneInput { state, loaded, reorient_binding_id, - })) -} - -fn map_core_epiphany_scene(scene: CoreEpiphanyScene) -> ThreadEpiphanyScene { - ThreadEpiphanyScene { - state_status: match scene.state_status { - CoreEpiphanySceneStateStatus::Missing => ThreadEpiphanySceneStateStatus::Missing, - CoreEpiphanySceneStateStatus::Ready => ThreadEpiphanySceneStateStatus::Ready, - }, - source: match scene.source { - CoreEpiphanySceneSource::Stored => ThreadEpiphanySceneSource::Stored, - CoreEpiphanySceneSource::Live => ThreadEpiphanySceneSource::Live, - }, - revision: scene.revision, - objective: scene.objective, - active_subgoal: scene.active_subgoal.map(map_core_epiphany_scene_subgoal), - subgoals: scene - .subgoals - .into_iter() - .map(map_core_epiphany_scene_subgoal) - .collect(), - invariant_status_counts: scene - .invariant_status_counts - .into_iter() - .map(map_core_epiphany_scene_status_count) - .collect(), - graph: map_core_epiphany_scene_graph(scene.graph), - retrieval: scene.retrieval.map(map_core_epiphany_scene_retrieval), - investigation_checkpoint: scene - .investigation_checkpoint - .map(map_core_epiphany_scene_investigation_checkpoint), - observations: map_core_epiphany_scene_records(scene.observations), - evidence: map_core_epiphany_scene_records(scene.evidence), - churn: scene.churn.map(map_core_epiphany_scene_churn), - available_actions: scene - .available_actions - .into_iter() - .map(map_core_epiphany_scene_action) - .collect(), - } -} - -pub fn map_core_epiphany_scene_action( - action: CoreEpiphanySceneAction, -) -> ThreadEpiphanySceneAction { - match action { - CoreEpiphanySceneAction::Index => ThreadEpiphanySceneAction::Index, - CoreEpiphanySceneAction::Retrieve => ThreadEpiphanySceneAction::Retrieve, - CoreEpiphanySceneAction::Distill => ThreadEpiphanySceneAction::Distill, - CoreEpiphanySceneAction::Context => ThreadEpiphanySceneAction::Context, - CoreEpiphanySceneAction::Planning => ThreadEpiphanySceneAction::Planning, - CoreEpiphanySceneAction::GraphQuery => ThreadEpiphanySceneAction::GraphQuery, - CoreEpiphanySceneAction::Jobs => ThreadEpiphanySceneAction::Jobs, - CoreEpiphanySceneAction::Roles => ThreadEpiphanySceneAction::Roles, - CoreEpiphanySceneAction::Coordinator => ThreadEpiphanySceneAction::Coordinator, - CoreEpiphanySceneAction::RoleLaunch => ThreadEpiphanySceneAction::RoleLaunch, - CoreEpiphanySceneAction::RoleResult => ThreadEpiphanySceneAction::RoleResult, - CoreEpiphanySceneAction::RoleAccept => ThreadEpiphanySceneAction::RoleAccept, - CoreEpiphanySceneAction::JobLaunch => ThreadEpiphanySceneAction::JobLaunch, - CoreEpiphanySceneAction::JobInterrupt => ThreadEpiphanySceneAction::JobInterrupt, - CoreEpiphanySceneAction::Freshness => ThreadEpiphanySceneAction::Freshness, - CoreEpiphanySceneAction::Pressure => ThreadEpiphanySceneAction::Pressure, - CoreEpiphanySceneAction::Reorient => ThreadEpiphanySceneAction::Reorient, - CoreEpiphanySceneAction::Crrc => ThreadEpiphanySceneAction::Crrc, - CoreEpiphanySceneAction::ReorientLaunch => ThreadEpiphanySceneAction::ReorientLaunch, - CoreEpiphanySceneAction::ReorientResult => ThreadEpiphanySceneAction::ReorientResult, - CoreEpiphanySceneAction::ReorientAccept => ThreadEpiphanySceneAction::ReorientAccept, - CoreEpiphanySceneAction::Propose => ThreadEpiphanySceneAction::Propose, - CoreEpiphanySceneAction::Promote => ThreadEpiphanySceneAction::Promote, - CoreEpiphanySceneAction::Update => ThreadEpiphanySceneAction::Update, - } -} - -fn map_core_epiphany_scene_subgoal( - subgoal: CoreEpiphanySceneSubgoal, -) -> ThreadEpiphanySceneSubgoal { - ThreadEpiphanySceneSubgoal { - id: subgoal.id, - title: subgoal.title, - status: subgoal.status, - summary: subgoal.summary, - active: subgoal.active, - } -} - -fn map_core_epiphany_scene_status_count( - count: CoreEpiphanySceneStatusCount, -) -> ThreadEpiphanySceneStatusCount { - ThreadEpiphanySceneStatusCount { - status: count.status, - count: count.count, - } -} - -fn map_core_epiphany_scene_graph(graph: CoreEpiphanySceneGraph) -> ThreadEpiphanySceneGraph { - ThreadEpiphanySceneGraph { - architecture_node_count: graph.architecture_node_count, - architecture_edge_count: graph.architecture_edge_count, - dataflow_node_count: graph.dataflow_node_count, - dataflow_edge_count: graph.dataflow_edge_count, - link_count: graph.link_count, - active_node_ids: graph.active_node_ids, - active_edge_ids: graph.active_edge_ids, - open_question_count: graph.open_question_count, - open_gap_count: graph.open_gap_count, - dirty_paths: graph.dirty_paths, - checkpoint_id: graph.checkpoint_id, - checkpoint_summary: graph.checkpoint_summary, - } -} - -fn map_core_epiphany_scene_retrieval( - retrieval: CoreEpiphanySceneRetrieval, -) -> ThreadEpiphanySceneRetrieval { - ThreadEpiphanySceneRetrieval { - workspace_root: retrieval.workspace_root, - status: retrieval.status, - semantic_available: retrieval.semantic_available, - index_revision: retrieval.index_revision, - indexed_file_count: retrieval.indexed_file_count, - indexed_chunk_count: retrieval.indexed_chunk_count, - shard_count: retrieval.shard_count, - dirty_path_count: retrieval.dirty_path_count, - } -} - -fn map_core_epiphany_scene_investigation_checkpoint( - checkpoint: CoreEpiphanySceneInvestigationCheckpoint, -) -> ThreadEpiphanySceneInvestigationCheckpoint { - ThreadEpiphanySceneInvestigationCheckpoint { - checkpoint_id: checkpoint.checkpoint_id, - kind: checkpoint.kind, - disposition: checkpoint.disposition, - focus: checkpoint.focus, - summary: checkpoint.summary, - next_action: checkpoint.next_action, - captured_at_turn_id: checkpoint.captured_at_turn_id, - open_question_count: checkpoint.open_question_count, - code_ref_count: checkpoint.code_ref_count, - evidence_count: checkpoint.evidence_count, - } -} - -fn map_core_epiphany_scene_records( - records: CoreEpiphanySceneRecords, -) -> ThreadEpiphanySceneRecords { - ThreadEpiphanySceneRecords { - total_count: records.total_count, - latest: records - .latest - .into_iter() - .map(map_core_epiphany_scene_record) - .collect(), - } -} - -fn map_core_epiphany_scene_record(record: CoreEpiphanySceneRecord) -> ThreadEpiphanySceneRecord { - ThreadEpiphanySceneRecord { - id: record.id, - kind: record.kind, - status: record.status, - summary: record.summary, - code_ref_count: record.code_ref_count, - } -} - -fn map_core_epiphany_scene_churn(churn: CoreEpiphanySceneChurn) -> ThreadEpiphanySceneChurn { - ThreadEpiphanySceneChurn { - understanding_status: churn.understanding_status, - diff_pressure: churn.diff_pressure, - graph_freshness: churn.graph_freshness, - warning: churn.warning, - unexplained_writes: churn.unexplained_writes, - } + }) } diff --git a/epiphany-codex-bridge/src/scene_protocol.rs b/epiphany-codex-bridge/src/scene_protocol.rs new file mode 100644 index 00000000..229f1f67 --- /dev/null +++ b/epiphany-codex-bridge/src/scene_protocol.rs @@ -0,0 +1,189 @@ +use codex_app_server_protocol::ThreadEpiphanyScene; +use codex_app_server_protocol::ThreadEpiphanySceneAction; +use codex_app_server_protocol::ThreadEpiphanySceneChurn; +use codex_app_server_protocol::ThreadEpiphanySceneGraph; +use codex_app_server_protocol::ThreadEpiphanySceneInvestigationCheckpoint; +use codex_app_server_protocol::ThreadEpiphanySceneRecord; +use codex_app_server_protocol::ThreadEpiphanySceneRecords; +use codex_app_server_protocol::ThreadEpiphanySceneRetrieval; +use codex_app_server_protocol::ThreadEpiphanySceneSource; +use codex_app_server_protocol::ThreadEpiphanySceneStateStatus; +use codex_app_server_protocol::ThreadEpiphanySceneStatusCount; +use codex_app_server_protocol::ThreadEpiphanySceneSubgoal; +use epiphany_core::EpiphanyScene as CoreEpiphanyScene; +use epiphany_core::EpiphanySceneAction as CoreEpiphanySceneAction; +use epiphany_core::EpiphanySceneChurn as CoreEpiphanySceneChurn; +use epiphany_core::EpiphanySceneGraph as CoreEpiphanySceneGraph; +use epiphany_core::EpiphanySceneInvestigationCheckpoint as CoreEpiphanySceneInvestigationCheckpoint; +use epiphany_core::EpiphanySceneRecord as CoreEpiphanySceneRecord; +use epiphany_core::EpiphanySceneRecords as CoreEpiphanySceneRecords; +use epiphany_core::EpiphanySceneRetrieval as CoreEpiphanySceneRetrieval; +use epiphany_core::EpiphanySceneSource as CoreEpiphanySceneSource; +use epiphany_core::EpiphanySceneStateStatus as CoreEpiphanySceneStateStatus; +use epiphany_core::EpiphanySceneStatusCount as CoreEpiphanySceneStatusCount; +use epiphany_core::EpiphanySceneSubgoal as CoreEpiphanySceneSubgoal; + +pub fn protocol_scene(scene: CoreEpiphanyScene) -> ThreadEpiphanyScene { + ThreadEpiphanyScene { + state_status: match scene.state_status { + CoreEpiphanySceneStateStatus::Missing => ThreadEpiphanySceneStateStatus::Missing, + CoreEpiphanySceneStateStatus::Ready => ThreadEpiphanySceneStateStatus::Ready, + }, + source: match scene.source { + CoreEpiphanySceneSource::Stored => ThreadEpiphanySceneSource::Stored, + CoreEpiphanySceneSource::Live => ThreadEpiphanySceneSource::Live, + }, + revision: scene.revision, + objective: scene.objective, + active_subgoal: scene.active_subgoal.map(protocol_scene_subgoal), + subgoals: scene + .subgoals + .into_iter() + .map(protocol_scene_subgoal) + .collect(), + invariant_status_counts: scene + .invariant_status_counts + .into_iter() + .map(protocol_scene_status_count) + .collect(), + graph: protocol_scene_graph(scene.graph), + retrieval: scene.retrieval.map(protocol_scene_retrieval), + investigation_checkpoint: scene + .investigation_checkpoint + .map(protocol_scene_investigation_checkpoint), + observations: protocol_scene_records(scene.observations), + evidence: protocol_scene_records(scene.evidence), + churn: scene.churn.map(protocol_scene_churn), + available_actions: scene + .available_actions + .into_iter() + .map(protocol_scene_action) + .collect(), + } +} + +pub fn protocol_scene_action(action: CoreEpiphanySceneAction) -> ThreadEpiphanySceneAction { + match action { + CoreEpiphanySceneAction::Index => ThreadEpiphanySceneAction::Index, + CoreEpiphanySceneAction::Retrieve => ThreadEpiphanySceneAction::Retrieve, + CoreEpiphanySceneAction::Distill => ThreadEpiphanySceneAction::Distill, + CoreEpiphanySceneAction::Context => ThreadEpiphanySceneAction::Context, + CoreEpiphanySceneAction::Planning => ThreadEpiphanySceneAction::Planning, + CoreEpiphanySceneAction::GraphQuery => ThreadEpiphanySceneAction::GraphQuery, + CoreEpiphanySceneAction::Jobs => ThreadEpiphanySceneAction::Jobs, + CoreEpiphanySceneAction::Roles => ThreadEpiphanySceneAction::Roles, + CoreEpiphanySceneAction::Coordinator => ThreadEpiphanySceneAction::Coordinator, + CoreEpiphanySceneAction::RoleLaunch => ThreadEpiphanySceneAction::RoleLaunch, + CoreEpiphanySceneAction::RoleResult => ThreadEpiphanySceneAction::RoleResult, + CoreEpiphanySceneAction::RoleAccept => ThreadEpiphanySceneAction::RoleAccept, + CoreEpiphanySceneAction::JobLaunch => ThreadEpiphanySceneAction::JobLaunch, + CoreEpiphanySceneAction::JobInterrupt => ThreadEpiphanySceneAction::JobInterrupt, + CoreEpiphanySceneAction::Freshness => ThreadEpiphanySceneAction::Freshness, + CoreEpiphanySceneAction::Pressure => ThreadEpiphanySceneAction::Pressure, + CoreEpiphanySceneAction::Reorient => ThreadEpiphanySceneAction::Reorient, + CoreEpiphanySceneAction::Crrc => ThreadEpiphanySceneAction::Crrc, + CoreEpiphanySceneAction::ReorientLaunch => ThreadEpiphanySceneAction::ReorientLaunch, + CoreEpiphanySceneAction::ReorientResult => ThreadEpiphanySceneAction::ReorientResult, + CoreEpiphanySceneAction::ReorientAccept => ThreadEpiphanySceneAction::ReorientAccept, + CoreEpiphanySceneAction::Propose => ThreadEpiphanySceneAction::Propose, + CoreEpiphanySceneAction::Promote => ThreadEpiphanySceneAction::Promote, + CoreEpiphanySceneAction::Update => ThreadEpiphanySceneAction::Update, + } +} + +fn protocol_scene_subgoal(subgoal: CoreEpiphanySceneSubgoal) -> ThreadEpiphanySceneSubgoal { + ThreadEpiphanySceneSubgoal { + id: subgoal.id, + title: subgoal.title, + status: subgoal.status, + summary: subgoal.summary, + active: subgoal.active, + } +} + +fn protocol_scene_status_count( + count: CoreEpiphanySceneStatusCount, +) -> ThreadEpiphanySceneStatusCount { + ThreadEpiphanySceneStatusCount { + status: count.status, + count: count.count, + } +} + +fn protocol_scene_graph(graph: CoreEpiphanySceneGraph) -> ThreadEpiphanySceneGraph { + ThreadEpiphanySceneGraph { + architecture_node_count: graph.architecture_node_count, + architecture_edge_count: graph.architecture_edge_count, + dataflow_node_count: graph.dataflow_node_count, + dataflow_edge_count: graph.dataflow_edge_count, + link_count: graph.link_count, + active_node_ids: graph.active_node_ids, + active_edge_ids: graph.active_edge_ids, + open_question_count: graph.open_question_count, + open_gap_count: graph.open_gap_count, + dirty_paths: graph.dirty_paths, + checkpoint_id: graph.checkpoint_id, + checkpoint_summary: graph.checkpoint_summary, + } +} + +fn protocol_scene_retrieval(retrieval: CoreEpiphanySceneRetrieval) -> ThreadEpiphanySceneRetrieval { + ThreadEpiphanySceneRetrieval { + workspace_root: retrieval.workspace_root, + status: retrieval.status, + semantic_available: retrieval.semantic_available, + index_revision: retrieval.index_revision, + indexed_file_count: retrieval.indexed_file_count, + indexed_chunk_count: retrieval.indexed_chunk_count, + shard_count: retrieval.shard_count, + dirty_path_count: retrieval.dirty_path_count, + } +} + +fn protocol_scene_investigation_checkpoint( + checkpoint: CoreEpiphanySceneInvestigationCheckpoint, +) -> ThreadEpiphanySceneInvestigationCheckpoint { + ThreadEpiphanySceneInvestigationCheckpoint { + checkpoint_id: checkpoint.checkpoint_id, + kind: checkpoint.kind, + disposition: checkpoint.disposition, + focus: checkpoint.focus, + summary: checkpoint.summary, + next_action: checkpoint.next_action, + captured_at_turn_id: checkpoint.captured_at_turn_id, + open_question_count: checkpoint.open_question_count, + code_ref_count: checkpoint.code_ref_count, + evidence_count: checkpoint.evidence_count, + } +} + +fn protocol_scene_records(records: CoreEpiphanySceneRecords) -> ThreadEpiphanySceneRecords { + ThreadEpiphanySceneRecords { + total_count: records.total_count, + latest: records + .latest + .into_iter() + .map(protocol_scene_record) + .collect(), + } +} + +fn protocol_scene_record(record: CoreEpiphanySceneRecord) -> ThreadEpiphanySceneRecord { + ThreadEpiphanySceneRecord { + id: record.id, + kind: record.kind, + status: record.status, + summary: record.summary, + code_ref_count: record.code_ref_count, + } +} + +fn protocol_scene_churn(churn: CoreEpiphanySceneChurn) -> ThreadEpiphanySceneChurn { + ThreadEpiphanySceneChurn { + understanding_status: churn.understanding_status, + diff_pressure: churn.diff_pressure, + graph_freshness: churn.graph_freshness, + warning: churn.warning, + unexplained_writes: churn.unexplained_writes, + } +} diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 67bfa692..9ee9a9b5 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -51,8 +51,9 @@ use crate::reorient::derive_epiphany_freshness_view; use crate::reorient::derive_epiphany_reorient; 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; -use crate::scene::map_epiphany_scene; +use crate::scene::derive_epiphany_scene; +use crate::scene_protocol::protocol_scene; +use crate::scene_protocol::protocol_scene_action; fn map_protocol_epiphany_view_lens(lens: EpiphanyViewLens) -> ThreadEpiphanyViewLens { match lens { @@ -307,9 +308,13 @@ pub async fn map_epiphany_view_response( ThreadEpiphanyViewResponse { thread_id: thread_id.clone(), - scene: lenses - .contains(&EpiphanyViewLens::Scene) - .then(|| map_epiphany_scene(state, loaded, EPIPHANY_REORIENT_LAUNCH_BINDING_ID)), + scene: lenses.contains(&EpiphanyViewLens::Scene).then(|| { + protocol_scene(derive_epiphany_scene( + state, + loaded, + EPIPHANY_REORIENT_LAUNCH_BINDING_ID, + )) + }), jobs: if lenses.contains(&EpiphanyViewLens::Jobs) { jobs.iter() .cloned() @@ -399,7 +404,7 @@ pub async fn map_epiphany_view_response( }) .available_actions .into_iter() - .map(map_core_epiphany_scene_action) + .map(protocol_scene_action) .collect(); let note = format!( "{} Result status: {:?}. {}", diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index b5028c7e..297f6c39 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -89,6 +89,7 @@ remembers doctrine; the branch remembers the blade. - `pressure.rs` is typed-only now. The convenience helper returning `ThreadEpiphanyPressure` was deleted; view response assembly derives typed pressure and calls `protocol_edge` for projection. - Coordinator projection is split out too. `coordinator.rs` no longer imports app-server protocol DTOs; it owns typed coordinator status, CRRC input shaping, role-board derivation, automation verdict selection, and note rendering. `coordinator_protocol.rs` owns Codex JSON-RPC projection for coordinator, CRRC, and role-board response payloads. - Context/planning/graph projection is split out too. `context.rs` returns typed `epiphany-core` view documents; `context_protocol.rs` owns Codex JSON-RPC tuple/projection cargo for context, planning, and graph-query responses. +- Scene projection is split out too. `scene.rs` returns the typed core `EpiphanyScene`; `scene_protocol.rs` owns `ThreadEpiphanyScene` and scene-action response 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 c8896ada..3a05b5f1 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index edc8c70e..05ffa377 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -436,6 +436,9 @@ current_status: `context.rs` now returns typed `epiphany-core` view documents, while `context_protocol.rs` owns the Codex JSON-RPC tuple/projection cargo used by view/context/graph response builders. + Scene derivation follows that boundary too: `scene.rs` now returns the + typed core `EpiphanyScene`, and `scene_protocol.rs` owns projection into + `ThreadEpiphanyScene` plus scene-action DTOs for view 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.