Repository navigation
feat(status): airc status — liveness view for #7 (monitor, queue, last-activity) - #13
Merged
Merged
Conversation
…ivity) Last item on #7's visible-resilience list. Before this: figuring out whether your mesh is alive required reading pidfiles, tailing logs, and guessing. After: one command shows the answers. Output (joiner): airc status — scope /Users/you/project/.airc identity: m5-test (joiner of host-abc @ [email protected]:7547) monitor: running (PID 50580) last send: 94s ago last recv: 156s ago queue: empty reminder: every 300s Output (host): airc status — scope /Users/you/project/.airc identity: host-abc (hosting on port 7547) monitor: running (PID 12345) last send: 5m ago last recv: 10s ago queue: empty reminder: off Fields: * identity + role — joiner shows paired host; host shows listen port * monitor — checks ALL PIDs in airc.pid (parent + python listener), alive if ANY is; reports "stale pidfile" if none, with the hint to run connect for self-healing * last send — elapsed seconds from AIRC_WRITE_DIR/last_sent (written by cmd_send) * last recv — elapsed seconds from newest inbound (from != $my_name and != 'airc') in local messages.jsonl, ts parsed in Python * queue — pending.jsonl line count; messages waiting for flush_pending_loop * reminder — off / paused / every Ns Opt-in `airc status --probe` does a 3s SSH probe of host_target with BatchMode=yes (no hangs), prints "reachable" or "UNREACHABLE". Kept off-by-default so `airc status` is always fast. Help text + dispatch entry updated. Full suite: 62/62 (was 55/55). Refs #7 umbrella — this closes item 3 (`airc status` liveness view).
This was referenced Apr 15, 2026
joelteply
added a commit
that referenced
this pull request
Apr 15, 2026
Pre-this-commit: airc status reported "last send: Xs ago" from a single
marker that cmd_send updated on every attempt. Queued-during-outage sends
showed "1s ago" right next to "queue: 1 pending" — a state that literally
means "we did NOT deliver." Users reading this as delivery confirmation
would be wrong.
Two files now:
- last_sent — "user attempted to send anything" (drives reminder reset, existing semantics)
- last_delivered — "host's messages.jsonl got the line" (new)
last_delivered is updated in three places only — each a point of
actual delivery:
1. cmd_send successful wire branch (after __APPENDED__ marker seen)
2. cmd_send host-mode (local append IS delivery on the host)
3. flush_pending_loop drain success (queued messages that eventually landed)
cmd_status now reports "last delivered: Xs ago" as the primary field.
Only prints "last attempt" when it's newer than last_delivered AND the
queue is non-empty — surfaces the exact state ("user tried Ns ago,
nothing has delivered since, message is queued").
Test updates:
- scenario_status joiner flow now asserts last_delivered advances after
a successful send AND that last_attempt is hidden when they agree
- Post-outage assertion now requires last_attempt with QUEUED tag —
the exact lie the old "last send" line was telling
Full suite 70/70.
Refs #15, #13.
joelteply
added a commit
that referenced
this pull request
Apr 15, 2026
vhsm-claude's last #12 followup. Before: `airc status --probe` hit SSH on every call; a statusline renderer or watch loop polling every few seconds could generate unnecessary connection load and terminal lag. Cache structure: ${AIRC_WRITE_DIR}/probe_cache is two lines — epoch seconds on line 1, result string on line 2. TTL 5s. Stale entries trigger a fresh probe and atomic rewrite (mv .new → probe_cache so concurrent reads never see half-written content). Cached entries render with a "(cached Ns)" suffix so the user can tell fresh from cached at a glance. $ airc status --probe host: UNREACHABLE (ssh timeout or auth failure) $ airc status --probe # within 5s host: UNREACHABLE (ssh timeout or auth failure) (cached 2s) Tests extend scenario_status with 3 assertions: first call is fresh (no cached suffix), first call correctly reports UNREACHABLE for fake host, second call within TTL shows the cached suffix. Full suite: 81/81. Refs #12 review, #13.
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
Adds
airc status— a one-command snapshot of mesh health. Last visible-resilience item on #7's umbrella list.Example — joiner
```
$ airc status
airc status — scope /Users/you/project/.airc
identity: m5-test (joiner of host-abc @ [email protected]:7547)
monitor: running (PID 50580)
last send: 94s ago
last recv: 156s ago
queue: empty
reminder: every 300s
```
Example — host
```
$ airc status
identity: host-abc (hosting on port 7547)
monitor: running (PID 12345)
...
```
Opt-in SSH reachability probe
```
$ airc status --probe
...
host: reachable
```
3s `ConnectTimeout` + `BatchMode=yes` — never hangs the terminal. Kept off-by-default so the plain `airc status` stays instant.
Fields
get_name+host_targetpresenceairc.pid, alive if ANY is; reports "stale pidfile" with hint to runairc connectAIRC_WRITE_DIR/last_sent(written bycmd_send)messages.jsonl(filters own name + system 'airc' source)pending.jsonlTest plan
scenario_status(7 assertions): identity line, monitor line, queue empty, joiner role visible, last-send reflects activity, queue shows pending after simulated outage sendRelated
🤖 Generated with Claude Code