Jidoka.Harness (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Thin execution harness around Jidoka's data-first agent kernel.

The harness is the named boundary where executable turn data, runtime capabilities, checkpoint policy, sessions, stores, replay, eval cases, memory, and review flows meet. Those operational concerns belong here rather than in the root Jidoka facade or the pure workflow steps.

Summary

Functions

Lists pending human-review requests from a session or store.

Returns a data-only replay view for a session or snapshot.

Resumes a hibernated agent snapshot.

Resumes the latest snapshot for a harness session.

Runs one turn for a harness session and persists the resulting session state.

Runs one agent turn through the harness.

Starts a persisted or caller-managed harness session.

Writes one memory entry through the configured memory store.

Types

agent_input()

@type agent_input() :: Jidoka.Agent.Spec.t() | keyword() | map()

plan_input()

@type plan_input() :: Jidoka.Agent.Spec.t() | Jidoka.Turn.Plan.t() | keyword() | map()

request_input()

@type request_input() :: Jidoka.Turn.Request.t() | String.t() | keyword() | map()

run_result()

@type run_result() :: Jidoka.Runtime.TurnRunner.run_result()

runtime_opts()

@type runtime_opts() :: keyword()

session_input()

@type session_input() :: Jidoka.Harness.Session.t() | String.t()

session_run_result()

@type session_run_result() ::
  {:ok, Jidoka.Harness.Session.t(), Jidoka.Turn.Result.t()}
  | {:hibernate, Jidoka.Harness.Session.t(), Jidoka.Runtime.AgentSnapshot.t()}
  | {:error, term()}

Functions

pending_reviews(session)

@spec pending_reviews(Jidoka.Harness.Session.t() | Jidoka.Harness.Store.store()) ::
  {:ok, [Jidoka.Review.Request.t()]} | {:error, term()}

Lists pending human-review requests from a session or store.

replay(session)

Returns a data-only replay view for a session or snapshot.

resume(snapshot_input, opts \\ [])

Resumes a hibernated agent snapshot.

resume_session(session_input, opts \\ [])

@spec resume_session(session_input(), runtime_opts()) :: session_run_result()

Resumes the latest snapshot for a harness session.

run_session(session_input, request_input, opts \\ [])

Runs one turn for a harness session and persists the resulting session state.

run_turn(spec_or_plan, request_input, opts \\ [])

@spec run_turn(plan_input(), request_input(), runtime_opts()) :: run_result()

Runs one agent turn through the harness.

start_session(spec_or_plan, opts \\ [])

@spec start_session(plan_input(), runtime_opts()) ::
  {:ok, Jidoka.Harness.Session.t()} | {:error, term()}

Starts a persisted or caller-managed harness session.

Pass store: {Jidoka.Harness.Store.InMemory, pid: pid} or another Jidoka.Harness.Store implementation to persist the session immediately.

write_memory(spec_or_session, content, opts \\ [])

@spec write_memory(
  plan_input() | Jidoka.Harness.Session.t(),
  String.t(),
  runtime_opts()
) ::
  {:ok, Jidoka.Memory.WriteResult.t()} | {:error, term()}

Writes one memory entry through the configured memory store.