Add Elixir Mix and Phoenix mapper#51
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f062f5c99a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds first-pass heuristic mapping and detection for Elixir Mix / Phoenix projects so Clawpatch can generate meaningful feature seeds (and avoid agent mapping) based on common filesystem conventions.
Changes:
- Introduces a new
elixirmapper that seeds Mix metadata, contexts underlib/<app>, Phoenix web slices underlib/<app>_web, runtime config, Ecto migrations, scripts, and associated ExUnit tests. - Extends project detection to recognize Mix/Elixir/Phoenix/Ecto signals and provide default
mixvalidation commands. - Improves mapping hygiene by skipping Mix dependency directories (
deps) and teaches agent mapping about Elixir/Phoenix file extensions.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/workflow.test.ts | Adds regression test ensuring meaningful Elixir heuristics prevent agent mapping. |
| src/mappers/shared.ts | Adds deps to skip logic for filesystem walking. |
| src/mappers/elixir.ts | New heuristic mapper for Mix/Phoenix project structure and ExUnit test association. |
| src/mapper.ts | Registers the new Elixir mapper in the mapper pipeline. |
| src/mapper.test.ts | Adds tests for Mix/Phoenix detection, mapping coverage, and deps skipping. |
| src/detect.ts | Detects Elixir/Mix, Elixir frameworks (Phoenix/Ecto/etc), and sets default Mix commands; skips deps during detection scans. |
| src/agent-mapper.ts | Adds Elixir/Phoenix-related extensions and Mix manifest name for agent mapping. |
| README.md | Documents Elixir Mix/Phoenix heuristic mapping support. |
| CHANGELOG.md | Notes the new Elixir mapping/detection capability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2800d25 to
0a11234
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a11234adb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| function isCOrCppDependencyPath(path: string): boolean { | ||
| return /(^|\/)(vendor|CMakeFiles|cmake-build-[^/]+)(\/|$)/u.test(path); | ||
| return /(^|\/)(deps|vendor|CMakeFiles|cmake-build-[^/]+)(\/|$)/u.test(path); |
There was a problem hiding this comment.
Limit C/C++ deps filtering to actual dependency roots
The new deps pattern now treats any path segment named deps as third-party, so targetSourcePaths drops explicit CMake sources like src/deps/util.c even when they are first-party code declared in add_executable/add_library. This regresses mapping accuracy by silently omitting real target files from ownedFiles, which can make heuristic coverage and downstream feature boundaries incorrect for projects that use deps as a normal source folder name.
Useful? React with 👍 / 👎.
| } | ||
| return [ | ||
| "node_modules", | ||
| "deps", |
There was a problem hiding this comment.
Avoid skipping nested deps folders in language detection
Adding "deps" to shouldSkipSearchEntry causes recursive detection scans to skip every nested deps directory, not just top-level dependency trees. As a result, projects with reviewable files under paths like src/deps/*.py/*.java/*.php can fail language detection (and therefore miss default commands/framework inference) when no root manifest is present, even though those files are first-party source.
Useful? React with 👍 / 👎.
Summary
Adds first-pass heuristic mapping for Elixir Mix and Phoenix projects.
The mapper creates feature seeds for:
mix.exs,mix.lock,.formatter.exs)lib/<app>lib/<app>_webfor controllers, LiveViews, plugs, components, and channelsconfig/*.exspriv/repo/migrationsscripts/*.exsandscripts/*.shIt also teaches project detection about Mix, Elixir source extensions, Phoenix/Ecto dependencies, default Mix validation commands, and skips generated Mix dependency directories during mapping.
Why
Before this change, Elixir projects fall back to much weaker generic mapping even when the repository has clear Mix/Phoenix conventions. This gives Clawpatch deterministic feature boundaries for common Phoenix applications without invoking agent mapping when heuristic coverage is already meaningful.
Notes
This is intentionally conservative. It does not try to parse Elixir ASTs or infer every Phoenix route. It follows common Mix/Phoenix filesystem conventions and keeps ownership scoped to recognizable project areas.
Validation
Ran on Fedora WSL with Node 26 and
pnpm@11.1.2:pnpm format pnpm lint pnpm typecheck pnpm test pnpm buildResult:
445 passed | 1 skipped, lint/typecheck/build clean.I also smoke-tested the built CLI against a large Phoenix/Elixir repository: the mapper produced 40 heuristic features, skipped agent mapping as meaningful, avoided
depsownership, and produced usable security-context review/fix boundaries.