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

@@ -353,21 +353,6 @@ func parseTime(s string) time.Time {
return t
}
// run is deprecated - foreground mode now just prints a message.
// The Refinery agent (Claude) handles all merge processing.
// See: ZFC #5 - Move merge/conflict decisions from Go to Refinery agent
func (m *Manager) run(_ *Refinery) error { // ref unused: deprecated function
_, _ = fmt.Fprintln(m.output, "")
_, _ = fmt.Fprintln(m.output, "╔══════════════════════════════════════════════════════════════╗")
_, _ = fmt.Fprintln(m.output, "║ Foreground mode is deprecated. ║")
_, _ = fmt.Fprintln(m.output, "║ ║")
_, _ = fmt.Fprintln(m.output, "║ The Refinery agent (Claude) handles all merge decisions. ║")
_, _ = fmt.Fprintln(m.output, "║ Use 'gt refinery start' to run in background mode. ║")
_, _ = fmt.Fprintln(m.output, "╚══════════════════════════════════════════════════════════════╝")
_, _ = fmt.Fprintln(m.output, "")
return nil
}
// MergeResult contains the result of a merge attempt.
type MergeResult struct {
Success bool

View File

@@ -1,49 +1,15 @@
// Package refinery provides the merge queue processing agent.
//
// ZFC-compliant: Running state is derived from tmux sessions, not stored in files.
// Merge queue is derived from beads merge-request issues.
package refinery
import (
"errors"
"fmt"
"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
)
// Refinery represents a rig's merge queue processor.
type Refinery struct {
// RigName is the rig this refinery processes.
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 refinery was started.
StartedAt *time.Time `json:"started_at,omitempty"`
// CurrentMR is the merge request currently being processed.
CurrentMR *MergeRequest `json:"current_mr,omitempty"`
// PendingMRs tracks merge requests that have been submitted.
// Key is the MR ID.
PendingMRs map[string]*MergeRequest `json:"pending_mrs,omitempty"`
// LastMergeAt is when the last successful merge happened.
LastMergeAt *time.Time `json:"last_merge_at,omitempty"`
}
// MergeRequest represents a branch waiting to be merged.
type MergeRequest struct {
// ID is a unique identifier for this merge request.