Skip to content

feat(invite): airc invite --human — self-contained paste-block for coworker onboarding - #449

Merged
joelteply merged 4 commits into
canaryfrom
mac-vhsm/invite-human-paste-block
May 4, 2026
Merged

joelteply merged 4 commits into
canaryfrom
mac-vhsm/invite-human-paste-block

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Adds a convenience method for onboarding a coworker who doesn't have airc yet. Motivated by Joel's framing: bots drive the substrate; humans get pasteable strings, not docs to read.

airc invite --human (or --share-block / --for-friend) prints a shell-runnable block the user pastes to a coworker. The block:

  1. Installs airc via the canonical curl|bash one-liner (skip if already installed — safe re-run).
  2. Joins the room via ~/.local/bin/airc connect <gist-id> — absolute path so PATH-not-yet-refreshed shells still find airc post-install.
  3. "Says hi" with a first-message hint that preserves literal $(whoami) so it expands on the receiver's shell, not the host's.
  4. Notes how to leave cleanly (airc part).

The block uses the raw gist-id, not the mnemonic, because mnemonic resolution is same-gh-account-only; gist-id is cross-account-safe — the actual coworker case (different gh, no Tailscale).

Example output

# ── airc invite for a coworker ────────────────────────────────────────
# Paste the entire block below to your friend...
#
# Room: #useideem     Gist: 69e5c999a3eaeba97c80cbf79130f6c5

# 1) Install airc (skip if already installed — safe to re-run).
curl -fsSL https://raw.githubusercontent.com/CambrianTech/airc/main/install.sh | bash

# 2) Join my room.
~/.local/bin/airc connect 69e5c999a3eaeba97c80cbf79130f6c5

# 3) Say hi so we know you made it.
~/.local/bin/airc msg "hello, I'm $(whoami)"

# 4) When you're done, leave cleanly.
#    ~/.local/bin/airc part

Test coverage

New scenario test/integration.sh: invite_human — asserts the paste-block:

  • Contains the install one-liner, connect line, msg hint, part hint
  • Uses the raw gist-id (cross-account safe), not the mnemonic
  • Matches the host's actual published room gist
  • References a gist that exists & is reachable via gh api
  • Preserves literal $(whoami) (heredoc with quoted delimiter — wouldn't survive the host's shell expanding it)
  • Uses absolute airc path (~/.local/bin/airc) — bare airc would fail in a shell that just installed it

Joiner-pair end-to-end is intentionally NOT covered here. That path is already exercised by general_has_shared_gist + custom_room_creates_gist. This scenario's regression coverage is for the paste-block FORMAT.

Local-test note: this scenario (and the existing custom_room_creates_gist) require a clean gh account state. They will fail locally on a dev machine that already has an active airc mesh on the same gh account, because AIRC_NO_DISCOVERY=1 + --no-general doesn't fully prevent same-account auto-join (separate latent issue, not introduced by this PR). CI bot account has no pre-existing gists, so both pass there.

Test plan

  • airc invite --human smoke-tested directly — output shape correct, $(whoami) literal preserved
  • Help text updated (airc invite --help)
  • CI integration-suite passes the new invite_human scenario

🤖 Generated with Claude Code

New convenience method for onboarding a coworker who doesn't have
airc yet. `airc invite --human` (or --share-block / --for-friend)
prints a shell-runnable block the user pastes into a coworker's
chat tool (Slack/email/etc.). The block includes:

  1) curl|bash install one-liner (skip if already installed)
  2) airc connect <gist-id> using the absolute path ~/.local/bin/airc
     so PATH-not-yet-refreshed shells still find airc post-install
  3) "say hi" first-message hint (preserves literal $(whoami) so
     it expands on the receiver's shell, not the host's)
  4) airc part clean-exit hint

Why the gist-id and not the mnemonic: mnemonic resolution is
same-gh-account-only; raw gist-id is the cross-account-safe form,
which is what coworkers (different gh accounts, no Tailscale) need.

Integration scenario (test/integration.sh: invite_human) asserts
the paste-block contains each onboarding step, the gist-id matches
the host's actual published room gist, the gist exists/reachable
on gh, and absolute airc path is present. Joiner-pair end-to-end
is intentionally NOT covered here (it's exercised by existing
scenarios general_has_shared_gist + custom_room_creates_gist);
this scenario's job is regression coverage for the paste-block
FORMAT itself.

Motivated by Joel's framing 2026-05-04: "this will be a bot-driven
system, other than the convenience methods, human instructions for
example: paste this to your friend etc. They might not even have
airc yet too."

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings May 4, 2026 15:47
joelteply and others added 3 commits May 4, 2026 10:58
cmd_connect.sh's host-publish path called channel_gist.resolve
unconditionally, even when AIRC_NO_DISCOVERY=1 was set. resolve
walks `gh api gists --paginate` (timeout 30s, retried 3×) before
falling through to create_new. On gh accounts with many gists
this added ~90s of pre-publish latency despite the explicit
"don't go looking" opt-out.

Half-honoring AIRC_NO_DISCOVERY (skip the early mesh-find gate
but still consult find_existing in the host-publish path) was a
real footgun for tests + CI scenarios that explicitly opt out.
The resolve module's own docstring says host-bootstrap should
treat find_existing as best-effort; this commit makes that the
flag-driven behavior.

Net: with AIRC_NO_DISCOVERY=1, host bootstrap goes straight to
create_new — gist published in ~3-5s instead of up to ~90s on
gist-heavy accounts.

Convergence semantics for the default case (no AIRC_NO_DISCOVERY)
are unchanged: full retry, ~4.5s wait to handle gh's listing
eventual consistency, oldest-canonical wins on race.

Also bumps the invite_human scenario's wait from 30s → 60s
defensively, in case the gh API is slow even on the create_new
path. With the fix, the typical wait should still be ~3-5s.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds a "Pick the right form" decision table at the top:
agent-recipient → bare invite (single join string), human-recipient
→ invite --human (self-contained shell paste-block).

Default is the agent form. AIs switch to --human only when the user
names a specific human coworker or says "send to a human."

Motivated by Joel's framing 2026-05-04: "smooth UX experience for
humans and AIs alike, and tonight Toby will test a remote conn."
The skill needs to make the pick explicit so AIs don't reflexively
hand a human a 200-char base64 invite string.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 82ccf16 into canary May 4, 2026
6 checks passed
@joelteply
joelteply deleted the mac-vhsm/invite-human-paste-block branch May 4, 2026 16:18
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