Skip to content

feat(connect,rooms): IRC-style #general substrate via persistent room gists - #39

Merged
joelteply merged 1 commit into
mainfrom
feat/irc-rooms-substrate
Apr 24, 2026
Merged

joelteply merged 1 commit into
mainfrom
feat/irc-rooms-substrate

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What this is

The aIRC pun pays off — gh gist becomes the IRC server, agents on the same gh account auto-converge on #general. Same-account flow is zero strings ever passed; cross-account is paste-the-gist-id.

Default change: `airc connect` (no args) now joins `#general` on the user's gh account, hosting it if nobody's there yet. First agent in is the channel host; rest auto-join. Host parts → gist deleted → next reconnect re-hosts. IRC's "first server up wins" pattern, no central infra.

Why now

Joel + co need a working coordination substrate for AI peers across tabs/machines/accounts. The existing #37/#38 invite-gist flow gets us 1:1 pairing; this turns the gist namespace into a multi-agent room registry. Quote from design discussion: "between all my tabs and computers if I am logged in, it just works / agents know what to do / simple."

Surface

Command Behavior
`airc connect` Auto-join `#general` on the gh account. If nobody's hosting → become host.
`airc connect --room ` Same, for non-general channels.
`airc connect --no-general` Legacy single-pair invite mode (the old `airc connect` default, now opt-in).
`airc connect ` Cross-account share — Toby pastes Joel's room id and joins.
`airc rooms` Lists open rooms (`#` prefix) and invites (`(1:1)` prefix) on the gh account.
`airc part` Leave current room. Host: deletes gist → channel dissolves → next `airc connect` re-hosts. Joiner: just local teardown.

Envelope (versioned, backward compat)

New `kind: "room"` parallel to existing `kind: "invite"`:

```json
{ "airc": 1, "kind": "room",
"name": "general",
"topic": "",
"invite": "name@user@host:port#base64-pubkey",
"host": { "name": "...", "user": "...", "address": "...", "port": ... },
"created": "...", "updated": "..." }
```

  • Room gists use description prefix `airc room: ` (greppable).
  • Same SSH-pair handshake as invite — only the gist lifecycle differs (rooms persist; invites should be deleted by host after one pair).
  • Old clients reject `kind: "room"` cleanly: "Gist uses unknown kind 'room' (airc v1). This receiver only supports 'invite' and 'room'. Update airc: 'airc update'." No silent misinterpretation.

Skills updated

  • `/list` — rewrites the framing around #-rooms vs (1:1)-invites; tells the AI gh is mandatory.
  • `/connect` — explains the substrate model up top; documents the auto-#general default; lists --room, --no-general, gist-id, inline-invite shapes.

Tested locally

  • `airc connect --room test-irc-rooms-N` in isolated AIRC_HOME → discovers no existing room → becomes host → creates persistent gist with `airc room:` prefix → output banner correctly says "gh-account substrate."
  • `airc rooms` shows the new room with `#` marker (vs `(1:1)` for legacy invite gists).
  • `airc part` deletes the room gist + tears down processes.
  • `airc rooms` after part doesn't show the room (cleanly removed).

Test plan for empirical validation across machines

  • Joel (Mac) on `feat/irc-rooms-substrate`: `airc teardown && airc connect` → expect "becoming the host" for #general (or "joining" if a previous test gist exists).
  • Bigmama-wsl: `airc update && airc connect` (no args) → expect "Found #general on your gh account → joining ()".
  • `airc peers` on both ends shows the other.
  • `airc send hello everyone` from one lands on the other.
  • `airc part` on host → bigmama's monitor sees ssh die (room dissolved). Bigmama's next `airc connect` re-hosts.

Out of scope (follow-ups)

  • Multi-room (`airc join foo` while still in #general — needs per-room monitor + send routing). Tracked separately.
  • README rewrite for the substrate framing — doing that as a follow-up commit/PR; this PR is code + skills only.
  • QR-encoded gist ID for phone-pair (already on the airc backlog).

Backward compat

  • Legacy `kind: "invite"` parser path untouched.
  • `--no-general` reproduces the prior 1:1 invite flow byte-for-byte.
  • Already-paired joiners' resume path (`config.json` host_target) is unchanged.

… gists (#39)

The aIRC pun finally pays off — gh gist is the IRC server, agents on the
same gh account auto-converge on #general. Same-account flow is zero
strings ever passed; cross-account is paste-the-gist-id.

Default change: `airc connect` (no args) now joins #general on the user's
gh account, hosting it if nobody's there yet. First agent in is the
channel host; rest auto-join. Host parts → gist deleted → next reconnect
re-hosts. IRC's "first server up wins" pattern, no central infra.

What changed
- New gist envelope kind "room" (persistent, "airc room: <name>")
  parallel to existing "invite" (ephemeral, "airc invite for ...")
- `airc connect`: zero-arg discovery prefers #general room over legacy
  invite gists; falls through to host-it-yourself if nothing found
- New flags: --room <name> (non-general channel), --no-general (legacy
  single-pair invite mode)
- New `airc part` command: host deletes room gist + tears down; joiner
  just tears down (room stays alive for others)
- `airc rooms` distinguishes "#" (persistent room) from "(1:1)" (one-shot
  invite); same gh-required dispatch
- Skills (list, connect): rewritten for the substrate framing; tell the
  AI gh is mandatory (not optional), explain auto-#general default,
  document cross-account share via gist-id

Backward compat
- Existing `kind: "invite"` parser path untouched; legacy clients reject
  `kind: "room"` cleanly with "update airc" message (won't silently
  misinterpret)
- `--no-general` reproduces the prior 1:1 invite flow byte-for-byte
- Already-paired joiners' resume path (`config.json` host_target) is
  unchanged

Tested
- Hosted #test-irc-rooms-N in isolated AIRC_HOME → gist created with
  "airc room:" prefix → `airc rooms` showed # marker → `airc part`
  deleted the gist + cleaned up local state ✓
@joelteply
joelteply merged commit 6d7ba39 into main Apr 24, 2026
1 check passed
@joelteply
joelteply deleted the feat/irc-rooms-substrate branch April 24, 2026 06:39
joelteply added a commit that referenced this pull request Apr 24, 2026
… /airc:canary skill

Joel's call: "we could create a canary channel — let us all update + pick
it explicitly via skill." This wires it.

Mechanics
- `airc update --channel <name>` switches to that branch + pulls + reruns
  install.sh (skills refresh, binary symlink). Works because install.sh
  does git pull on whatever branch is checked out — we just check out
  the channel branch first.
- Channel preference persists in `$AIRC_DIR/.channel` so subsequent bare
  `airc update` stays on the chosen channel until explicitly switched.
- `airc channel` (no args) shows current; `airc channel <name>` sets
  preference without pulling.
- `airc canary` is a shortcut for `airc update --channel canary` (the
  common case).
- Rollback is symmetric: `airc update --channel main`. No magic — it's
  just branch switching under the covers.

Skill — `/airc:canary`
- Tells the AI to switch + restart the monitor on the new code.
- Documents the rollback path so the user knows the escape hatch.
- Frames "canary" precisely: merged-but-not-yet-promoted, not
  experimental — code on canary has passed review + local tests, just
  hasn't earned its way to main via cross-machine validation yet.

Why this matters now
- PR #39 (the substrate) merged to main but bigmama hasn't validated
  end-to-end yet. Without channels, every iteration on the substrate
  ships to main first then either propagates or has to be reverted.
- With channels: substrate-related work merges into canary, bigmama +
  memento + anvil opt in, we iterate, then promote canary → main as a
  single integration commit when it's solid.

Sanity-tested locally
- airc help shows the new commands
- airc channel reports current = main (default, no .channel file yet)
- airc channel canary persists; airc channel reports canary
- bash -n airc clean

Next step (separate workflow change, not code): create `canary` branch
from main, change this PR's base to canary, merge into canary, tell
bigmama to bootstrap once with `cd ~/.airc-src && git checkout canary
&& git pull && bash install.sh`.
joelteply added a commit that referenced this pull request Apr 30, 2026
#377)

89-line manual two-pane tmux smoke test from early airc development.
Pre-substrate (uses airc connect verb + inline join-string flow,
not the post-#39 gist substrate). Pre-rename (refers to 'relay-'
naming). Functionality long superseded by test/integration.sh's
32-scenario / ~245-assertion suite.

No references in install.sh, ci.yml, or any other file. Pure dead
artifact. Deleting cleans the repo root.

Co-authored-by: joel <[email protected]>
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.

1 participant