# `PtcRunner.Lisp.ProtectedNamespaces`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/lisp/protected_namespaces.ex#L1)

Single consult point for namespace protection in Capability Prelude V1.

Reserved namespaces are host-owned and may never be declared by a
deployment prelude, redefined by user code, or shadowed. V1 reserves
exactly: `tool`, `data`, `budget`, and `ptc.core` (plan §2). The future
"catalog" namespace name is deliberately deferred.

Namespace names are string-backed at the host boundary (plan §3,
Implementation Notes), so this module operates on binaries.

`protected/1` unions the reserved set with a compiled prelude's declared
namespaces — the full set of namespace names that user code must not write
into. This is the seam later phases (analyzer protected-write rejection)
consult.

# `protected`

```elixir
@spec protected(PtcRunner.Lisp.Prelude.t() | nil) :: MapSet.t()
```

The full protected namespace set: reserved namespaces unioned with the
namespaces a compiled prelude declares.

Passing `nil` (no prelude attached) returns just the reserved set.

# `reserved`

```elixir
@spec reserved() :: MapSet.t()
```

The reserved (host-owned) namespace name set.

# `reserved?`

```elixir
@spec reserved?(String.t() | atom()) :: boolean()
```

Whether `name` is a reserved host namespace.

Accepts a binary or an atom; atoms are stringified at the boundary.

---

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