Frontier.Store
(Frontier v0.2.1)
Copy Markdown
ETS-backed runtime store for Frontier config: root, contexts, ignored modules, reclassifications, and tracer references.
Summary
Functions
Returns all ignored modules as a MapSet.
Returns all reclassified modules as a map of module => target context.
Returns the config for a context module, or nil.
Returns all registered contexts as a map of module => config.
Creates the ETS tables in the calling process. Only Store.Owner should
call this — everything else goes through init/0 so the tables are owned
by the stable process rather than the caller.
Loads Frontier config from compiled BEAM files if ETS is empty.
Returns true if the module is ignored.
Ensures the ETS tables exist, owned by a stable process.
Marks a module as initialized, clearing its previous references. Idempotent per compilation.
Scans compiled BEAM files for persisted frontier_opts attributes and registers them.
Returns the target context for a reclassified module, or nil.
Records a cross-module reference from the tracer.
Returns all recorded references with :from key injected.
Registers a context module and its config.
Registers a module as ignored.
Registers a module as reclassified to a different context.
Registers the root module config.
Wipes all ETS tables.
Resets the initialized tracking table.
Returns the root module and its config, or nil.
Functions
Returns all ignored modules as a MapSet.
Returns all reclassified modules as a map of module => target context.
Returns the config for a context module, or nil.
Returns all registered contexts as a map of module => config.
@spec create_tables() :: :ok
Creates the ETS tables in the calling process. Only Store.Owner should
call this — everything else goes through init/0 so the tables are owned
by the stable process rather than the caller.
@spec ensure_loaded() :: :ok
Loads Frontier config from compiled BEAM files if ETS is empty.
Returns true if the module is ignored.
@spec init() :: :ok
Ensures the ETS tables exist, owned by a stable process.
Idempotent and safe to call concurrently from parallel compiler workers:
delegates to Frontier.Store.Owner, which spawns an unlinked, detached
process to own the tables so ownership never rides on the transient worker
that triggered it. Blocks until the tables exist, so a caller can insert
immediately on return.
@spec initialize_module(module()) :: :ok
Marks a module as initialized, clearing its previous references. Idempotent per compilation.
@spec load_from_modules() :: :ok
Scans compiled BEAM files for persisted frontier_opts attributes and registers them.
Returns the target context for a reclassified module, or nil.
Records a cross-module reference from the tracer.
@spec references() :: [map()]
Returns all recorded references with :from key injected.
Registers a context module and its config.
@spec register_ignored(module()) :: true
Registers a module as ignored.
Registers a module as reclassified to a different context.
Registers the root module config.
@spec reset() :: :ok
Wipes all ETS tables.
@spec reset_initialized() :: :ok | true
Resets the initialized tracking table.
Returns the root module and its config, or nil.