# `Pixir.Tools.Workspace`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/tools/workspace.ex#L1)

Workspace confinement (CONTEXT.md): the v0.1 safety floor. File Tools resolve a
user/model-supplied path against the Workspace root and refuse anything that escapes
it. Containment is lexical, accepts the root itself, and treats `/` as containing all
absolute descendants. Symlink resolution is deliberately out of scope for v0.1.

# `confine`

```elixir
@spec confine(String.t(), String.t()) :: {:ok, String.t()} | {:error, map()}
```

Resolve `path` (relative or absolute) against `workspace`, confined to it. Returns
`{:ok, absolute_path}` or a structured `:outside_workspace` error.

# `contains?`

```elixir
@spec contains?(String.t(), String.t()) :: boolean()
```

Whether `path` resolves to the Workspace root or one of its descendants.

---

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