Class: ChronoForge::Dashboard::DefinitionOverlay

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/chrono_forge/dashboard/definition_overlay.rb

Overview

Overlays a workflow run's execution_logs onto a static Definition, producing per-node hashes with a runtime :status (and fan-out/repeat aggregates). Read-only. The Definition is the static map; logs are the source of truth for a specific run.

Constant Summary collapse

LOG_STATUS =

ExecutionLog's state enum is only pending/completed/failed. "pending" means reached-but-unfinished (in progress), so it maps to :active; the fetch default below catches any state added later.

{"completed" => :done, "failed" => :failed, "pending" => :active}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(definition, workflow) ⇒ DefinitionOverlay

Returns a new instance of DefinitionOverlay.



13
14
15
16
# File 'app/presenters/chrono_forge/dashboard/definition_overlay.rb', line 13

def initialize(definition, workflow)
  @definition = definition
  @workflow = workflow
end

Instance Method Details

#nodesObject



18
19
20
21
# File 'app/presenters/chrono_forge/dashboard/definition_overlay.rb', line 18

def nodes
  mapped = @definition.nodes.map { |n| overlay(n) }
  mapped + unmapped_nodes(mapped)
end

#warningsObject



23
# File 'app/presenters/chrono_forge/dashboard/definition_overlay.rb', line 23

def warnings = @definition.warnings