Definitively.Domain.MaestroAction (definitively v0.5.0)

Copy Markdown

Pure maestro argv builders and result parsers for maestro nodes.

Summary

Functions

Builds argv for a maestro node.

Builds maestro CLI argv for the given action and options.

Parses stdout into signals and structured data for a maestro action.

When from-spec fails because the mission slug already exists, resolve its id from missions.jsonl.

Runs the composite claim-next flow: list draft tasks, claim first or mark empty.

Types

argv()

@type argv() :: [String.t()]

Functions

argv_for(node_definition, workspace)

@spec argv_for(Definitively.Domain.NodeDefinition.t(), Path.t()) ::
  {:ok, argv() | {:multi, [argv()]} | {:claim_next, String.t()}}
  | {:error, term()}

Builds argv for a maestro node.

build_argv(action, opts, workspace)

@spec build_argv(atom(), map() | nil, Path.t()) ::
  {:ok, argv() | {:multi, [argv()]}} | {:error, term()}

Builds maestro CLI argv for the given action and options.

parse_result(arg1, arg2, stdout, workspace)

@spec parse_result(atom(), non_neg_integer(), String.t(), Path.t()) :: {map(), map()}

Parses stdout into signals and structured data for a maestro action.

recover_existing_mission(output, workspace)

@spec recover_existing_mission(String.t(), Path.t()) ::
  {:ok, String.t(), String.t()} | :error

When from-spec fails because the mission slug already exists, resolve its id from missions.jsonl.

run_claim_next(mission_id, workspace, runner)

@spec run_claim_next(String.t(), Path.t(), (String.t(), [String.t()], keyword() ->
                                        term())) ::
  {:ok, {non_neg_integer(), String.t(), map(), map()}} | {:error, term()}

Runs the composite claim-next flow: list draft tasks, claim first or mark empty.