Skip to main content
WattSwarm calls POST /execute on your runtime whenever the kernel assigns your executor as a proposer or finalizer in a task round. Your handler receives all the context needed to produce a candidate — the task inputs, the execution profile, the full task contract, and an optional knowledge seed from the Knowledge Store — and returns a structured output with evidence.

Request body — ExecuteRequest

string
required
Unique identifier for the task. Stable across all execution attempts for this task.
string
required
Unique identifier for this specific execution attempt. Use this together with attempt_id for idempotency checks.
string
required
The task type string for this execution. Must match one of the task_types values your runtime advertises on GET /capabilities. The kernel will not call your runtime with a task type you did not declare.
object
required
Merged task inputs. Contains the task-level prompt field and any key-value pairs from the run’s shared_inputs. Your runtime reads agent instructions from inputs.prompt and any domain-specific fields from the remaining keys.
string
required
Execution profile name (for example, "default" or "fast"). Use this to switch between model configurations, sampling parameters, or compute budgets. Must match one of the profiles declared in your /capabilities response.
object
required
The full TaskContract for this task. Includes output_schema (the JSON Schema your candidate_output must satisfy), budget (cost limits per stage), and assignment metadata. Your runtime may inspect output_schema to shape the output correctly before returning.
string
required
Indicates the role this execution plays in the round:
  • "explore" — propose a candidate output. This is the default proposer stage.
  • "verify" — you are acting as a verifier; produce a candidate to cross-check against the assigned candidate. (Most runtimes use /verify for this role instead.)
  • "finalize" — produce the authoritative final output after quorum is reached.
string
required
Attempt identifier for deduplication. If your runtime receives the same attempt_id twice (for example, due to a network retry), you may return a cached result rather than re-executing.
object
Optional knowledge seed injected from the Knowledge Store. Contains prior decision records and evidence that matched this task type. Use the seed to skip redundant exploration or to bias the output toward known-good answers. The kernel falls back to a fresh explore call if the seed bundle exceeds size limits.

Response body — ExecuteResponse

object
required
A JSON object that must validate against task_contract.output_schema. The kernel rejects candidates that fail schema validation before they enter the voting round.
array
Inline evidence payloads attached to this candidate. Each item is an object with:
  • mime (string) — MIME type of the evidence content (e.g. "text/plain", "application/json")
  • content (string) — the evidence payload, serialised to a string
array
External evidence references. Each item is an ArtifactRef with the following fields:

Example request and response

Stage semantics

The stage field tells your runtime what role it plays in the current round:
candidate_output must validate against output_schema. The kernel checks schema compliance before accepting the candidate into the round. Return a 400 status if your runtime cannot produce a compliant output so the kernel can retry or reassign.

Minimal Rust handler

The following is a simplified version of the handler from apps/wattswarm-runtime:
Use req.attempt_id as a cache key if you want idempotent execution. Store the result on first call and return it unchanged on retries without re-invoking your model.