fix(spawn): use rig-level beads instead of mayor/rig path

The spawn command and polecat manager were incorrectly looking for beads
in <rig>/mayor/rig/.beads instead of <rig>/.beads. This caused:
- `gt spawn --issue ga-xxp` to fail with "no issue found" even when
  `bd show ga-xxp` worked from the rig directory
- Polecats couldn't find rig-level issues (with ga- prefix) because
  mayor/rig has a different beads database (with gt- prefix)

This fix:
- spawn.go: Use r.Path instead of filepath.Join(r.Path, "mayor", "rig")
- polecat/manager.go: Use r.Path for beads.New() initialization
- session/manager.go: Use r.Path/.beads for BEADS_DIR environment

Closes beads-2nh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-19 23:28:06 -08:00
parent 71d313ed60
commit 43641e1dfb
4 changed files with 13 additions and 7 deletions

View File

@@ -30,8 +30,8 @@ type Manager struct {
// NewManager creates a new polecat manager.
func NewManager(r *rig.Rig, g *git.Git) *Manager {
// Use the mayor's rig directory for beads operations (rig-level beads)
mayorRigPath := filepath.Join(r.Path, "mayor", "rig")
// Use the rig root for beads operations (rig-level beads at .beads/)
rigPath := r.Path
// Try to load rig config for namepool settings
rigConfigPath := filepath.Join(r.Path, ".gastown", "config.json")
@@ -56,7 +56,7 @@ func NewManager(r *rig.Rig, g *git.Git) *Manager {
return &Manager{
rig: r,
git: g,
beads: beads.New(mayorRigPath),
beads: beads.New(rigPath),
namePool: pool,
}
}