fix(witness,rig): code review cleanup

- Remove unused workDir field from witness manager
- Use witMgr.IsRunning() consistently instead of direct tmux call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/mel
2026-01-20 20:18:55 -08:00
committed by Steve Yegge
parent 6a3780d282
commit 0a6b0b892f
2 changed files with 4 additions and 7 deletions

View File

@@ -1073,9 +1073,8 @@ func runRigStatus(cmd *cobra.Command, args []string) error {
// Witness status
fmt.Printf("%s\n", style.Bold.Render("Witness"))
witnessSession := fmt.Sprintf("gt-%s-witness", rigName)
witnessRunning, _ := t.HasSession(witnessSession)
_ = witness.NewManager(r) // silence unused warning, manager created for consistency
witMgr := witness.NewManager(r)
witnessRunning, _ := witMgr.IsRunning()
if witnessRunning {
fmt.Printf(" %s running\n", style.Success.Render("●"))
} else {

View File

@@ -27,15 +27,13 @@ var (
// Manager handles witness lifecycle and monitoring operations.
// ZFC-compliant: tmux session is the source of truth for running state.
type Manager struct {
rig *rig.Rig
workDir string
rig *rig.Rig
}
// NewManager creates a new witness manager for a rig.
func NewManager(r *rig.Rig) *Manager {
return &Manager{
rig: r,
workDir: r.Path,
rig: r,
}
}