Skip to content

feat(discovery): LAN presence beacon — same-network peers converge with zero gh requests - #1371

Merged
joelteply merged 1 commit into
canaryfrom
feat/lan-presence-beacon
Sep 4, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/lan-presence-beacon

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

See commit message — full rationale, security posture, convergence math, and verification (incl. the pre-existing drain_stdin failure reproduced on clean canary) are there.

Key points: RFC 2365 group 239.255.77.77:47700 (not mDNS/SSDP), 15s beacons with identity-derived jitter, SO_REUSEADDR for multi-scope machines, hints land in the SAME learned_ips map learn-live-address feeds (no new plumbing), enrolled-only (discovery ≠ authorization), non-fatal degraded mode for multicast-less containers.

This is the governor's LAN tier per Joel's directive: node churn handled continuously, event-driven, with zero GitHub budget spent on what the local wire says for free.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

…th ZERO gh requests

airc had no LAN-local discovery at all: no mDNS, no multicast, no broadcast.
Two peers on the same /24 could only find each other through the GitHub
rendezvous (budget-capped, beacons stale in minutes) or cached endpoints
(invalidated by churn). Measured live 2026-09-04: a peer's Mac was on this
LAN, daemon LISTENING, while this node reported "0 routes, 96 enrolled" — a
human closed the gap with arp + a hand-derived port + airc dial.

This is also what made gh a single point of failure and a spam risk at once:
LAN convergence rode the same request budget as SOS and registry sync. Per
Joel's governor directive: the mesh must ride nodes coming on/offline
continuously, without spending gh budget on anything the local wire can say
for free.

The slice, composed onto existing machinery rather than beside it:

  - airc-transport/lan_presence: ~100-byte JSON beacon on an RFC 2365
    administratively-scoped group (239.255.77.77:47700 — deliberately not
    mDNS/SSDP's groups), every ANNOUNCE_INTERVAL=15s with per-identity
    jitter (802.11-style desync, no RNG dep). SO_REUSEADDR so every scope
    on one machine hears the group. Crate stays log-free per convention.
  - airc-lib::start_lan_presence: the consumer. Only an ENROLLED peer's
    beacon teaches anything (discovery is not authorization); what it
    teaches lands in learned_ips — the SAME map learn-live-address (#9)
    feeds — so existing dial rungs pick it up with no new plumbing.
    Edge-triggered logging.
  - daemon wiring beside listen_lan_advertising: non-fatal on bind failure
    (a container without multicast still dials out + rides the rendezvous),
    loud about the consequence when degraded.

Security: a beacon is a HINT, never trust — it can only trigger the existing
authenticated dial pinned to an enrolled identity; IP from the datagram
SOURCE (observed), only the port claimed, and a wrong claim just fails the
handshake, bounded by dial quarantine.

Convergence: online -> first beacon <=18s -> next refresh dials. Offline ->
beacons stop -> proof-of-life freshness + failure-counted eviction age it
out. The governor's LAN tier: churn handled continuously, gh-free.

Verified: lan_presence 4/4; airc-lib --lib 341/0; airc-cli integration green
except drain_stdin_timeout_proceeds_when_eof_never_arrives, which fails
IDENTICALLY on clean origin/canary (reproduced before claiming) — pre-existing.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply
joelteply enabled auto-merge (squash) September 4, 2026 16:58
@joelteply
joelteply merged commit e4060b8 into canary Sep 4, 2026
11 of 12 checks passed
@joelteply
joelteply deleted the feat/lan-presence-beacon branch September 4, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant