Examples
Daemon Client
Control local runs through the runtime daemon API.
Daemon Client Example
The daemon client example demonstrates local run management through the runtime daemon API: create a run, append percepts, start a tick, inspect traces/state, and request inspect-only replay.
Start the local daemon
cargo run -p splendor-daemonThe local daemon binds to loopback and warns when explicit local development mode is active. Do not expose an unauthenticated daemon as a remote service.
Public workflow
POST /runswith caller attribution and a signed scoped work order.POST /runs/{run_id}/perceptswith an allowed percept schema and provenance.POST /runs/{run_id}/startto execute one local tick.GET /runs/{run_id}/state-headto read committed state metadata.GET /runs/{run_id}/traces?redaction_policy=noneto inspect ordered trace records.POST /runs/{run_id}/replayto reconstruct facts without side effects.POST /runs/{run_id}/stoporcancelto end the run while preserving evidence.
CLI helper
splendorctl daemon request \
--method GET \
--url http://127.0.0.1:8077/health \
--token "$SPLENDOR_CALLER_TOKEN" \
--caller-credential ./caller-credential.jsonFor mutating requests, use a JSON body that includes caller credentials, audit attribution, and work-order or lifecycle data required by the endpoint.
What this proves
- daemon callers are separate from tenant, agent, and run identity;
- endpoint scopes authorize daemon API access;
- signed work orders authorize run creation/resume;
/actionsgoes through the gateway and cannot self-attest verification;- replay does not invoke policies, gateways, verifiers, or adapters.