# `Jidoka.Session.Transitions`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/session/transitions.ex#L1)

Pure durable session state transitions.

This module validates revisions, leases, claims, checkpoints, commits, and
recovery. It does not call a store or another external service.

# `checkpoint`

```elixir
@spec checkpoint(Jidoka.Session.Data.t(), String.t(), Jidoka.Snapshot.t(), keyword()) ::
  {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Records a durable snapshot under an active lease.

# `claim`

```elixir
@spec claim(Jidoka.Session.Data.t(), Jidoka.Turn.Request.t(), keyword()) ::
  {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Claims a session with a worker lease for one request.

# `claim_without_lease`

```elixir
@spec claim_without_lease(Jidoka.Session.Data.t(), Jidoka.Turn.Request.t()) ::
  {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Claims a caller-managed session without a store lease.

# `commit`

```elixir
@spec commit(Jidoka.Session.Data.t(), String.t(), Jidoka.Session.Data.t(), keyword()) ::
  {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Commits session state and releases its active lease.

# `put`

```elixir
@spec put(Jidoka.Session.Data.t() | nil, Jidoka.Session.Data.t()) ::
  {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Validates a direct session write against the current session.

# `recover`

```elixir
@spec recover(
  Jidoka.Session.Data.t(),
  keyword()
) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Replaces an expired lease for crash recovery.

# `recoverable?`

```elixir
@spec recoverable?(Jidoka.Session.Data.t(), non_neg_integer()) :: boolean()
```

Returns true when a running session has recoverable expired work.

# `renew`

```elixir
@spec renew(Jidoka.Session.Data.t(), String.t(), keyword()) ::
  {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Extends an active session lease.

# `resume`

```elixir
@spec resume(
  Jidoka.Session.Data.t(),
  keyword()
) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
```

Claims a hibernated or waiting session for resume.

---

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