Add Manager/Worker orchestration design decision entry#42
Merged
Conversation
Design/spike output for the coordinated Manager/Worker model: - Gate verdict (verified live, herdr 0.7.0): agent_status is pollable for agent-start tabs (idle|working|blocked|done), hook-integration-based; agent read returns clean TUI text. Resolves the previously-UNVERIFIED agent-status flag. - Cross-agent constraint: workers may be claude/codex/grok; only claude+codex are hook-integrated (status + session UUID), grok is TUI-scrape-only. git/PR state is the one uniform bus; the contract is agent-agnostic. - The .mailbox/ protocol: outbox+inbox (single-writer, single-sequencer), offset-drain, Claude Code hook push (Stop/SessionStart/Notification), herdr idle-wake as the only residual push. - Milestone-defined worker autonomy, deterministic merge sequencer, roadmap-as-derived-view co-equal with the GH board. Spawns 7 implementation task files (local backlog): add-lane-registry, add-lane-mailbox, add-manager-watch-loop, extend-worker-autonomy, add-merge-sequencer, add-roadmap-skill, add-mailbox-statusline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two design additions (2026-07-19):
- ready-to-close becomes a handoff report {summary, follow_ups, deploy,
updates, learnings} so the worker's fresh context transfers to the
Manager (→ /define, /curate, deploy-from-main-post-merge).
- Mailbox moves to a central ~/.agent_messaging/ store (id = encoded
absolute path): unlocks a broadcast channel + Manager presence registry
for cross-Manager / system-wide coordination, and makes never-commit
automatic. Broadcast ships as a follow-up task (add-agent-broadcast);
aligns with plugin-settings-system's [related_projects] peering.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prior-art research (2026-07-19): the mailbox is the recognized inbox/outbox pattern; AMQ (avivsinai/agent-message-queue) already implements our design (Maildir delivery, .agent-mail store, swarm/agent-teams, federation, presence). Decisions: - name the store ~/.agent-mail/ (community convention) - fix mechanics: Maildir (atomic rename, lockless, tmp/new/cur) + a CloudEvents-aligned envelope; align concepts with A2A for future interop - add spike-agent-mail-substrate (decide adopt-AMQ-adapter vs build-thin) before add-lane-mailbox; document the protocol in the work-system README Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`amq swarm`'s self-reported claim/block/complete is NOT adopted as a task-state authority — it fights the derived-from-git/PR lanes model. AMQ owns message transport; herdr-derived lanes own state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LTZx9DqrXPXQFoTrCvcJmD
- `amq swarm` explicitly out of scope: it bridges Claude Code's native Agent Teams (~/.claude/tasks/), a competing orchestration substrate — we use only AMQ core messaging (send/inbox-outbox/who/receipts/dlq/wake). - Drop the thin-Maildir fallback: AMQ is a prerequisite (brew install), absent degrades to the git/PR floor + manual relay (already the base). - Envelope is AMQ-native, not CloudEvents; CloudEvents/A2A stay conceptual alignment for a future HTTP bridge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LTZx9DqrXPXQFoTrCvcJmD
Answers the obvious reviewer question: CC's native Agent Teams is Claude-only, no worktree isolation, self-reported status, no PR/merge lifecycle — complementary, not competing. Note the shared Maildir envelope and the TeammateIdle / auto-unblock ideas worth reusing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LTZx9DqrXPXQFoTrCvcJmD
Owner
Author
🐝 Swarm review (local ensemble) · reviewed at 0e3dc63PR #42: Add Manager/Worker orchestration design decision entry
External-only run (codex gpt-5.6-sol@xhigh + grok-4.5, --max); Claude finder lenses off. Reviews the committed ADR diff only (DESIGN-NOTES.md + task backlog are untracked and out of this diff). Local mixture-of-agents review (Claude lenses + codex + grok) run from the author's machine — not a hosted bot. Verdicts (✅/🟨/❌) are the runner's own assessment. |
External-only swarm review (codex + grok) on PR #42. Apply the agreed findings to the decision record: - AMQ send vs single-sequencer: workers send only to the Manager handle; Manager relays. `amq send --to <peer>` bypasses the sequencer (#1). - Broadcast: reuse AMQ fan-out/presence/federation instead of hand-rolled multi-writer global.jsonl (the model Maildir superseded) (#2). - Lane lifecycle: drain-on-/close + stale-mail guard so a reused path never reconsumes a prior occupant's undrained message (#3). - Soften the "RESOLVES" overclaim: this ADR supersedes the herdr docs' enum; their refresh is pending (#4). - Canonicalize the lane key via git rev-parse --show-toplevel, not raw cwd (#7). - Fix ws-statusline states flag order: `states [--cached] <dir>` (#10). - _index.md blurb: central ~/.agent-mail/ mailbox, not the superseded .mailbox/ protocol (always-loaded surface) (#11). - Note the spike is decided, no open task file (#12). - Trust-model residuals (convention-based identity, home-dir readable store) as accepted for a single-user local tool (#5, #6). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LTZx9DqrXPXQFoTrCvcJmD
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
main: one decision knowledge entry (an ADR). The 7 spawned implementation tasks live in the local, untracked backlog (tasks/*.mdby convention) — not in this PR.agent_statusIS pollable for agent-start tabs (idle|working|blocked|done), hook-integration-based;agent readreturns clean TUI text — resolving the previously-UNVERIFIED agent-status flag.Changes
+.claude/knowledge/architecture/manager-worker-orchestration.md— the decision record: the Manager/Worker/Lane model (identity = worktree path), the cross-agent constraint (workers may be claude/codex/grok; only claude+codex are hook-integrated → git/PR is the one uniform bus, contract is agent-agnostic, claude-first), the.mailbox/protocol (outbox+inbox single-writer, offset-drain, Claude Code hook push, herdr idle-wake as the only residual push), milestone-defined worker autonomy, the deterministic merge sequencer, and roadmap-as-derived-view co-equal with the GitHub board.~.claude/knowledge/_index.md— index the new entry.Readiness
scripts/check-structure.py) — 0 errorsmain(da19bee)Test plan
python3 scripts/check-structure.pystays greenskill-composition,idempotent-scaffolding,herdr-kickoff-automation,herdr-tab-glyphs)🤖 Generated with Claude Code