Unify agent startup with Manager pattern

Refactors all agent startup paths (witness, refinery, crew, polecat) to use
a consistent Manager interface with Start(), Stop(), IsRunning(), and
SessionName() methods.

Includes:
- Witness manager with GUPP propulsion nudge for startup
- Refinery manager for engineer sessions
- Crew manager for worker agents
- Session/polecat manager updates
- claude_settings_check doctor check for settings validation
- Settings management consolidated from rig/manager.go
- Settings location moved outside source repos to prevent conflicts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
julianknutsen
2026-01-06 15:16:33 -08:00
parent 81a7d04239
commit 72544cc06d
12 changed files with 935 additions and 384 deletions

View File

@@ -137,8 +137,11 @@ func (m *Manager) Start(polecat string, opts StartOptions) error {
workDir = m.polecatDir(polecat)
}
// Ensure Claude settings exist (autonomous role needs mail in SessionStart)
if err := claude.EnsureSettingsForRole(workDir, "polecat"); err != nil {
// Ensure Claude settings exist in polecats/ (not polecats/<name>/) so we don't
// write into the source repo. Claude walks up the tree to find settings.
// All polecats share the same settings file.
polecatsDir := filepath.Join(m.rig.Path, "polecats")
if err := claude.EnsureSettingsForRole(polecatsDir, "polecat"); err != nil {
return fmt.Errorf("ensuring Claude settings: %w", err)
}