Files
gastown/internal/dog/types.go
Steve Yegge ddf5b5a9f4 Add Dog infrastructure package for Deacon helper workers (gt-0x5og.2)
Dogs are reusable workers managed by the Deacon for cross-rig infrastructure
tasks. Unlike polecats (single-rig, ephemeral), dogs have worktrees into
multiple rigs and persist between tasks.

Key components:
- internal/dog/types.go: Dog struct, State enum, DogState JSON schema
- internal/dog/manager.go: Manager with Add/Remove/List/Get/Refresh operations
- internal/dog/manager_test.go: Unit tests

Features:
- Multi-rig worktrees: Each dog gets a worktree per configured rig
- State tracking: .dog.json with idle/working state, last-active, work assignment
- Worktree refresh: Recreate stale worktrees with fresh branches
- Branch cleanup: Remove orphaned dog branches across all rigs

Directory structure: ~/gt/deacon/dogs/<name>/
  - <rig>/ (worktree into each rig: gastown/, beads/, etc.)
  - .dog.json (state file)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 10:38:18 -08:00

41 lines
1.5 KiB
Go

// Package dog manages Dogs - Deacon's helper workers for infrastructure tasks.
// Dogs are reusable workers with multi-rig worktrees, managed by the Deacon.
// Unlike polecats (single-rig, ephemeral), dogs handle cross-rig infrastructure work.
package dog
import (
"time"
)
// State represents a dog's operational state.
type State string
const (
// StateIdle means the dog is available for work.
StateIdle State = "idle"
// StateWorking means the dog is executing a task.
StateWorking State = "working"
)
// Dog represents a Deacon helper worker.
type Dog struct {
Name string // Dog name (e.g., "alpha")
State State // Current state
Path string // Path to kennel dir (~/gt/deacon/dogs/<name>)
Worktrees map[string]string // Rig name -> worktree path
LastActive time.Time // Last activity timestamp
Work string // Current work assignment (bead ID or molecule)
CreatedAt time.Time // When dog was added to kennel
}
// DogState is the persistent state stored in .dog.json.
type DogState struct {
Name string `json:"name"`
State State `json:"state"`
LastActive time.Time `json:"last_active"`
Work string `json:"work,omitempty"` // Current work assignment
Worktrees map[string]string `json:"worktrees,omitempty"` // Rig -> path (for verification)
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}