# `Spectre.Stack.Runtime`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/stack/runtime.ex#L1)

Caller-owned supervisor for resources declared by a resolved Stack.

A Runtime is never globally registered by default. Package callbacks receive
runtime-only options, where credentials and client configuration may live,
and return child specs paired with logical resource identifiers. The
supervisor fences every child under the corresponding `Spectre.Stack.Ref`.

This isolates Stack bindings without claiming that all existing Spectre
application processes are already per-Stack; that broader runtime migration
belongs to later vNext phases.

# `child_specs`

```elixir
@spec child_specs(
  module() | Spectre.Stack.Definition.t(),
  keyword()
) :: {:ok, [Supervisor.child_spec()]} | {:error, term()}
```

Returns the child specs resolved for a Stack without starting them.

# `resolve`

```elixir
@spec resolve(Supervisor.supervisor(), Spectre.Stack.Ref.t()) ::
  {:ok, pid()} | {:error, term()}
```

Resolves a running resource Ref to its supervised child pid.

# `start_link`

```elixir
@spec start_link(
  module() | Spectre.Stack.Definition.t(),
  keyword()
) :: Supervisor.on_start()
```

Starts a Stack runtime.

`:packages` is a map or keyword list keyed by local installation id. These
values are supplied only to runtime callbacks and are not copied into the
immutable Stack definition.

---

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