Skip to main content
API reference sections

Schema

RunHeader

What the Run document carries (D14).

There is no conversion to or from [crate::AttemptState], and these two doctests keep it that way: the day someone writes the From, they fail.

compile_fail use koru_delegate_core::{AttemptState, RunHeader}; fn sync_side(state: AttemptState) -> RunHeader { state.into() }

compile_fail use koru_delegate_core::{AttemptState, RunHeader}; fn execution_side(header: RunHeader) -> AttemptState { header.into() }

Type object

Shape

FieldTypeDescription
runrequiredRunId
created_at_msrequiredinteger (int64)
requested_byrequiredActorRef
objectiverequiredObjective

What a person asked the agent to do (D9). The one field of a run that is a prompt, and therefore the one field that must never be reported.

agentrequiredSessionProfileKey

Stable identity for a launch profile. Built-ins remain readable across machines; user-created profiles are opaque UUIDs.

requested_modelDelegateModelName or null

The person's explicit choice; absent means the provider default. Retained intent, never proof of the model the provider actually used.

scoperequiredWorkspaceScope

The working folder a run is admitted to (P1.5) and started in.

Identity is a [ProjectId] rather than a path: the project already carries a canonical root the host validates at launch, and an id is what a second device can name without being able to resolve it (D15, D16). The folder inside it is text a person chose, and is redacted like every path.

`None` is unreachable at admission. It exists so a request can be built before a scope is chosen and so the modal has a state to refuse; P1.5 makes it impossible to start a run with it. M4 adds git shapes - a worktree per run - as new variants, which is why this is an enum.

contextrequiredarray of RunContextItem

Context as given - pinned, and unchanged by anything that happens to the source afterwards (§7.2).

grantsarray of WorkspaceId

The grant set (D28). A resume re-reads it and never widens it.

Default []

statusrequiredRunStatus

The one canonical status (§7.1).

failure_reasonRunFailureReason or null

Safe terminal cause, absent for older runs. Raw provider text is never retained here.

environmentrequiredExecutionEnvironment

The machine a run executes on (D3: execution machinery is device-local).

One variant today. D12 makes the orchestrator cloud-deployable later, and that arrives as a second variant here rather than as a flag on the device - which is why this is #[non_exhaustive]: a dependant that matches it must already say what it does with an environment it does not know.

artifactsarray of ResultReference

Every result registered, in registration order.

Default []

economicsEconomicsSummary

A projection of the retained usage facts and the timeline (§17.1), recomputable; kept here so a device reads the numbers without replaying.

Default {"orchestrator_turns":0,"human_turns":0,"turns_with_usage":0,"input":{"known":0,"unavailable_turns":0},"output":{"known":0,"unavailable_turns":0},"cached_input":{"known":0,"unavailable_turns":0},"tool_calls":0,"interventions":0,"elapsed_ms":null,"models":[],"complete":false}

ratingRunRating or null
originRunOrigin

Durable provenance copied from the creation intent. Additive and defaulted so runs written before scheduling remain manual.

Default {"origin":"manual"}

Example
{
  "run": "00000000-0000-4000-8000-000000000000",
  "created_at_ms": 0,
  "requested_by": {
    "profile": "00000000-0000-4000-8000-000000000000",
    "kind": "person"
  },
  "objective": "string",
  "agent": {
    "kind": "built_in",
    "value": "string"
  },
  "requested_model": "string",
  "scope": {
    "kind": "none"
  },
  "context": [
    {
      "workspace": "00000000-0000-4000-8000-000000000000",
      "document": "00000000-0000-4000-8000-000000000000",
      "version": "00000000-0000-4000-8000-000000000000",
      "kind": "document"
    }
  ],
  "grants": [],
  "status": {
    "state": "created"
  },
  "failure_reason": "capability_not_negotiated",
  "environment": {
    "device": "string",
    "kind": "local_device"
  },
  "artifacts": [],
  "economics": {
    "orchestrator_turns": 0,
    "human_turns": 0,
    "turns_with_usage": 0,
    "input": {
      "known": 0,
      "unavailable_turns": 0
    },
    "output": {
      "known": 0,
      "unavailable_turns": 0
    },
    "cached_input": {
      "known": 0,
      "unavailable_turns": 0
    },
    "tool_calls": 0,
    "interventions": 0,
    "elapsed_ms": null,
    "models": [],
    "complete": false
  },
  "rating": {
    "rating": "good",
    "note": "string",
    "rated_by": {
      "profile": "00000000-0000-4000-8000-000000000000",
      "kind": "person"
    },
    "rated_at_ms": 0
  },
  "origin": {
    "origin": "manual"
  }
}

The contract has no example values, so example bodies are generated from each schema: every field is shown with a placeholder of its type.

Generated from contract version 1. Last updated .

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.