Fix gt ready using wrong beads path for rigs (#963)

The ready command was incorrectly using RigMayorPath() which resolves to
<rig>/mayor/rig, causing BEADS_DIR to be set to a non-existent path like
/home/baldvin/gt/jbrs/mayor/rig/.beads instead of the actual database at
/home/baldvin/gt/jbrs/.beads.

This caused \"bd ready --json\" to fail with \"no beads database found\" when
called by gt ready, even though the database existed at the rig root.

Fix by using r.BeadsPath() which returns the rig root path. The beads
redirect system at <rig>/.beads/redirect already handles routing to
mayor/rig/.beads when appropriate.

Also updated getFormulaNames() and getWispIDs() calls to use the correct
path consistently.

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
baldvin-kovacs
2026-01-26 03:01:27 +01:00
committed by GitHub
parent 212f08ad03
commit 8a8603e6df

View File

@@ -147,9 +147,9 @@ func runReady(cmd *cobra.Command, args []string) error {
wg.Add(1)
go func(r *rig.Rig) {
defer wg.Done()
// Use mayor/rig path where rig-level beads are stored
rigBeadsPath := constants.RigMayorPath(r.Path)
rigBeads := beads.New(rigBeadsPath)
// Use rig root path where rig-level beads are stored
// BeadsPath returns rig root; redirect system handles mayor/rig routing
rigBeads := beads.New(r.BeadsPath())
issues, err := rigBeads.Ready()
mu.Lock()
@@ -159,10 +159,10 @@ func runReady(cmd *cobra.Command, args []string) error {
src.Error = err.Error()
} else {
// Filter out formula scaffolds (gt-579)
formulaNames := getFormulaNames(rigBeadsPath)
formulaNames := getFormulaNames(r.BeadsPath())
filtered := filterFormulaScaffolds(issues, formulaNames)
// Defense-in-depth: also filter wisps that shouldn't appear in ready work
wispIDs := getWispIDs(rigBeadsPath)
wispIDs := getWispIDs(r.BeadsPath())
src.Issues = filterWisps(filtered, wispIDs)
}
sources = append(sources, src)