Skip to content

fix(monitor,#407): tighten mesh-rediscover cadence to 60s (was 300s) - #407

Merged
joelteply merged 1 commit into
canaryfrom
fix/airc-405-followup-faster-rediscover
May 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/airc-405-followup-faster-rediscover

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Tonight's bus-rotation incident proved 300s too slow for satellite/bios semantics. 60s = 5x faster recovery, still gh-rate-limit safe (~60 calls/peer/hr).

When peers refresh, host-rotation blackouts drop from "5min + Joel manually notifies" to "<1min, transparent."

Companion fixes follow-up: on-bearer-fail immediate trigger (#408?), stale-binary detection on connect, aggressive airc daemon install prompting.

🤖 Generated with Claude Code

Tonight's incident proved 300s too slow for "satellite/bios" semantics:
host rotation = 5min worst-case comms blackout = Joel having to
manually notify every peer. Drop to 60s default — still well under
gh's 5000/hr authenticated rate limit (~60 calls/peer/hr from this
loop), 5x faster recovery.

The full bus-restoration arc still requires:
  1. peer's rediscover loop fires (now ≤60s, was ≤300s)
  2. _mesh_find returns the new gist
  3. config.json updated + bearer respawn

When this PR lands and peers refresh, host-rotation blackouts drop
from "5min and Joel notifies manually" to "<1min, transparent."

Out of scope (separate PRs):
  - On-bearer-fail trigger immediate rediscover (no-wait-for-cadence
    when bearer's own poll says "404 / gone / auth_failure")
  - Stale binary detection on connect (b69f's "wrong branch" issue
    today — peer's airc didn't have all our fixes because they
    restarted onto an old branch)
  - Aggressive 'airc daemon install' prompting on first connect
    (the dead-monitor failure mode — interactive Monitor task ends
    with Claude session, no auto-respawn)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings May 2, 2026 15:39
@joelteply
joelteply merged commit d93b498 into canary May 2, 2026
8 checks passed
@joelteply
joelteply deleted the fix/airc-405-followup-faster-rediscover branch May 2, 2026 15:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces the mesh rediscovery polling interval in monitor() from 5 minutes to 60 seconds so joiners can recover from host gist rotation much faster. In the broader airc mesh self-healing flow, this makes automatic recovery from host restarts or re-joins noticeably quicker without changing the underlying rediscovery mechanism.

Changes:

  • Change _mesh_rediscover_loop() to default AIRC_MESH_REDISCOVER_SEC to 60 instead of 300.
  • Update the inline rationale/comments around rediscovery cadence and GitHub API rate-limit expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread airc
Comment on lines +1950 to +1957
# Cadence: 60s default (was 300s). Joel's "satellite/bios" framing
# argues for the tightest cadence that's still gh-rate-limit safe.
# _mesh_find does ~1 gh api call (gist list filtered by description);
# 60 calls/hour/peer is well under the 5000/hr authenticated limit.
# Tonight's incident 2026-05-02 made this concrete: a host rotation
# + 5min cadence = 5min comms blackout = Joel having to manually
# notify every peer. 60s reduces that to <1min worst-case (still
# not great but 5x improvement over 300s).
joelteply added a commit that referenced this pull request May 2, 2026
… missing) (#408)

The Windows daemon launcher .bat (generated by 'airc daemon install')
called the airc binary with NO stdout redirect:
  "$bash_exe" -c "exec '$airc_bin_unix' connect"

So airc's event stream (the entire stdout output: hosting messages,
peer joins, channel state, beacons) went to NOTHING. Only the
launcher's own restart-record messages reached daemon.err.

Symptom (b69f 2026-05-02): airc daemon-installed on Windows; daemon
"running" per the registry entry; but `airc daemon log` reports
"daemon.log doesn't exist" because no process ever wrote to it.
Operator has no way to see what airc actually did — bios-critical
substrate is opaque on the very platform users need it most.

Fix: 1>> daemon.log 2>> daemon.err on the airc invocation. Now
daemon.log captures the actual airc event stream while daemon.err
keeps the launcher's restart records separate.

Per the global "evidence is for the debugger, not the trash" rule
+ tonight's bios-resilience sweep (everything airc does must be
visible AND self-healing). Daemon mode is the OS-supervised path
that survives Claude session ends — but only useful if its logs
exist.

## Cumulative effect

Tonight's airc sweep now closes:
- Receive path silent failures (#400/#401/#402/#403/#404/#406)
- Self-heal of host rotation (#405/#407)
- Daemon-log invisibility on Windows (THIS PR)

Last remaining bios-fragility I know of: `airc daemon install` on
Windows succeeded BEFORE this fix — so b69f's daemon may be running
right now but wrote nothing all session. After this lands + b69f
re-installs, daemon.log will populate.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request May 2, 2026
…414)

Tonight's repro 2026-05-02: I rotated my host gist via teardown,
60s+ later b69f still couldn't reach me — Joel had to relay. 30s
halves the worst-case rotation blackout window and starts
approaching the bearer's own 15s poll cadence so the rediscover
happens at most 2 polls late from the bearer's PoV.

Cost: 120 gh api calls/hour/peer (was 60), still well under the
5000/hr authenticated limit.

This is iteration #2 of the cadence parameter:
  300s (original) → 60s (#407) → 30s (this)

Hard floor on this approach is the gh-list-gists rate +
single-cycle latency. To go lower would need bearer-fail-triggers-
rediscover (sentinel file pattern or in-process signal) — that's
the next-PR architectural move when 30s isn't tight enough.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request May 2, 2026
…routing) (#418)

Captures the architecture conversation Joel surfaced 2026-05-02 end of the
22-PR airc hardening session. Replaces "single transport at a time" with a
reticulum-style fusion routing layer above pluggable interface drivers
(loopback / LAN / Tailscale / gh / Reticulum-future).

Core principles, all from Joel verbatim:

- "airc is you as an agent's complex vocal learning trait" — substrate is
  constitutive of cognition, not infrastructure under it
- "you never require these dependencies to exist" — every transport is
  optional, auto-detected, gracefully absent
- "since we know it is a rate limited feature it should be used sparingly
  if possible. because when you do, gh suffers an outage and we are down"
  — gh as scarce resource, not default channel
- "its like sensor fusion, if we lose accelerometer we dont lose position,
  it all works together" — fusion not failover; loss of one transport
  degrades the fused estimate gracefully, layer above sees one virtual
  channel

Doc covers:

- Layered structure (drivers → fusion → app)
- Interface driver contract (is_available, addresses, connect, health,
  send, recv_iter)
- Per-transport health vector (RTT EMA, success rate, budget, jitter)
- Routing policy by traffic class (control_critical, control_routine,
  data, discovery, outsider)
- Scenario matrix (TS-logout, TS-comeback, gh rate-limit, network
  partition, outsider, all-down)
- 5-phase implementation plan (loopback+LAN → +TS → +health/routing →
  gh-as-control-only → Reticulum slot-in)
- Pairs explicit with vuln-A (prompt injection), #412 daemon takeover,
  #414/#407 rediscover, #415 KEEP gist
- 6 open questions for design ratification before code

Companion to issue #417 (which holds the same content as the discussion
surface). The repo doc is the durable artifact; the issue is the
conversation lane.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

2 participants