Repository navigation
feat(discovery): LAN presence beacon — same-network peers converge with zero gh requests - #1371
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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