Parlora.ContextPolicy behaviour (Parlora v0.1.0)

Copy Markdown View Source

Interprets conversation and application state into backend task decisions.

Configure a session with context_policy: {MyApp.Policy, options}. Parlora calls 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 for decision shapes.

Summary

Callbacks

interpret(t, t, keyword)