When testing telemetry, pub/sub, or any broadcast mechanism with
async: true, events from concurrent tests can leak into mailbox.
Fix: Pin-match on unique identifier to filter.
Two-part pattern:
1. Filter at source — only forward events matching test's identifier
2. Pin in assertion — ^variable rejects mismatches that slip through
Applies to telemetry handlers, PubSub, GenStage/Broadway consumers,
any shared message bus.
Triggered by PR #710 flaky test fix in gargoyle.
Frame the README for someone setting up a subagent that uses
this repo as a knowledge base. Three prompt templates:
solving problems, reviewing code, evaluating patterns.
Patterns are prescriptive — follow them.
Conventions are descriptive — study for ideas.
Clarifies repo purpose, directory structure, and how to
use patterns during development and review.
Absorbed content from rodin/elixir-conventions and rodin/oban-conventions
into a sources/ directory. These are reference material — descriptive,
not prescriptive. Patterns that prove broadly applicable get promoted
into patterns/.
Part of taxonomy cleanup (issue #4):
- Pattern = prescriptive, follow these
- Convention/Source = reference, study for ideas
The original repos can now be archived.
- option_parser.ex: String.to_existing_atom/1 is at line 859, not 855
(line 855 is the String.to_atom clause for allow_nonexistent_atoms)
- logger test_helper.exs: capture_log after clause spans lines 57-65,
not 57-62 (the 'after' keyword is at line 64, restore at line 65)
Pattern 10 (Callback Documentation Convention) now owns the full rule
for callback documentation — both the behaviour side (@callback docs)
and the implementation side (when to override @doc false on @impl
functions). Patterns 2 and 5 cross-reference Pattern 10 instead of
making their own partial statements.
The test: "Would this statement be true of any implementation?" If yes,
it belongs on the @callback. If no, the implementation earns its own
@doc.
Adds 5 new pattern files covering the core Ecto APIs, each with real
source citations at commit fd2ec52b, before/after examples, anti-patterns,
and decision trees.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove Python enhancement scripts (enhance_macros3.py,
enhance_modules.py, enhance_modules2.py), watermark file,
and changelog directory. These were scaffolding from the
initial extraction pass.
Every source reference now links to elixir-lang/elixir at commit f4e1b34.
122 hyperlinks across 11 topic files. Added PATTERN_COMPLETE sentinels.
Removed from-source.md (326 lines, shallow) — covered by existing files.
Using codebase-analysis skill (patterns mode) on the language source.
Real examples from the repo, not invented. Each pattern has:
- Rule, Example, Why, When NOT to use, Source file.
Topics: module org, protocol design, error handling, testing,
documentation, naming, process design, smells.
Extracted patterns from Elixir core and Phoenix source code with specific
file:line citations, then verified all citations against the actual source
in a second pass.
Structure:
- patterns/ — Elixir core patterns (GenServer, errors, data, types, etc.)
- phoenix/ — Phoenix-specific patterns and deviations
- comparison/ — Elixir vs Phoenix side-by-side
- smells/ — Anti-patterns and common mistakes
- changelog/ — Daily Elixir/Phoenix PR digest (auto-updated)
Extracted patterns, conventions, and code smells directly from the
Elixir and Phoenix source code with file path and line number citations.
Covers: GenServer, error handling, data transforms, process design,
testing, documentation, typespecs, macros, behaviours, module organization,
Phoenix-specific patterns, framework deviations, and anti-patterns.