refactor: ZFC cleanup - move Go heuristics to Deacon molecule (gt-gaxo)

Remove Go code that makes workflow decisions. All health checking,
staleness detection, nudging, and escalation belongs in the Deacon
molecule where Claude executes it.

Removed:
- internal/daemon/backoff.go (190 lines) - exponential backoff decisions
- internal/doctor/stale_check.go (284 lines) - staleness detection
- IsFresh/IsStale/IsVeryStale from keepalive.go
- pokeMayor, pokeWitnesses, pokeWitness from daemon.go
- Heartbeat staleness classification from pokeDeacon

Changed:
- Lifecycle parsing now uses structured body (JSON or simple text)
  instead of keyword matching on subject line
- Daemon now only ensures Deacon is running and sends simple heartbeats
- No backoff, no staleness classification, no decision-making

Total: ~800 lines removed from Go code

The Deacon molecule will handle all health checking, nudging, and
escalation. Go is now just a message router.

See gt-gaxo epic for full rationale.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-24 00:11:15 -08:00
parent 0f88c793f8
commit b6817899b4
13 changed files with 145 additions and 1224 deletions

View File

@@ -206,32 +206,8 @@ func TestSaveLoadState_Roundtrip(t *testing.T) {
}
}
func TestIsWitnessSession(t *testing.T) {
tests := []struct {
name string
expected bool
}{
{"gt-gastown-witness", true},
{"gt-myrig-witness", true},
{"gt-my-rig-name-witness", true},
{"gt-a-witness", true}, // minimum valid
{"gt-witness", false}, // no rig name
{"gastown-witness", false}, // missing gt- prefix
{"gt-gastown", false}, // missing -witness suffix
{"gt-mayor", false}, // not a witness
{"random-session", false},
{"", false},
{"gt-", false},
{"witness", false},
}
for _, tc := range tests {
result := isWitnessSession(tc.name)
if result != tc.expected {
t.Errorf("isWitnessSession(%q) = %v, expected %v", tc.name, result, tc.expected)
}
}
}
// NOTE: TestIsWitnessSession removed - isWitnessSession function was deleted
// as part of ZFC cleanup (gt-gaxo). Witness poking is now Deacon's responsibility.
func TestLifecycleAction_Constants(t *testing.T) {
// Verify constants have expected string values