Skip to content

fix(ci): TEST-NET-2 instead of 127.0.0.99 for unreachable-host fixtures - #261

Merged
joelteply merged 2 commits into
canaryfrom
fix/cmd-rooms-tolerates-gh-no-auth
Apr 28, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/cmd-rooms-tolerates-gh-no-auth

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

127.0.0.99 is routed loopback on Linux; CI runners with localhost sshd hit auth-fail path → die. 198.51.100.99 (RFC 5737 test range) is non-routable everywhere → ssh times out → queue branch fires as intended.

joelteply and others added 2 commits April 28, 2026 18:43
CI integration-suite failed with 'airc list crashed (rc=4)' on canary
push. Root cause: airc has `set -euo pipefail`. `gh gist list`
exits 4 when not authed (CI runners have no gh auth). Under pipefail
the whole pipeline propagates the failure; -e then aborts the script
with rc=4. Cascaded: subsequent integration scenarios saw side
effects from the aborted process.

## Fix

Wrap the gh call in `{ ... || true; }` so unauthed gh produces empty
output instead of failing the pipeline. The downstream count=0 branch
already handles 'no rooms found' cleanly; this just lets it run.

Verification: tabs 19/0; manual airc list with gh present works
unchanged.
…-host fixtures

CI failure on Linux: 127.0.0.99 is routed loopback on Linux (the
entire 127.0.0.0/8 is loopback per RFC). On a runner with sshd on
localhost (default for many GitHub runners), ssh to [email protected]
hits the local sshd, fails as 'Permission denied, please try again /
Too many authentication failures' — that matches cmd_send's auth-fail
grep, hits die() with exit 1 instead of the queue branch.

Mac doesn't route 127.0.0.99, so ssh times out instead of getting
auth-rejected. Tests passed.

## Fix

Use 198.51.100.99 (TEST-NET-2, RFC 5737) — explicitly reserved for
documentation/test, never routable in any environment. ssh fails
with 'Network is unreachable' / 'Operation timed out' which doesn't
match the auth-fail grep, so the queue branch fires as intended.

3 scenarios affected: tabs (failed-send subsection), queue, status.

Verification: tabs / queue / status all pass on Mac post-fix; the
TEST-NET-2 IP ensures Linux behavior matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings April 28, 2026 23:54
@joelteply
joelteply merged commit d354e88 into canary Apr 28, 2026
@joelteply
joelteply deleted the fix/cmd-rooms-tolerates-gh-no-auth branch April 28, 2026 23:54

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 improves CI reliability by making “unreachable host” integration fixtures truly unreachable across Linux runners, and by preventing airc list/rooms/ls from aborting under set -euo pipefail when gh isn’t authenticated.

Changes:

  • Update integration outage/unreachable-host fixtures to use 198.51.100.99 (RFC 5737 TEST-NET-2) instead of 127.0.0.99.
  • Make cmd_rooms tolerate non-zero gh gist list exit codes in unauthenticated CI environments (avoid rc=4 crash).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
test/integration.sh Replaces loopback fixture IPs with TEST-NET-2 to ensure “unreachable” behavior is consistent in CI.
lib/airc_bash/cmd_rooms.sh Guards gh gist list pipeline to prevent set -euo pipefail abort when gh is not authed.
Comments suppressed due to low confidence (1)

test/integration.sh:262

  • The comment says the send should exit non-zero ("we die()"), but the queued-on-network-error path in cmd_send returns 0 (queued is treated as success). Consider updating this comment to match the current behavior (and/or explicitly asserting the intended exit code in the test).
  AIRC_HOME=$fake_home/state "$AIRC" send @ghost "this-should-fail-but-still-mirror" >/dev/null 2>&1
  # Exit should be non-zero (we die()), but local must have both the attempt AND the failure marker
  grep -q '"this-should-fail-but-still-mirror"' "$fake_home/state/messages.jsonl" 2>/dev/null && \
    pass "failed send: outbound still mirrored to local log (no silent loss)" \

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

Comment on lines +75 to +81
local raw=""
raw=$( { gh gist list --limit 50 2>/dev/null || true; } \
| awk -F'\t' '
/airc mesh/ { print "mesh\t" $1 "\t" $2 "\t" $5 }
/airc room:/ { print "room\t" $1 "\t" $2 "\t" $5 }
/airc invite for/ { print "invite\t" $1 "\t" $2 "\t" $5 }
')
' || true)

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

This change makes any gh gist list failure look like an empty listing because stderr is discarded and the command is forced to succeed (|| true). That hides real problems (e.g., transient network/API errors) behind "No open airc rooms...". Consider only suppressing the unauthenticated case (exit status 4) and surfacing other failures (or at least preserving stderr for non-auth errors).

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +75
# CI fix: airc has \`set -euo pipefail\` at the top. \`gh gist list\` exits
# 4 when not authed; under pipefail that propagates and -e aborts the
# script with rc=4. The integration suite's scenario_list saw
# 'airc list crashed (rc=4)'. Tolerate gh's nonzero exit explicitly:
# capture stderr to /dev/null, OR-true the pipeline so an unauthed
# gh produces empty raw (which the count=0 branch handles cleanly).
local raw=""

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

This PR adds an additional CI behavior change (tolerating gh gist list exit 4 when not authenticated) in addition to the unreachable-host fixture IP swap described in the PR title/description. Please update the PR title/description to mention this airc list/rooms fix, or split it into a separate PR to keep scope clear.

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +74
# CI fix: airc has \`set -euo pipefail\` at the top. \`gh gist list\` exits
# 4 when not authed; under pipefail that propagates and -e aborts the
# script with rc=4. The integration suite's scenario_list saw
# 'airc list crashed (rc=4)'. Tolerate gh's nonzero exit explicitly:
# capture stderr to /dev/null, OR-true the pipeline so an unauthed
# gh produces empty raw (which the count=0 branch handles cleanly).

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

The new comment block contains escaped backticks ("`...") inside a Bash comment. In the rendered source this will show the backslashes literally and is harder to read; consider using plain backticks (or no backticks) since comments don't need escaping.

Copilot uses AI. Check for mistakes.
Comment thread test/integration.sh
Comment on lines 249 to 255
# Point host_target at an unreachable host
python3 -c "
import json
c = json.load(open('$fake_home/state/config.json'))
c['host_target'] = 'nobody@127.0.0.99'
c['host_target'] = 'nobody@198.51.100.99'
c['host_airc_home'] = '/tmp/nowhere'
json.dump(c, open('$fake_home/state/config.json', 'w'))

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

Switching the unreachable-host fixture to a non-loopback IP means relay_ssh will typically hit its ConnectTimeout=10 path (airc:1001) instead of failing fast via local SSH auth. This can add ~10s per fixture send (scenario_tabs/queue/status) to CI runtime; if that’s too slow, consider a test-only override for the SSH connect timeout (e.g., env var consumed by relay_ssh) or a faster-failing unreachable address.

Copilot uses AI. Check for mistakes.
joelteply added a commit that referenced this pull request Jul 31, 2026
…e endpoints (#267) (#1302)

* fix(route): terminal cert-mismatch eviction ignores proof-of-life revival — kill the 0↔1 route flap (self-heal #2)

Glass-boxed live on the M5↔bigmama grid 2026-07-28: transport health oscillated
0↔1 healthy route every ~20s. Root cause: record_terminal_failure (the
cert-identity-mismatch path, #1296) evicts the orphan endpoint on the first
strike but left BOTH revival signals live — a fresher advert OR proof-of-life.
Proof-of-life revival is wrong for a DETERMINISTIC failure: the peer being alive
changes nothing about a cert that mismatches forever on the SAME stored endpoint.
So every presence beacon (last_seen_ms advances each registry import) revived the
corpse → re-dial → re-mismatch → re-kill → next beacon revives again. That IS the
flap ('cert is for 71dcc50f, expected 2f0aed7f' cycling).

Fix: mark terminal entries `terminal: true` on QuarantineEntry; gate()'s
alive_since_failure is now `!entry.terminal && proof_of_life_ms > failed_at_ms`.
A terminal eviction revives SOLELY on a genuinely fresher endpoint ADVERTISEMENT
(new addr/port/cert) — the only thing that can actually clear a deterministic cert
mismatch. Non-terminal (transient) failures keep both signals, preserving the #240
live-peer heal untouched.

Tests: renamed the terminal test to _revives_only_on_fresher_advert (drops the now-
wrong proof-of-life-revives assertion); added terminal_eviction_is_not_revived_by_
proof_of_life_no_flap pinning the flap regression (advancing PoL stays DEAD every
tick; only a fresher advert lifts it). #240 non-terminal PoL-heal test stays green.
12 dial_quarantine + 44 route tests pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(daemon): attach cursor HEARTBEAT — AttachCursorAdvanced rides live streaming, throttled 1/s

The seam summary was the ONLY advance a consumer ever saw: during live
streaming the watermark never moved, so a cursor-persisting consumer
(continuum #261, found by its PR #2057 review) re-received the WHOLE
session's events on every reattach — five reboots of full-session
redelivery produced a persona echo storm on 2026-07-30. After each
forwarded Event the daemon now emits an advance frame carrying that
event's cursor, throttled to one per second (kinds:None attaches carry
StreamChunk bursts — never a frame storm). The unadvanced tail at
shutdown shrinks from the whole session to ≤1s of events. skipped=0 on
heartbeats (nothing suppressed).

Contract change, test re-pinned: AttachCursorAdvanced may interleave on
ANY attach shape; clients must tolerate it. The no-skip property the
test now asserts: an advance NEVER precedes the delivery of the event
it points at — persisting advanced_to can only resume at-or-before what
was seen. attach_backlog_coalesce 3/3, airc-daemon suite green.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(route): #267 — stable relay port + self-relay live-port dial + honest doctor on zero routes

Three layers of the 'airc always broken' shape, glass-boxed live today
(peers dialing relay :65280 while the live listener sat on :57958,
Connection refused, 0 healthy routes — and doctor stamping [ok] on it):

1. doctor: 'degraded == 0' was vacuously true for an EMPTY health list —
   zero routes with enrolled remote peers now WARNS 'remote delivery is
   DOWN' instead of [ok] 0 route(s) healthy.
2. dial: a relay endpoint pinning THIS node's peer id is rewritten onto
   the LIVE relay listener port before dialing — the node is the
   authority on its own listener; it must never dial (then quarantine)
   a previous incarnation's dead port.
3. election: become_relay_with_stable_port persists the bound port in
   the runtime dir and re-binds it on restart, so every peer's imported
   airc-relay://me@ip:port card stays valid across daemon restarts —
   OS-assigned is only the first-election / port-stolen fallback.

Tests: self-relay substitution (live port wins / foreign relay dials as
recorded) + bind-candidate order (persisted first, no double-zero).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cli): room lists ALL subscriptions + inbox names what it is NOT showing (#270)

The day's fourth silent-drop layer was pure presentation: bare 'airc room'
printed only the CURRENT room (read as a membership list) and 'airc inbox'
silently paged only the current room — so a subscribed-but-not-current
channel's messages sat invisible while both agents diagnosed a transport
failure that did not exist. Membership must be visible to be trusted:
room now lists every subscription with the current one marked; inbox
headlines 'room X ONLY — N other subscribed room(s) NOT shown: ...'.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cli): keep 'room:' as the current-room label — output formats are APIs

The #270 rename to 'current:' broke continuum-core's airc bootstrap, which
parses `airc room` stdout for the 'room: <name>' line (degraded probe on
next boot). Restore the stable label; the subscription list stays beneath.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cli): wire:/channel: labels stay at column 0 — start-server.sh awks /^channel:/

Second downstream parser of the same human output (continuum's
start-server.sh derives AIRC_DEFAULT_CHANNEL via awk anchored at line
start); the #270 indent broke it and fail-loud full-citizen boot refused.
Exact legacy shape restored; subscription list still appended after.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cli): transport-health endpoints come from the MACHINE DAEMON, not the CLI scope

The five-month 'airc is broken' pattern was mostly this class: short-lived
CLI probes building their own scope-local view of state the machine daemon
owns. 'endpoints: none' printed while the daemon listened on two ports with
live inbound connections — a lie of omission that misdirected every
transport debug toward routes that were fine. Now: ask the daemon
(Request::RouteEndpoints, the op card 4b6a0ffa already built for exactly
this reason); print each advertised endpoint; empty-from-daemon says
loudly 'NOT dialable'; daemon-unreachable falls back to the scope view
LABELED non-authoritative. Verified live: daemon-advertised LanTcp
192.168.1.249:57958 now visible where 'none' printed before.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(daemon): relay-hood is a DURABLE ROLE — re-assume the persisted relay on every tick

Regression glass-boxed 2026-07-31 morning: overnight daemon restart dropped
the :65280 relay listener because self-election only fires when NO peer is
reachable — and a direct LAN peer was connected. But peers hold
airc-relay://me@ip:port cards; a relay that only exists during total
isolation refuses every card-holder the rest of the time. The persisted
relay-port file IS the role record: when it exists, become_relay runs every
tick unconditionally (idempotent — already-relaying is a cheap re-advertise).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(feed): ONE event = ONE line — multi-line bodies must never fragment the live feed

Glass-boxed 2026-07-31 after a full day of it: a multi-paragraph room
message printed its body raw, so every line-tailing consumer (agent
monitors, Codex hooks, grep pipelines, both grid agents' feeds) saw one
attributed '[Message] a -> b: <first line>' and then a storm of orphan
fragments ('1. **', '- Investigate', 'Let') with no sender, no channel,
no kind — hours of unattributable noise per message, on BOTH nodes
('the version-drift rendering'). render_feed_line now flattens newlines
to a visible pilcrow so the line contract holds unconditionally;
regression test pins it.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(ci): kill the relay-election expect() + un-pin the stale endpoints assertion

Two CI-only reds on #1302, both genuinely ours:

- clippy (-D clippy::expect-used): become_relay_with_stable_port ended in
  last_err.expect(). Restructured so the OS-assigned bind (port 0 — always
  the terminal candidate, pinned by the relay_bind_candidates tests) is the
  final attempt whose error propagates via ?. No Option, no panic path.

- transport_health_reports_no_routes_on_fresh_scope asserted the OLD
  scope-local 'endpoints: none' literal — exactly the line this PR replaced
  with daemon-authoritative rendering. A fresh scope now prints one of two
  honest states (daemon advertising nothing / daemon unreachable, labeled
  scope-local) depending on whether the environment auto-spawned the scope
  daemon; the test accepts both and still rejects the killed lie.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
joelteply added a commit that referenced this pull request Aug 2, 2026
… 7d5b6a65 extension) (#1312)

Discord analogy (Joel): when you join a channel you don't read 10 years
of history — you get one page back. Today's coalesce_backlog is
all-or-nothing (zero pages back); this adds the knob.

- AttachRequest gains `backlog_tail: Option<u32>` (wire-compat: omitted
  when unset, old daemons ignore the unknown field). Builder
  `with_backlog_tail(n)` + getter; gated by coalesce_backlog — a no-op
  without it.
- BacklogCatchup buffers the tail_cap most-recent suppressed envelopes
  (Arc clones, VecDeque capped by popping the front); `skipped` keeps
  counting ALL suppressed as before.
- Seam flush order: tail Event frames oldest-first, THEN the
  AttachCursorAdvanced summary with skipped = total − tail.len() (only
  events NOT delivered), then the live event. Invariant (continuum
  #261): advanced_to is the last suppressed cursor ≥ every tail cursor
  and the tail is written first, so a watermark-persisting consumer
  never persists past an undelivered event.
- Guard choice: the seam gates on TOTAL suppressed (> 0), not the
  post-subtraction remainder — when the whole backlog fits in the tail
  the summary still ships with skipped=0 because the client needs the
  watermark frame to persist its cursor. (take_summary already keyed
  off last_skipped_cursor being set, i.e. total > 0; the handler's
  redundant skipped>0 check is folded into that.)
- Known limitation kept as-is and documented: the seam only flushes on
  the first LIVE event, so an idle room's tail+summary wait for
  traffic — same as the existing summary.
- Tests: 3 new socket-level cases in the existing
  attach_backlog_coalesce.rs proof file (tail order + skipped math,
  tail=0 regression vs plain coalesce, backlog smaller than tail →
  skipped=0 watermark) + wire-compat/roundtrip cases in the existing
  request.rs mod.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Sep 14, 2026
…ssue #1411) (#1416)

fix(lib): the subscribe reader knows the daemon's cursor heartbeat — AttachCursorAdvanced is bookkeeping, never a warn per frame

The daemon emits one AttachCursorAdvanced per second per subscription after events (the cursor heartbeat, continuum #261). airc-lib's subscribe reader matched it as 'non-Event frame' and warned per frame: 3,100 lines/min on a 16-citizen core, the core log rotating every 15 minutes (airc #1411, continuum card c5466b56). The reader now consumes it silently; every other unknown frame still warns.
joelteply added a commit that referenced this pull request Sep 14, 2026
fix(daemon): the live cursor heartbeat is opt-in per attach — a stream that never persists a cursor never receives it

The daemon emitted a throttled AttachCursorAdvanced on EVERY subscribe stream after
forwarded events (continuum #261). Nothing in the tree reads that frame's advanced_to:
the attach monitor reads only the seam summary's `skipped`, and airc-lib's reader had to
grow an ignore arm (#1416) after the frame produced 3,100 warn lines/min on a 16-citizen
core. Every consumer of the protocol — including one in another language — would have
had to grow the same arm.

Fix at the source: `AttachRequest::with_cursor_heartbeat()` (wire field
`cursor_heartbeat`, default false, omitted when unset so old daemons ignore it); the
emitter checks `parts.cursor_heartbeat`. The seam summary (coalesce_backlog) is
unchanged. A consumer that persists its cursor asks for the heartbeat; nobody else sees
bookkeeping.

Tests (attach_backlog_coalesce): a live attach without the flag sees the Event and then
nothing for 1.5 s; with the flag it sees the Event then the heartbeat. The legacy-replay
test now asks for the heartbeat since it pins the no-skip guarantee.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5.1 <[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