feat(doctor): add federation health checks (bd-wkumz.6)

Add 5 federation health checks:
- CheckFederationRemotesAPI: verifies remotesapi port accessibility
- CheckFederationPeerConnectivity: checks peer remote reachability
- CheckFederationSyncStaleness: detects commits behind peers
- CheckFederationConflicts: detects unresolved merge conflicts
- CheckDoltServerModeMismatch: detects embedded vs server mode mismatch

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
emma
2026-01-20 23:13:02 -08:00
committed by Steve Yegge
parent c3f68caf7a
commit 1a7f8efc9e
3 changed files with 601 additions and 0 deletions

View File

@@ -381,6 +381,31 @@ func runDiagnostics(path string) doctorResult {
result.Checks = append(result.Checks, legacyDaemonConfigCheck)
// Note: Don't set OverallOK = false for this - deprecated options still work
// Federation health checks (bd-wkumz.6)
// Check 8d: Federation remotesapi port accessibility
remotesAPICheck := convertWithCategory(doctor.CheckFederationRemotesAPI(path), doctor.CategoryFederation)
result.Checks = append(result.Checks, remotesAPICheck)
// Don't fail overall for federation issues - they're only relevant for Dolt users
// Check 8e: Federation peer connectivity
peerConnCheck := convertWithCategory(doctor.CheckFederationPeerConnectivity(path), doctor.CategoryFederation)
result.Checks = append(result.Checks, peerConnCheck)
// Check 8f: Federation sync staleness
syncStalenessCheck := convertWithCategory(doctor.CheckFederationSyncStaleness(path), doctor.CategoryFederation)
result.Checks = append(result.Checks, syncStalenessCheck)
// Check 8g: Federation conflict detection
fedConflictsCheck := convertWithCategory(doctor.CheckFederationConflicts(path), doctor.CategoryFederation)
result.Checks = append(result.Checks, fedConflictsCheck)
if fedConflictsCheck.Status == statusError {
result.OverallOK = false // Unresolved conflicts are a real problem
}
// Check 8h: Dolt init vs embedded mode mismatch
doltModeCheck := convertWithCategory(doctor.CheckDoltServerModeMismatch(path), doctor.CategoryFederation)
result.Checks = append(result.Checks, doltModeCheck)
// Check 9: Database-JSONL sync
syncCheck := convertWithCategory(doctor.CheckDatabaseJSONLSync(path), doctor.CategoryData)
result.Checks = append(result.Checks, syncCheck)