Minga.Extension.ArtifactGenerationState (Minga v0.1.0)

Copy Markdown View Source

VM-generation storage for extension artifact provenance.

Admission snapshots live in persistent_term, so restarting this process or its containing supervisor does not reopen an empty generation while extension modules remain loaded. Snapshots contain only durable provenance and lifecycle status; process identifiers, monitors, callers, and attempt tokens are never retained as authority across a restart.

Summary

Functions

Returns a specification to start this module under a supervisor.

Reads the sanitized admission snapshot for this VM generation.

Starts a VM-generation state owner.

Persists a sanitized admission snapshot after one serialized transition.

Types

admission_state()

@type admission_state() :: map() | nil

persistence_key()

@type persistence_key() :: term()

state()

@type state() :: %{admission: admission_state(), persistence_key: persistence_key()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

fetch(server \\ __MODULE__)

@spec fetch(GenServer.server()) :: {:ok, admission_state()} | {:error, term()}

Reads the sanitized admission snapshot for this VM generation.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts a VM-generation state owner.

store(server \\ __MODULE__, admission)

@spec store(GenServer.server(), map()) :: :ok | {:error, term()}

Persists a sanitized admission snapshot after one serialized transition.