From 9cb33ee2890f2eed2062a8cea7daf71b4993577a Mon Sep 17 00:00:00 2001 From: gastown/crew/jack Date: Fri, 2 Jan 2026 01:31:49 -0800 Subject: [PATCH] fix(rig): Use correct beads path during rig/crew creation (GHI #7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit initAgentBeads and crew_add were looking for beads at mayor/rig/.beads/ but during initial creation, beads is at rig root. The redirect mechanism to mayor/rig/.beads/ gets set up later. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/crew_add.go | 5 ++--- internal/rig/manager.go | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/cmd/crew_add.go b/internal/cmd/crew_add.go index 7d5e88a8..7b197f17 100644 --- a/internal/cmd/crew_add.go +++ b/internal/cmd/crew_add.go @@ -56,9 +56,8 @@ func runCrewAdd(cmd *cobra.Command, args []string) error { crewGit := git.NewGit(r.Path) crewMgr := crew.NewManager(r, crewGit) - // Beads for agent bead creation - rigBeadsPath := filepath.Join(r.Path, "mayor", "rig") - bd := beads.New(rigBeadsPath) + // Beads for agent bead creation (use rig root where .beads/ lives) + bd := beads.New(r.Path) // Track results var created []string diff --git a/internal/rig/manager.go b/internal/rig/manager.go index fbaf783b..1dfd67f8 100644 --- a/internal/rig/manager.go +++ b/internal/rig/manager.go @@ -437,8 +437,8 @@ func (m *Manager) initBeads(rigPath, prefix string) error { // // Agent beads track lifecycle state for ZFC compliance (gt-h3hak, gt-pinkq). func (m *Manager) initAgentBeads(rigPath, rigName, prefix string, isFirstRig bool) error { - // Run bd commands from mayor/rig which has the beads database - mayorRigPath := filepath.Join(rigPath, "mayor", "rig") + // Run bd commands from rig root where .beads/ was initialized + // Set BEADS_DIR explicitly to ensure bd finds the database beadsDir := filepath.Join(rigPath, ".beads") prevBeadsDir, hadBeadsDir := os.LookupEnv("BEADS_DIR") if err := os.Setenv("BEADS_DIR", beadsDir); err != nil { @@ -451,7 +451,7 @@ func (m *Manager) initAgentBeads(rigPath, rigName, prefix string, isFirstRig boo _ = os.Unsetenv("BEADS_DIR") } }() - bd := beads.New(mayorRigPath) + bd := beads.New(rigPath) // Define agents to create type agentDef struct {