Skip to content

Commit 5a0d560

Browse files
authored
Merge pull request #55 from 100monkeys-ai/copilot/rename-validation-feedback-constant
Rename VALIDATION_FEEDBACK_FILE_PATH and eliminate redundant execution_id string round-trip
2 parents 5345961 + dde4aec commit 5a0d560

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

orchestrator/core/src/infrastructure/temporal_event_listener.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ use serde::{Deserialize, Serialize};
6666
use std::sync::Arc;
6767
use uuid::Uuid;
6868

69-
const VALIDATION_FEEDBACK_FILE_PATH: &str = "validation_feedback";
69+
const VALIDATION_FEEDBACK_FILE_NAME: &str = "validation_feedback";
7070

7171
/// External event payload from Temporal worker
7272
#[derive(Debug, Clone, Deserialize, Serialize)]
@@ -332,7 +332,7 @@ impl TemporalEventListener {
332332
};
333333

334334
let code_diff = crate::domain::execution::CodeDiff {
335-
file_path: VALIDATION_FEEDBACK_FILE_PATH.to_string(),
335+
file_path: VALIDATION_FEEDBACK_FILE_NAME.to_string(),
336336
diff: diff_str,
337337
};
338338

@@ -363,39 +363,39 @@ impl TemporalEventListener {
363363
let domain_event = TemporalEventMapper::to_domain_event(&payload)
364364
.context("Failed to map Temporal event to domain event")?;
365365

366-
let execution_id_str = match &domain_event {
366+
let execution_id_obj = match &domain_event {
367367
WorkflowEvent::WorkflowRegistered { .. } => {
368368
// Definition-time event — no execution_id exists.
369369
// Publish to the event bus so subscribers are notified, then return early.
370370
self.event_bus.publish_workflow_event(domain_event.clone());
371371
return Ok(String::new());
372372
}
373373
WorkflowEvent::WorkflowExecutionStarted { execution_id, .. } => {
374-
execution_id.0.to_string()
374+
execution_id.clone()
375375
}
376-
WorkflowEvent::WorkflowStateEntered { execution_id, .. } => execution_id.0.to_string(),
377-
WorkflowEvent::WorkflowStateExited { execution_id, .. } => execution_id.0.to_string(),
376+
WorkflowEvent::WorkflowStateEntered { execution_id, .. } => execution_id.clone(),
377+
WorkflowEvent::WorkflowStateExited { execution_id, .. } => execution_id.clone(),
378378
WorkflowEvent::WorkflowIterationStarted { execution_id, .. } => {
379-
execution_id.0.to_string()
379+
execution_id.clone()
380380
}
381381
WorkflowEvent::WorkflowIterationCompleted { execution_id, .. } => {
382-
execution_id.0.to_string()
382+
execution_id.clone()
383383
}
384384
WorkflowEvent::WorkflowIterationFailed { execution_id, .. } => {
385-
execution_id.0.to_string()
385+
execution_id.clone()
386386
}
387387
WorkflowEvent::WorkflowExecutionCompleted { execution_id, .. } => {
388-
execution_id.0.to_string()
388+
execution_id.clone()
389389
}
390390
WorkflowEvent::WorkflowExecutionFailed { execution_id, .. } => {
391-
execution_id.0.to_string()
391+
execution_id.clone()
392392
}
393393
WorkflowEvent::WorkflowExecutionCancelled { execution_id, .. } => {
394-
execution_id.0.to_string()
394+
execution_id.clone()
395395
}
396396
};
397397

398-
let execution_id_obj = ExecutionId(uuid::Uuid::parse_str(&execution_id_str)?);
398+
let execution_id_str = execution_id_obj.0.to_string();
399399

400400
// Step 2: Persist event to the repository for event sourcing
401401
self.execution_repository

0 commit comments

Comments
 (0)