spawn.go: Replace WriteSlungWork with bd update --status=pinned (gt-rgd9x.1)

This commit is contained in:
Steve Yegge
2025-12-26 16:21:33 -08:00
parent 42f4f0555f
commit 03e0e541af

View File

@@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strings" "strings"
@@ -20,7 +21,6 @@ import (
"github.com/steveyegge/gastown/internal/session" "github.com/steveyegge/gastown/internal/session"
"github.com/steveyegge/gastown/internal/style" "github.com/steveyegge/gastown/internal/style"
"github.com/steveyegge/gastown/internal/tmux" "github.com/steveyegge/gastown/internal/tmux"
"github.com/steveyegge/gastown/internal/wisp"
"github.com/steveyegge/gastown/internal/witness" "github.com/steveyegge/gastown/internal/witness"
"github.com/steveyegge/gastown/internal/workspace" "github.com/steveyegge/gastown/internal/workspace"
) )
@@ -395,19 +395,14 @@ func runSpawn(cmd *cobra.Command, args []string) error {
style.Bold.Render("✓"), style.Bold.Render("✓"),
assignmentID, rigName, polecatName) assignmentID, rigName, polecatName)
// Write hook file to polecat's worktree so gt mol status can find it // Pin the bead in the polecat's worktree for the propulsion protocol
// This puts work on the polecat's hook for the propulsion protocol pinCmd := exec.Command("bd", "update", assignmentID, "--status=pinned", "--assignee="+polecatAddress)
sw := wisp.NewSlungWork(assignmentID, "mayor/") pinCmd.Dir = polecatObj.ClonePath
if moleculeCtx != nil { pinCmd.Stderr = os.Stderr
sw.Subject = fmt.Sprintf("Molecule: %s", moleculeCtx.MoleculeID) if err := pinCmd.Run(); err != nil {
sw.Context = fmt.Sprintf("Step %d/%d of %s", moleculeCtx.StepNumber, moleculeCtx.TotalSteps, moleculeCtx.MoleculeID) fmt.Printf("%s pinning bead: %v\n", style.Dim.Render("Warning:"), err)
} else if issue != nil {
sw.Subject = issue.Title
}
if err := wisp.WriteSlungWork(polecatObj.ClonePath, polecatAddress, sw); err != nil {
fmt.Printf("%s creating hook file: %v\n", style.Dim.Render("Warning:"), err)
} else { } else {
fmt.Printf("%s Hook file created in polecat worktree\n", style.Bold.Render("✓")) fmt.Printf("%s Bead pinned for polecat\n", style.Bold.Render("✓"))
} }
// Sync beads to push assignment changes // Sync beads to push assignment changes