# `Minga.Project.WorkspaceSnapshot`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/project/workspace_snapshot.ex#L1)

Atomic cached state for one active directory workspace.

The root authorizes recursive project behavior, files are always relative to
that root, and `rebuilding?` describes discovery for that same root.
Operational worker, monitor, and timer state remains owned by `Minga.Project`.

# `activation_id`

```elixir
@type activation_id() :: pos_integer()
```

A monotonic identity assigned to one explicit workspace activation.

# `t`

```elixir
@type t() :: %Minga.Project.WorkspaceSnapshot{
  activation_id: activation_id(),
  files: [String.t()],
  rebuilding?: boolean(),
  root: Minga.Project.Root.t()
}
```

A coherent directory workspace and its cached inventory state.

# `activate`

```elixir
@spec activate(Minga.Project.Root.t()) :: t()
```

Installs a directory root with a fresh activation identity and an empty inventory.

# `begin_rebuild`

```elixir
@spec begin_rebuild(t()) :: t()
```

Marks discovery as running for this workspace.

# `complete_rebuild`

```elixir
@spec complete_rebuild(t(), [String.t()]) :: t()
```

Installs one completed workspace-relative inventory atomically.

# `invalidate`

```elixir
@spec invalidate(t()) :: t()
```

Clears cached inventory before discovery starts.

# `stop_rebuild`

```elixir
@spec stop_rebuild(t()) :: t()
```

Marks discovery as stopped while retaining the current cached inventory.

---

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