fix(witness,refinery): remove ZFC-violating state types

Remove Witness and Refinery structs that recorded observable state
(State, PID, StartedAt, etc.) in violation of ZFC and "Discover,
Don't Track" principles.

Changes:
- Remove Witness struct and State type alias from witness/types.go
- Remove Refinery struct and State type alias from refinery/types.go
- Remove deprecated run(*Refinery) method from refinery/manager.go
- Update witness/types_test.go to remove tests for deleted types

The managers already derive running state from tmux sessions
(following the deacon pattern). The deleted types were vestigial
and unused.

Resolves: gt-r5pui

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
furiosa
2026-01-20 20:37:27 -08:00
committed by beads/crew/emma
parent 44d5b4fdd2
commit 78ca8bd5bf
4 changed files with 6 additions and 233 deletions

View File

@@ -1,46 +1,9 @@
// Package witness provides the polecat monitoring agent.
//
// ZFC-compliant: Running state is derived from tmux sessions, not stored in files.
// Configuration is sourced from role beads (hq-witness-role).
package witness
import (
"time"
"github.com/steveyegge/gastown/internal/agent"
)
// State is an alias for agent.State for backwards compatibility.
type State = agent.State
// State constants - re-exported from agent package for backwards compatibility.
const (
StateStopped = agent.StateStopped
StateRunning = agent.StateRunning
StatePaused = agent.StatePaused
)
// Witness represents a rig's polecat monitoring agent.
type Witness struct {
// RigName is the rig this witness monitors.
RigName string `json:"rig_name"`
// State is the current running state.
State State `json:"state"`
// PID is the process ID if running in background.
PID int `json:"pid,omitempty"`
// StartedAt is when the witness was started.
StartedAt *time.Time `json:"started_at,omitempty"`
// MonitoredPolecats tracks polecats being monitored.
MonitoredPolecats []string `json:"monitored_polecats,omitempty"`
// Config contains auto-spawn configuration.
Config WitnessConfig `json:"config"`
// SpawnedIssues tracks which issues have been spawned (to avoid duplicates).
SpawnedIssues []string `json:"spawned_issues,omitempty"`
}
// WitnessConfig contains configuration for the witness.
type WitnessConfig struct {
// MaxWorkers is the maximum number of concurrent polecats (default: 4).
@@ -58,5 +21,3 @@ type WitnessConfig struct {
// IssuePrefix limits spawning to issues with this prefix (optional).
IssuePrefix string `json:"issue_prefix,omitempty"`
}