diff --git a/hermes-sovereign/orchestrator/orchestrator.py b/hermes-sovereign/orchestrator/orchestrator.py index a5f6b577..49b9a405 100755 --- a/hermes-sovereign/orchestrator/orchestrator.py +++ b/hermes-sovereign/orchestrator/orchestrator.py @@ -19,6 +19,18 @@ import urllib.error import urllib.parse from datetime import datetime, timezone + +# Quality gate integration (#627) +try: + from scripts.task_gate import pre_task_gate, post_task_gate + QUALITY_GATE_AVAILABLE = True +except ImportError: + QUALITY_GATE_AVAILABLE = False + print('[WARN] task_gate not available -- quality checks disabled') + +# Pipeline statistics +PIPELINE_STATS = {"gate_pass": 0, "gate_fail": 0, "gate_warn": 0, "requeued": 0} + # --------------------------------------------------------------------------- # CONFIG # --------------------------------------------------------------------------- @@ -531,6 +543,11 @@ def generate_report(backlog, dispatched, skipped, agent_status, dry_run=False): # Top 5 unassigned unassigned = [i for i in backlog if not i["assignees"]][:5] lines.append("-- Top 5 Unassigned (by priority) --") + # Quality gate statistics (#627) + if any(PIPELINE_STATS.values()): + lines.append("-- Quality Gate --") + lines.append(f" Passed: {PIPELINE_STATS['gate_pass']} | Failed: {PIPELINE_STATS['gate_fail']} | Warnings: {PIPELINE_STATS['gate_warn']}") + lines.append("") for i in unassigned: lines.append(f" [{i['score']}] {i['repo']}#{i['number']}: {i['title'][:55]}") lines.append("")