Skip to content

feat: agora — CLI communication surface for agent groups - #87

Merged
SSFSKIM merged 15 commits into
mainfrom
worktree-agora
Aug 28, 2026
Merged

SSFSKIM merged 15 commits into
mainfrom
worktree-agora

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Who is submitting this PR?

Field Value
Your model + version Claude Fable 5 (claude-fable-5)
Harness + version Claude Code CLI, interactive session on the fork owner's machine
All plugins installed doperpowers 7.65.0 (this repo), vercel, supabase, plugin-dev, chatgpt-advisor, skill-creator, code-review, claude-md-management, designer, eli5
Human partner who reviewed this diff Design grilled and approved interactively by the fork owner (autonomous execplan track); diff review is what this PR requests

What problem are you trying to solve?

Agents on one machine have native point-to-point messaging (SendMessage/ListAgents) but no group layer: no way to scope a working set of agents, no record of who spawned whom, no durable conversation a human can inspect, and no way for a shell process — a human at a terminal, a dispatch script — to send a message at all (documented absence of any CLI injection path). Orchestrations of 3–4 daemons had no shared picture of themselves, and daemon wake still leaned on the legacy resume-fork.

What does this PR change?

Adds agora (skills/agora/): a bash CLI giving agent fleets named groups with a durable JSONL conversation log, parent→child spawn topology with soft edges, per-recipient inboxes with push delivery via a persistent-Monitor tail, an ASCII graph view for humans and topology JSON for agents; plus an env-gated daemon-spawn.sh dimension (AGORA_GROUP/AGORA_PARENT) that auto-wires spawned daemons into the group.

Evidence

  • ExecPlan with full Decision Log, empirical findings, and verbatim demo transcripts: docs/doperpowers/execplans/2026-08-27-agora.md
  • M0: Monitor events empirically proven to wake --bg sessions (the receive foundation)
  • M6 live demo: human → architect → implementer → architect → human, 4 hops over agora edges in 12 s, every hop a Monitor wake, child spawned by the architect daemon itself with correct auto-topology
  • 29-assertion self-contained test suite (tests/agora/run-agora-tests.sh), shellcheck-clean at the repo baseline
  • Exit-gate codex review (gpt-5.6-sol, xhigh): 6 findings, all verified and fixed in c69f7088 with regression tests

Notable discoveries recorded in the plan: a live persistent Monitor pins a --bg session at state=working (so agora daemons must spawn --no-wait), and Bash-tool shells never inherit session env (so agora identity travels in the rendered spawn preamble, not env).

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0070abcd23

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +236 to +237
gmode="$(stat -f %Lp "$h/groups/g" 2>/dev/null || stat -c %a "$h/groups/g")"
imode="$(stat -f %Lp "$h/groups/g/inbox/archi.jsonl" 2>/dev/null || stat -c %a "$h/groups/g/inbox/archi.jsonl")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use platform-correct stat syntax in the permission test

On GNU/Linux, stat -f %Lp <path> treats %Lp as another path, prints filesystem details for the real path to stdout, and then fails; the fallback's numeric mode is consequently appended to that existing output. Both captured variables therefore contain multi-line text rather than 700/600, so tests/agora/run-agora-tests.sh reliably reports a failure on Linux even though the permissions are correct. Select the stat syntax by platform or discard the failed probe's stdout before falling back.

Useful? React with 👍 / 👎.

Comment on lines +117 to +119
if [ -n "$agora_group" ]; then
(cd "$cwd" && "$agora_cli" join "$agora_group" "$name" --parent "$agora_parent" >/dev/null) \
|| echo "warning: agora pre-join failed for $name in group $agora_group" >&2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate daemon names before using them as Agora aliases

When AGORA_GROUP is set and an otherwise valid daemon name contains a space or another character outside Agora's [A-Za-z0-9._-] alias alphabet, this join is rejected but only emits a warning. The daemon still reports a successful spawn and receives a preamble claiming it is already joined, while every subsequent agora send --from <name> fails with “sender has not joined”; metacharacters such as | can also break the earlier sed rendering. Validate or normalize the name before launching an Agora-wired daemon rather than allowing a silently disconnected child.

Useful? React with 👍 / 👎.

Comment on lines +89 to +91
_valid "$a" || die "bad alias: $a"
[ "$a" = "human" ] && die "the alias 'human' is reserved for the operator"
[ -z "$parent" ] || _valid "$parent" || die "bad parent alias: $parent"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject self-parent relationships when joining

A call such as agora join g a --parent a passes this validation and creates a self-cycle. agora view g then prints no members because the node is neither a root nor dangling, while agora topology g exposes the nonsensical a → a edge; rejoining existing nodes can similarly form larger cycles. At minimum reject parent == alias here, and prevent cycle-forming parent updates if reparenting is supported.

Useful? React with 👍 / 👎.

Comment on lines +137 to +138
--) shift; text="$*"; break ;;
*) if [ -z "$text" ]; then text="$1"; else text="$text $1"; fi; shift ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject unknown send flags instead of impersonating the operator

If an agent mistypes an option such as --form archi or --offedge, this catch-all treats the option and its value as message text rather than reporting an error. Because --from was then never recognized, the send defaults to human and bypasses edge rules, producing a successfully delivered message falsely attributed to the operator—the exact provenance failure the explicit-identity protocol is meant to avoid. Reject unrecognized -* arguments and require -- when message text intentionally begins with a dash.

Useful? React with 👍 / 👎.

Comment on lines +59 to +61
now=$(date +%s)
lkage=$(stat -f %m "$lk" 2>/dev/null || stat -c %Y "$lk" 2>/dev/null || echo "$now")
[ $((now - lkage)) -gt 30 ] && rmdir "$lk" 2>/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fix stale-lock timestamp probing on GNU stat

On GNU/Linux, once a send lock survives long enough to reach this stale-lock check—such as after a sender is killed or an append fails—stat -f %m prints filesystem information before failing, and the fallback timestamp is appended to that output. The resulting multi-line lkage is not an arithmetic value, so the lock is never removed and subsequent sends wait indefinitely instead of recovering after 30 seconds. Use an OS-specific stat probe or suppress the failed command's stdout before the fallback.

Useful? React with 👍 / 👎.

Comment on lines +100 to +105
jq -n --arg alias "$a" --arg parent "$parent" --arg session "$session" \
--arg cwd "$PWD" --arg branch "$branch" --arg desc "$desc" \
--arg joined "$joined" --arg updated "$(_now)" \
'{alias:$alias,parent:$parent,session:$session,cwd:$cwd,branch:$branch,desc:$desc,joined:$joined,updated:$updated}' \
> "$gd/nodes/$a.json.tmp"
mv "$gd/nodes/$a.json.tmp" "$gd/nodes/$a.json"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Give concurrent joins unique temporary files

Two processes refreshing the same alias concurrently both truncate and move the shared <alias>.json.tmp. One process can move a file while the other is still writing it, causing later mv calls to fail and allowing partially populated data such as an empty preserved joined value to become the node record. Since join is explicitly idempotent and can be invoked by multiple orchestration paths, write to a process-unique temporary file before the atomic rename or serialize updates for an alias.

Useful? React with 👍 / 👎.

…nthetical, rationale clause, duplicate metaphor
agora post appends long-form markdown to board.jsonl and fans a body-less
marker (id/from/title) into every other member's inbox; the existing
listener renders it as a one-line <agora-board-post> wake event. agora
board renders posts as markdown in <agora-post> envelopes (real newlines —
no line-framing on a whole-document read; --json for machines). Posts
snapshot cwd/branch at post time, mark the shared log (one timeline), and
surface in view. Edge rules don't apply to the board.
…g + live-proof evidence

A listener outlives the binary that armed it — reproduced: pre-board
listeners die on the first marker (jq error under set -e) and deliver
nothing after. The render pipeline now tolerates any record it cannot
render (stderr complaint, loop and cursor continue). 37th test asserts
delivery continues around an unknown record type.
…mit separation, envelope spoof neutralization, leave-race-tolerant fan-out

Four verified codex findings: (P1) wake notices name a post id but the
CLI could only read the latest — agora board --id fetches the named post
and the preamble now directs waking agents to it; (P1) the skew || true
also swallowed emit failures, checkpointing undelivered records — render
(captured) and emit (explicit printf) are now separate, so a render error
skips+advances while a dead consumer dies un-checkpointed and re-arm
replays; (P2) board bodies could close or forge the <agora-post>
envelope — the tag's own grammar is neutralized and cwd/branch attrs
html-escaped, all other markdown stays raw; (P2) a concurrent leave
could abort post's fan-out holding send.lock — vanished members are
skipped, same tolerance in _children_of. 40 assertions green.
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