# Deliberation circle — kido-interop design (2026-10-15)

Module: the inter-kernel protocol between Kido (outer seat) and BUBO (inner
seat), plus the doll-layer placement it formalizes. This closes two items the
boot/HAL conformance reviews explicitly DEFERRED: doll-layer placement and
the inter-kernel protocol. The resonate C5 verdict ("DECLARED, not built ...
the wire shape is carried so the future transport plugs in") is the direct
parent of this design.

Builder crew: Mechane builders + Merlin's execution pattern + deliberation
circle. One solid piece: protocol + placement, not five thin ones.

## Positions

- **P1 — Asymmetry advocate.** Kido adapts; BUBO announces. The protocol puts
  every adaptive behavior on Kido's side: Kido probes, Kido retries, Kido
  degrades to solo — loudly. BUBO, the stable inner core, owes the protocol
  exactly one behavior: answer an ANNOUNCE with an ACK. This is kido.json's
  "compensates BUBO's flaws" made into protocol law. A symmetric handshake
  would pretend the two kernels are interchangeable; they are not — the seats
  are fixed, and only the outer seat moves.
- **P2 — Envelope purist.** `kido_signal_t` is Gate-approved and was carried
  whole for exactly this moment ("plugs in without changing the API"). The
  interop envelope WRAPS it: `kido_packet_t = { magic, version, dest_kernel,
  src_kernel, hop_count, kido_signal_t signal }`. No field is duplicated, no
  field is redefined. `kido-resonate.h` is not modified — the same discipline
  as every prior session (Gate-approved files are read, never rewritten).
- **P3 — Loud-link auditor.** No inter-kernel bus exists on bare metal, and
  none is invented. The link is a function-pointer table (the HAL pattern:
  `send`/`recv`), medium-agnostic by construction. Every send on an
  uninitialized, unbound, peerless, or driverless link returns a loud status
  code — never a silent drop. The existing Gate-approved code set suffices:
  `KIDO_ERR_EARLY_ENV` for uninitialized use, `KIDO_ERR_STUB_REACHED` for
  absent transport (documented mapping, per the sched D1 precedent — a new
  header code is N8toriousAi's call, and this session does not touch the approved
  header).
- **P4 — MEDUSA mathematician.** Every cross-boundary behavior reduces to a
  readable equation. Hop decay is explicit integer math in the header
  comment: `strength_rx = strength_tx * (1000 - LOSS) / 1000`, LOSS = 50
  (5%/hop). `hop_count` increments on ingress. The 0.5 delivery threshold
  stays in-kernel (resonate's law) and is NOT duplicated here — the interop
  layer transports; reception gates. No new numerology is introduced.
- **P5 — Testability builder.** BUBO does not exist yet as code (the BUBO ARM
  port is Phase 4 territory). Kido's side must be fully provable today: a
  hosted two-endpoint loopback pipe plus a simulated BUBO peer that ACKs
  announces and answers pings. The peer is declared simulation in the test
  file's own comments — it proves Kido's side, not BUBO's existence.

## Challenges and resolutions

- **C1 — BUBO doesn't exist.** Resolved by P5: the simulated peer + loopback
  pipe proves Kido's envelope, handshake, decay, and loudness end-to-end.
  The real peer is a declared DEFERRED item, not a hole in this draft.
- **C2 — The medium is unknown.** Resolved by P3: the driver contract names
  no medium. Bare metal gets no driver (loud stub by absence); hosted gets
  the loopback. Guessing UART-vs-shared-memory now would be inventing
  platform facts — the HAL session's "registers-are-honest" law forbids it.
- **C3 — Frequency addressing across kernels.** Within Kido, frequency IS the
  address (resonate P1) and stays that way. Across the doll boundary the
  envelope adds exactly one routing dimension: `dest_kernel`
  (KIDO_KERNEL_KIDO / KIDO_KERNEL_BUBO). Band addressing applies unchanged
  *within* the destination kernel. One new dimension, not a new addressing
  scheme.
- **C4 — Message type namespaces.** The wire shape's `type` is opaque; the
  interop layer defines a minimal registry and nothing more: ANNOUNCE
  (0x0001) / ANNOUNCE_ACK (0x0002) for the handshake, SYS (0x0010) for
  system/service traffic, LANG (0x0020) for language-ball material — Kido's
  outer-seat identity is that synthesized language fragments cross this
  boundary. Everything else is reserved, not guessed.
- **C5 — Ordering and duplicates.** None claimed. The protocol is
  cooperative and unordered; receivers must be idempotent-tolerant by
  contract. Sequence numbers would be fake reliability on a link with no
  retransmission — the honesty auditor vetoed them.
- **C6 — Versioning.** Magic `KIDO_INTEROP_MAGIC` ('KIDP') + version 1 in
  every envelope. Mismatch → packet rejected, counted in
  `rx_version_reject`, `got=0`, `KIDO_OK` (a counted result like resonate's
  REJECTED, not an error — but visible in stats, never silent).
- **C7 — Solo vs. dead peer.** Bounded ANNOUNCE wait (`max_rounds`; 0 =
  fire-and-forget, stays ANNOUNCED). ACK → LINKED. Timeout → SOLO with one
  loud console note. SOLO is a *state*, not an error: Kido boots and runs
  without BUBO — the announce proved absence, and absence is a fact. Sends
  in SOLO/ANNOUNCED/UNBOUND are loud errors, never silent drops.
- **C8 — Which side applies decay.** The receiver, on ingress. The wire
  carries what was sent (honest); decay is a receiver-measured fact. This
  also keeps the sender's accounting (`tx_packets`) clean of receiver-side
  physics.

## Convergence

- Envelope wraps `kido_signal_t` whole; `kido-resonate.h` untouched.
- Asymmetric handshake: Kido ANNOUNCEs, BUBO ACKs; bounded wait; SOLO on
  timeout (loud note once); LINKED is idempotent to re-announce.
- Link driver = `{ send, recv }` function pointers; NULL/unbound driver =
  loud `KIDO_ERR_STUB_REACHED` on announce, never a guessed medium.
- Hop decay: `strength_rx = strength_tx * 950 / 1000`, integer math,
  applied on ingress with `hop_count++`. Draft constant; N8toriousAi tunes it.
- Control packets (ANNOUNCE/ACK) use `source_id = 0xFFFFFFFF` (the kernel
  itself, never a task) and bypass band addressing — consumed by the
  interop layer, never handed to resonate.
- No ordering/dup guarantees, claimed or implied. No new status codes —
  the approved set covers every case via documented mappings.
- Static state only; no allocator, no hidden coupling (explicit init with
  hal + self id). Cooperative: announce's wait is a bounded poll loop,
  never a blocking spin.

## Preserved dissent

- **D1 — Beacon-only vs. handshake.** Overruled (P1/C7). Alternative: BUBO
  beacons periodically, Kido only listens — zero handshake. Rejected:
  listening cannot distinguish a dead peer from an absent one, and it puts
  a periodic emission burden on the stable side, which the asymmetry law
  forbids.
- **D2 — Lossless carrier vs. 5%/hop decay.** Overruled (P4/C8).
  Alternative: the carrier is lossless and the receiver's own eta gate is
  the only attenuation. Rejected: multi-hop needs a measured loss term for
  honest distance accounting, and the draft constant is tunable, not
  load-bearing.
- **D3 — Standalone interop struct vs. wrapping the wire shape.** Overruled
  (P2). Alternative: a fresh struct duplicating the signal fields with
  kernel routing added. Rejected: it forks the wire shape the resonate
  session explicitly carried whole for this exact future.
