# `VulnCheck.Workspace`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck/workspace.ex#L1)

Stage 1 of the pipeline: loads the project under audit into a
`VulnCheck.Types.Workspace`.

It detects the project type, parses the lockfile without evaluating code,
computes the production dependency closure (packages reachable only from
`:dev`/`:test` dependencies become `:non_prod`, packages reachable only
from `runtime: false` dependencies become `:build_only`) and locates
compiled `ebin`
directories, falling back from the requested build environment to the other
available ones.

# `assign_scopes`

```elixir
@spec assign_scopes(
  %{required(String.t()) =&gt; VulnCheck.Types.Package.t()},
  [String.t()],
  [String.t()],
  [String.t()]
) :: %{required(String.t()) =&gt; VulnCheck.Types.Package.t()}
```

Assigns `:prod` / `:build_only` / `:non_prod` scopes. Packages reachable
from production roots are `:prod`; packages reachable otherwise only from
build-time roots (`runtime: false` dependencies of the production
closure) are `:build_only`; packages reachable only from non-production
roots are `:non_prod`; packages reachable from none stay `:prod`
(fail-safe).

# `closure`

```elixir
@spec closure(%{required(String.t()) =&gt; VulnCheck.Types.Package.t()}, [String.t()]) ::
  MapSet.t(String.t())
```

Computes the set of package names reachable from `roots` through `deps`.

# `load`

```elixir
@spec load(VulnCheck.Config.t()) ::
  {:ok, VulnCheck.Types.Workspace.t()} | {:error, term()}
```

Loads the workspace described by `config`.

---

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