From 9e35c4a472016004218f3c97b612ec595c996a95 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 8 Mar 2026 20:54:27 -0400 Subject: [PATCH] Add GitCheckpointFailed event and align with logging/events strategy - Add GitCheckpointFailed variant to WorkflowRunEvent with node_id and error fields - Add trace() arm at ERROR level per logging strategy (operation cannot continue) - Add rename_fields rule to default node_label from node_id - Emit the event before returning ArcError::Engine on checkpoint failure - Update events-strategy.md with the new event in the checkpoints table - Add rename_fields serialization test Co-Authored-By: Claude Opus 4.6 --- crates/arc-workflows/src/engine.rs | 6 ++++++ crates/arc-workflows/src/event.rs | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/crates/arc-workflows/src/engine.rs b/crates/arc-workflows/src/engine.rs index 4efbaa9e0..6974f28ce 100644 --- a/crates/arc-workflows/src/engine.rs +++ b/crates/arc-workflows/src/engine.rs @@ -2048,6 +2048,12 @@ impl WorkflowRunEngine { last_git_sha = Some(sha); } Err(e) => { + self.services + .emitter + .emit(&WorkflowRunEvent::GitCheckpointFailed { + node_id: node.id.clone(), + error: e.clone(), + }); return Err(ArcError::Engine { message: format!( "git checkpoint commit failed for node '{}': {e}", diff --git a/crates/arc-workflows/src/event.rs b/crates/arc-workflows/src/event.rs index c3453b113..d9dd7f4af 100644 --- a/crates/arc-workflows/src/event.rs +++ b/crates/arc-workflows/src/event.rs @@ -117,6 +117,10 @@ pub enum WorkflowRunEvent { status: String, git_commit_sha: String, }, + GitCheckpointFailed { + node_id: String, + error: String, + }, EdgeSelected { from_node: String, to_node: String, @@ -382,6 +386,9 @@ impl WorkflowRunEvent { } => { debug!(run_id, node_id, status, "Git checkpoint"); } + Self::GitCheckpointFailed { node_id, error } => { + error!(node_id, error, "Git checkpoint commit failed"); + } Self::EdgeSelected { from_node, to_node, @@ -773,6 +780,7 @@ fn rename_fields(event_name: &str, fields: &mut serde_json::Map