Lux.Company.ExecutionEngine.ObjectiveProcess (Lux v0.5.0)
View SourceA GenServer process that manages the execution of a single objective.
This module is responsible for:
- Managing the state machine of an objective's execution
- Tracking progress and current step
- Handling state transitions
- Managing errors and failures
- Coordinating with the company process
- Integrating with TaskTracker and ArtifactStore
Summary
Functions
Add an error message to the objective's error list
Cancel the objective execution
Returns a specification to start this module under a supervisor.
Mark the objective as completed
Mark the objective as failed with the given reason
Get the artifact store for this objective
Get the task tracker for this objective
Initialize the objective process
Set the current step being executed
Start executing the objective
Starts a new ObjectiveProcess with the given options.
Update the progress percentage (0-100)
Types
@type state() :: %{ id: String.t(), objective: Lux.Company.Objective.t(), company_pid: pid(), input: map(), status: :pending | :initializing | :in_progress | :completed | :failed | :cancelled, current_step: integer(), progress: integer(), error: term() | nil, started_at: DateTime.t() | nil, completed_at: DateTime.t() | nil, task_tracker: pid() | nil, artifact_store: pid() | nil }
Functions
Add an error message to the objective's error list
Cancel the objective execution
Returns a specification to start this module under a supervisor.
See Supervisor
.
Mark the objective as completed
Mark the objective as failed with the given reason
Get the artifact store for this objective
Get the task tracker for this objective
Initialize the objective process
Set the current step being executed
Start executing the objective
Starts a new ObjectiveProcess with the given options.
Required options:
- :objective_id - Unique identifier for this objective process
- :objective - The Objective struct to execute
- :company_pid - PID of the company process
- :input - Map of input values for the objective
- :registry - The registry to register this process with
Update the progress percentage (0-100)