# `Minga.Foundation.Supervisor`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/foundation/supervisor.ex#L1)

Supervises foundational infrastructure that the rest of the application depends on.

Uses `rest_for_one` because Events (an Elixir Registry) is the pub/sub
bus for the entire application. If Events crashes under `one_for_one`,
every subscriber silently loses its registration with no error and no
crash. `rest_for_one` ensures all children after Events re-initialize
and re-subscribe.

## Children

    Foundation.Supervisor (rest_for_one)
    ├── Minga.Language.Registry      ETS, language definitions
    ├── Minga.Events                 Registry(:duplicate), pub/sub bus
    ├── Minga.Config.Options         GenServer, typed options
    ├── Minga.Keymap.Active          Active keymap state
    ├── Minga.Config.Hooks           Lifecycle hooks
    ├── Minga.Config.Advice          Before/after command advice (ETS)
    ├── MingaAgent.Tool.Registry     Agent tool specs (ETS)
    └── Minga.Language.Filetype.Registry      Filetype detection

Language.Registry is first because it has no dependencies and nothing
depends on it within this group. Events is second so that everything
after it re-subscribes on Events restart.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: Supervisor.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
