Expand description
Synchronous event delivery — collapses the legacy
wire send → outbox → daemon push → relay 3-step into a single
direct relay POST.
§Why this exists
Paul (2026-06-01): “Why are we dealing with this whole outbox queued delivered thing it’s a headache and always breaks can we streamline and collapse steps.”
Pre-fix, every wire send (CLI and MCP) wrote to
<outbox_dir>/<peer>.jsonl and returned status: "queued". The
daemon’s 5s push loop later POSTed the event to the relay. Three
distinct silent-drop classes hide in those steps:
- outbox write succeeds, daemon never pushes — daemon dead,
daemon on wrong WIRE_HOME, TLS broken (the #176 → #183 saga),
operator never ran
wire push.queuedlooked like success but no byte ever left the box. - daemon pushed, peer’s relay slot stale — earlier
half-paired state, peer rotated slot, slot_token expired (the
brisk-iris case). Push got 4xx, marked as skipped in the daemon
log, operator never sees it from the
wire sendside. - content-hash dedup blocks retries —
event_idissha256(canonical(body)). Sending the same body twice produces the same event_id; relay drops the second asduplicate. Retry feels like success but never reaches the peer.
§The new contract
-
Default (
wire send,tool_send): synchronous POST to the peer’s pinned relay slot. ReturnsDelivered/Duplicate/Failedinline. No outbox write on the happy path. Operator sees the actual verdict, not a fakequeued. -
--queueopt-in (CLI flag; MCPqueue: truearg): preserves the legacy outbox-write path for explicit batching / offline-buffer / pre-pair queue use cases. The daemon’srun_sync_pushloop continues to drain the outbox so anything written via this path still delivers. -
Peer not pinned: the relay coords are unknown — sync POST is impossible. We error explicitly with a hint to run
wire dial <peer>(or pass--queueif the operator wants pre-pair queueing). Pre-fix this case silently wrote to outbox and the daemon would never push it; now it’s loud. -
Stale slot (4xx from relay): return
Failedwith the slot error string. The existingcli::error_smells_like_slot_4xxclassifier already detects this shape; the caller surfaces the re-resolve hint. We do NOT auto-re-pair without the operator’s consent (that’swire dial’s job).
Enums§
- Sync
Delivery - Result of attempting a synchronous delivery to a peer.
Functions§
- attempt_
deliver - Attempt synchronous delivery of
signed_eventtopeer_handle. - delivery_
json - Render a
SyncDeliveryas the JSON valuewire send --json/tool_sendreturn. Fields are flat (no nested struct) so JSON consumers can read.status+.event_iddirectly without pattern-matching the variant tag.