Lockspire.Install.OperationPlan (lockspire v1.6.1)

Copy Markdown

A fully preflighted, immutable install or upgrade operation.

The plan is deliberately built from rendered bytes and a complete migration inventory before it mutates a host project. Applying it is the only write boundary and always writes the manifest last.

Summary

Types

file_operation()

@type file_operation() :: %{
  :relative_path => String.t(),
  :destination => String.t(),
  :rendered => String.t(),
  :status => :create | :update | :unchanged,
  optional(:expected_checksum) => String.t()
}

t()

@type t() :: %Lockspire.Install.OperationPlan{
  assigns: map(),
  file_operations: [file_operation()],
  manifest: map(),
  migration_plan: Lockspire.Install.Migrations.plan(),
  mode: :install | :upgrade
}

Functions

apply(plan)

@spec apply(t()) :: {:ok, t()} | {:error, [map()]}

install(assigns, rendered_templates)

@spec install(map(), [map()]) :: {:ok, t()} | {:error, [map()]}

report(plan, mode)

@spec report(t(), :apply | :dry_run) :: :ok

Reports the same immutable plan used by dry-run and apply.

upgrade(assigns, rendered_templates, manifest)

@spec upgrade(map(), [map()], map()) :: {:ok, t()} | {:error, [map()]}