fix(reconcile): gate heal flapping by drift fingerprint instead of kernel count

This commit is contained in:
patrick committed 2026-02-10 21:48:50 -05:00
1 parent 3d7c1b3f2a
commit e342d83a70
3 files changed
+100 -17

No files matched your search

+15 -2
View File
@@ -37,7 +37,15 @@ class LocalStateReporter:
except Exception as e:
logging.error(f"Reporter: Failed to write state file: {e}")
def log_heal_event(self, gap_count):
def log_heal_event(
self,
kernel_count,
missing_count,
extra_count,
metadata_drift_count,
drift_fingerprint,
reason,
):
"""
Records a specific healing event in a persistent history log.
"""
@@ -46,6 +54,11 @@ class LocalStateReporter:
try:
with open(history_file, 'a') as f:
f.write(f"{timestamp} - HEAL: Fixed desync of {gap_count} IPs\n")
f.write(
f"{timestamp} - HEAL: reason={reason} "
f"kernel={kernel_count} missing={missing_count} "
f"extra={extra_count} metadata={metadata_drift_count} "
f"drift_fingerprint={drift_fingerprint}\n"
)
except Exception as e:
logging.error(f"Reporter: Failed to write to history log: {e}")