Deprecate hook files, use pinned beads for propulsion (gt-rgd9x)
Replace hook file mechanism with discovery-based pinned beads: - gt hook: now runs bd update <bead> --status=pinned - gt sling: same, plus nudge to target - gt handoff: same when bead ID provided - gt prime: checks pinned beads instead of hook files - gt mol status: no longer checks hook files Key changes: - outputAttachmentStatus: extended to all roles (was Crew/Polecat only) - checkSlungWork: now queries pinned beads instead of reading hook files - wisp/io.go functions: marked deprecated with migration notes This follows Gas Town discovery over explicit state principle. Hook files are kept for backward compatibility but no longer written. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+9
-13
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/steveyegge/gastown/internal/style"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
"github.com/steveyegge/gastown/internal/wisp"
|
||||
"github.com/steveyegge/gastown/internal/workspace"
|
||||
)
|
||||
|
||||
@@ -504,29 +503,26 @@ func hookBeadForHandoff(beadID string) error {
|
||||
return fmt.Errorf("bead '%s' not found", beadID)
|
||||
}
|
||||
|
||||
// Determine agent identity and clone root
|
||||
agentID, _, cloneRoot, err := resolveSelfTarget()
|
||||
// Determine agent identity
|
||||
agentID, _, _, err := resolveSelfTarget()
|
||||
if err != nil {
|
||||
return fmt.Errorf("detecting agent identity: %w", err)
|
||||
}
|
||||
|
||||
// Create the slung work wisp
|
||||
sw := wisp.NewSlungWork(beadID, agentID)
|
||||
sw.Subject = handoffSubject
|
||||
sw.Context = handoffMessage
|
||||
|
||||
fmt.Printf("%s Hooking %s...\n", style.Bold.Render("🪝"), beadID)
|
||||
|
||||
if handoffDryRun {
|
||||
fmt.Printf("Would create wisp: %s\n", wisp.HookPath(cloneRoot, agentID))
|
||||
fmt.Printf("Would run: bd update %s --status=pinned --assignee=%s\n", beadID, agentID)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Write the wisp to the hook
|
||||
if err := wisp.WriteSlungWork(cloneRoot, agentID, sw); err != nil {
|
||||
return fmt.Errorf("writing wisp: %w", err)
|
||||
// Pin the bead using bd update (discovery-based approach)
|
||||
pinCmd := exec.Command("bd", "update", beadID, "--status=pinned", "--assignee="+agentID)
|
||||
pinCmd.Stderr = os.Stderr
|
||||
if err := pinCmd.Run(); err != nil {
|
||||
return fmt.Errorf("pinning bead: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s Work attached to hook\n", style.Bold.Render("✓"))
|
||||
fmt.Printf("%s Work attached to hook (pinned bead)\n", style.Bold.Render("✓"))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user