diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 2248444f..8c727009 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -562,26 +562,9 @@ pub async fn map_epiphany_reorient_result_response( pub fn map_epiphany_distill_response( expected_revision: u64, - params: ThreadEpiphanyDistillParams, + input: EpiphanyDistillInput, ) -> std::result::Result { - let ThreadEpiphanyDistillParams { - source_kind, - status, - text, - subject, - evidence_kind, - code_refs, - .. - } = params; - let proposal = distill_observation(EpiphanyDistillInput { - source_kind, - status, - text, - subject, - evidence_kind, - code_refs, - }) - .map_err(|err| err.to_string())?; + let proposal = distill_observation(input).map_err(|err| err.to_string())?; Ok(ThreadEpiphanyDistillResponse { expected_revision, @@ -593,6 +576,28 @@ pub fn map_epiphany_distill_response( }) } +pub fn map_core_epiphany_distill_input( + params: ThreadEpiphanyDistillParams, +) -> EpiphanyDistillInput { + let ThreadEpiphanyDistillParams { + source_kind, + status, + text, + subject, + evidence_kind, + code_refs, + .. + } = params; + EpiphanyDistillInput { + source_kind, + status, + text, + subject, + evidence_kind, + code_refs, + } +} + pub fn map_epiphany_propose_response( state: EpiphanyThreadState, observation_ids: Vec, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 0e4697f5..34fb781c 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -68,6 +68,7 @@ remembers doctrine; the branch remembers the blade. - 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. +- Distill response assembly now consumes core `EpiphanyDistillInput`; `ThreadEpiphanyDistillParams` is converted before bridge policy invocation. - 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 826c6e4d..71c42283 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 5d874f79..fd326320 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -357,7 +357,9 @@ current_status: `EpiphanyGraphQuery`; app-server read routes convert JSON-RPC request cargo 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. + while shaping the legacy JSON-RPC response. Distill response assembly now + consumes core `EpiphanyDistillInput`; the JSON-RPC distill params are + converted before policy invocation. 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 5ab62712..b23fb015 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 @@ -27,6 +27,7 @@ use epiphany_codex_bridge::view::epiphany_view_needs_jobs; use epiphany_codex_bridge::view::epiphany_view_needs_pressure; use epiphany_codex_bridge::view::epiphany_view_needs_reorientation_inputs; use epiphany_codex_bridge::view::epiphany_view_needs_runtime_store; +use epiphany_codex_bridge::view::map_core_epiphany_distill_input; use epiphany_codex_bridge::view::map_epiphany_context_response; use epiphany_codex_bridge::view::map_epiphany_distill_response; use epiphany_codex_bridge::view::map_epiphany_graph_query_response; @@ -510,7 +511,8 @@ impl CodexMessageProcessor { .await .map(|state| state.revision) .unwrap_or(0); - let response = match map_epiphany_distill_response(expected_revision, params) { + let input = map_core_epiphany_distill_input(params); + let response = match map_epiphany_distill_response(expected_revision, input) { Ok(response) => response, Err(err) => { self.send_invalid_request_error(