Skip to content

Concepts

Each word below has exactly one meaning: in the Python API, in the files a run writes, in the monitor’s HTTP API, in the web components and in this documentation. No other word is used for the same thing.

“In code” names the code by its name (Task), by its public path where that says more (contraagent.engine.Run), or by a file. A name a public module exports (contraagent, contraagent.config, contraagent.backends, contraagent.engine, contraagent.plugins, contraagent.monitor, contraagent.monitor.api, contraagent.testing) is found there, and its __module__ names that module; any other name is implementation, not public (Compatibility), and is named for whoever works on contraagent itself.

Word Means In code
coding agent the CLI program that does the work (claude, omp, opencode, pi, codex, agy) agent in config, routes, journal and monitor; Backend is its Python adapter
LLM the language model the coding agent runs on, nothing else model
agent task / Python task a task a coding agent executes / one this process executes agent_task, @python_task; Task.executor and on disk executor: "agent" | "python"
kind the class of work (summarize); a Python task’s kind is its function’s name unless its declaration names another Task.kind, agent_task(kind), @python_task(kind=)
unit what a kind is applied to (alpha): it names a task and its output, and locks nothing Task.unit; an agent task call’s first positional argument; a Python task’s parameter named unit
claim / claim capacity a name a task holds while it runs, its declaration a template (topic:{unit}, topic:{params.topics}: one name per element of a list); one task holds a name at a time / how many running tasks may hold one name instead, given by the name or by an fnmatch pattern that gives each name it matches a capacity of its own: a number, or what one running task that claims the name needs of the host (memory, cores), worked out each time such a task would start from what the running ones hold until they end (their declaration, or what their processes take when that is more), the host’s free memory and its usable cores agent_task(claims=), @python_task(claims=), Task.claims; plan claims / claim_capacity, [defaults.claim_capacity], PerTask, ClaimCapacity, WorkQueue.capacity
service / service address the long-lived helper a claim name stands for (a worker service, a database, a local server), given by a function of the name that returns a context manager: the first task that claims the name starts it, every task that claims it shares it while it runs, and the run’s end stops it; a start that fails fails the tasks that claim the name, for the rest of the run or for its cool-off; a task a stub run plays holds none / the string its start gives, by which a task that claims the name reaches it Pipeline(services=), Service, Pipeline(service_cooloff_s=), service_address, CONTRAAGENT_SERVICE_<NAME>; services.jsonl (ServiceEvent); monitor Plan.services (ServiceSpan)
task one kind applied to one unit Task
key a task’s stable identity: an agent task’s is <kind>-<unit> (<kind> with no unit), a Python task’s python:<kind>-<unit> (python:<kind> with no unit), or the key of its call options; the n-th task a flow call creates under one key is <key>~n Task.key, field key everywhere, monitor URL key; as the name of its files (streams/, contracts/, calls/, inflight/): file_name(key), every character but a letter, a digit, -, _ and . turned into _
params what a task is given, copied as JSON at the call, so what the flow does with a value afterwards does not reach the task: for an agent task, the instance of its params= model that its task call passes (none when it declares no model), as the JSON of its fields; for a Python task, the arguments of its task call bound to its function’s parameters, the unit aside; a Pending among them, at any depth, and a value that is not JSON raise TypeError at the call Task.params, AgentTask.params, call file params
input file a file a task is given as a param, by its path and the SHA-256 of its content, taken at the task call: a file of the task’s working directory, or a file of an input root, an output file of the run among them (of the root out); the params hold the hash and the path, relative to that working directory, or relative to the root with the root’s name, so all of them are in the fingerprint, and the task is refused (invalid_input) when the file no longer has that content as it starts. The call file holds a root’s file by its absolute path, and a Python task is given it so. A path outside the task’s working directory and the input roots, itself or through a symbolic link, a root the run does not have, and an absolute path under a root the run names raise ValueError at the call InputFile, InputFile.root, Pending.input_file(); params value {"path", "sha256"}, or {"root", "path", "sha256"}; journal fingerprint_parts input_files; plan input_files, monitor TaskIO.input_files (TaskInputFile: its root, the task whose output file it is, and its check at the start)
input root a directory, by a name, whose files a task is given as input files of the root: the records hold the name and the path under the directory, so the directory can move between a run and its resume or replay. A run names its own (lowercase letters, digits, _ and -, starting with a letter; each a directory when the run starts), and has out, its out/ directory, besides; every coding agent may read them Pipeline(input_roots=), contraagent run --input-root NAME=DIR, run input_roots; InputFile(path, root=); Launch.input_roots, AgentRunner(input_roots=)
working directory the directory a task works in: the run’s (Pipeline(cwd=)), or, for an agent task whose call options give cwd, that directory (relative to the run’s, or absolute); its coding agent runs in it, and its call file’s cwd, its validators’ cwd, its changes patterns and the relative paths of its input files are of it. A task’s own must be a directory when the task starts, or the task is refused (invalid_input). A Python task has none of its own: its function runs in this process’s current directory, which every task shares. Where a task works, not what it does: not part of the fingerprint Pipeline(cwd=), run cwd; AgentTask.options(cwd=), Task.cwd, Launch.cwd, call file cwd; plan cwd (empty: the run’s), monitor PlanNode.cwd
call options the words of a task call beside its params: key, after, priority, an agent task’s credential and cwd (its working directory), and cancellable; task.options(...) gives them, for an agent task and a Python task alike, and returns the same task with them, so task.options(key=k)(unit, ...) is a task call; an option it does not give keeps the value it had (none at first), and None as key, credential or cwd clears it. They are not part of the task’s declaration, and but for key not part of its fingerprint AgentTask.options, PythonTask.options
flow the function that calls the tasks: a plain function, which creates tasks that are independent or ordered with after= only, or an async def function (an async flow) when a task is given another’s output, which awaits task calls, flow calls, time_box, asyncio.gather and asyncio.TaskGroup; its code runs on the flow loop, so what needs a clock, threads or I/O is refused where it is called Pipeline.run(flow, ...), await Pipeline.run_async(flow, ...) from async code
flow call one run of an async def flow: the top flow, or an asyncio Task created on the flow loop while a flow call’s code runs; it waits at each await for tasks or other flow calls; ids 0, 0.1, 0.1.2, …, a child’s id its parent’s and its number in the order the parent created it, from 1, every asyncio Task taking a number; it is on record (flow_calls.jsonl, the monitor) once it creates a task or a flow call or ends with an error of its own (a task’s TaskFailed or TaskDeferred passing through it unchanged is not), a top flow call from its start, so a Task that only waits for a task already created leaves no record and the ids on record may skip numbers; a flow that does not wait is flow call 0; its state is running until it returned, raised or was closed (cancelled: by a failed sibling in its TaskGroup, past its time box’s grace window, at the run’s end, or when it waits for what nothing will answer, with an error that names where it waits); one that raised records where the exception left its own code and the key of the failed task the exception is, if it is one; a flow call goes on when its parent ends, returned or raised, and the run waits for every flow call to end FlowCall, FlowDriver, FlowCall.state, FlowCall.raised_at, FlowCall.raised_by; flow_calls.jsonl (FlowCallRow, its end’s raised_at and raised_by); monitor Plan.flow_calls, FlowCallNode
flow loop the event loop flow code runs on: callbacks that are ready to run, in order, and no clock, no threads and no I/O, so an await that needs one raises TypeError there; the run lets the flow calls run until none is ready (every flow call waits for a task or for another flow call) before it starts what they queued FlowDriver.settle, FlowDriver.settle_here
flow error an exception of flow code’s own (a bug, TooManyPasses; not a task’s TaskFailed or TaskDeferred passing through) that a flow call raised, listed once, for the flow call it started in, even when a parent caught it with asyncio.gather(..., return_exceptions=True); or any other exception a top flow call raised after its first task was queued; or the error that closed a top flow call that waited for what nothing would answer; a run with one is not ok; the run keeps going past it and past a failed task: a failure stops only the code that awaits its output and the flow calls that await that code, never another flow call or a task, and the run ends not ok once it has done all it can (see Failures) RunReport.flow_errors
origin where a flow created a task: its flow path (with each loop’s pass), created from, given from and flow call Task.origin, Origin; plan flow, created_from, given_from, flow_call
flow path the frames of flow code that created a task, outermost first, across flow calls; a flow call’s flow path is its parent’s where the parent created it Origin.flow, Frame; plan and flow call flow, the monitor’s too
call site where a frame of the flow path was when the task was created: function (module.qualname), file and line; a flow call’s site is where its parent created it Frame.function, .file, .line; FlowCall.site
loop a for or while statement in flow code, named by its first line; a call site’s loops are those whose pass it is in, outermost first; a comprehension is not a loop Loop.line, Frame.loops; flow[].loops[].line
pass one iteration of one loop, numbered from 1 each time the loop is entered; never an attempt, never the ~n of a key Loop.pass_, flow[].loops[].pass; max_passes (the passes a while loop may make; a for loop has no limit), @max_passes(n) (the passes each while loop of one async def function of flow code may make, in place of the run’s), TooManyPasses
created from the keys of the results that reached a flow call between its previous resume and the resume in which it created a task: of each task it awaited (an await of a result given before resumes it at once), of the items of a gather or TaskGroup it awaited, and the created from of a flow call it awaited, as that flow call ended Origin.created_from, FlowCall.frontier
given from the keys of the tasks whose outputs a task was given in its params: of the outputs that had reached the flow call that created the task (its causal past: every result that reached it or its ancestors before they created it, and what the flow calls whose end it awaited had received; FlowDriver.received), each one whose JSON is a value of its params, at any depth, whole, or one whole item of which is (an output that is a list, a Rows), and each one whose output file is an input file among its params; so a copy of an output counts as the output, and a field or a text taken out of it, or a value built from it, does not (the task’s created from still shows that it came after); shown only, never part of the fingerprint or of what a resume skips Origin.given_from; plan given_from, monitor PlanNode.given_from
unawaited task a task whose task call’s Pending no flow awaited, gave in after= or returned: it ran all the same, for its output file and its changes; information, never an error FlowCall.unawaited; the end of a top flow call in flow_calls.jsonl (FlowCallRow.unawaited), once every flow call it started has ended; monitor FlowCallNode.unawaited
fingerprint a digest of what defines a task’s work: kind, unit, key, its params as JSON (an output it was given among them, by its content; an input file by its input root, path and hash), its definition (instructions, role file, its plugins’ skills, schemas, validators; a Python task’s source), for an output_of task the content of the file it fills in as it was when the task was about to start, and its outside state when it declares one; neither a task it waits for with after= nor where its params came from (given from) is part of it, so a task that runs again and writes the same output leaves the tasks given that output as they were; a digest of each of these parts is kept beside it, so a resume names the parts that changed; resume skips a key whose last journal row is ok with the same fingerprint and whose output still reads under its output schema, but not a task declared rerun_on_resume, nor one whose last result was partial Task.fingerprint, Task.fingerprint_parts, journal fingerprint, fingerprint_parts (definition, params, input_files, outside, output_of); AgentTask.digest, PythonTask.digest
outside state what a task’s work depends on beside its params and its definition (a state file the pipeline keeps, files another process wrote, or what a task it waits for with after= changed), as the JSON value a function of its unit and params returns; called when the task is about to start, its value’s digest is part of the task’s fingerprint, so a resume runs the task again when it changed; a function that raises refuses the task agent_task(outside_state=), @python_task(outside_state=), OutsideState, Task.outside; journal outside
rerun a task a resume runs again although an earlier attempt of the run finished it, and why: its outside state or other parts of its fingerprint changed (each named), a divergence, its output no longer reads under its output schema, the file it fills in (output_of) is not as the earlier attempts left it, its last result was partial, or its kind is declared rerun_on_resume journal rerun, monitor PlanNode.rerun; rerun_reason
divergence a rerun whose params differ from its key’s journal row although every task it was given from or created from was skipped in this resume, and whose input files did not change: the flow’s code took another path for the same outputs (a clock, randomness, outside state, or changed code); its fingerprint keeps a wrong output from being used, so it costs a run of the task, never a wrong result journal rerun (divergence: ...), the warning [resume] <key>: divergence: ...
Word Means In code
interface what an agent task takes, produces and may spend agent_task(params=, output=, max_turns=, ...)
implementation how an agent task is done: a plugin directory, with the skills of the skill plugins it names. One declaration may name several by name, each a kind of its own agent_task(plugin=), agent_task(implementations=), Plugin
base kind the kind a declaration of several implementations names (review); each implementation is the kind <base kind>-<name> (review-go), takes the base kind’s task table below its own, and is drawn in the base kind’s group; no other declaration may have the base kind or an implementation kind as its kind agent_task(implementations=), Implementations, kind_clash, AgentTask.base_kind, Task.base_kind; plan.jsonl and definition base_kind
skill plugin a plugin that holds skills and nothing else that acts; tasks with different plugins load it to share its skills agent_task(skills_from=), Plugin.skills_only
role a named agent definition in a plugin: its procedure agents/<role>.md, Launch.role, Claude Code’s --agent
instructions text before the call protocol, for an agent task with no plugin agent_task(instructions=)
hook a hook inside the coding agent, declared by a plugin; nothing else hooks.toml, contraagent plugin render
MCP servers the MCP servers an agent task’s coding agent gets: its plugin’s .mcp.json, or what the pipeline’s function returns for the task; never the user’s or the project’s .mcp.json, Pipeline(mcp_servers=), McpServers, Launch.mcp_config
call file the params and output contract handed to one agent task CallFile, runs/<run>/calls/<key>.json, CONTRAAGENT_CALL
changes the files one attempt created, modified or deleted under the patterns its task declares (but those a ! pattern leaves out), beside its output, by their paths relative to the task’s working directory; the files a failed attempt created are removed, or kept when its kind keeps them agent_task(changes=, keep_failed_changes=), TaskAdapter.changes; Changes: TaskResult.changes, journal changes (removed, kept)
conflict two tasks that may not run at once: a pipeline’s two tasks whose changes patterns, each relative to its working directory, may cover one file (read folded: case, Unicode form, ? and a set as *); the queue starts no task while a task it conflicts with runs, so a failed attempt’s removal never takes another task’s files Graph.conflicts, a runner’s conflicts(task, other) that WorkQueue asks; may_overlap, overlap
final message the agent’s last message of a launch; an agent task whose output is its final message has it written to its output file and checked there LaunchResult.result_text; agent_task(output_from="message"), call file output.from, OutputContract.from_message
unwrap taking the JSON document out of a final message that wraps it (a sentence before it, a fence around it): the output is the document, the whole message is kept beside it agent_task(unwrap=True), OutputContract.unwrap, unwrap_json; <output>.message.txt; LaunchResult.unwrapped
Word Means In code
schema the pydantic class a file is checked against agent_task(output=), OutputContract.schema; call file params_json_schema (the JSON Schema of a task’s params model)
rows / row an output that is a JSON Lines file, each line one instance of a pydantic model, checked line by line (a line that fails names its number) / one such line, the model’s instance (a row of a log, a journal row, is the same: one JSON object on one line); as a value, a list of the rows in the file’s order: what the flow receives, validators are given and a task it is passed to gets agent_task(output=Rows[Row]), Rows (a list), RowsFile; call file output.format: "jsonl", json_schema that of one row; monitor ContractSpec.format
example the value an output declares for a stub run, by one rule at every part of its JSON Schema: the first entry of that part’s examples (a model’s own, model_config = ConfigDict(json_schema_extra={"examples": [...]}); a field’s, Field(examples=[...]); a text output’s, Annotated[str, Field(examples=[...])]), else the smallest value that part accepts; in each of its strings, {unit}, {key}, {kind} and {params.<name>} are the task call’s, as in a claim; it must pass its own schema. The example of rows is one row, its model’s writes_example, contraagent run --stub; contraagent check reports one that fails its schema
validator a check a file must pass beyond its schema; it may also take, by keyword, the task’s params, its call file, its cwd (its working directory), and before (the file as it was before the task) agent_task(validators=), CommandValidator, any (path, value) -> errors; CONTEXT
contract a file plus its schema and validators: an output contract, checked after each launch, or an input contract, a file that a runner built on the engine checks before it launches a task; a pipeline declares no input contract: as a task of a pipeline is about to start, its input files are checked against their hashes, its outside state is worked out, and the file it fills in (output_of) is read for its fingerprint, and nothing else is checked OutputContract, InputContract, TaskAdapter.input_contracts
preserve the parts of an output file a launch must keep as they were before it: JSON pointers (RFC 6901, a segment * for every member), each value they select in the file before the launch equal in it after agent_task(preserve=), OutputContract.preserve; call file output.preserve
output of the output file of another kind’s task for the same unit, which an agent task writes in place of a file of its own; the task waits for the latest task created before it that writes that file; a resume skips it only when the file is as it, or a task after it that fills the file in, left it agent_task(output_of=), AgentTask.output_of; definition output_of; journal fingerprint_parts output_of, output_of_after
check what can be found wrong with a flow without a launch Pipeline.check, CheckReport, contraagent check
diagnosis / sign what a run’s records say to change in its pipeline, kind by kind, read after the run with no launch; against an earlier run of the same tasks, also what changed between the two, task by task (the parts of the fingerprints that changed, the tasks that pass now and did not then and the reverse, the outputs that differ) / one pattern in the records of one kind’s tasks, with the tasks that show it and the change it suggests: the outputs that did not pass one check, the launches stopped at one limit of their budget, the calls of one tool the permissions refused, a safety classifier’s refusals, a route passed over, the attempts that ended in one other stop, the tasks that cost several times the kind’s median contraagent diagnose RUN_DIR --against EARLIER_RUN_DIR; diagnosis.Sign
reachable kind a kind whose task declaration an async flow’s code refers to, directly or through the functions, modules, closures, containers, classes of flow code (their methods, static and class methods, properties, bases) and instances of them it refers to; checked, routed and probed before the first launch. A candidate, not a use: of two declarations of one kind, the one whose tasks are created is the kind’s reachable, CheckReport.later_kinds
stub agent a coding agent that plays scripted replies instead of an LLM, for tests contraagent.testing.StubAgent
stub run a run in which no coding agent is launched: the stub agent plays its tasks (agent tasks, and Python tasks but the kinds it executes: names or fnmatch patterns, * for every one), or a replay plays its tasks’ recordings (but the Python task kinds it executes); flow code runs as in any run Pipeline(stub=), StubAgent(default=, execute=), writes_example, contraagent run --stub --execute PATTERN; run.json stub
recording what one task attempt left behind, kept to be played again: for an agent task, the facts of its last launch, the final contents of its outputs, the files its changes patterns saw created, modified and deleted, and its transcript; for a Python task, how its call ended and its output; and its task’s fingerprint; never the rest of a working directory. A file over the cap is kept by its hash and size only, and its task’s recording cannot be played Pipeline(record=, record_max_file_mb=), contraagent run --record DIR --record-max-file-mb N; <DIR>/<kind>/<key>.json (by_hash); Recorder
replay a run whose tasks play their recordings in place of a launch or of a Python task’s function, attempt by attempt, with nothing spent; the Python task kinds it executes (execute, as in a stub run) run their functions. A replay is a stub run: its run.json says stub; with record_missing, a task with no recording launches or runs as in any run and is recorded into the same directory, and the run is no stub run Pipeline(replay=, execute=, record_missing=), contraagent run --replay DIR --execute PATTERN --record-missing; Replay, ReplayAgent; run.json replay; a played attempt: TaskResult.replayed, JournalRow.replayed, and the recording it played: Played (key, fingerprint, outside), TaskResult.played, JournalRow.played
imported recording a recording made from the run directory of a run that was not recorded: for each task whose last attempt finished ok or partial, one attempt with its output files and changed files as they are now, the facts the journal and the launches recorded, and the fingerprint its journal row holds; a replay plays it only for a task of its own key and that fingerprint, or, imported by_key, for a task of its key whatever its fingerprint, as a recorded one; the import lists the tasks it leaves out contraagent.import_recording(run_dir, directory, by_key=), RecordingImport (imported, unfinished, not_imported), contraagent recording import RUN_DIR DIR --by-key; the entry’s imported (run, run_uid, imported_at, by_key)
undeclared change a path of the run’s working directory (Pipeline(cwd=), not a task’s own) a recording run created, modified or deleted that no task’s outputs or changes= patterns cover (.git, __pycache__, the recordings, the run’s own files and what record_exclude matches left out): a replay cannot make it again. Tasks run at once, so it is the run’s, not a task’s <DIR>/undeclared.json (run, excluded, created, modified, deleted); the warning [record] undeclared change: <path>, or [record] undeclared changes: <dir>/ (<n> paths), see <DIR>/undeclared.json for a top-level directory with more than 20; Pipeline(record_exclude=), --record-exclude; Recorder.start, Recorder.finish
Word Means In code
task table one kind’s [tasks.<kind>] table in the config; an implementation kind’s starts from its base kind’s PipelineConfig.task_tables(), resolved_task_tables, TASK_TABLE_KEYS
pipeline table a pipeline’s own table in the config, read by its code; contraagent never checks its keys [pipeline.<name>]; contraagent.pipeline_table(name) in a run or in flow code a check builds (NoCurrentRun outside both), PipelineConfig.table(name)
[defaults] run-wide routing, including [[defaults.fallbacks]] PipelineConfig.defaults(), .fallbacks()
routing plan how each kind is routed (not plan.jsonl) RoutingPlan
KindConfig one kind’s resolved routing and budgets RoutingPlan.configs
route one entry of a kind’s failover chain: a coding agent, a model and a credential, labeled by its place in the chain (hop 2/3 omp/m2); a failover hop may name the stops of an earlier hop’s launch it is for (every stop when it names none), and a task whose launch ended on another stop passes it over Route, Route.stops, Router; [[...fallbacks]] stops; journal route (the last hop’s, or the hop whose stop the attempt ends on)
hop one launch of an attempt on one route; an attempt that fails over has one hop per route it launched on Hop: TaskResult.hops, journal hops
budget the turn, time, cost, context and stall caps of a launch max_turns, timeout_s, context_budget, …; Limits, Launch.limits
turn one response of a launch’s model in its agent loop: one API call, with every tool call it asks for, run in parallel or not; a subagent’s calls are none of the launch’s turns; every coding agent’s turns are counted so, and max_turns caps them max_turns, Limits.max_turns; LaunchResult.num_turns, Hop.num_turns; EventFold.begin_turn, EventFold.end_turn
credential the identity (and so the account) an agent’s API calls are billed to [credentials.<name>], Credential (each kind of credential a subclass), Launch.credential; for one task, the credential of its call options (Task.credential, plan credential)
trait a label on a credential that a task may require (zdr) traits, agent_task(requires=)
pool / gateway several credentials used as one / your own endpoint (LiteLLM, a proxy) Pool, Gateway
ambient the built-in credential: the host’s own setup, untouched AMBIENT
quota a subscription’s utilization of its 5-hour and weekly windows (and a model’s own windows), as the coding agent reports it: account-wide. One reading is a QuotaReading, one window of it a QuotaWindow; the two windows a quota cap names are five_hour and seven_day, each with its words and length in one table QuotaReading, QuotaWindow, WINDOWS; LaunchResult.quota, journal quota, Backend.usage_reading
quota refusal a launch refused for its quota (a 429), with the cool-off the provider stated; not a reading QuotaRefusal (retry_after_s), LaunchResult.quota_refusal, quota_refusal; stop rate_limited
account the billing account a quota reading is of, as a 12-hex-digit digest of its login’s UUID or of the credential’s secret, never the value itself; one credential can stand for two (ambient on two coding agents, a token replaced between runs), and a credential’s rests are judged by the readings of the account a launch as it bills QuotaReading.account, Backend.account, account_digest
quota cap / quota rule the utilization past which a credential rests / a domain’s own test of a credential’s latest quota reading max_five_hour_pct, max_seven_day_pct, QuotaCap (run.json quota_caps, monitor Plan.quota_caps) / Pipeline(quota_rule=)
rest not launched on for a time: a hop or a pool member after a 429, a credential past a quota cap or rule until its window resets, a credential a launch was refused as (auth_failed) on that launch’s coding agent and model for the rest of the run; a task takes the next hop; with none left it ends rate_limited after 429s, is deferred (never launched) when its credentials rest on their quota, and fails auth_failed (never launched) when they were all refused. A credential’s rest is recorded as data (Rest: window, reading, cap, what the rule said, or the refused stop, coding agent and model; and until when) as it begins and ends Router, CredentialPool, CredentialRests, Rest; rests.jsonl (RestEvent); monitor Plan.rests (CredentialRest)
preflight / preflight policy one probe of each distinct route of the reachable kinds before the first launch: a route its coding agent does not list, or whose probe does not complete, is dropped / what happens to a kind with no route left: substitute (it runs on the first route that answered, of its own credential), stop (the run is refused, nothing launches), off (no probe) Pipeline(preflight=), [defaults] preflight, contraagent run --preflight, PreflightStopped; run.json preflight and Plan.preflight (PreflightRecord: DroppedRoute, Substitution, KeptKind)
skipped hop a hop an attempt passed over without a launch because its credential rested; not one of the attempt’s hops, which are launches SkippedHop: TaskResult.skipped_hops, journal skipped_hops, a deferral’s cause rests
Word Means In code
engine the parts underneath Pipeline that run tasks on their own: the runners, the queue, the flow driver, a run’s directory and cursor, the routing contraagent.engine (Run, AgentRunner, RetryingRunner, PythonTaskRunner, TaskAdapter, WorkQueue, FlowDriver, CursorStore, RoutingPlan, Router, run_until_valid); RunnerConfig: what WorkQueue reads of a task’s config (max_concurrent)
launch one run of a coding agent, and its result Launch, Backend.run, LaunchResult
light launch the launch of an agent task declared with no tools: its role’s text (or its instructions) replaces the coding agent’s system prompt, its params and output schema are in the prompt, no plugin, settings or MCP server is loaded, and its final message is its output agent_task(tools=()), AgentTask.light, KindConfig.light, Backend.light_launch
tokens what API calls took and gave: input, output, cache read, cache write, and the calls; a launch’s calls one by one, and summed over a launch, a hop or an attempt per call CallUsage, a launch’s calls Usage; summed TokenUsage (Usage.totals(), Hop.usage, JournalRow.usage); per model ModelUsage
resident the whole input of an attempt’s first API call: what the coding agent loads before the task starts TokenUsage.resident, Usage.resident
peak context the whole input (fresh input, cache read and cache write) of a launch’s largest API call; of an attempt, the largest of its hops’ and rounds’. context_budget stops a launch whose peak context passes it; context_warn_pct warns past that % of it and stops nothing LaunchResult.peak_context, Usage.peak_context, TokenUsage.peak_context, ModelUsage.peak_context; JournalRow.context_budget, JournalRow.context_warned; a queue note with context_warned
context window the most input one API call of a model takes, as the coding agent reports it for the model a launch ran on, in its stream or its model catalogue (never inferred from the model’s name); of an attempt, the window of the model its peak context was on. context_pct is the peak context as a percent of it LaunchResult.context_window, LaunchResult.context_pct, TokenUsage.context_window, ModelUsage.context_window
other model a model a launch called besides the one it ran on (Claude Code summarizes a fetched page on a smaller model): its cost is in the launch’s, its tokens are not in the launch’s usage, and the models’ spend counts it apart OtherModel: LaunchResult.other_models, Hop.other_models
round one launch within a session: the first, or a resume: after contract errors (a correction round) or after a round that stopped on max_turns (a continuation round); an attempt’s cost counts each round once rounds, round_costs
correction the errors of the output’s checks sent back to the session: by the stop hook within a round (an objection: the hook exits 2 and the agent goes on) or by the runner, which resumes the session (a correction round). A kind allows max_corrections of them in all (3 unless set); once they are spent the stop hook lets the agent stop, and the task ends invalid_output with the last errors agent_task(max_corrections=), [tasks.<kind>] max_corrections, KindConfig.max_corrections, run_until_valid(max_corrections=), TaskResult.max_corrections; CONTRAAGENT_CORRECTIONS_LEFT (each round’s, for its stop hook); LaunchResult.hook_errors (each objection’s errors); journal max_corrections, hook_errors; the run summary’s corrections
correction round a round after one whose output failed its checks: the same session resumed with the errors of the output’s checks, one correction TaskResult.rounds, TaskResult.round_errors; journal rounds (each round after the first but the continuation rounds is one), round_errors; StubLaunch.resumed
continuation round a round after one that stopped on max_turns: the same session resumed with the whole budget again, to go on with the task; a kind allows max_continuations of them in a launch (0 unless set); no correction agent_task(max_continuations=), [tasks.<kind>] max_continuations, KindConfig.max_continuations; LaunchResult.continuations, journal continuations
attempt one try of a task, numbered from 0: an agent task’s in a fresh session, a Python task’s a call of its function RetryingRunner, PythonTaskRunner, Task.attempt, journal rows
partial a task’s result whose output is only part of the work: a Python task’s placeholder, returned when a server it needs is unavailable, or what an agent task wrote before the runner stopped its launch for one of its partial_on stops (timeout, stalled), when it was written by the attempt and passes every check; ok, so the flow receives its value and later tasks run on it, and stop partial, so a resume runs it again with the tasks that wait for it; its reason says why (an agent task’s: the launch’s stop); counted apart from passed and failed Partial(value, reason=), agent_task(partial_on=), [tasks.<kind>] partial_on, STOP_PARTIAL, RunReport.partial; journal stop: "partial"; monitor plan state partial, TaskCounts.partial, TrendKind.tasks_partial, partial beside ok
cancelled the result of a task whose call options give cancellable=True, once the flow call that created it and every flow call that waited for it were closed and no flow call waits for it: a queued one never launches, a running agent task’s launch is stopped, a running Python task runs to its end and keeps its result; not ok, not retried, run again by a resume, and no failure (RunReport.cancelled, never RunReport.failed). A task without cancellable=True runs to its end whatever happens to its flow calls stop cancelled, TaskResult.cancelled, Task.cancellable, WorkQueue.cancel, RunReport.cancelled; journal stop; monitor plan state cancelled
retries the fresh attempts a task may make after its first: an agent task’s after one that made no progress (after one that ended on max_turns only with a max_turns_growth above 1, which gives each fresh attempt more turns), a Python task’s after an exception of a class in its retry_on KindConfig.retries, KindConfig.max_turns_growth; @python_task(retries=, retry_on=), PythonTask.retries, PythonTask.retry_on
result a task’s final result / what Pipeline.run and Pipeline.run_async return TaskResult / RunReport
run / run group one runs/<id>/ directory, named by its run id, which is a file name on every operating system / a label grouping runs contraagent.engine.Run, Run(run_group=)
run format the version of a run directory’s layout and records, a whole number its run.json records: a release writes one and reads the formats it lists; a run.json without one is of run format 1. Each record has a JSON Schema of its run format run.json format; FORMAT, FORMATS, format_of; RunFormatError; contraagent/docs/schemas/*.schema.json, RunInfo, LaunchRow
run uid / host id the id no other run has, on any host, kept when the run is resumed / the host that drives the run run.json run_uid / host_id (CONTRAAGENT_HOST_ID, else the host name)
resumed from the run a new run id resumes from (the earlier run): the new run starts from a copy of its out/, pipeline/ and definitions/, skips by a resume’s rule each task it finished (its key’s last journal row ok with the same fingerprint, its output reading under its output schema), journals each as skipped with that run’s fingerprint and parts, and runs the rest, each it had finished with its rerun’s reason; the working directory is not copied Pipeline.run(resume_from=), contraagent run --resume-from RUN_ID, EarlierRunError; run.json resumed_from (run_id, run_uid), journal resumed_from
run records / layout / layout name what a run writes in its directory apart from its outputs (logs and documents) / the name of each record, written down once / a record’s name relative to the run directory (journal.jsonl, streams/<file>.stream.jsonl) the run records layer, layout; the model of a record, which ignores a field it does not know: RecordModel
log / document a run record of JSON lines, appended whole and never rewritten, read by its complete lines only (a last line without its newline is still being written; the next append ends one left by a write that did not end) / a run record of one JSON value, replaced whole LOGS, RunSource.logs, RunSource.lines, RunSource.lines_at (from a LogPosition), append_lines, read_lines, parse_rows / RunSource.documents, RunSource.document, write_document
run source / liveness where runs’ records are read from, by the monitor, a relay and the trends / which runs are live and their processes contraagent.monitor.RunSource (public: DirectorySource; implementation: MemorySource, HubSource) / contraagent.monitor.Liveness (implementation: ProcLiveness, StaticLiveness, HeartbeatLiveness), a snapshot’s shape Liveness.snapshot
telemetry line the first line of an agent task’s prompt, naming its run, kind, unit, key and role; the monitor reads a live process’s role from it telemetry.line, telemetry.parse, TELEMETRY run=... role=...
hub / relay the server that holds every host’s runs and serves their monitor / the process on a host that ships its runs to a hub (never “agent”, which is the coding agent); a run on a hub is named <run_id>@<host_id> contraagent hub, Hub, HubStore, RunRef / contraagent relay, HubClient
heartbeat / TTL a relay’s report that its host is up, with its runs’ live processes; a host’s runs are live while its heartbeats keep arriving / the seconds a hub counts a host as up after it receives the host’s heartbeat, set by the relay and carried in each heartbeat (never “lease” or “timeout”) Heartbeat, Heartbeat.interval_s (contraagent relay --interval); its runs’ liveness: HeartbeatLiveness / Heartbeat.ttl_s, HeartbeatAck.ttl_s, contraagent relay --ttl
blob a file’s content on a hub, named by its SHA-256 BlobStore
segment / open segment a sealed part of a transcript on a hub: one object of zstd frames with an index of their first lines / the part still being written, a file on the hub’s disk SegmentedStreamLogs, segment_format, SegmentIndex; --segments / --streams-dir
held / durable the lines of a log a hub holds / those of them that survive the loss of the hub’s disk (sealed segments, the database) Held, Accepted.logs / Accepted.durable
retention / prune how long a hub keeps a run after its last activity / removing what is older, with everything the hub holds of it contraagent hub --retain-days, Hub.prune, PruneReport, contraagent hub prune
grace period how long an unreferenced blob is kept before a prune removes it (it may be on its way) Hub.prune(blob_grace=)
active transcript a transcript whose task is running or whose file grew in the last seconds; a relay ships it between its full passes Relay.fast_once
journal / plan the finished attempts / the queued tasks journal.jsonl (JournalRow) / plan.jsonl (PlanRow; monitor PlanNode)
wire what a coding agent prints about a launch as it runs, one event per line: its reader folds it into the launch’s result (unread event: one the reader could not read), and the monitor renders it through its stream format each backend’s wire reader, EventFold, KNOWN_EVENTS, READ_FIELDS, Backend.wire
stop how one launch ended, exactly one, weighed from what its wire said in one order for every coding agent: a limit it was ended on, quota, refused credential, safety refusal, abort, the agent’s own cap, another API error, the agent done, a nonzero exit with no answer, nothing seen, no answer Stop, LaunchResult.stop; Signals (how an agent words a refusal), classify_stop; journal stop
safety stop a safety classifier that stopped part of a launch while the launch went on: a response of the launch’s own model (response; its unfinished tool calls did not run), or a request of a model that a tool calls (tool; the tool call ended in an error), or one the coding agent counted in words its reader does not know (unread); the launch ends on its own stop, often completed. Not a safety refusal, which ends the launch (stop refused). Claude Code reports them SafetyStop, LaunchResult.safety_stops, journal safety_stops; [tasks.<kind>] safety_stop_failover, agent_task(safety_stop_failover=); monitor Trends.safety_stops
model catalogue the models a coding agent lists, each with the context window it lists for it; read once per backend Backend.models, Backend.read_models
unread event an event a coding agent sent that its reader in this contraagent could not read, counted by what was not read: a type the reader does not know (<type>), a field the reader reads that the event lacked or held as another JSON type (<event>.<field>), or an event whose reading failed (<event>: <error>); a coding agent of another version than the reader LaunchResult.unread_events, JournalRow.unread_events, EventFold.read_fields
unknown usage the tokens of a launch that its reader could not read: calls when only the totals the coding agent printed are known (its per-call tokens are missing, and the totals stand as one call), tokens when the launch ran and no tokens are known. Codex writes each call’s tokens, the context window and the plan’s quota only in its rollout file, a file of its own in no documented form LaunchResult.usage_unknown, JournalRow.usage_unknown
web fetch the coding agent reading a web page by its URL (Claude Code WebFetch, omp read of a URL, opencode webfetch, Codex web_search opening a page) a transcript’s tool call web_fetch
web search a search of the web by the coding agent’s own tool (Claude Code WebSearch, omp web_search, opencode websearch, Codex web_search, agy search_web); its query is recorded LaunchResult.web_queries, JournalRow.web_queries; a transcript’s tool call web_query
tail the expected wall time of the work a flow creates after a task, not queued when the task is: the median, over tasks with the same flow path’s function names, kind and loop passes (capped) in recent runs and in this one, of the longest complete chain of wall times after them along after and created from; the samples are kept (the 100 most recent per tail key, with each task’s own wall time), and the finish chance reads them Task.tail_s, JournalEstimates.tail, TailKey
bottom level a queued task’s estimate plus the longer of its known dependents’ path and its tail: what the queue orders by first, highest first WorkQueue._blevel
priority a number a task’s call options give (default 0) that breaks ties in the queue’s order, highest first: between tasks the bottom level, overdue waiting and a time box’s endgame leave equal; not part of the fingerprint summarize.options(priority=)(unit), Task.priority; plan priority
slot a place for one running task, of which the queue has max_concurrent: every running task takes one, an agent task or a Python task alike; two rate-limited ends in a row halve them for throttle_s Pipeline(max_concurrent=), WorkQueue(max_concurrent=), WorkQueue.slots(); run.json max_workers; monitor Procs.max_workers
overdue a queued task startable for longer than overdue_s: it goes before the others, and while it is the first that cannot start, no later task takes the last place it needs on a name it claims or under its kind’s cap (the starvation guard) WorkQueue(overdue_s=)
slack the time before the deadline from which the queue orders for the deadline: shortest remaining work first, late tasks last WorkQueue(slack_s=)
finish chance the chance that a task and the work after it end before a deadline: the share of the samples of its tail key (each a past task’s own wall time plus its tail, or the known work after the task where that is longer) that fit in the time left; without them, its kind’s wall times; 1 or 0 for a point estimate JournalEstimates.finish_chance, WorkQueue(finish_chance=), FinishChance
late a task in a time box’s slack, not of its finishing kinds, whose finish chance is below 0.35: it goes after every other task, starts when a slot is still free, and is deferred (cannot_finish) only when other tasks took every slot; a task with no samples and no estimate is never late a deferral’s cause cannot_finish
time box a deadline over part of a run: the run’s own (deadline_s), or a flow call’s, counted from its start, over the tasks it and the flow calls it starts create; past it only its finishing kinds launch, for its grace window; a task is held to every time box it is in time_box(flow, deadline_s=, grace_s=, finishing_kinds=, slack_s=), TimeBox, Task.time_boxes; as recorded, with when its flow call started: TimeBoxRecord (flow_calls.jsonl and monitor FlowCallNode.time_box); a deferral’s cause flow_call
stream file the raw transcript of a task’s launches streams/<file>.stream.jsonl (stream(key)); keep_transcripts
stream format how a stream file is parsed (claude, omp, opencode, pi, codex, agy) normalize_stream_line(format, ...)
stage a run phase cursor stage
TaskScope a function of a task that returns the context manager around one attempt of it: every hop of an agent task; the input check, the call and the output check of a Python task Pipeline(scopes=), AgentRunner(scopes=), PythonTaskRunner(scopes=)
ResultEnricher what sees a task, agent or Python, before one attempt and its result after, and may return it with a payload added or its verdict (ok, stop) changed; the task and the result it is given are frozen Pipeline(enrichers=), AgentRunner(enrichers=), PythonTaskRunner(enrichers=)
pipeline log / pipeline document a pipeline’s own file in its run, written by its flow code and its Python tasks, shipped to a hub and read by panels: rows appended one per line / one JSON value, replaced whole contraagent.log(name, row) / contraagent.save(name, value); runs/<id>/pipeline/<name>.jsonl / <name>.json; outside a run NoCurrentRun; read with RunRecords.log / .document
row extras a pipeline’s own columns of a journal row, named by the pipeline: what row_extras(result) adds Pipeline(row_extras=), Run(row_extras=); monitor RunSummary.row_extras, TaskDetail.row_extras

The runners: AgentRunner (one agent task, with failover), RetryingRunner, PythonTaskRunner. Queue callbacks: on_event, on_result, follow_up. A task not launched by the deadline (of a time box it is in), late while other tasks took every slot, or with every hop on a resting credential, finishes deferred: not launched, nothing spent, and no failure (RunReport.deferred, never RunReport.failed). deferred.jsonl records why (DeferredRow): a Deferral, its reason in one line and its cause as data (DeferralCause: deadline, grace_window, cannot_finish, each with the flow_call whose time box it was, dependency_not_queued, no_capacity, dependency_cycle, rest, and dependency_deferred, with the dependency it read, written by releases before 0.7; AgentRunner.deferral); a follow-up task the queue refuses because its key is in flight finishes duplicate_key. A task a flow waited for that did not succeed raises TaskFailed at the await (TaskDeferred when it was deferred). A text output a flow receives is a str.

Word Means In code
deprecated name a public name that a later major release removes or renames, still read in its public module until then (from 1.0, for at least two minor releases: compatibility): a moved name warns and gives the object from its new home, a removed name raises AttributeError saying what to use instead ContraagentDeprecationWarning; a public module’s __getattr__ = migration(...)
Word Means In code
group a column of the plan: the kinds Monitor(groups=) lists together, the implementation kinds of a base kind it does not list, or one kind Monitor(groups=), PlanGroup
period days from..to, both included, in a time zone, over which runs are summed contraagent.monitor.Period; /api/trends?from=&to=&tz=; its runs as a trends panel reads them: PeriodRuns (RunRecords for each)
trends what the runs of a period add up to, day by day: cost by kind (or group), each kind’s tasks, success and time, each model’s spend, failures, refused tool calls, safety stops, utilization, rests, deferrals, run starts; read from each run’s digest, kept in a finished run’s trends.json (RunSource.kept, RunSource.keep) Monitor.trends, /api/trends, Trends; Panel(scope="trends")
function drawn open a function node of the pipeline graph drawn as a box holding its own layer, in the layer shown; a chain of functions, each the only function in the layer of the one before, is one box named by its path FlowBox, compound (@contraagent/ui/adapters), cluster id fx::<place>
place where a function node is across every layer: its layer and its id there placeKey, <layer>/<id>
outline the pipeline graph’s list of every function of the flow and the loops they are in, as a tree outlineTree, nav.outline
tab one top-level view (overview, journal, …, panel:<name>); on the Trends page, the trends with the trends panels of no tab, or the trends panels of one tab Tab, view route tab; Panel.tab, PanelInfo.tab, view route trendsTab (?page=trends&tab=)
panel / panel body a view a pipeline adds to the monitor: computed per run (scope="run", fn(run) with the run’s RunRecords, a tab of each run) or over the runs of a period (scope="trends", fn(runs, period)) / what it returns: a typed body (tiles, table, columns, lines, heatmap, status_grid, hbars, note, code, tree, embed, blocks of them) the monitor draws, or any other JSON object, shown as a JSON tree contraagent.monitor.Panel; contraagent.monitor.PanelBody, PANEL_TYPES; contraagent monitor --panels
app a page of the pipeline’s own, with its own routes and files: an ASGI app the monitor serves under apps/<name>/, behind its base path, which a panel shows in a frame (embed) contraagent.monitor.App, Monitor(apps=), EmbedBody; contraagent monitor --apps
status grid / note a panel body of a state per row and column, each named by its label and coloured by its tone (a heatmap is a number per cell, in shades of one colour) / a panel body of text beside the figures, markdown shown escaped contraagent.monitor.StatusGridBody, GridCell; contraagent.monitor.NoteBody; the element cae-state-grid
code / tree a panel body of a text shown as code: highlighted by its language, with line numbers, some lines highlighted / a panel body of nodes the reader folds and opens (files and directories), each node holding the code shown beside the tree while it is selected, or a link contraagent.monitor.CodeBody, LANGUAGES, CODE_LINES; contraagent.monitor.TreeBody, TreeNode, TreeLink; the elements cae-code, cae-tree
anchor the name of a body of a panel, which a tree node’s link leads to each panel body’s anchor, TreeLink.anchor
task view what the stream tab shows of a task: transcript, input, output, definition TaskView, view route view
view route where the reader is in the monitor, kept in the URL (or in the element, with history="memory") ViewRoute, ViewRoutePatch, ViewRouter in @contraagent/ui
element a web component: ca-* in @contraagent/ui, cae-* in @contraagent/elements CaMonitor, CaTranscript, CaeSegmented, …
tone the status colour a value takes: failed, attention, done, running, muted, neutral PanelTile.tone and each panel body’s tone, a table row’s _tone; data-tone
selection what is selected: in the pipeline graph’s layer, a node, a loop box or a mark; in a tree body, a node view route sel, markSel, parseSelection; TreeBody.selected
inspector the card beside the selection in the pipeline graph’s frame (a sheet under the frame on a narrow screen) that shows its facts and where it leads ca-pipeline-graph (its content), the inspector slot of cae-layered-graph
cluster a box of nodes in a layered graph; a loop box is one GraphClusterInput, .cluster
edge path the slots a drawn edge passes in a layered graph, from its source to its target: a point on every layer it crosses (not a route) EdgePath, EdgePathStep, Arrangement.edgePaths in @contraagent/elements
series the id that lines marks up across a layered graph’s nodes; the pipeline graph’s units GraphInput.series
adapter a function in @contraagent/ui/adapters that turns run data into a generic element’s model graphFromPlan, matrixFromPlan, kpiTiles, …
wrapper a ca-* element that feeds a cae-* element through an adapter and turns its cae-* events into ca-* events ca-pipeline-graph, ca-kpis, …
run start one start of a run over its directory: the first, or a resume; a task numbers its attempts from 0 in each run.json started_at (the latest), runStarts
lineage how a task is joined to an earlier task, by its plan row: given from (it was given the earlier task’s output, data), after alone (it waits for the earlier task and was not given its output, order only), created from (its flow call created it after the earlier task’s result); the pipeline graph draws each as an edge of its own, and a task’s earlier and later tasks name it Lineage, UpstreamTask.lineage, DownstreamTask.lineage
forecast the tasks a run is expected to create and has not yet, with their wall time and cost: by tail key, the tasks of the run of the same flow that finished last before this run started, less those this run has created; a display only, never part of the schedule, and a run that creates more or fewer tasks is no error run.json flow; the view forecast (Forecast, ForecastEntry); run_shape, latest_finished
view one thing the monitor answers about a run, by name: the JSON at /api/runs/<run>/<name>, the run feed’s <name> event when its value changes, and an export’s runs/<run>/<name>.json VIEWS (View), serialize
endpoint one method and path of an HTTP API: the monitor’s (GET /api/runs, /api/runs/{run}/journal, as its OpenAPI document lists them), the hub’s ingest (POST /ingest/records, …), a coding agent’s provider’s usage endpoint (GET <base>/v1/usage) (not a route) server.create_app, createMonitorClient (a method per GET endpoint), contraagent hub --openapi; an export holds a file per GET endpoint
base path the path a reverse proxy serves the monitor under (/monitor), which the proxy takes off before it passes a request on; the page the monitor serves names it in every URL it reads contraagent monitor --base-path, contraagent hub --base-path, create_app(base_path=), serve(base_path=); <ca-monitor base-url="/monitor">
export the monitor’s views of some runs written as files (the page and the JSON the API answers for each view), read with no server; it holds no transcripts and no processes, and this machine’s paths and name are taken out contraagent monitor export, contraagent.monitor.export (ExportReport), SiteExportFile (a file of no run); Info.export (ExportInfo); createExportClient, openExportFeed, <ca-monitor export="data/">

The monitor’s screens show some of these in the words of engineers who use coding agents (a failover hop is a “model switch”, a task’s Outcome its “status”); the words above stay in its tooltips.