harness::filesystem::grant
Internal control-plane: grant a session access to an additional filesystem root.
- rootstringrequired
- session_idstringrequired
- rootsstring[]required
- session_idstringrequired
Thin durable turn loop that wires session-manager, context-manager, and llm-router into an agent loop; spawns sub-agents as child sessions.
exact versions are immutable; binary and bundle artifacts are digest-pinned.
Internal control-plane: grant a session access to an additional filesystem root.
Internal control-plane: list additional filesystem roots granted to a session.
Internal control-plane: revoke a session's access to an additional filesystem root.
Internal: settle a pending call's result (or release a held call) and resume the parked turn.
`deliver` (default) supplies the result; `execute` releases a hook-held call through the remaining trigger pipeline.
execute only: one-shot additional roots trusted by the caller and unioned with the session's durable filesystem grants.
False when the call is unknown, already done, or (execute) not held.
True when this resolve re-enqueued the turn.
Internal: invoke one iii function (unwrapped from agent_trigger), enforce the dispatch policy, and capture the normalised result — or report it pending.
The iii function to invoke (already unwrapped from `agent_trigger`).
function_call id, echoed into the result.
Internal: the shared subscription fire handler — injects a notification into the owning session (resolved from the local subscription registry). Not called directly.
Internal: hot-reload harness from the authoritative configuration when it changes — re-binds the cron pending-sweep on a sweep_expression change and swaps the per-call tuning snapshot otherwise.
Configuration id that changed (advisory; the handler re-fetches).
Internal: refresh the cached function-registry snapshot when functions are registered/unregistered (driven by the engine::functions-available trigger).
Engine event tag (advisory; the handler re-fetches the full list).
Internal: drop a deleted session's ephemeral subscriptions. Not called directly.
Internal trigger bridge: reshape a subscribed event into a harness::spawn (a sub-agent), optionally behind a join barrier. Not called directly — THE way to spin up sub-agents on events and callbacks: bind it via engine::register_trigger with the sub-agent spec in `metadata`.
The spawned sub-agent's child session id, when spawn returned one.
Why nothing spawned (missing spec, join not yet complete, already fired, error). Present iff `!spawned`.
Whether a `harness::spawn` was dispatched this call.
Entry point: ensure the session, persist the incoming message, and kick off a turn; returns fast (or merges into a running turn).
Webhook dedupe: a repeated key returns the original `{session_id, turn_id}` and appends nothing.
The incoming message; a string is sugar for a user text message. The role must be `user` or `custom`.
The fail-closed dispatch policy; omit to deny every call.
Tracing passthrough.
The turn's deliverable; default `{ type: "text" }`.
How `system_prompt` combines with the built-in prompt: `override` replaces it; `enrich` (default) appends to it.
Applied when this send creates/ensures the session.
Omit to create a new session.
True when `idempotency_key` matched an earlier send.
True when folded into an in-flight turn (steering).
Spawn a sub-agent in a child session; the model-facing pending trigger — parks the calling turn until the child resolves. Call it directly ONLY when the current turn needs the child's answer; for callbacks, follow-up stages, and fan-in, register the reaction via engine::register_trigger -> harness::react instead.
Absolute filesystem root for the child turn (e.g. an isolated `worktree::create` checkout), written to the child's `metadata.fs_scope.root`. When set it overrides the inherited scope for this child; when absent the child inherits its direct parent's root unchanged.
Intersected with the parent policy — narrow, never escalate.
Fan-out guard for the child's own spawns.
Capped at the parent's remaining turn budget.
The child's deliverable: text / json / json+schema.
Parent-side wait guard for this child.
How `system_prompt` combines with the built-in prompt: `override` replaces it; `enrich` (default) appends to it.
Display-only parent for the console session tree, used when there is no live parent turn (e.g. a trigger-fired spawn from `harness::react`). Writes `SessionMeta.metadata.parent_session_id` so the console nests this child; it does NOT grant policy inheritance or parent-call resolution. Ignored when the dispatcher injects a real parent link (an in-turn spawn).
Stamped by `harness::react` (not caller-supplied): reactive-chain depth, echoed on this turn's `turn-completed` event so react can cap runaway chains at `MAX_REACTIVE_DEPTH`.
Spawn into this session, creating it if it does not exist (e.g. a fork, or a pre-chosen id to filter `turn-completed` subscriptions on); default: create fresh.
Stamped by `harness::react` (not caller-supplied): the subscription that spawned this turn. Its completion event is never delivered back to that same subscription (self-edge loop breaker).
The child's goal — its opening user message.
Read the current turn status for a session.
The coarse, harness-internal turn lifecycle (harness.md § API Reference). Finer-grained than the session's `status`, which the loop derives from it.
Request cancellation of an in-flight turn (cascades to spawned children).
Omit to stop the current turn.
Internal cron sweep: resolve pending function calls past their timeout so a parked turn never wedges. Not called directly.
Number of expired pending calls resolved this sweep.
Internal durable loop step (enqueued onto the default queue); not called directly.
Sub-agent depth carried from the turn record (0 = top-level), so the step can stamp the `iii.tag.kind` baggage (`harness.turn` / `harness.subagent`) before any state read. Defaults to 0 so stale in-flight payloads from before this field existed still classify as top-level turns.
Preview carried from the turn record so the step can stamp the `iii.tag.message` baggage before any state read.
True when a redelivered/stale step was acked and dropped.
The coarse, harness-internal turn lifecycle (harness.md § API Reference). Finer-grained than the session's `status`, which the loop derives from it.
Synchronous hook: after the final assistant message update. Observe only.
pre/post_trigger only: target function_id globs to consult on.
Failure policy (default fail_closed for pre_*, fail_open for post_*).
Chain order: ascending, ties broken by function_id (default 0).
Per-invocation timeout (default 5000ms).
Synchronous hook: after the target returns, before the result is appended. May rewrite content/details/is_error.
pre/post_trigger only: target function_id globs to consult on.
Failure policy (default fail_closed for pre_*, fail_open for post_*).
Chain order: ascending, ties broken by function_id (default 0).
Per-invocation timeout (default 5000ms).
Synchronous hook: after context assembly, before generation. May extend the system prompt, append messages, or veto.
pre/post_trigger only: target function_id globs to consult on.
Failure policy (default fail_closed for pre_*, fail_open for post_*).
Chain order: ascending, ties broken by function_id (default 0).
Per-invocation timeout (default 5000ms).
Synchronous hook: after the allow/deny policy passes, before the target is invoked. May deny, hold, or rewrite arguments.
pre/post_trigger only: target function_id globs to consult on.
Failure policy (default fail_closed for pre_*, fail_open for post_*).
Chain order: ascending, ties broken by function_id (default 0).
Per-invocation timeout (default 5000ms).
Synchronous hook: first step of a turn, before any model spend. May veto.
pre/post_trigger only: target function_id globs to consult on.
Failure policy (default fail_closed for pre_*, fail_open for post_*).
Chain order: ascending, ties broken by function_id (default 0).
Per-invocation timeout (default 5000ms).
A harness turn reached a terminal status (completed/cancelled/failed).
Only deliver sub-agent events whose parent is this session.
Only deliver events for this session.
A harness turn began executing (first loop step).
Only deliver sub-agent events whose parent is this session.
Only deliver events for this session.