Remove gt polecat done/reset/finish/sleep commands (idle producers)
These commands transitioned polecats to idle state, violating the transient model. From PRIMING.md: "Polecats exist only while working. One task, then nuked." Removed: - gt polecat done - marked polecat as done and returned to idle - gt polecat reset - force reset polecat to idle state - gt polecat finish - alias for done - gt polecat sleep - deprecated transition to done state - gt polecat wake - deprecated transition to working state - Manager.Finish() method - Manager.Reset() method - Manager.Wake() method - Manager.Sleep() method The correct model is: polecats use 'gt done' which signals Witness for nuke. There is no "return to idle" - only death. (gt-32d4a) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ MR: <mr-id> # if exit=MERGED
|
||||
Branch: <branch>
|
||||
```
|
||||
|
||||
**Trigger**: `gt polecat done` command generates this automatically.
|
||||
**Trigger**: `gt done` command generates this automatically.
|
||||
|
||||
**Handler**: Witness creates a cleanup wisp for the polecat.
|
||||
|
||||
|
||||
@@ -90,71 +90,6 @@ Examples:
|
||||
RunE: runPolecatRemove,
|
||||
}
|
||||
|
||||
var polecatWakeCmd = &cobra.Command{
|
||||
Use: "wake <rig>/<polecat>",
|
||||
Short: "(Deprecated) Resume a polecat to working state",
|
||||
Long: `Resume a polecat to working state.
|
||||
|
||||
DEPRECATED: In the transient model, polecats are created fresh for each task
|
||||
via 'gt sling'. This command is kept for backward compatibility.
|
||||
|
||||
Transitions: done → working
|
||||
|
||||
Example:
|
||||
gt polecat wake greenplace/Toast`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: runPolecatWake,
|
||||
}
|
||||
|
||||
var polecatSleepCmd = &cobra.Command{
|
||||
Use: "sleep <rig>/<polecat>",
|
||||
Short: "(Deprecated) Mark polecat as done",
|
||||
Long: `Mark polecat as done.
|
||||
|
||||
DEPRECATED: In the transient model, polecats use 'gt handoff' when complete,
|
||||
which triggers automatic cleanup by the Witness. This command is kept for
|
||||
backward compatibility.
|
||||
|
||||
Transitions: working → done
|
||||
|
||||
Example:
|
||||
gt polecat sleep greenplace/Toast`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: runPolecatSleep,
|
||||
}
|
||||
|
||||
var polecatDoneCmd = &cobra.Command{
|
||||
Use: "done <rig>/<polecat>",
|
||||
Aliases: []string{"finish"},
|
||||
Short: "Mark polecat as done with work and return to idle",
|
||||
Long: `Mark polecat as done with work and return to idle.
|
||||
|
||||
Transitions: working/done/stuck → idle
|
||||
Clears the assigned issue.
|
||||
Fails if session is running (stop first).
|
||||
|
||||
Example:
|
||||
gt polecat done greenplace/Toast
|
||||
gt polecat finish greenplace/Toast`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: runPolecatDone,
|
||||
}
|
||||
|
||||
var polecatResetCmd = &cobra.Command{
|
||||
Use: "reset <rig>/<polecat>",
|
||||
Short: "Force reset polecat to idle state",
|
||||
Long: `Force reset polecat to idle state.
|
||||
|
||||
Transitions: any state → idle
|
||||
Clears the assigned issue.
|
||||
Use when polecat is stuck in an unexpected state.
|
||||
Fails if session is running (stop first).
|
||||
|
||||
Example:
|
||||
gt polecat reset greenplace/Toast`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: runPolecatReset,
|
||||
}
|
||||
|
||||
var polecatSyncCmd = &cobra.Command{
|
||||
Use: "sync <rig>/<polecat>",
|
||||
@@ -328,10 +263,6 @@ func init() {
|
||||
polecatCmd.AddCommand(polecatListCmd)
|
||||
polecatCmd.AddCommand(polecatAddCmd)
|
||||
polecatCmd.AddCommand(polecatRemoveCmd)
|
||||
polecatCmd.AddCommand(polecatWakeCmd)
|
||||
polecatCmd.AddCommand(polecatSleepCmd)
|
||||
polecatCmd.AddCommand(polecatDoneCmd)
|
||||
polecatCmd.AddCommand(polecatResetCmd)
|
||||
polecatCmd.AddCommand(polecatSyncCmd)
|
||||
polecatCmd.AddCommand(polecatStatusCmd)
|
||||
polecatCmd.AddCommand(polecatGitStateCmd)
|
||||
@@ -599,112 +530,6 @@ func runPolecatRemove(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func runPolecatWake(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println(style.Warning.Render("DEPRECATED: Use 'gt sling' to create fresh polecats instead"))
|
||||
fmt.Println()
|
||||
|
||||
rigName, polecatName, err := parseAddress(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mgr, _, err := getPolecatManager(rigName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := mgr.Wake(polecatName); err != nil {
|
||||
return fmt.Errorf("waking polecat: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s Polecat %s is now working.\n", style.SuccessPrefix, polecatName)
|
||||
return nil
|
||||
}
|
||||
|
||||
func runPolecatSleep(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println(style.Warning.Render("DEPRECATED: Use 'gt handoff' from within a polecat session instead"))
|
||||
fmt.Println()
|
||||
|
||||
rigName, polecatName, err := parseAddress(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mgr, r, err := getPolecatManager(rigName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Check if session is running
|
||||
t := tmux.NewTmux()
|
||||
sessMgr := session.NewManager(t, r)
|
||||
running, _ := sessMgr.IsRunning(polecatName)
|
||||
if running {
|
||||
return fmt.Errorf("session is running. Use 'gt handoff' from the polecat session, or stop it with: gt session stop %s/%s", rigName, polecatName)
|
||||
}
|
||||
|
||||
if err := mgr.Sleep(polecatName); err != nil {
|
||||
return fmt.Errorf("marking polecat as done: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s Polecat %s is now done.\n", style.SuccessPrefix, polecatName)
|
||||
return nil
|
||||
}
|
||||
|
||||
func runPolecatDone(cmd *cobra.Command, args []string) error {
|
||||
rigName, polecatName, err := parseAddress(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mgr, r, err := getPolecatManager(rigName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Check if session is running
|
||||
t := tmux.NewTmux()
|
||||
sessMgr := session.NewManager(t, r)
|
||||
running, _ := sessMgr.IsRunning(polecatName)
|
||||
if running {
|
||||
return fmt.Errorf("session is running. Stop it first with: gt session stop %s/%s", rigName, polecatName)
|
||||
}
|
||||
|
||||
if err := mgr.Finish(polecatName); err != nil {
|
||||
return fmt.Errorf("finishing polecat: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s Polecat %s is now idle.\n", style.SuccessPrefix, polecatName)
|
||||
return nil
|
||||
}
|
||||
|
||||
func runPolecatReset(cmd *cobra.Command, args []string) error {
|
||||
rigName, polecatName, err := parseAddress(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mgr, r, err := getPolecatManager(rigName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Check if session is running
|
||||
t := tmux.NewTmux()
|
||||
sessMgr := session.NewManager(t, r)
|
||||
running, _ := sessMgr.IsRunning(polecatName)
|
||||
if running {
|
||||
return fmt.Errorf("session is running. Stop it first with: gt session stop %s/%s", rigName, polecatName)
|
||||
}
|
||||
|
||||
if err := mgr.Reset(polecatName); err != nil {
|
||||
return fmt.Errorf("resetting polecat: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s Polecat %s has been reset to idle.\n", style.SuccessPrefix, polecatName)
|
||||
return nil
|
||||
}
|
||||
|
||||
func runPolecatSync(cmd *cobra.Command, args []string) error {
|
||||
if len(args) < 1 {
|
||||
return fmt.Errorf("rig or rig/polecat address required")
|
||||
|
||||
@@ -649,71 +649,6 @@ func (m *Manager) ClearIssue(name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Wake transitions a polecat from idle to active.
|
||||
// Deprecated: In the transient model, polecats start in working state.
|
||||
// This method is kept for backward compatibility with existing polecats.
|
||||
func (m *Manager) Wake(name string) error {
|
||||
polecat, err := m.Get(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Accept both idle and done states for legacy compatibility
|
||||
if polecat.State != StateIdle && polecat.State != StateDone {
|
||||
return fmt.Errorf("polecat is not idle (state: %s)", polecat.State)
|
||||
}
|
||||
|
||||
return m.SetState(name, StateWorking)
|
||||
}
|
||||
|
||||
// Sleep transitions a polecat from active to idle.
|
||||
// Deprecated: In the transient model, polecats are deleted when done.
|
||||
// This method is kept for backward compatibility.
|
||||
func (m *Manager) Sleep(name string) error {
|
||||
polecat, err := m.Get(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Accept working state as well for legacy compatibility
|
||||
if polecat.State != StateActive && polecat.State != StateWorking {
|
||||
return fmt.Errorf("polecat is not active (state: %s)", polecat.State)
|
||||
}
|
||||
|
||||
return m.SetState(name, StateDone)
|
||||
}
|
||||
|
||||
// Finish transitions a polecat from working/done/stuck to idle and clears the issue.
|
||||
// This clears the assignee from any assigned issue.
|
||||
func (m *Manager) Finish(name string) error {
|
||||
polecat, err := m.Get(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Only allow finishing from working-related states
|
||||
switch polecat.State {
|
||||
case StateWorking, StateDone, StateStuck:
|
||||
// OK to finish
|
||||
default:
|
||||
return fmt.Errorf("polecat is not in a finishing state (state: %s)", polecat.State)
|
||||
}
|
||||
|
||||
// Clear the issue assignment
|
||||
return m.ClearIssue(name)
|
||||
}
|
||||
|
||||
// Reset forces a polecat to idle state regardless of current state.
|
||||
// This clears the assignee from any assigned issue.
|
||||
func (m *Manager) Reset(name string) error {
|
||||
if !m.exists(name) {
|
||||
return ErrPolecatNotFound
|
||||
}
|
||||
|
||||
// Clear the issue assignment
|
||||
return m.ClearIssue(name)
|
||||
}
|
||||
|
||||
// loadFromBeads gets polecat info from beads assignee field.
|
||||
// State is simple: issue assigned → working, no issue → idle.
|
||||
// We don't interpret issue status (ZFC: Go is transport, not decision-maker).
|
||||
|
||||
Reference in New Issue
Block a user