Expand description
/v1/data/* endpoints (v9 Big Response handling, Store-owner direct path).
HTTP /v1/data/* endpoints (v9 Data path, for Big Response handling).
Thin HTTP wrapper that lets SubAgents push Big Responses (4k-token-scale
bodies / intermediate artifacts / file paths) directly to the Store owner,
bypassing the MainAgent. The Store implements
mlua_swarm::store::output::OutputStore (default =
InMemoryOutputStore). This module never touches the Engine core or the
Domain path (/v1/worker/result / submit_output / output_tail /
dispatch verdict) — it is the boundary point that physically wires the
Data / Domain separation axis. For the canonical narrative, see
mlua_swarm::store::output module docs.
§Routes
POST /v1/data/emit— body{task_id, attempt, producer_agent, event, parent_refs?}→ callsOutputStore.appendand returns{out_id}. The MainAgent only needs to receive an out_id ref (avoids context bloat).POST /v1/data/:name— same body minusproducer_agent(the path segment is the producer name); the write-side twin of name addressing.GET /v1/data/:key—keyis anout_id(out-<10hex>) or anout_name(producer agent name → latest emit). Id lookup first, name fallback. Used by the next Spawn’s$IN_REFSto fetch.
§Auth (single-mouth contract)
Every emit requires a worker CapToken, carried either as
Authorization: Bearer <token> or ?token=<token> (same token material —
the transport is the caller’s choice). The token passes the
Verb::EmitOutput gate and is verified against the body’s task_id.
The former split surface (/v1/data/emit unauthenticated +
/v1/data/emit-auth Bearer) was collapsed into this single mouth
(the emit-auth API consolidation): expressing auth as endpoint forks multiplies the API
surface without adding capability. How far to tighten GET (and token
scoping in general) is deferred to the security-hardening pass after
dogfooding.
Structs§
- Data
Emit Named Req - Input for
POST /v1/data/:name(name addressing —producer_agentcomes from the path segment, not the body). - Data
Emit Req - Input for
POST /v1/data/emit. - Data
Emit Resp - Response for the emit endpoints.
- Token
Query - Auth-carrying query params (
?token=— the header-less twin of Bearer).
Functions§
- data_
emit - Handler for
POST /v1/data/emit(single mouth, auth required). - data_
emit_ named - Handler for
POST /v1/data/:name(name addressing, auth required). - data_
get - Handler for
GET /v1/data/:key(key= out_id, falling back to out_name).