Dispatch one typed TurnEvent through the service area — the SAME handler both transports serve: local runs libatomic's `ProvenanceImpl::dispatch_turn_event` in this process (the orchestrator with the in-process journal core), reactor dispatches over the socket (D4 start-or-retry). There is no unreachable fallback path anymore — a failure is a real failure and surfaces to the caller.
(
root: &Path,
event: &atomic_agent::event::TurnEvent,
agent_id: &str,
agent_display: &str,
agent_identity: Option<String>,
hook_context: &atomic_agent::hook_log::HookContext,
| 7694 | /// (D4 start-or-retry). There is no unreachable fallback path anymore — |
| 7695 | /// a failure is a real failure and surfaces to the caller. |
| 7696 | pub fn dispatch_turn_event( |
| 7697 | root: &Path, |
| 7698 | event: &atomic_agent::event::TurnEvent, |
| 7699 | agent_id: &str, |
| 7700 | agent_display: &str, |
| 7701 | agent_identity: Option<String>, |
| 7702 | hook_context: &atomic_agent::hook_log::HookContext, |
| 7703 | ) -> CliResult<crate::commands::agent::receive::ReceiveResult> { |
| 7704 | let Some(session) = Service::open_root(root)? else { |
| 7705 | return Err(CliError::InvalidArgument { |
| 7706 | message: format!("'{}' is not an Atomic repository", root.display()), |
| 7707 | }); |
| 7708 | }; |
| 7709 | let response = session.dispatch_turn_event(pb::DispatchTurnEventRequest { |
| 7710 | repository: Some(session.reference.clone()), |
| 7711 | meta: request_meta(), |
| 7712 | agent_id: agent_id.to_string(), |
| 7713 | agent_display_name: Some(agent_display.to_string()), |
| 7714 | agent_identity, |
| 7715 | event: Some(turn_event_body(event, hook_context)), |
| 7716 | })?; |
| 7717 | Ok(crate::commands::agent::receive::ReceiveResult { |
| 7718 | session_id: response.session_id, |
| 7719 | recorded: response.recorded, |
| 7720 | change_hash: response.change_hash.as_ref().map(|hash| { |
| 7721 | let bytes: [u8; 32] = hash.value.clone().try_into().unwrap_or([0; 32]); |
| 7722 | Merkle(bytes).to_base32() |
| 7723 | }), |
| 7724 | view: response.view, |
| 7725 | files: response.files, |
| 7726 | warnings: response.warnings, |
| 7727 | }) |
| 7728 | } |
| 7729 | |
| 7730 | fn turn_event_body( |
| 7731 | event: &atomic_agent::event::TurnEvent, |
no test coverage detected