Files
gastown/internal/witness/types.go
Steve Yegge 8e96e12e37 Remove stats from .runtime/*.json observable state (gt-lfi2d)
Remove Stats fields from witness and refinery types that tracked
observable metrics (total counts, today counts). These are now
handled by the activity stream/beads system instead.

Removed:
- WitnessStats type and Stats field from Witness
- RefineryStats type and Stats field from Refinery
- LastCheckAt field from Witness
- Stats display from gt witness status
- Stats display from gt refinery status
- Stats increment code from refinery.completeMR()

Kept minimal process state:
- RigName, State, PID, StartedAt (both)
- MonitoredPolecats, Config, SpawnedIssues (witness)
- CurrentMR, PendingMRs, LastMergeAt (refinery)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 02:05:54 -08:00

65 lines
1.8 KiB
Go

// Package witness provides the polecat monitoring agent.
package witness
import (
"time"
)
// State represents the witness's running state.
type State string
const (
// StateStopped means the witness is not running.
StateStopped State = "stopped"
// StateRunning means the witness is actively monitoring.
StateRunning State = "running"
// StatePaused means the witness is paused (not monitoring).
StatePaused State = "paused"
)
// 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).
MaxWorkers int `json:"max_workers"`
// SpawnDelayMs is the delay between spawns in milliseconds (default: 5000).
SpawnDelayMs int `json:"spawn_delay_ms"`
// AutoSpawn enables automatic spawning for ready issues (default: true).
AutoSpawn bool `json:"auto_spawn"`
// EpicID limits spawning to children of this epic (optional).
EpicID string `json:"epic_id,omitempty"`
// IssuePrefix limits spawning to issues with this prefix (optional).
IssuePrefix string `json:"issue_prefix,omitempty"`
}