fix(demo): print the monitor summary once per incident
Some checks failed
Tests / Declarative: Post Actions testing.tests.test_repo_structure.test_knowledge_service_mirror_matches_source failed
Some checks failed
Tests / Declarative: Post Actions testing.tests.test_repo_structure.test_knowledge_service_mirror_matches_source failed
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 <noreply@anthropic.com>
This commit is contained in:
parent
93ff096fa1
commit
e9c2d84dbc
@ -96,6 +96,7 @@ class Monitor:
|
|||||||
self.done: dict[str, str] = {}
|
self.done: dict[str, str] = {}
|
||||||
self.incident = ""
|
self.incident = ""
|
||||||
self.last_line = ""
|
self.last_line = ""
|
||||||
|
self.summarised = False
|
||||||
|
|
||||||
def mark(self, key: str, evidence: str) -> None:
|
def mark(self, key: str, evidence: str) -> None:
|
||||||
"""Record a stage as reached and print it once, with its evidence."""
|
"""Record a stage as reached and print it once, with its evidence."""
|
||||||
@ -123,6 +124,7 @@ class Monitor:
|
|||||||
if incident and incident != self.incident:
|
if incident and incident != self.incident:
|
||||||
self.incident = incident
|
self.incident = incident
|
||||||
self.done.clear()
|
self.done.clear()
|
||||||
|
self.summarised = False
|
||||||
print(f"\n{BOLD}{YELLOW}{stamp()} ── incident {incident} ──{RESET}")
|
print(f"\n{BOLD}{YELLOW}{stamp()} ── incident {incident} ──{RESET}")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
@ -167,10 +169,13 @@ def main() -> None:
|
|||||||
f"Ariadne refused: {state.get('reason', 'human_required')} — no action taken",
|
f"Ariadne refused: {state.get('reason', 'human_required')} — no action taken",
|
||||||
)
|
)
|
||||||
monitor.mark("response", "escalated to a human; issue filed in the service repository")
|
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("verify", "rebuild finished green")
|
||||||
monitor.mark("outputs", f"resolved: {', '.join(state['resolved'])}")
|
monitor.mark("outputs", f"resolved: {', '.join(state['resolved'])}")
|
||||||
monitor.checklist()
|
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()}"
|
line = f"{status}|{incident}|{fixture_state()}"
|
||||||
if line != monitor.last_line:
|
if line != monitor.last_line:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user