API Reference Firebreak v#0.1.0

Copy Markdown View Source

Modules

Firebreak reads the supervision structure of an Elixir/OTP application and reports where the declared failure topology (the supervision tree) diverges from the actual one (the runtime coupling between processes).

The aggregate result of analysing a project: the parsed modules, the resolved coupling edges, the supervision forest (subtree membership), and the findings produced by the checks.

CI plumbing: a committed allowlist (.firebreak.exs) and a finding baseline so a pipeline can fail only on new coupling, not on the backlog it inherited.

Tier-2 analysis — the part no existing tool does.

Boot order ≠ dependency order.

Tier-1 structural checks: facts you can read straight off the supervision tree and each process module, no cross-module graph needed. Cheap, fast, deterministic — the kind of thing that belongs in a CI gate.

A single child entry inside a supervisor's child list.

Supervision-topology conformance: diff the intended tree against the one the code actually produces, and report the drift.

Resolves the per-module coupling edges produced by Firebreak.Source into a global graph.

Detects cycles of synchronous calls in the coupling graph — a deadlock hazard the supervision tree can't show.

A coupling edge: a runtime dependency from one module to another that is not expressed by the supervision tree.

Per-process failure simulation — "if this process crashes right now, what actually goes down, and who blocks?"

Renders the failure modes in the model IR as a Mermaid diagram — making the gap firebreak hunts for visible: which external caller blocks on :noproc when a process in another supervision subtree restarts.

A single issue surfaced by an analysis pass. Findings carry a stable check id (so they can be allowlisted in CI), a severity, and the source location they point at.

Builds the supervision forest from parsed modules: who supervises whom, which supervisors are roots, and the full set of descendant modules in each supervisor's subtree.

A tiny, zero-dependency JSON encoder — just enough to emit Firebreak's report as a CI artifact without pulling in a dependency. A CI gate should be boring and offline; that includes its own dependency footprint.

Generates lockstep concurrency-test scaffolds from firebreak's model IR — the dynamic counterpart to the TLA+ backend.

A spec-generation IR: per supervisor, exactly the facts a lifecycle model needs — and nothing it doesn't.

Everything we learned about a single module: what kind of OTP citizen it is, its supervision configuration (if a supervisor), the names it registers itself under, and its outgoing coupling edges.

Ground-truth enrichment from a live BEAM node.

Finds stateful processes that no supervisor starts.

Generates a Quint lifecycle module from a Firebreak.Model bundle — the same supervision-lifecycle model as Firebreak.Tla, in Quint's syntax.

Renders an Firebreak.Analysis as human-readable text or as JSON (the CI artifact / handoff format).

A single, transparent supervision-risk number per project (and per supervisor), derived from the model IR — for dashboards and for tracking whether a tree is getting riskier over time.

Exact supervision-tree extraction by the canonical OTP method.

Join the static model IR against a live node's observed reality.

A point-in-time reading of a live node's runtime shape, produced by Firebreak.Observe.snapshot/2. Pure data — every field describes what was actually running, so anything derived from it carries :exact confidence.

Parses Elixir source into Firebreak.ModuleInfo structs.

Generates a TLA+ lifecycle module + TLC config from a Firebreak.Model bundle.

Renders an Firebreak.Analysis as a graph in DOT (Graphviz) or Mermaid.

Topology refactor simulation: mutate the supervision structure, re-run the real analysis on the hypothetical, and diff the synchronous cross-tree crossings — so you can answer "does this move actually fix the coupling, or just relocate it?" before touching code.

Mix Tasks

Analyses an Elixir/OTP project's supervision structure and the runtime coupling between processes, reporting where the supervision tree understates the real failure topology.

Generates a lockstep ctest scaffold per synchronous cross-tree crossing firebreak found — the dynamic counterpart to mix firebreak.spec (which generates TLA+). Where the TLA+ spec proves the cross-tree :noproc failure is reachable in a model, the lockstep scaffold is the starting point for a test that reproduces it in the running BEAM.

Generates a formal lifecycle spec per supervisor, derived purely from firebreak's supervision model (mix firebreak --format model). Each spec models the restart/escalation lifecycle and — only where firebreak found a synchronous cross-tree crossing — an external-caller availability property.