From e9c2d84dbca1ca169c0fd1a637787e0a9dd847ae Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 6 Aug 2026 16:07:03 -0300 Subject: [PATCH] fix(demo): print the monitor summary once per incident The resolving tick remains the newest one until another incident opens, so the completed checklist reprinted on every poll. Co-Authored-By: Claude Opus 5 --- scripts/ops/hermes_triage_monitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ops/hermes_triage_monitor.py b/scripts/ops/hermes_triage_monitor.py index 495e61b9a..4f0b3881a 100755 --- a/scripts/ops/hermes_triage_monitor.py +++ b/scripts/ops/hermes_triage_monitor.py @@ -96,6 +96,7 @@ class Monitor: self.done: dict[str, str] = {} self.incident = "" self.last_line = "" + self.summarised = False def mark(self, key: str, evidence: str) -> None: """Record a stage as reached and print it once, with its evidence.""" @@ -123,6 +124,7 @@ class Monitor: if incident and incident != self.incident: self.incident = incident self.done.clear() + self.summarised = False print(f"\n{BOLD}{YELLOW}{stamp()} ── incident {incident} ──{RESET}") sys.stdout.flush() @@ -167,10 +169,13 @@ def main() -> None: f"Ariadne refused: {state.get('reason', 'human_required')} — no action taken", ) monitor.mark("response", "escalated to a human; issue filed in the service repository") - if status == "healthy" and state.get("resolved"): + if status == "healthy" and state.get("resolved") and not monitor.summarised: monitor.mark("verify", "rebuild finished green") monitor.mark("outputs", f"resolved: {', '.join(state['resolved'])}") monitor.checklist() + # The resolving tick stays newest until another incident opens, so + # the completed checklist is printed once rather than every poll. + monitor.summarised = True line = f"{status}|{incident}|{fixture_state()}" if line != monitor.last_line: