# `Parlora.ContextPolicy`
[🔗](https://github.com/hfiguera/parlora/blob/v0.1.0/lib/parlora/context_policy.ex#L1)

Interprets conversation and application state into backend task decisions.

Configure a session with `context_policy: {MyApp.Policy, options}`. Parlora calls
`c:interpret/3` outside the coordinator and audio processes with an immutable
`Parlora.ContextSnapshot`, a `Parlora.ContextTrigger`, and your options.

Return `{:ok, decisions}` using `Parlora.ContextDecision`, or `{:ok, []}` when
no action is needed. Start tasks from a pending delegation, associate a later
delegation with existing work, ask for clarification, or supersede a task when
the caller corrects it. Decisions are checked against current context and task
revisions before admission.

The policy is application code; it may use deterministic rules or an
interpretation service. Its decisions do not authorize business side effects.
Validate permissions and confirmations in application operations too. See the
[policy reference](public-interfaces.html#7-parlora-contextpolicy) for decision shapes.

# `interpret`

```elixir
@callback interpret(Parlora.ContextSnapshot.t(), Parlora.ContextTrigger.t(), keyword()) ::
  {:ok, [Parlora.ContextDecision.t()]} | {:error, Parlora.Error.t()}
```

---

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