# Deliberation circle — kido-resonate deferred delivery at yield (2026-10-20)

Module: the D2 refinement queued since the 2026-10-14 resonate design
("Deferred delivery at yield. Overruled for v1: evaluating at yield
would need hooks in the fenced scheduler files. Queued as a future
refinement with its justification intact.").

The fork: v1's transmit() evaluates every receiver synchronously inside
the sender's call. The refinement splits release from delivery: defer()
puts an unevaluated signal into a mesh outbox; drain() delivers pending
entries to receiver queues at the caller's pace — the yield rhythm.
The question the circle must settle: can this be built WITHOUT touching
the fenced scheduler files, and what stays honest across the split.

## Positions

- **P1 — Medium realist.** Signals should propagate at the medium's pace,
  not the sender's instruction pointer. Synchronous transmit() charges
  the sender unbounded receiver-evaluation work inside its own time
  slice, and lets a burst flood receivers before they run a single
  instruction. A mesh with transit time is honest physics; a sender that
  pays for every receiver's eta is a hidden coupling.
- **P2 — Fence keeper.** kido-sched.c/h are not to be touched. The
  session-5 fence, the session-6/7 allocator integration, and the whole
  QEMU proof chain (sessions 6, 8, 11, 14) rest on the scheduler's
  stability. Deferred delivery must be built from public scheduler API
  alone — create, yield, task liveness. Anything needing a scheduler
  hook is dead on arrival.
- **P3 — Honesty auditor.** Aggregates must stay truthful across the
  defer/drain split. transmit() can report delivered/rejected/dropped
  because it evaluates NOW. defer() can only honestly report
  accepted-into-the-mesh vs refused-at-the-door. Receiver outcomes
  (delivered/rejected/dropped) are counted at DRAIN time, never
  projected at defer time. Nothing is silent: a full outbox is a
  counted door-drop; a signal drained with no tuned listener is a
  counted dissipation.
- **P4 — Radio semanticist.** eta is evaluated at DRAIN time against the
  receiver's then-current tuning. A receiver that retunes between defer
  and drain hears with its new ears — like a radio, you hear what is on
  when you are listening. Freezing the tuning at defer time would be
  sender-side fiction: the sender cannot know who will be listening.
- **P5 — Courier advocate.** The delivery mechanism is a task, not a
  hook. A canonical courier body — drain, yield, forever — created via
  public kido_sched_create, gives the mesh one breath per scheduler
  cycle under round-robin. Zero scheduler changes, zero reliance on
  every task remembering to drain. Task-owned drain (each task drains
  after its own yield) stays a documented pattern, not the mechanism.
- **P6 — Static-tables keeper.** The outbox is a bounded static ring.
  The allocator stays fenced; the mesh never allocates, on either path.

## Challenges and resolutions

- **C1 — What does defer() report?** It cannot report
  delivered/rejected/dropped — nothing was evaluated. It mirrors
  transmit()'s aggregate shape with what IS known at the door:
  `accepted_out` (1 = entered the mesh, 0 = refused) and `dropped_out`
  (1 = outbox full, counted in the mesh stats). Status KIDO_OK on a
  decided door; KIDO_ERR_EARLY_ENV on arg errors (src not live,
  strength > 1000, NULL outs) — the codebase's arg-validation
  convention, unchanged.
- **C2 — How deep is the outbox?** 32 entries: 4x the per-task queue
  depth (8). The mesh must hold more than any single receiver can, or
  the door becomes the bottleneck by construction. Static, like
  everything else here.
- **C3 — What does drain() look like?** `kido_resonate_drain(
  delivered_out, rejected_out, dropped_out)` — walks the outbox FIFO,
  evaluates each entry against CURRENT receiver tuning with the same
  eta/threshold/queue-full rules as transmit()'s inner loop (one
  evaluation path, extracted — no duplicated truth). Consumes every
  entry it walks. All three out-params required non-NULL, transmit's
  convention. KIDO_OK.
- **C4 — When is arrival_ticks stamped?** At DRAIN — arrival means
  arrival at the receiver. Defer-time is transit through the medium,
  not arrival. A signal that waits ten cycles arrives ten cycles late,
  and the stamp says so honestly.
- **C5 — Does the synchronous path survive?** Untouched, zero behavior
  change. Deferred is additive and opt-in. The 59 existing self-test
  checks must pass unmodified — they are the regression proof.
- **C6 — Who calls drain()?** The module provides the canonical
  courier body `kido_resonate_courier(void *arg)`: drain, yield,
  forever, never returns by design (a returned courier recycles its
  slot and the mesh stops breathing — documented as a bug, not a
  state). The kernel creates it like any task. No scheduler hook, no
  scheduler file touched — P2 satisfied by construction.
- **C7 — Does a deferred send count as tx_sent?** Yes: defer()
  increments the sender's tx_sent — a send is a send. A door-refusal
  does NOT (it never entered the mesh); it is counted in the mesh's
  own dropped counter. Kept distinct, both visible.
- **C8 — A signal nobody hears?** Drained, evaluated against zero
  candidates, consumed — and counted as dissipated in the new mesh
  stats. It was not delivered, not rejected, not dropped; it
  dissipated, like a broadcast with no listeners. The counter keeps
  it from being silent.

## Convergence

- Additive API: `kido_resonate_defer()` (the door),
  `kido_resonate_drain()` (delivery at the caller's pace),
  `kido_resonate_courier()` (the canonical drain-at-yield task),
  `kido_resonate_mesh_stats()` (outbox pending, deferred total,
  mesh_dropped, dissipated).
- eta evaluated at drain against live tuning (P4); arrival stamped at
  drain (C4); tx_sent on accepted defers only (C7).
- Synchronous transmit() bit-identical; its inner receiver loop is
  extracted into one shared static helper used by both paths.
- No kido-sched.c/h change: the courier is a plain task body using
  public create/yield. The fence stands.
- kido_signal_t unchanged — interop's envelope wraps it whole, so
  interop needs no changes.

## Preserved dissent

- **D1 — Scheduler-hook drain.** Overruled (P2). A hook in
  kido_sched_run/yield would couple the mesh to scheduler internals
  and invalidate the QEMU proof chain that certifies the scheduler.
  The courier task achieves the same rhythm with public API.
- **D2 — Transmit-time eta evaluation.** Overruled (P4). Freezing
  receiver tuning at defer time lets the sender dictate what the
  receiver "would have" heard — fiction. Delivery-time evaluation is
  the radio semantics the mesh claims.
- **D3 — Unbounded or growable outbox.** Overruled (P6). The static-
  tables law and the allocator fence are not negotiable for
  convenience; 32 with a loud counted door-drop is the honest bound.
