Foundry. Context. Introspector
(foundry v0.1.3)
Copy Markdown
Core Spark DSL introspection logic for mix foundry.context and
mix foundry.context.all.
Reads compiled modules via Spark.Dsl.Extension introspection and maps
them to Foundry.Context.ModuleContext structs. All reads are against
the live compiled beam — never against source text.
Module type detection
Detection order (first match wins):
- Implements
AshAuthenticationsubject →:resource(auth) - Uses
Ash.Resource→:resource - Uses
Reactorwith Transfer DSL →:transfer - Uses
Reactor→ checked for Oban worker pattern →:oban_job - Uses Foundry
RuleDSL →:rule - Uses Foundry
BlueprintDSL →:blueprint - Uses
Phoenix.LiveView+ LiveResource →:live_page - Implements provider adapter behaviour →
:adapter
Caller responsibility
The caller (Mix task) is responsible for ensuring the target project is
compiled and its modules are loaded before calling into this module.
Introspector never calls Mix.Task.run("compile") itself.
Sensitive detection
A module is marked sensitive: true when its string name appears in
manifest.sensitive_resources, or when it is an ash_authentication
User/Token resource.
Summary
Functions
Build a ModuleContext for a single module.
Build ModuleContext structs for all Foundry-relevant modules in the
compiled project, grouped by domain name string.
Types
Functions
Build a ModuleContext for a single module.
Returns {:ok, %ModuleContext{}} or {:error, reason}.
Build ModuleContext structs for all Foundry-relevant modules in the
compiled project, grouped by domain name string.
Returns %{domain_name => [ModuleContext.t()]}.