feat(reporter): count heals the gate suppresses
CI / Unit tests (push) Successful in 4s
CI / Unit tests (pull_request) Successful in 3s

A drift whose fingerprint matches a heal from the last heal_min_interval
seconds was counted as a drift event but never as a heal attempt, so the
24h counters showed a drift with no heal and no failure. Decide on the
heal before recording the check and report heals_suppressed_24h and
heals_suppressed_total, so every drift event is either a heal attempt
or a suppressed heal. The suppression warning now names the earlier
heal that did not hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-10-19 18:04:24 -04:00
1 parent 02ca338eb7
commit 4e8a4d6717
5 files changed
+50 -11

No files matched your search

+9 -7
View File
@@ -97,6 +97,13 @@ def main():
)
if stop_event.is_set():
break
# Decide on the heal before recording the check, so a drift the gate
# suppresses is counted as such rather than silently lacking a heal.
heal_approved = is_synced or should_heal(
reporter.get_history_file(),
drift.get("fingerprint", ""),
min_interval=settings.heal_min_interval,
)
reporter.update_status(
is_synced,
count,
@@ -106,6 +113,7 @@ def main():
last_drift_fingerprint=drift.get("fingerprint", ""),
checks_increment=1,
drift_events_increment=0 if is_synced else 1,
heal_suppressed=not heal_approved,
)
if is_synced:
@@ -125,13 +133,7 @@ def main():
f"extra={drift['extra_count']}, metadata={drift['metadata_drift_count']})."
)
history_file = reporter.get_history_file()
if should_heal(
history_file,
drift.get("fingerprint", ""),
min_interval=settings.heal_min_interval,
):
if heal_approved:
logging.warning("Healing approved.")
heal_result, post_drift = execute_heal_and_verify(
auditor,