Mix Project Exists + Elixir Collector
Enforce Mix Project Exists using data collected by Elixir Collector. Automatically check devex build and ci standards on every PR.
How Elixir Collector Powers This Guardrail
The Elixir Collector gathers metadata from your languages, build systems. This data flows into Lunar's Component JSON, where the Mix Project Exists guardrail evaluates it against your standards.
When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.
Quick Start Configuration
Add both the collector and policy to your lunar-config.yml to enable this guardrail.
# Step 1: Enable the Elixir Collector
collectors:
- uses: github://earthly/lunar-lib/collectors/elixir@v1.0.5
# with: ...
# Step 2: Enable the Elixir Project Guardrails
policies:
- uses: github://earthly/lunar-lib/policies/elixir@v1.0.5
include: [mix-project-exists]
# with: ...
What Elixir Collector Collects
This collector gathers the following data that the Mix Project Exists guardrail evaluates.
project
Analyzes Elixir project structure by detecting mix.exs, mix.lock, .credo.exs, .formatter.exs, dialyzer config, and test directory. Parses project name/version, Elixir version requirement, OTP apps, umbrella members, and framework usage (Phoenix, LiveView, Ecto). Writes project metadata to .lang.elixir.
dependencies
Extracts direct dependencies from mix.exs and resolved transitive versions from mix.lock when present. Captures Hex package name and version for each dependency. Writes dependency data to .lang.elixir.dependencies.
cicd
Records every mix command executed in CI pipelines along with the Elixir runtime version. Writes command strings and version info to .lang.elixir.cicd for audit trails and build reproducibility analysis.
test-coverage
Extracts coverage percentage from excoveralls or mix test --cover output after tests complete. Parses coverage reports and writes results to .lang.elixir.tests.coverage.
Example Data Flow
Here's an example of the data that Elixir Collector writes to the Component JSON, which Mix Project Exists then evaluates.
{
"lang": {
"elixir": {
"version": "1.16.2",
"otp_version": "26",
"build_systems": ["mix"],
"mix_exs_exists": true,
"mix_lock_exists": true,
"project_name": "my_app",
"project_version": "0.1.0",
"elixir_requirement": "~> 1.15",
"otp_apps": ["my_app"],
"test_directory_exists": true,
"credo_configured": true,
"dialyzer_configured": true,
"formatter_configured": true,
"frameworks": ["phoenix", "phoenix_live_view", "ecto"],
"umbrella": {
"is_umbrella": true,
"apps": ["my_app_web", "my_app_core"]
},
"source": { "tool": "mix", "integration": "code" },
"cicd": {
"cmds": [
{ "cmd": "mix test --cover", "version": "1.16.2" },
{ "cmd": "mix deps.get", "version": "1.16.2" }
]
},
"tests": {
"coverage": {
"percentage": 85.0,
"source": { "tool": "excoveralls", "integration": "ci" }
}
},
"dependencies": {
"direct": [
{ "path": "phoenix", "version": "~> 1.7" },
{ "path": "phoenix_live_view", "version": "~> 0.20" },
{ "path": "ecto_sql", "version": "~> 3.10" }
],
"transitive": [
{ "path": "telemetry", "version": "1.2.1" }
],
"source": { "tool": "hex", "integration": "code" }
}
}
},
"testing": {
"coverage": {
"percentage": 85.0,
"source": { "tool": "excoveralls", "integration": "ci" }
}
}
}
Configuration Options
Elixir Project Guardrails Inputs
| Input | Required | Default | Description |
|---|
Ready to Automate Your Standards?
See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 200+ built-in guardrails.