Skip to content

Add Manager/Worker orchestration design decision entry#42

Merged
gering merged 7 commits into
mainfrom
task/design-manager-worker-orchestration
Jul 23, 2026
Merged

Add Manager/Worker orchestration design decision entry#42
gering merged 7 commits into
mainfrom
task/design-manager-worker-orchestration

Conversation

@gering

@gering gering commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Design/spike output for evolving work-system into a coordinated Manager/Worker model (user direction 2026-07-15).
  • Deliverable to main: one decision knowledge entry (an ADR). The 7 spawned implementation tasks live in the local, untracked backlog (tasks/*.md by convention) — not in this PR.
  • Gate 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 — 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

  • ✅ Structure check (scripts/check-structure.py) — 0 errors
  • ➖ Version / Changelog / Build / Lint — N/A (knowledge-only, no plugin bump, declarative repo)
  • ✅ Knowledge — this PR is the knowledge entry
  • ✅ Rebased onto latest main (da19bee)

Test plan

  • python3 scripts/check-structure.py stays green
  • Entry reads coherently and cross-links resolve (skill-composition, idempotent-scaffolding, herdr-kickoff-automation, herdr-tab-glyphs)

🤖 Generated with Claude Code

gering and others added 6 commits July 18, 2026 15:07
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
@gering

gering commented Jul 23, 2026

Copy link
Copy Markdown
Owner Author

🐝 Swarm review (local ensemble) · reviewed at 0e3dc63

PR #42: Add Manager/Worker orchestration design decision entry

# Sev Location Finding Source V Note
1 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:83 AMQ send bypasses the single-sequencer invariant gpt·grok ✓ Workers send only to the Manager handle; Manager relays
2 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:98 Broadcast re-adds the multi-writer JSONL model gpt·grok ✓ Reuse AMQ fan-out/presence/federation for broadcast
3 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:24 Path-ID + mail outlives /close gpt·grok ✓ Drain-on-close + stale-mail guard (ties to R3d)
4 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:37 Claims RESOLVES but herdr docs unchanged gpt·grok ~ Update herdr docs or soften RESOLVES to proposes
5 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:83 Convention ID is not a security boundary gpt ~ 🟨 Out of threat model; add a 1-line residual note
6 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:58 Central store: no cross-repo isolation grok ~ 🟨 Single-user local; add a 1-line residual note
7 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:59 Lane key from raw cwd, not worktree root gpt ~ Canonicalize via git rev-parse --show-toplevel
8 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:127 Stop-hook acks (new to cur) before processing gpt ~ 🟨 T2 impl detail: ack only after handling
9 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:13 Linked docs still specify .mailbox JSONL grok ~ Sync DESIGN-NOTES + statusline task to Maildir
10 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:180 Wrong ws-statusline states flag order grok ✓ states [--cached] <dir> — flag before the dir
11 🟡 .claude/knowledge/_index.md:9 Index blurb still advertises .mailbox/ grok ✓ Always-loaded surface — high value
12 .claude/knowledge/architecture/manager-worker-orchestration.md:13 Spike listed as task but already decided grok ✓ 🟨 File is in the main backlog; mark spike done
13 .claude/knowledge/architecture/manager-worker-orchestration.md:97 Handoff drops the worker-curate division grok ~ 🟨 Preserve worker-primary / Manager-backstop
14 🟡 .claude/knowledge/architecture/manager-worker-orchestration.md:157 [simplification] Merge overlap heuristic misses cross-file breaks gpt ~ 🟨 T5: test-merge/CI rerun vs file-overlap
Balance: 14 findings (🔴0 🟡12 ⚪2 · 1 design) · consensus 4 · solo 10 · REFUTED 6 · Verdict ✅8 🟨6 ❌0
Agents: gpt 13 · grok 12 (in-session merge/verify: opus)
Lenses: external-only run — Claude lens gate skipped

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
@gering
gering merged commit 3196a61 into main Jul 23, 2026
1 check passed
@gering
gering deleted the task/design-manager-worker-orchestration branch July 23, 2026 10:37
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