发布

  • v1222 c9f005c360

    cog-ha-matter (ADR-116 P3): wire publisher::spawn into main.rs

    frostbyte_neo 发布于 2026-05-23 21:59:02 +00:00

    P3 closes the publisher wiring loop. main.rs now:

    1. builds PublisherInputs from CLI args via the pure helper
      extracted last iter,
    2. opens a broadcast::channel::<VitalsSnapshot>(256),
    3. calls runtime::spawn_publisher(inputs, rx) — a thin
      wrapper around ADR-115's publisher::spawn that owns the
      Arc<MqttConfig> wrap,
    4. holds the tx side so the channel stays open until P3.5
      wires the sensing-server bridge,
    5. awaits Ctrl-C or unexpected publisher exit (logged at WARN).

    Two new tests:

    • spawn_publisher_returns_live_handle_without_broker — proves
      the wiring compiles and the rumqttc event loop survives an
      unreachable broker (it retries internally; we abort the handle
      inside 100 ms). Catches breakage from a future refactor that
      accidentally pre-validates host reachability.
    • default_state_channel_capacity_is_reasonable — locks the
      DEFAULT_STATE_CHANNEL_CAPACITY = 256 default; a regression to
      e.g. 1 would surface here instead of as a dropped frame in
      production under bursty multi-Seed federation.

    12/12 cog-ha-matter tests green (10 → 12).

    ADR-116 phase table: P3 flipped from "in progress" to wiring done,
    with the P3.5 follow-up (sensing-server /v1/snapshot WS bridge)
    explicitly named.

    Co-Authored-By: claude-flow ruv@ruv.net

    下载附件