feat(wfe-core): add LogSink trait and wire lifecycle publisher into executor

LogSink trait for real-time step output streaming. Added to
StepExecutionContext as optional field (backward compatible).
Threaded through WorkflowExecutor and WorkflowHostBuilder.

Wired LifecyclePublisher.publish() into executor at 5 points:
StepStarted, StepCompleted, Error, Completed, Terminated.
Also added lifecycle events to host start/suspend/resume/terminate.
This commit is contained in:
2026-04-01 14:33:27 +01:00
parent d437e6ff36
commit 7a9af8015e
9 changed files with 183 additions and 2 deletions

View File

@@ -38,6 +38,8 @@ pub struct StepExecutionContext<'a> {
pub cancellation_token: tokio_util::sync::CancellationToken,
/// Host context for starting child workflows. None if not available.
pub host_context: Option<&'a dyn HostContext>,
/// Log sink for streaming step output. None if not configured.
pub log_sink: Option<&'a dyn super::LogSink>,
}
// Manual Debug impl since dyn HostContext is not Debug.
@@ -50,6 +52,7 @@ impl<'a> std::fmt::Debug for StepExecutionContext<'a> {
.field("step", &self.step)
.field("workflow", &self.workflow)
.field("host_context", &self.host_context.is_some())
.field("log_sink", &self.log_sink.is_some())
.finish()
}
}