Class: Aidp::Temporal::Activities::RecordCheckpointActivity

Inherits:
BaseActivity
  • Object
show all
Defined in:
lib/aidp/temporal/activities/record_checkpoint_activity.rb

Overview

Activity that records a checkpoint for progress tracking Persists state for recovery and observability

Instance Method Summary collapse

Methods inherited from BaseActivity

#activity_context, #cancellation_requested?, #check_cancellation!, #heartbeat

Instance Method Details

#execute(input) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/aidp/temporal/activities/record_checkpoint_activity.rb', line 11

def execute(input)
  with_activity_context do
    project_dir = input[:project_dir]
    step_name = input[:step_name]
    iteration = input[:iteration]
    state = input[:state]
    test_results = input[:test_results]

    log_activity("recording_checkpoint",
      project_dir: project_dir,
      step_name: step_name,
      iteration: iteration)

    # Create checkpoint recorder
    checkpoint = Aidp::Execute::Checkpoint.new(project_dir)

    # Build metrics from test results
    metrics = build_metrics(test_results)

    # Record the checkpoint
    checkpoint.record_checkpoint(
      step_name,
      iteration,
      {
        state: state,
        test_results_summary: summarize_test_results(test_results),
        metrics: metrics,
        workflow_type: "temporal"
      }
    )

    success_result(
      step_name: step_name,
      iteration: iteration,
      timestamp: Time.now.iso8601
    )
  end
end