Scoria (scoria v0.1.0)

Copy Markdown View Source

Public facade for Phoenix-hosted Scoria runtime integration.

Start here when wiring Scoria into an application. The happy path is:

  1. Normalize request or session context with identity/1
  2. Start a durable run with start_run/2
  3. Persist the returned run_id
  4. Inspect or resume that exact run through the same module

session_id is the host-owned continuity key that groups related turns. run_id is Scoria's exact durable handle for one run. Reuse a session_id across turns, but resume only by run_id.

For edge normalization details, see Scoria.Identity. For deeper lifecycle APIs behind this facade, see Scoria.Runtime.

Examples

iex> identity =
...>   Scoria.identity(%{
...>     actor_id: "user_123",
...>     tenant_id: "tenant_456",
...>     session_id: "session_789"
...>   })
iex> {identity.actor_id, identity.tenant_id, identity.session_id}
{"user_123", "tenant_456", "session_789"}
iex> identity.metadata
%{}

Summary

Functions

Returns the stable public summary for a run.

Returns the stable public summary for a run or raises.

Returns the curated detailed public view for a run.

Returns the curated detailed public view for a run or raises.

Normalizes caller-supplied edge identity into the canonical runtime envelope.

Lists runs that share the same host-owned session_id.

Resumes a run by exact durable run_id.

Starts a bounded delegated run with one explicit handoff and projected context.

Starts a run through the canonical public runtime facade.

Functions

get_run(run_id)

Returns the stable public summary for a run.

get_run!(run_id)

Returns the stable public summary for a run or raises.

get_run_detail(run_id)

Returns the curated detailed public view for a run.

get_run_detail!(run_id)

Returns the curated detailed public view for a run or raises.

identity(attrs \\ %{})

Normalizes caller-supplied edge identity into the canonical runtime envelope.

list_runs_for_session(session_id)

Lists runs that share the same host-owned session_id.

resume_run(run_id, opts \\ [])

Resumes a run by exact durable run_id.

start_handoff_run(identity, delegated_role_id, opts \\ [])

Starts a bounded delegated run with one explicit handoff and projected context.

start_run(identity, opts \\ [])

Starts a run through the canonical public runtime facade.