fix: ZFC improvements - query tmux directly instead of marker TTL

Two ZFC fixes:

1. Boot marker file (hq-zee5n): Changed IsRunning() to query
   tmux.HasSession() directly instead of checking marker file
   freshness with TTL. Removed stale marker check from doctor.

2. Branch pattern matching (hq-zwuh6): Replaced hardcoded "polecat/"
   strings with constants.BranchPolecatPrefix for consistency.

Also removed 60-second WaitForCommand blocking from crew Start()
which was causing gt crew start to hang.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/george
2026-01-09 22:08:12 -08:00
committed by Steve Yegge
parent e0858096f6
commit c94d59dca7
6 changed files with 16 additions and 46 deletions

View File

@@ -3,7 +3,6 @@ package doctor
import (
"fmt"
"os"
"path/filepath"
"time"
"github.com/steveyegge/gastown/internal/boot"
@@ -84,24 +83,9 @@ func (c *BootHealthCheck) Run(ctx *CheckContext) *CheckResult {
details = append(details, "No previous run recorded")
}
// Check 4: Marker file freshness (stale marker indicates crash)
markerPath := filepath.Join(bootDir, boot.MarkerFileName)
if info, err := os.Stat(markerPath); err == nil {
age := time.Since(info.ModTime())
if age > boot.DefaultMarkerTTL {
return &CheckResult{
Name: c.Name(),
Status: StatusWarning,
Message: "Boot marker is stale (possible crash)",
Details: []string{
fmt.Sprintf("Marker age: %s", age.Round(time.Second)),
fmt.Sprintf("TTL: %s", boot.DefaultMarkerTTL),
},
FixHint: "Stale marker will be cleaned on next daemon tick",
}
}
// Marker exists and is fresh - Boot is currently running
details = append(details, fmt.Sprintf("Currently running (marker age: %s)", age.Round(time.Second)))
// Check 4: Currently running (uses tmux session state per ZFC principle)
if sessionAlive {
details = append(details, "Currently running (tmux session active)")
}
// All checks passed