From 1013b057909975684af33eca4241616751154473 Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 6 Mar 2026 19:22:25 -0500 Subject: [PATCH] fix(reporter): emit UTC-aware timestamps for state and heal history --- reporter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reporter.py b/reporter.py index 4f863c2..7833243 100644 --- a/reporter.py +++ b/reporter.py @@ -4,7 +4,7 @@ import json import os import logging import time -from datetime import datetime +from datetime import datetime, timezone class LocalStateReporter: """ @@ -140,7 +140,7 @@ class LocalStateReporter: effective_last_heal_timestamp = ( last_heal_timestamp if last_heal_timestamp is not None - else datetime.now().isoformat() + else datetime.now(timezone.utc).isoformat() ) now_epoch = time.time() @@ -176,7 +176,7 @@ class LocalStateReporter: uptime_seconds = max(0, int(now_epoch - self.started_at_epoch)) status_data = { "node_name": self.node_name, - "last_check": datetime.now().isoformat(), + "last_check": datetime.now(timezone.utc).isoformat(), "status": "HEALTHY" if is_synced else "DESYNC_DETECTED", "is_synced": is_synced, "kernel_ban_count": ban_count, @@ -228,7 +228,7 @@ class LocalStateReporter: Records a specific healing event in a persistent history log. """ history_file = self.get_history_file() - timestamp = datetime.now().isoformat() + timestamp = datetime.now(timezone.utc).isoformat() try: with open(history_file, 'a') as f: