---
title: Glossary
description: weft's terms in one or two sentences each — run, step, park, approval boundary, session, seam, tap, record, destination and the rest — with the page that explains each.
url: https://weftgo.dev/docs/reference/glossary/
type: reference
sources:
  - weft/AGENTS.md:1-18 (modules, facades), 20-166 (blocks 1-3b), 168-192 (blocks 4-5), 195-214 (block 6), 215-479 (blocks 7, 7a, 7b), 552-596 (block 8), 597-635 (block 9), 637-653 (testing), 656-723 (rules 1-13), 725-750 (T1-T5)
  - weft/docs/agent-loop-deep-dive.md:3008-3049 (§31 Glossary)
  - weft/core/events.go:8-183
  - weft/core/subagent.go:166-182 (child run ids)
  - weft/core/tool.go:642-765 (ReplayPolicy)
  - weft/core/model.go:274-282 (ModelToolCallDelta)
  - weft/thread/doc.go:1-197 (sessions, entries, turns, busy policies, compaction, approvals, identity, concurrency)
  - weft/runtime/doc.go:1-119 (runtime link, commands, engines, side effects, breakpoints)
  - weft/studio/doc.go:1-60 (Inspector, setups A, B and C, capabilities)
  - weft/otel/doc.go:1-50 (destinations, content policy, heartbeats, slog bridge, local sink)
  - weft/obsdb/doc.go:1-36 (obsdb, hub, deltas and heartbeats not stored)
  - weft/scope/scope.go:1-49 (Scope, Weft-Scope)
  - weft/scope/scope.go:92 (FlowID); weft/studio/web/src/panel/element.ts:631-637 (conversationKey keeps flow), 3018-3027 (the flow chip, filters nothing), 3242-3282 (the switcher label)
  - weft/docs/record-contract.md:237-486 (spans), 486-511 (log records), 936-951 (content policy), 1023 (status), 1554-1572 (badges)
  - weft/internal/discovery/discovery.go:99-114, 314-350 (discovery file)
  - weft/CHANGELOG.md:35 (layer spans, DevDetail), 36 (mcp.Server, origins), 38 (CallerMeta, the caller link), 41 (a derived run with no session), 46-48 (tag, agent and flow scopes; tag-scoped panel tokens), 124 (0.19.0 DevMode)
  - weft/docs/record-contract.md:88-90 (caller link, remote), 177 (weft.flow), 449 (weft.tool.origin), 462-485 (layer), 1728 (derived session_id)
---

# Glossary

Each entry defines one weft term in a sentence or two and links the page that explains it. Code names link to [pkg.go.dev](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2). Terms other agent frameworks use, and how they map to weft, are at the [end of the page](#glossary).

## A

### Adapter

An **adapter** is a package that implements [`weft.Model`](https://pkg.go.dev/github.com/weftgo/weft/core@v0.20.2#Model) over a provider's official SDK: `weft/openai`, `weft/anthropic` and `weft/google`. Each passes the shared [conformance suite](#conformance-suite). See [Connect a model provider](https://weftgo.dev/docs/guides/providers/).

### Agent

An **agent** is an immutable value built by [`weft.New`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#New): a model, instructions, tools and policy. You build it once and run it many times, concurrently. See [What is an agent in weft?](https://weftgo.dev/docs/concepts/agents/).

### App log record

An **app log record** is a line your program logs through `slog` that [`otel.Slog()`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/otel#Slog) bridges into the run's records, under the span of the context it was logged on. See [Bridge your app's slog lines into runs](https://weftgo.dev/docs/observe/app-logs/).

### Approval boundary

The **approval boundary** is the point where a run ends successfully with [pending](#pending) tool calls instead of running them; a later run [resumes](#resume) them with `Approve`, `Deny` or `Resolve` ([rule 12](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md#the-rules-do-not-break-these-tests-pin-them)). It is a policy seam, not a security boundary. See [Require human approval for a tool](https://weftgo.dev/docs/guides/approvals/).

### Attempt

An **attempt** is one try inside a model call, reported by `mw.Retry`, `mw.Fallback` or an adapter as an `attempt` span under the call's `chat` span. See [Retry and fall back when a provider fails](https://weftgo.dev/docs/guides/retries-and-fallback/).

## B

### Badge

A **badge** is the mark Studio and the panel draw where a record is missing, cut or derived. Every badge is a [hole](#hole) word from one closed table, with an optional cause. See [Badges and holes](https://weftgo.dev/docs/reference/badges/).

### Barrier

A **barrier** is a tool marked [`weft.Sequential()`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Sequential): it waits for the step's in-flight calls, runs alone, then lets the step continue. See [Set per-tool policy](https://weftgo.dev/docs/guides/tool-policy/).

### Branch

To **branch** a session is to append a leaf entry with `Session.Branch` that moves its [leaf](#leaf) to any entry the session holds, on any branch, or to the root. The abandoned entries stay in the tree. See [Label, branch and fork a session](https://weftgo.dev/docs/sessions/tree/).

### Breakpoint

A **breakpoint** is a tool name the playground parks on every run a [runtime](#runtime) starts, and on the app's own runs of an agent built with `runtime.Breakpoints()`. See [Pause runs at breakpoints](https://weftgo.dev/docs/observe/playground/breakpoints/).

### Budget

A **budget** is a limit whose breach fails the run: `MaxSteps`, `UsageLimit`, `MaxModelRetries` and `DetectLoops`. Each is checked only when the loop would call the model again ([rule 13](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md#the-rules-do-not-break-these-tests-pin-them)). See [How does a run stop?](https://weftgo.dev/docs/concepts/budgets-and-stopping/).

### Busy policy

A **busy policy** is what `Session.Send` does when a [turn](#turn) is already running: `Queue` (the default), `Reject`, `Steer`, `Interrupt` or `Rollback`. See [What happens when you send while a turn runs?](https://weftgo.dev/docs/sessions/busy-and-steering/).

## C

### Call ID

A **call ID** is the model's id for one tool call. It pairs the call's `ToolStart` and `ToolFinish` events and its result in the transcript. See [Event types](https://weftgo.dev/docs/reference/events/#toolstart).

### Caller link

A **caller link** is the pair `weft.caller.run.id` and `weft.caller.call.id` on a run started from inside another run's tool call: a link, not parenthood. Since 0.20.0 `weft.WithCaller` sets one for a caller in another process, such as an MCP client sending `mcp.CallerMeta`; that run stays top-level. See [Link a served run to its caller](https://weftgo.dev/docs/guides/mcp/#link-a-served-run-to-its-caller).

### Capability

A **capability** is a name in Studio's `/api/meta` that says a route group or feature is on (`live`, `playground`, `search`, …). The UI and the panel show a screen only when its capability is listed. See [Studio HTTP API](https://weftgo.dev/docs/reference/studio-api/).

### Child run

A **child run** is the run a [subagent](#subagent) tool starts. Its id is `<parent>/<step>/<call>`, or `<parent>/resume/<call>` for a call run under `Approve`, and its events reach the parent's stream wrapped in `Nested`. See [Delegate to another agent](https://weftgo.dev/docs/guides/subagents/).

### Command

A **command** is one request Studio sends a [runtime](#runtime) over the [runtime link](#runtime-link): run an experiment, decide a parked call, steer, cancel. Run and decision commands are acked before they run, at most once; a cancel is best effort, with no ack. See [How does the playground work?](https://weftgo.dev/docs/observe/playground/overview/).

### Compaction

**Compaction** keeps a long session inside the model's context window: a compaction entry carries a summary and the first entry kept raw, and the [context](#context) reads the summary in place of what came before. Nothing is deleted. See [Keep long sessions inside the context window](https://weftgo.dev/docs/sessions/compaction/).

### Conformance suite

The **conformance suite** is `wefttest/conformance`: the executable contract every provider adapter passes, offline against fixtures or live behind `-tags live`. See [Prove a provider adapter](https://weftgo.dev/docs/testing/conformance/).

### Containment boundary

The **containment boundary** is the point outside the tool middleware chain where a panic or a timeout becomes an error result. A hung tool never hangs the run ([rule 9](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md#the-rules-do-not-break-these-tests-pin-them)). See [Tool errors are data, run errors are yours](https://weftgo.dev/docs/concepts/errors/).

### Content policy

A **content policy** is a destination's choice whether records carry content: message text, tool arguments and results, the system prompt, the tool catalog. Content is on for the local sink and Studio and off for `otel.OTLP`, `otel.Exporters` and the vendor presets. See [Control what content leaves the process](https://weftgo.dev/docs/production/content-and-privacy/).

### Context

A session's **context** is what the model sees on the next turn: the messages on the path from a root to the [leaf](#leaf), repaired (`Session.Context`). See [What is a session?](https://weftgo.dev/docs/sessions/overview/).

### Core

**core** is the module `github.com/weftgo/weft/core`: the loop alone, whose only dependency is the OpenTelemetry API. The root package `weft` re-exports it under the same names. See [Install weft and choose a module](https://weftgo.dev/docs/get-started/install/).

## D

### Delta

A **delta** is a `TextDelta`, `ReasoningDelta` or `ToolArgsDelta` event: an increment while the model streams. As `delta` records they go to the destinations that take records, unless that destination's `otel.NoDeltas` drops them, and they are the first records shed when a destination's queue fills. No database stores them. See [Event types](https://weftgo.dev/docs/reference/events/).

### Derived run

A **derived run** is a run obsdb built from stock OpenTelemetry GenAI spans of an app that is not weft, instead of from weft's own records. Its root's `gen_ai.conversation.id` is its session; since 0.20.0 a top-level root without one is a run with no session rather than skipped. Its row is marked derived, and what Studio reconstructed for it carries the `derived` badge. See [Inspect agents written in other languages](https://weftgo.dev/docs/observe/other-languages/).

### Destination

A **destination** is one place the [pipeline](#pipeline) sends spans and records: the local sink, Studio, Datadog, Langfuse, any OTLP endpoint, or your own exporters. Each has its own content policy; the exporting destinations also have a batch queue, while the local sink writes synchronously. See [Send records to Studio, Datadog, Langfuse or any OTLP backend](https://weftgo.dev/docs/observe/destinations/).

### Dev gate

The **dev gate** is the check development-only options pass before they take effect: `WEFT_ENV=dev` when the pipeline starts, or `otel.DevMode()` in code (since 0.19.0). Behind it are raw provider bodies, blocking delivery and, since 0.20.0, `otel.DevDetail`; otherwise `Start` ignores them and logs a WARN for each one it ignored. When `WEFT_ENV` is set to anything but `dev`, it overrules `DevMode` with one line, `otel: DevMode ignored: WEFT_ENV=<value>`. See [Record provider wire bodies](https://weftgo.dev/docs/observe/destinations/#record-provider-wire-bodies-development-only).

### Dev token

The **dev token** is the token `weft studio` serves with full access, stable per database file (`<db>.token`, mode 0600). See [Secure Studio](https://weftgo.dev/docs/production/security/).

### Discovery file

The **discovery file** is `studio.json`, written by a running `weft studio` or `weft dev` with its URL and token. An app with no `WEFT_STUDIO_URL` reads it and exports to that Studio; `WEFT_DISCOVERY=off` stops it. See [Develop with weft dev](https://weftgo.dev/docs/observe/weft-dev/).

### Drain point

A **drain point** is where the loop delivers [steered](#steer) messages: after a step's tool batch, and at what would be the final step, where a delivery redirects into one more step. See [Steer a running turn](https://weftgo.dev/docs/guides/steering/).

## E

### Engine

An **engine** is how a playground command runs: `live` calls the agent's model (or an allowed alternate); `scripted` answers each model call with the source run's recorded turn, at zero tokens. See [How does the playground work?](https://weftgo.dev/docs/observe/playground/overview/).

### Entry

An **entry** is one node appended to a session's tree: a message, a turn, a compaction, a leaf move, a label, an approval record, a receipt and so on. Every entry has an id, a parent and a time, and none is rewritten. See [The session log format](https://weftgo.dev/docs/sessions/format/).

### Event

An **event** is one typed progress value a run emits, from `RunStart` to `RunFinish`, with a `type` discriminator on the wire. See [Event types](https://weftgo.dev/docs/reference/events/).

### Experiment

An **experiment** is a group of playground runs, variants of one command, that share an `experiment_id`; Studio saves it with its command, and budget caps count per experiment. See [Run experiments with the option lab](https://weftgo.dev/docs/observe/playground/experiments/).

## F

### Facade

A **facade** is a generated package (`weft`, `mw`, `wefttest`, `wefttest/conformance`) whose every name is an alias of, or a wrapper around, the same name in `core`. See [Go API reference](https://weftgo.dev/docs/reference/api/).

### Fixture

A **fixture** is a recorded model exchange: [`wefttest.Record`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Record) writes one JSON file per request, and [`wefttest.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Replay) answers a request whose messages, tool names, thinking level and sequential flag match. Studio's wefttest export writes fixtures from a recorded run, its tool results keyed by step and call id. See [Turn a Studio run into a test](https://weftgo.dev/docs/testing/studio-runs-as-tests/).

### Flow

A **flow** is an id your app chooses for a part of a conversation, carried in the [scope](#scope) as `flow=`. Since 0.20.0 it is run metadata, `weft.flow`, stamped by `scope.Header` or `scope.WithFlow`: Studio's lists and the panel narrow by it. It is caller-written, so it narrows a view and never grants one. See [Flows](https://weftgo.dev/docs/observe/devtools/scope/#narrow-by-a-flow).

### Fork

To **fork** a session is to copy a path of its tree into a new, self-contained session whose header names its origin (`Session.Fork`). The playground's `fork` thread mode does this for an experiment. See [Label, branch and fork a session](https://weftgo.dev/docs/sessions/tree/).

## G

### Grant

A **grant** is a session's standing approval: the decision chain consults it for every call about to park, newest grant first, and a call it covers runs without parking. `Session.Grant` adds one and `Session.Revoke` removes it; the decision `thread.ApproveAlways` approves a call and grants the same tool with the same arguments for the future. See [Approvals in sessions](https://weftgo.dev/docs/sessions/approvals/).

## H

### Heartbeat

A **heartbeat** is a `weft.heartbeat` record the pipeline emits for each open run, every 10 s by default, so a quiet run still reads running and a crashed process stops beating. Heartbeats are never stored. See [Record every run with otel.Install](https://weftgo.dev/docs/observe/recording/).

### Hole

A **hole** is a place where a run's record is missing, cut or derived. `obsdb.Hole` names it (`not_recorded`, `stripped`, `truncated`, `gap`, …) and `obsdb.HoleCause` says why; Studio and the panel draw each hole as a [badge](#badge). See [Badges and holes](https://weftgo.dev/docs/reference/badges/).

### Hub

The **hub** is obsdb's in-process live lane (`obsdb.Hub`): the obsdb SQLite database publishes each write's frames to it before the write returns, so Studio embedded beside the local sink streams new records with no network hop. See [Watch runs live](https://weftgo.dev/docs/observe/studio/live/).

## I

### Idle timeout

The **idle timeout** is an adapter's limit on the gap between stream chunks, 60 s by default; when it expires the call fails wrapping `ErrStreamIdle`. It bounds silence, not slowness. See [Connect a model provider](https://weftgo.dev/docs/guides/providers/).

### Inspector

The **Inspector** is what package `studio` serves: the UI, the JSON API, the live stream and the OTLP receiver over one observability database. Studio is its product name. See [Run Studio](https://weftgo.dev/docs/observe/studio/setup/).

### Interrupted

**Interrupted** is the status of a run with no recorded end whose last record or span is more than 30 s old: the process stopped without finishing it. It is derived when read, never stored. See [Find runs](https://weftgo.dev/docs/observe/studio/runs/).

## K

### Kill switch

The **kill switch** is `WEFT_MODEL_REQUESTS=deny`: every first-party adapter that built its own client fails its call with `ErrModelRequestsDenied` before any network I/O. See [Environment variables](https://weftgo.dev/docs/reference/env/#weft-model-requests).

## L

### Layer span

A **layer span** is one `layer <name>` span per model or tool middleware layer per call, recorded only under `otel.DevDetail` behind the [dev gate](#dev-gate) and only by Local and Studio destinations with content on (since 0.20.0). Studio draws them as the call's onion. See [The onion in the record](https://weftgo.dev/docs/guides/middleware/#the-onion-in-the-record) and the [`layer` span](https://weftgo.dev/docs/reference/record-contract/#layer).

### Leaf

A session's **leaf** is the entry the next one attaches to; [branching](#branch) moves it. See [Label, branch and fork a session](https://weftgo.dev/docs/sessions/tree/).

### Lineage

**Lineage** is the parent-to-child relation between runs, in the child's id (`<parent>/<step>/<call>`, or `<parent>/resume/<call>` for a resumed call) and in the `Nested` wrapper's `CallID`; a pool child session carries it in its header. See [Delegate to another agent](https://weftgo.dev/docs/guides/subagents/).

### Local sink

The **local sink** is the [destination](#destination) [`otel.Local`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/otel#Local): a SQLite file (`./.weft/weft.db` by default) written synchronously, with content on and no network. Studio reads it back through `obsdb`. See [Record every run with otel.Install](https://weftgo.dev/docs/observe/recording/).

### Loop

The **loop** is the agent loop: call the model, run the tool calls it asked for, feed the results back, and repeat until a stop condition, a final answer or a budget ends the run. See [What happens in one step?](https://weftgo.dev/docs/concepts/the-loop/).

## M

### Manifest

The **manifest** is `weft.json`, generated from code by [`weft.Manifest`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Manifest) and committed: each agent's name, instructions, policy and tool schemas. It is output, never read back as configuration. See [Describe your agents in weft.json](https://weftgo.dev/docs/guides/manifest/).

### Message

A **message** is a role (`user`, `assistant` or `tool`) plus typed [parts](#part). There is no system role: instructions are configuration. See [Messages, parts and the transcript](https://weftgo.dev/docs/concepts/messages/).

### Metadata

**Metadata** is string pairs set with [`weft.Metadata`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Metadata) that land on every span and record of a run; subagent runs inherit them. See [Tag runs with metadata](https://weftgo.dev/docs/guides/metadata/).

### Middleware

**Middleware** is a function that wraps the next model or tool caller, registered with `WrapModel` or `WrapTools`; the first one listed is the outermost. It is how behaviour attaches at the two [seams](#seam). Under the [dev gate](#dev-gate) with `otel.DevDetail`, each layer is recorded as a [layer span](#layer-span). See [Add behaviour with middleware](https://weftgo.dev/docs/guides/middleware/).

### Model

A **model** is any value that implements `weft.Model`, one `Stream` method: a provider [adapter](#adapter) or a scripted test double. The loop enforces its stream contract. See [What is a Model?](https://weftgo.dev/docs/concepts/models/).

### Model retry

A **model retry** is a tool asking the model to fix its arguments with `weft.ModelRetry`: the model sees a `RETRY:` result, and the loop bounds the retries with `MaxModelRetries` (3 by default). See [Tool errors are data, run errors are yours](https://weftgo.dev/docs/concepts/errors/).

## N

### Nested event

A **nested event** is a child run's event wrapped in `Nested` for the parent's stream, numbered from the parent's `Seq`. See [Event types](https://weftgo.dev/docs/reference/events/#nested).

## O

### Observer

An **observer** sees a run without changing it: `weft.Tap` (every event), `weft.OnRunEnd` (the outcome, once per run) and `weft.OnMessages` (each message as it joins the transcript). See [Observe a run without changing it](https://weftgo.dev/docs/guides/observers/).

### Option lab

The **option lab** is the playground form that runs an agent with overrides (instructions, model, tools, sampling, options), each one narrowing or neutral, never widening. See [Run experiments with the option lab](https://weftgo.dev/docs/observe/playground/experiments/).

### Origin

A tool's **origin** says where a non-local tool came from: `subagent`, `mcp:<server>` for a tool `weft/mcp` imported under `mcp.Server(name)`, or your own word. Since 0.20.0 it is recorded on the call's span as `weft.tool.origin`, never an address. See [MCP identity](https://weftgo.dev/docs/guides/mcp/#mcp-identity).

## P

### Panel

The **panel** (the devtools panel) is Studio's in-page view of the conversation on your app's page, loaded from Studio's `/panel.js` or the `@weftgo/devtools` package. See [What is the devtools panel?](https://weftgo.dev/docs/observe/devtools/overview/).

### Panel token

A **panel token** is a scoped, HMAC-signed token for one [public id](#public-id), or since 0.20.0 for one batch of runs by their [tags](#tag), minted through `POST /api/panel-tokens` on a Studio that has a token. See [Secure the devtools panel](https://weftgo.dev/docs/observe/devtools/security/#tokens).

### Park

To **park** a tool call is to hold it at the [approval boundary](#approval-boundary) without running it, so the run ends with the call pending. A call parks under `RequireApproval`, `ParkOn`, `ParkAllExcept`, a `ParkSource`, or middleware returning an error that wraps `ErrApprovalRequired`. See [Require human approval for a tool](https://weftgo.dev/docs/guides/approvals/).

### Part

A **part** is one typed piece of a message: text, a file, a tool call, a tool result or a reasoning block, each with a `type` discriminator on the wire. See [Messages, parts and the transcript](https://weftgo.dev/docs/concepts/messages/).

### Pending

A **pending** call is one the run ended on without running it, awaiting a decision; it is listed on `RunResult.Pending` and `RunFinish.Pending`. Studio calls such a run parked until a resume names it. See [Require human approval for a tool](https://weftgo.dev/docs/guides/approvals/).

### Pipeline

The **pipeline** is what `otel.Install` builds: one OpenTelemetry provider pair whose spans and records fan out to every [destination](#destination). See [Record every run with otel.Install](https://weftgo.dev/docs/observe/recording/).

### Playground

The **playground** is Studio's surface for running experiments against your real agents: Studio sends [commands](#command), and the [runtime](#runtime) in your process runs them with your tools and model keys. Studio never runs your agent. See [How does the playground work?](https://weftgo.dev/docs/observe/playground/overview/).

### Pool

A **pool** (package `thread/pool`) runs bounded concurrent child sessions for a parent session: each child is a session of its own, linked to the parent call, and its usage lands in the parent's `Usage.Delegated`. See [Run bounded child sessions with a pool](https://weftgo.dev/docs/sessions/pools/).

### PrepareStep

**PrepareStep** is the one loop knob: a function that rewrites each step's model request (messages, tools, system prompt) before it is sent. See [Rewrite the request each step](https://weftgo.dev/docs/guides/prepare-step/).

### Prompt snippet

A **prompt snippet** is a paragraph a tool adds to the system prompt with `weft.PromptSnippet`, composed after the agent's instructions. See [Set per-tool policy](https://weftgo.dev/docs/guides/tool-policy/).

### Public id

A **public id** is a session's opaque handle that is safe to show a browser (`thread.PublicID`). Its runs carry it as `weft.public_id`, and the panel scopes itself by it. See [Scope the panel to a conversation](https://weftgo.dev/docs/observe/devtools/scope/).

## R

### Raw tool

A **raw tool** is a tool with an explicit JSON schema and a handler that takes the raw argument bytes ([`weft.RawTool`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#RawTool)), for tools defined outside Go source. See [Define tools at runtime](https://weftgo.dev/docs/guides/dynamic-tools/).

### Receipt

A **receipt** is the entry a session writes when it accepts input it cannot run yet, a queued send or a steer, so the input survives a crash. A `pool_receipt` records one delegation's journey. See [What happens when you send while a turn runs?](https://weftgo.dev/docs/sessions/busy-and-steering/).

### Record

A **record** is one OpenTelemetry log record weft emits, its kind in `weft.record`: `event`, `delta`, `messages`, `request`, `prompt`, `tools`, `raw`, `compaction` or `heartbeat`. See [The record contract](https://weftgo.dev/docs/reference/record-contract/).

### Repair

To **repair** a transcript is to make it valid input: every tool call gets a result and orphan results are dropped ([`weft.Repair`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Repair)). The loop repairs a transcript fed back in. See [Messages, parts and the transcript](https://weftgo.dev/docs/concepts/messages/).

### Replay

**Replay** means two things. In tests, [`wefttest.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Replay) answers model calls from recorded [fixtures](#fixture); in the playground, a replay re-runs a recorded run from a chosen step, optionally with edits. See [Record a real conversation once, replay it forever](https://weftgo.dev/docs/testing/record-replay/) and [Replay a run from any step](https://weftgo.dev/docs/observe/playground/replay/).

### Replay class

A tool's **replay class** says whether a re-run may call it for real: `weft.Replay(weft.ReplaySafe)` vouches it has no side effects; an unannotated tool counts as `never`, and its call is substituted with the recorded result or parked. See [How does the playground work?](https://weftgo.dev/docs/observe/playground/overview/).

### Resolve

To **resolve** a pending call is to resume it with a result computed outside the process, with [`weft.Resolve`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Resolve); the tool's handler never runs. See [Require human approval for a tool](https://weftgo.dev/docs/guides/approvals/).

### Resume

To **resume** a parked run is to start the next run with its transcript and a decision for each pending call (`Approve`, `Deny`, `Resolve`). [`weft.ResumeOf`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#ResumeOf) links the new run to the parked one. See [Require human approval for a tool](https://weftgo.dev/docs/guides/approvals/).

### Run

A **run** is one call to `Generate` or `Stream`: the loop takes steps until a stop condition, a final answer or the approval boundary ends it, or an error fails it. Every run has an id; `RunStart` is its first event. See [What does a run return?](https://weftgo.dev/docs/concepts/runs/).

### Run error

A **run error** is the Go error a failed run returns: always a `*weft.RunError`, matched with `errors.Is`, carrying the partial transcript on `.Result`. See [Tool errors are data, run errors are yours](https://weftgo.dev/docs/concepts/errors/).

### Run option

A **run option** applies to one `Generate` or `Stream` call instead of the agent: a prompt, metadata, a lower `MaxSteps`, `OnlyTools`, `UseModel` and others. See [Change an agent's configuration for one run](https://weftgo.dev/docs/guides/run-options/).

### Runtime

A **runtime** is your process as the playground sees it: `weft/runtime`, installed in the app, registers its agents with Studio under a stable id (`rt_` and 16 hex digits) and runs the commands it receives. See [Connect your app to Studio's playground](https://weftgo.dev/docs/observe/playground/connect/).

### Runtime link

The **runtime link** is the connection a runtime dials out to Studio: it registers, receives commands on an SSE stream, and acks each one. It opens only under `WEFT_ENV=dev` or `runtime.Enabled(true)`. See [Connect your app to Studio's playground](https://weftgo.dev/docs/observe/playground/connect/).

## S

### Scope

A **scope** is what the devtools panel follows: a [public id](#public-id) and, optionally, the session, flow and run inside it, written `pub_…;session=…;flow=…;run=…`. Since 0.20.0 a scope can also name a batch of runs by their [tags](#tag) or one agent's runs (`;tag.arena.batch=…;agent=director`), with no public id. Your handler sends it in the `Weft-Scope` header with package `scope`. See [Scope the panel to a conversation](https://weftgo.dev/docs/observe/devtools/scope/).

### Scripted model

A **scripted model** is the offline test double [`wefttest.Script`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Script): a deterministic `Model` that plays turns you write (`Say`, `ToolCalls`, `Fail`). See [Test an agent with a scripted model](https://weftgo.dev/docs/testing/scripted-models/).

### Seam

A **seam** is where behaviour attaches to the loop. There are two: around the model call (`WrapModel`) and around the tool call (`WrapTools`) ([rule 10](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md#the-rules-do-not-break-these-tests-pin-them)). See [Add behaviour with middleware](https://weftgo.dev/docs/guides/middleware/).

### Seq

**Seq** is the per-run counter that numbers `ToolStart`, `ToolFinish`, `Nested` and `Steered` events, assigned and emitted under one lock, so the observed order is the `Seq` order. See [Event types](https://weftgo.dev/docs/reference/events/#ordering-rules).

### Session

A **session** (package `thread`) is a durable conversation: an append-only tree of [entries](#entry) stored through a `thread.Storage` backend, written by one `Session` at a time. Pre-1.0: its API and format may change. See [What is a session?](https://weftgo.dev/docs/sessions/overview/).

### Setup A, B, C

Studio's three deployments: **setup A** embeds `studio.Handler` in your app over the local sink; **setup B** runs the `weft studio` binary; **setup C** hosts Studio behind a token. See [Run Studio](https://weftgo.dev/docs/observe/studio/setup/).

### Settling

A run is **settling** for up to 30 s after its root span is stored without its `run_finish` record; until then no reader calls the trailing records lost. A failed run never settles. See [The record contract](https://weftgo.dev/docs/reference/record-contract/).

### Side-effects mode

A playground command's **side-effects mode** decides what happens to a tool that is not replay-safe: `substitute` (the default) answers it from the recorded run's call with the same tool and arguments, and a call with no recorded match parks; `park` holds it for a person, `allow` runs the tools the app opted in for real. See [How does the playground work?](https://weftgo.dev/docs/observe/playground/overview/).

### Span

A **span** is one OpenTelemetry span the loop reports: `invoke_agent` per run, `chat` per model call, `attempt` per try inside it, `execute_tool <tool>` per tool call (zero-length for a denied call). See [The record contract](https://weftgo.dev/docs/reference/record-contract/).

### Steer

To **steer** is to deliver user messages into a running turn; the loop takes them at the next [drain point](#drain-point). Use `weft.Steering` on a run or `Session.Steer` on a session. See [Steer a running turn](https://weftgo.dev/docs/guides/steering/).

### Step

A **step** is one model call plus the tool calls it asked for. `StepStart` and `StepFinish` bracket it, and `RunResult.Steps` holds one record per step. See [What happens in one step?](https://weftgo.dev/docs/concepts/the-loop/).

### Stop condition

A **stop condition** is the intended, successful end of a run, set with `weft.StopWhen` (`HasToolCall`, `StepCountIs`, or your own). `RunFinish.StoppedBy` names the one that fired. See [How does a run stop?](https://weftgo.dev/docs/concepts/budgets-and-stopping/).

### Storage

**Storage** is the `thread.Storage` backend interface (`Create`, `Append`, `Load`, `List`, `Delete`). Three ship: memory, `thread/jsonl` and `thread/sqlite`. See [Store sessions](https://weftgo.dev/docs/sessions/storage/).

### Structured output

**Structured output** is a run that ends with a typed value: [`weft.Output`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Output) registers a `submit_output` tool with the type's schema, and the run ends on a valid call. See [Get structured output from a run](https://weftgo.dev/docs/guides/structured-output/).

### Studio

**Studio** is weft's run inspector: the runs list, run pages, live view and playground over the observability database. It is the `weft/studio` package, embedded or run as `weft studio`. See [Run Studio](https://weftgo.dev/docs/observe/studio/setup/).

### Subagent

A **subagent** is another agent wrapped as a tool with [`weft.Subagent`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Subagent): the parent's model calls it, and the tool's handler runs the child agent as a [child run](#child-run). The child's failure is data to the parent; its usage is the parent's. See [Delegate to another agent](https://weftgo.dev/docs/guides/subagents/).

## T

### Tag

A **tag** is a run metadata pair your app stamps, such as `arena.batch=cli-20261012-115753`, that a scope (`tag.<key>=<value>`), a Studio filter or a tag-scoped [panel token](#panel-token) selects runs by, across public ids. A tag scope is only as tight as your app's tagging. See [Tags, agents and flows](https://weftgo.dev/docs/observe/devtools/scope/#name-a-batch-of-runs-by-tags-agent-or-flow).

### Tap

A **tap** is an observer registered with [`weft.Tap`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Tap): it sees every event of every run of the agent, in emission order, and changes nothing. See [Observe a run without changing it](https://weftgo.dev/docs/guides/observers/).

### Thinking

**Thinking** is the provider's reasoning, set with `weft.Thinking` and a `weft.ThinkingConfig` level; each adapter maps the level to what its provider accepts. See [Control reasoning](https://weftgo.dev/docs/guides/thinking/).

### Thread mode

A playground command's **thread mode** says where its run's messages go: `ephemeral` writes nothing to thread storage, and `fork` copies the source session into a new session with lineage and runs the command there as its next turn. See [How does the playground work?](https://weftgo.dev/docs/observe/playground/overview/).

### Tool

A **tool** is a function the model can call. [`weft.Tool`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Tool) builds one from a Go function, and the input struct's tags become the schema the model sees. See [How do tools work?](https://weftgo.dev/docs/concepts/tools/).

### Tool error

A **tool error** is a failed tool call delivered to the model as data: a result marked as an error, while the call's siblings keep running ([rule 1](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md#the-rules-do-not-break-these-tests-pin-them)). A `*weft.ToolError` gives it a code the model can branch on. See [Tool errors are data, run errors are yours](https://weftgo.dev/docs/concepts/errors/).

### Tool result

A **tool result** is what a tool call returns to the model, a `ToolResultPart` in the transcript. Results are capped at 64 KiB by default, with a marker the model sees. See [How do tools work?](https://weftgo.dev/docs/concepts/tools/).

### Tool source

A **tool source** is a function the loop calls each step for the advertised tool set ([`weft.ToolSource`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#ToolSource)), for registries that change mid-run. See [Define tools at runtime](https://weftgo.dev/docs/guides/dynamic-tools/).

### Transcript

A run's **transcript** is the full list of its messages, `RunResult.Messages`. Feed it back to continue the conversation. See [Messages, parts and the transcript](https://weftgo.dev/docs/concepts/messages/).

### Truncated call

A **truncated call** is a tool call in a reply that hit the output token limit: none of that step's calls run, each gets a "not executed" result, and the model retries. See [How does a run stop?](https://weftgo.dev/docs/concepts/budgets-and-stopping/).

### Turn

A **turn** is one `Session.Send`: the prompt is appended durably, then usually one run executes under the id `<session>-t<n>`. A turn may instead be a steer delivered into the running turn, a follow-up turn, or nothing at all; its outcome is answered, parked, delivered, deferred, dropped, failed or canceled. See [Send turns and wait for them](https://weftgo.dev/docs/sessions/turns/).

## U

### Usage

**Usage** is a run's token counts (`weft.Usage`). `RunResult.Usage` includes subagent runs; a pool child's usage is on the parent session's `Usage.Delegated` instead. See [What does a run return?](https://weftgo.dev/docs/concepts/runs/).

## W

### Writer lease

The **writer lease** is a session's single-writer right: a `Session` takes it with its first write and holds it until `Close`, and another `Session`'s write fails with `ErrLocked` ([T1](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md#thread-rules-package-weftthread-its-tests-pin-them)). See [What is a session?](https://weftgo.dev/docs/sessions/overview/).

<h2 id="glossary">Terms from other frameworks</h2>

The [agent loop deep dive](https://weftgo.dev/docs/explanation/agent-loop/) compares weft with other agent frameworks; its glossary (`docs/agent-loop-deep-dive.md` §31) uses these terms. Each row says what weft has instead.

| Term | Meaning | In weft |
|---|---|---|
| Activity | In replay-based durable execution (Temporal, DBOS), a journaled side effect a workflow substitutes on replay | The model call and the tool call; the playground substitutes never-class tool calls from the record |
| Agent card | A2A's signed manifest advertising an agent's skills | Not a weft primitive; the [manifest](#manifest) is generated output |
| Agent-as-tool | A child agent wrapped as a tool the parent's model can call | [Subagent](#subagent) |
| Checkpoint | A persisted snapshot of loop state a later process resumes from | Not in the core; a [session](#session) holds durable conversation state |
| Context engineering | Deciding, at every step, which tokens the model sees | `PrepareStep`, compaction, subagents |
| Context rot | The decline in a model's recall as its context grows, before the window is full | [Compaction](#compaction) |
| Guardrail | A check on input, tool arguments or output that can deny or rewrite | Middleware at a [seam](#seam); a policy, not a boundary |
| Handoff | Transferring the conversation to another agent that continues on the same transcript | Not a weft primitive |
| Harness | The product around a loop: tools, permissions, context management, sessions, extension points | No single package: tools, middleware and approvals, `PrepareStep` and `weft/thread` together |
| Interrupt | LangGraph's human-in-the-loop: an exception caught at the root, resumed by re-running the node | The [approval boundary](#approval-boundary): the run ends, a later run resumes |
| Lane | pi's unit: one session, several named model configurations over a shared tree | Not a weft primitive |
| Lethal trifecta | Private data, untrusted content and external communication in one agent | No dedicated primitive; approvals and `mw.Allow` are the policy seams |
| Superstep | LangGraph's unit: all triggered nodes run, then writes merge | A [step](#step) |
| Tombstone | A recorded outcome for a cancelled or interrupted turn | A session's turn entry closes the ledger on success, failure or cancellation |
| Trajectory | The full sequence of steps a run took | `RunResult.Steps` and the transcript |

## See also

- [The agent loop, from first principles](https://weftgo.dev/docs/explanation/agent-loop/)
- [weft concepts](https://weftgo.dev/docs/concepts/)
- [Event types](https://weftgo.dev/docs/reference/events/)
- [Package weft on pkg.go.dev](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2)
