From 5ee9bb13c86f1470cd6a3619b76be3543229b985 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 21 Dec 2025 10:44:20 -0800 Subject: [PATCH] fix: replace stale 'bd mail' references with 'gt mail' - docs/architecture.md: update mail routing explanation - internal/witness/manager.go: fix actual bd mail calls to gt mail - internal/cmd/mail.go: remove stale compatibility note - internal/daemon/lifecycle.go: update comment --- docs/architecture.md | 10 +++++----- internal/cmd/mail.go | 2 +- internal/daemon/lifecycle.go | 2 +- internal/witness/manager.go | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index cc9fe0e2..c419a69f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -114,11 +114,11 @@ Agents communicate via **mail** - messages stored as beads issues with `type=mes - **Town beads** (prefix: `gm-`): Mayor inbox, cross-rig coordination, handoffs - **Rig beads** (prefix: varies): Rig-local agent communication -Mail commands use `bd mail` under the hood: +Mail commands use beads issues with type=message: ```bash -gt mail send mayor/ -s "Subject" -m "Body" # Uses bd mail send -gt mail inbox # Uses bd mail inbox -gt mail read gm-abc # Uses bd mail read +gt mail send mayor/ -s "Subject" -m "Body" # Creates message issue +gt mail inbox # Lists message issues +gt mail read gm-abc # Shows message issue ``` ```mermaid @@ -248,7 +248,7 @@ Gas Town uses a **two-level beads architecture**. This is critical to understand Mail is routed to the correct beads database based on recipient address. The `Router` (in `internal/mail/router.go`) handles this: ``` -Sender → Router.Send() → resolveBeadsDir(recipient) → bd mail send with BEADS_DIR +Sender → Router.Send() → resolveBeadsDir(recipient) → creates message issue in target beads ``` **Routing logic (`resolveBeadsDir`):** diff --git a/internal/cmd/mail.go b/internal/cmd/mail.go index b2349fe6..39a927f2 100644 --- a/internal/cmd/mail.go +++ b/internal/cmd/mail.go @@ -63,7 +63,7 @@ Message types: notification - Informational (default) reply - Response to message -Priority levels (compatible with bd mail send): +Priority levels: 0 - urgent/critical 1 - high 2 - normal (default) diff --git a/internal/daemon/lifecycle.go b/internal/daemon/lifecycle.go index f72f1f04..c4d0e9df 100644 --- a/internal/daemon/lifecycle.go +++ b/internal/daemon/lifecycle.go @@ -32,7 +32,7 @@ func (d *Daemon) ProcessLifecycleRequests() { output, err := cmd.Output() if err != nil { - // bd mail might not be available or inbox empty + // gt mail might not be available or inbox empty return } diff --git a/internal/witness/manager.go b/internal/witness/manager.go index 403aec07..cc62e3bc 100644 --- a/internal/witness/manager.go +++ b/internal/witness/manager.go @@ -384,7 +384,7 @@ Time: %s // processShutdownRequests checks mail for lifecycle requests and handles them. func (m *Manager) processShutdownRequests(w *Witness) error { - // Get witness mailbox via bd mail inbox + // Get witness mailbox via gt mail messages, err := m.getWitnessMessages() if err != nil { return fmt.Errorf("getting messages: %w", err) @@ -477,9 +477,9 @@ Rig: %s Time: %s `, reason, polecatName, m.rig.Name, time.Now().Format(time.RFC3339)) - // Send via bd mail + // Send via gt mail recipient := fmt.Sprintf("%s/%s", m.rig.Name, polecatName) - cmd := exec.Command("bd", "mail", "send", recipient, + cmd := exec.Command("gt", "mail", "send", recipient, "-s", subject, "-m", body, ) @@ -502,8 +502,8 @@ type WitnessMessage struct { // getWitnessMessages retrieves unread messages for the witness. func (m *Manager) getWitnessMessages() ([]WitnessMessage, error) { - // Use bd mail inbox --json - cmd := exec.Command("bd", "mail", "inbox", "--json") + // Use gt mail inbox --json + cmd := exec.Command("gt", "mail", "inbox", "--json") cmd.Dir = m.workDir cmd.Env = append(os.Environ(), "BEADS_AGENT_NAME="+m.rig.Name+"-witness")