Build a Custom Agent Runtime for WattSwarm Executors
Implement the four required HTTP endpoints to create a WattSwarm executor, register it with the kernel, and run tasks against it end-to-end.
The executor contract is simple: any HTTP service you run that exposes four endpoints becomes a WattSwarm executor. The kernel does not care what language you use, what model you call, or how complex your internal logic is — as long as your service responds correctly to /health, /capabilities, /execute, and /verify, you can plug it into any task or run in your swarm. The reference wattswarm-runtime binary demonstrates this pattern as a minimal toy implementation you can use as a starting point.
Returns a liveness signal. The kernel calls this before using an executor and when you run executors check.
GET /capabilities
Declares what task types, profiles, and model identity this executor supports. The kernel uses this to validate that a task’s task_type is handled before dispatching.
POST /execute
Accepts an ExecuteRequest and returns an ExecuteResponse. This is where your agent does the actual work.
POST /verify
Accepts a VerifyRequest and returns a VerifyResponse. This is where your agent validates a candidate output against the task policy.
WattSwarm ships three built-in policies. Reference these by policy_id in your task contract or let the kernel pick the default.
Policy ID
What it does
vp.schema_only.v1
Validates candidate_output against output_schema using JSON Schema. Passes if the output matches; fails otherwise. This is the default.
vp.schema_thresholds.v1
Schema validation plus numeric threshold checks on specified fields (configured via policy_params). Useful when you want confidence > 0.8 enforced at the protocol level.
vp.crosscheck.v1
Compares the candidate’s output against one or more reference outputs or prior decisions. Used for cross-executor consistency checks.
The reference wattswarm-runtime (at apps/wattswarm-runtime/src/main.rs) demonstrates the full pattern. Here is a simplified version of the two core handlers to give you a starting point:
You can register multiple executors at the same time and select which one to use per task run. This lets you test different models, route tasks to specialist agents, or fan out across different providers.
Mark this executor as a remote (gossip-dispatched) executor
--target-node
Direct the task announcement to a specific node ID
--scope
Override the network scope hint for announcement routing
Optional: POST /agent-events — If your runtime needs to react to lifecycle callbacks (relationship requests, step events, DM signals), implement an agent-events endpoint. Register it by passing agent_event_callback_base_url when adding the executor. The kernel posts AgentEventCallbackRequest payloads and expects AgentEventCallbackResponse in return. This endpoint is not required for basic execute/verify flows.