Source-owned contribution cleanup coordinator.
The extension supervisor lives in the core Minga.* layer, so it cannot depend on editor presentation modules directly. Editor-layer registries register cleanup callbacks here when they accept source-owned contributions. The supervisor calls this module with a source, and the coordinator cleans core registries plus any registered higher-layer callbacks without creating compile-time upward dependencies.
Summary
Types
Cleanup failure reported for one family.
Cleanup callback invoked with a source identifier.
Cleanup options with injectable test registries.
Targeted lifecycle callback invoked with source-specific authority.
Source that contributed registry entries.
Functions
Runs one targeted source finalizer before runtime termination.
Registers a cleanup callback for a contribution family.
Registers a targeted lifecycle callback that requires explicit authority context.
Unregisters a cleanup callback. Mostly useful for tests.
Removes all contributions owned by a source.
Types
@type cleanup_failure() :: %{ family: atom(), source: contribution_source(), reason: term() }
Cleanup failure reported for one family.
@type cleanup_fun() :: (contribution_source() -> :ok | {:error, term()})
Cleanup callback invoked with a source identifier.
@type cleanup_opts() :: [ command_registry: GenServer.server(), keymap: GenServer.server(), callbacks: %{required(atom()) => registered_cleanup_fun()}, context: term() ]
Cleanup options with injectable test registries.
@type contextual_cleanup_fun() :: (contribution_source(), context :: term() -> :ok | {:error, term()})
Targeted lifecycle callback invoked with source-specific authority.
Source that contributed registry entries.
Functions
@spec finalize_source(contribution_source(), atom(), cleanup_opts()) :: :ok | {:error, cleanup_failure()}
Runs one targeted source finalizer before runtime termination.
@spec register(atom(), cleanup_fun()) :: :ok
Registers a cleanup callback for a contribution family.
@spec register_contextual(atom(), contextual_cleanup_fun()) :: :ok
Registers a targeted lifecycle callback that requires explicit authority context.
@spec unregister(atom()) :: :ok
Unregisters a cleanup callback. Mostly useful for tests.
@spec unregister_source(contribution_source(), cleanup_opts()) :: :ok | {:error, [cleanup_failure()]}
Removes all contributions owned by a source.