Repository navigation
Merged
Conversation
* fix: populate _now/_machine_id on find-first; multi-line airc.pid in test cmd_connect.sh: when adopting an existing canonical gist via find-first convergence, we skip the create-new block — but downstream heartbeat setup uses _now and _machine_id, which were only initialized inside that skipped block. Fresh joiners crashed with "_now: unbound variable" right at the moment they should have been completing pairing. Populate both in the adopt branch too. integration_smoke.sh: post-#328 airc.pid has multiple entries (parent on line 1, appended subshells below). The orphan_loops_self_reap test was extracting parent_pid with `awk '{print $1}'`, which returns every line and broke the test's PID logic. Restrict to NR==1 + exit. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(connect): gate gh-auth pre-flight on use_room=1 The gh-auth pre-flight from #331 was unconditional at the top of cmd_connect, so any caller running --no-room (legacy 1:1 invite mode, no substrate, no gh dependency) on a machine without gh auth got killed before the host loop could start. CI's clean-install smoke matrix runs exactly that path on fresh runners, so it broke clean-install-{linux,macos} on this branch. Move the pre-flight below flag parsing and gate on use_room=1. Substrate users (the common path) still get the early, actionable error. Legacy/offline users (--no-room) skip it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(install,ci): AIRC_INSTALL_NO_PULL escape hatch for staged trees CI's clean-install matrix stages the PR's tree at $HOME/.airc-src via 'cp -r .' then runs install.sh. install.sh sees the .git checkout, notices the branch isn't 'main' or 'canary', and "recovers" by fetching + checking out main. Result: every PR's CI was running origin/main's code, not the PR's. Mine of #338's pre-flight gating fix never executed in CI — the symptom that surfaced this. Add AIRC_INSTALL_NO_PULL=1 — when set, install.sh trusts CLONE_DIR's checked-out tree exactly as-is and skips the branch-switch + pull. Wire it into the three CI install invocations so the smoke matrix actually exercises the PR's code. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(monitor): only track flush_pending_loop PID when it'll persist flush_pending_loop returns immediately when host_target is empty (legacy host mode, no peer paired, nothing to flush). monitor() was spawning it unconditionally and recording its PID in airc.pid — but the subshell exited within the same tick, so kill -0 on that PID failed seconds later. clean-install-{macos,linux} smoke caught this: 'PID <X> in airc.pid is not alive' moments after connect started. Gate the spawn on host_target presence. When empty, don't spawn, don't track. Next monitor invocation will pick it up if pairing has happened in the meantime. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(teardown): swallow pgrep-empty-match in scope-path orphan sweep The orphan-sweep step ran: _scope_path_pids=$(pgrep -f "$AIRC_WRITE_DIR" 2>/dev/null | sort -un) pgrep returns 1 when nothing matches. With pipefail + set -e (airc top-level uses set -euo pipefail), the pipe surfaces that 1, the assignment fails non-zero, set -e dies the whole airc binary — but HALFWAY through cmd_teardown, after the kill but before "Teardown complete". The CI smoke runner saw 'killing scope ...' then nothing, then the test step exited 1 from set -e propagating up via airc's own exit code. Why dev machines didn't catch this: prior test runs leave AIRC_HOME- tagged zombies on disk, so pgrep always finds something and returns 0. Fresh runners (and Carl's laptop) have nothing — pgrep returns 1 on the first invocation. `|| true` swallows the empty-match case; the if-block below handles the empty-result case cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…instead of silent exit (#341) (#342) fix(openssl): detect LibreSSL, prefer brew openssl@3, loud die instead of silent exit (#341) Carl on a fresh Mac ran 'airc join' after the documented curl install and got 'No mesh found on your gh account → becoming the host.' followed by exit 1, no error, no diagnostic. The whole stack was working — gh authed, gist about to be created — except 'openssl genpkey -algorithm Ed25519' silently failed because /usr/bin/openssl on macOS is LibreSSL 3.3.6, and LibreSSL doesn't implement Ed25519. The 2>/dev/null on the openssl call swallowed the actual error; set -e killed the script with no trap. Two-part fix: airc binary: resolve openssl with Ed25519 capability at startup (_resolve_openssl), prefer brew openssl@3 / openssl over PATH default on Mac (so /usr/bin/openssl LibreSSL is bypassed when a working brew binary is present), expose as AIRC_OPENSSL. init_identity + sign_message gate on AIRC_OPENSSL non-empty; if empty, _die_no_ed25519_openssl prints a clear actionable error pointing the user at 'brew install openssl@3' or AIRC_OPENSSL=/path env override, plus the issue link. AIRC_OPENSSL env var is also the user override for non-standard layouts. install.sh: 'openssl --version' is not enough — LibreSSL passes that probe. Add a real 'openssl genpkey -algorithm Ed25519' probe after the existing prereq install loop. On Mac, if the probe fails AND brew is available AND brew openssl@3 isn't already keg-installed, auto-install it. Brew openssl@3 is keg-only (doesn't shadow /usr/bin/openssl) but airc's runtime resolver locates it at /opt/homebrew/opt/openssl@3/bin/. On Linux/Windows the probe failing is rare; emit a warning with manual fix guidance. Tested both paths on this Mac: * with only LibreSSL → loud actionable error, exit 1 * after 'brew install openssl@3' → 'airc join' succeeds, hosts #general Doesn't change the bigger question (raised by Joel: do we need shell openssl at all when the venv already has python-cryptography?). That's a follow-up — this PR just stops Carl from hitting a silent failure on every fresh Mac install. Co-authored-by: joel <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
) Identity gen (genpkey) and message signing (pkeyutl -sign) used to shell out to system openssl. macOS LibreSSL doesn't implement Ed25519 via genpkey, which silently broke fresh-Mac installs (the 2>/dev/null ate the error — exactly the error-suppression antipattern that "Never swallow errors" exists to forbid). #342 made the failure loud and auto-installed brew openssl@3; this PR removes the dependency on system openssl entirely by routing both ops through the venv python-cryptography module that's already installed for envelope encryption. What changed: - lib/airc_core/crypto.py: add generate_ed25519_keypair_pem, load_ed25519_priv_pem, sign_ed25519_pem, save_ed25519_keypair_pem. PEM format (PKCS#8 priv, SPKI pub) matches openssl byte-for-byte — existing scopes that paired under shell-openssl load + verify cleanly here. Cross-checked: signing a Python-gen key via openssl pkeyutl -sign and signing the same message via the new path produces byte-identical base64 output. - lib/airc_core/identity.py: bootstrap_ed25519 + sign_ed25519 siblings to the existing X25519 functions, plus bootstrap-ed25519 and sign-ed25519 CLI subcommands so bash invokes via $AIRC_PYTHON -m airc_core.identity ... - airc top-level: sign_message and init_identity now route through the python CLI. Removed _resolve_openssl, AIRC_OPENSSL, _die_no_ed25519_openssl — all dead code post-migration. ssh-keygen remains (it's an OpenSSH client tool, not a libcrypto consumer, and ships working on every supported platform). - install.sh: drop openssl from the prereq list; drop the LibreSSL-detect + brew-install-openssl@3 dance (no longer needed since shell openssl isn't called). cryptography stays a hard dep via the existing venv pip-install step. - cmd_doctor.sh: replace the openssl probe with a cryptography import probe ("import cryptography.hazmat.primitives.asymmetric .ed25519"). Surfaces "re-run install.sh" if the venv didn't finish setting up. Backward compat: existing scopes' private.pem / public.pem files (generated by shell openssl in any prior version) continue to work unchanged. The PEM wrapping format is the same; load_pem_private_key parses both. No identity rotation triggered by upgrade. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* docs(install): drop redundant gh auth login + walk to /join README told users to run 'gh auth login' as a separate step, but install.sh already detects unauthed gh and runs 'gh auth login -s gist' interactively when there's a TTY. Drop the README line and lean on install.sh, then walk the user through opening their agent and running /join. install.sh: skip the interactive gh auth path when running as root/sudo (the token would attach to root's keyring, but airc runs as the real user and would read an empty token); print an explicit warning instead. Also update the post-install Next block to point at 'claude' (or any other supported agent) and the /join skill, with the raw 'airc join' as the fallback for shell-only users. Joel hit this on a fresh canary install where he was already gh-authed from past work — the README's redundant 'gh auth login' was just noise, and the post-install block didn't tell him to open his agent. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * ux(install): green '==>' headline + Enter pause before gh auth login Without a break between install.sh's progress output and gh's device- code flow, the browser popup looks mid-install — user has no signal they're being handed off to a different tool. Match Claude Code's installer convention: bold green '==>' headline, bold action line, explicit Press Enter / Ctrl+C prompt. Honor AIRC_INSTALL_YES=1 for power users who curl|bash repeatedly. Already gated on TTY (the existing elif), so CI / non-interactive installs are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: joel <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
feat(uninstall): airc uninstall verb + /uninstall skill, fleshed-out script
Replaces the four-line uninstall.sh stub (only removed the airc symlink
and skill symlinks) with a full uninstall flow + a first-class verb on
the binary + an agent-invocable skill. Single source of truth: airc
uninstall execs uninstall.sh, /uninstall wraps the same path.
uninstall.sh now:
1. airc teardown --all to stop running processes (idempotent if none)
2. airc daemon uninstall to remove launchd / systemd-user / Task
Scheduler unit (no-op if not installed)
3. removes binary forwarders ~/.local/bin/{airc, relay, airc.cmd,
airc.ps1} — symlinks unconditionally, real .cmd/.ps1 only when
their contents reference the clone (don't blow away an unrelated
binary at the same name)
4. drops every skill symlink under ~/.claude/skills/ that resolves
into the clone — covers current names + any stale ones
5. rm -rf the clone dir (incl. .venv)
Per-project .airc/ state (identity keys, peer records, chat logs) is
left alone by default — that's user data. --purge prints a 'remove
manually if you want' list scoped to common project roots
($HOME/{Development,Projects,work,src}, max-depth 6) instead of
walking the whole filesystem.
Confirmation prompt asks the user to type 'yes'. Non-interactive runs
(curl|bash without a TTY) require --yes; refusing rather than silently
proceeding. -y and --yes both work.
The verb (airc uninstall|self-uninstall) resolves the clone via
_airc_lib_dir (lib path → strip /lib → clone root), execs the script
in-place. uninstall is a real word — added to the dispatch case + the
help block.
The /uninstall skill (skills/uninstall/SKILL.md) is built for agents:
emphasizes the destructive nature, tells the AI not to pass --yes
without explicit user confirmation, lists the leave-alone surface so
the agent can answer 'will this nuke X?' questions correctly.
install.sh: removed 'uninstall' from the stale-symlink cleanup loop
(it was there from when the skill didn't exist; now the per-skill
symlink loop recreates it).
README: added airc uninstall to the command list and the skill table.
Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…cope-doc correction (#341) (#344) * fix(gh): distinguish secondary rate limit from real auth failure (#341) `gh auth status` calls /user, which returns 403 during a GitHub secondary rate limit (abuse detection). gh interprets that 403 as 'token invalid' and prints exactly that. airc surfaced it verbatim — Carl saw 'GitHub token is invalid' during a rate-limit cooldown, ran 'gh auth login' fruitlessly, and got nowhere because the token was actually fine. The /rate_limit endpoint is reachable during secondary rate limits. If it works, the token works. Use it as the discriminator. Three sites use 'gh auth status' as a preflight or status check; all three got the same fix shape: - cmd_connect.sh (airc join preflight): instead of dying with 'token invalid' and pointing at gh auth login, dies with 'rate-limited; wait 5-15 min' when /rate_limit is reachable. Includes a brief explanation of why gh misreports. - cmd_doctor.sh: '[BLOCKED] gh authenticated' becomes '[BLOCKED] gh secondary rate limit (abuse detection) — token is fine' under the same condition, with 'wait then re-run' guidance instead of 'gh auth login -s gist'. Same fix applied to the downstream gist-API-reachable check. - cmd_status.sh: 'gh auth: ✗ INVALID' becomes 'gh auth: RATE-LIMITED' under the same condition, so a user inspecting status mid-cooldown gets accurate information. Hit on this Mac mid-Carl-QA pass: a 15-second issue-comment polling Monitor combined with rapid PR/issue/comment activity tripped GitHub's secondary rate limit. 'gh auth status' said 'token invalid'. 'airc join' surfaced the same. Both wrong. Doesn't touch cmd_send.sh's auth_failure path — that runs off a bearer report, not a direct gh probe, and needs a separate look at the Python bearer's auth_failure logic. Filed as a follow-up under #341. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(join skill): correct scope state location ($PWD/.airc/ not ~/.airc/) The /join skill claimed non-git-repo cwds put state in ~/.airc/. Code actually writes to $PWD/.airc/ (detect_scope in airc:162). README is correct on three different lines (256, 375, 501) — only the skill disagrees. Carl reading the skill expects ~/.airc/, sees state appear in /Users/joel/Development/.airc/ when running from a non-project dir, gets confused. Per-cwd-by-default is intentional — multi-tab on one machine: each tab in its own dir = distinct identity, never colliding. The fix updates the skill text to match actual behavior + mentions AIRC_HOME as the override knob. Identified during the Carl QA pass tracked at #341. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: joel <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
) airc doctor still reported [MISSING] sshd "needed when you HOST a room" on every Mac/Linux/Windows box where Remote Login wasn't enabled. The fix in install.sh comment 287 already notes "Post-3c: sshd setup + Tailscale install fully removed" — the doctor probe was the last vestige claiming sshd is required, and it confused Carl on this rig (reported as the third sub-bullet during the QA pass on #341). Post-3c, every peer reads + writes the room gist via gh API. There is no ssh path remaining. ssh-keygen stays (identity key generation), ssh client probe stays (occasional manual diagnostic + future wire-pluggable bearers like LoRa/Reticulum may want it), but sshd itself is irrelevant. Removes: - _doctor_probe_sshd() function (~100 lines of macOS launchctl / systemd / Windows OpenSSH.Server probe code) - Both call sites: default `airc doctor` (line 56) and `airc doctor --connect` preflight (line 366) Replaces each call site with a one-line comment explaining the removal, so future readers don't add it back. Verified on this Mac: pre-fix doctor reported [MISSING] sshd; post-fix "All required prereqs present." Identical change applies to the --connect preflight. Doesn't touch the dead sshd-comment chunk in install.sh:268-287 (historical context, no actual logic) — fold into the next install.sh touch. Co-authored-by: joel <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Carl flagged this in #345: the install.sh sshd-install block was removed as part of Phase 3c (gist-substrate replaces ssh-on-the-wire), but the surrounding comments + AIRC_SKIP_SSHD doc + CI auto-detect narrative were left behind. Confused enough on read that #345 had to explicitly call out 'this is unused, just comments now'. Replace with a single tombstone comment so anyone grepping git history for 'sshd' finds the rationale, but nothing else. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 30, 2026
Open
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.
Summary
Triggered by Carl's fresh-Mac QA pass on #341 —
airc joinwas silently exit-1 on a clean Mac because LibreSSL doesn't implement Ed25519 and the openssl call had2>/dev/null. Pulling that thread surfaced 8 real bugs across the install path, the CI rig, and the post-3c cleanup tail.Bundled fixes (8 PRs, oldest → newest)
cmd_connectfind-first adopt branch crashed on_now: unbound variable; smoke test pidfile parsing broke after fix: gh-auth surface + identity caps + airc.pid full-tree #328's multi-line format;install.shself-update was overwriting PR code in CI; pre-flight gh-auth check fired even in--no-roomlegacy mode;monitor()recordedflush_pending_loop's short-lived PID leaving a stale dead PID inairc.pid;cmd_teardowndied mid-cleanup on fresh runners becausepgrep -freturning 1 + pipefail trippedset -e.openssl genpkeycalls had2>/dev/null, hiding LibreSSL's "Algorithm Ed25519 not found" error. Made the failure loud + auto-installedbrew openssl@3as the immediate unblocker.cryptographymodule (already a dep for envelope encryption). Drops openssl as a hard prereq entirely. Backward-compat verified — existing scopes'private.pem/public.pemload unchanged; cross-signing produces byte-identical output.gh auth loginfrom README; install.sh now drives the auth interactively (with green Enter pause); README walks user to/joinvia Claude.airc uninstallverb +/uninstallskill replacing the prior 40-line stub./joinskill scope-doc corrected (\$PWD/.airc/not~/.airc/)._doctor_probe_sshd— post-3c the gist IS the wire, ssh isn't on the message path anymore.Themes
2>/dev/nullor distinguishing a "shouldn't happen" error from a routine one. Joel's hard rule, justified again here.cryptography. Identity is a security primitive; truth lives in the venv module the rest of the codebase already trusts, not in whatever libcrypto flavor/usr/bin/opensslhappens to be.install.sh's "I'm on a non-channel branch, let me pull main" recovery path silently overwrote the staged tree on every CI run. Every PR for the past N weeks was effectively a no-op against the CI matrix.AIRC_INSTALL_NO_PULL=1escape hatch fixes it.End-to-end proof
This bundle was coordinated peer-to-peer over airc on canary itself — both Macs paired via the gist substrate in
#general, ranairc msg --channel generalto exchange status, merged each other's PRs, all on the code being shipped here. The substrate fixed itself enough during the session to be the comm channel for shipping the fix.Test plan
airc joinsucceeds, doctor reads[ok] cryptographyand all-green#generalvia airc itself (this PR coordinated over the wire)curl ... | bashfrom a fresh shell on the test rig produces a working install end-to-endKnown followups (post-bundle)
#cambriantechto fresh#generalreverted Carl'scarl-macnick todevelopment-cf82. Keys survive; identity metadata doesn't. Separate bug, separate PR.🤖 Generated with Claude Code