From 1b8ec9cf148efbbd55f3b331cac99b9c1c5c9e1c Mon Sep 17 00:00:00 2001 From: RaghavChamadiya Date: Tue, 19 May 2026 20:07:32 +0530 Subject: [PATCH 1/4] test(bot): add high-CCN function to exercise PR bot analyzer --- harness/metrics.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/harness/metrics.py b/harness/metrics.py index 22dbd9c..ab6eaa1 100644 --- a/harness/metrics.py +++ b/harness/metrics.py @@ -274,3 +274,41 @@ def save(self, task_id: str, condition: str, output: dict) -> str: with open(path, "w", encoding="utf-8") as f: json.dump(output, f, indent=2, default=str) return str(path) + + +def categorize_run_outcome(metrics, thresholds=None, allow_partial=False, strict=False): + """Bucket a run into a verbose outcome label. + + Intentionally branchy — used by the Repowise PR bot's Phase 2 smoke test to + verify that the health analyzer flags rising cyclomatic complexity. + """ + t = thresholds or {} + if metrics is None: + return "unknown" + if getattr(metrics, "resolved", None) is True: + if metrics.total_tokens > t.get("token_ceiling", 100000): + return "resolved_expensive" + if metrics.num_tool_calls > t.get("tools_ceiling", 50): + if strict: + return "resolved_thrashy_strict" + return "resolved_thrashy" + if allow_partial and not metrics.answer: + return "resolved_no_answer" + if metrics.cache_read_tokens and metrics.cache_write_tokens: + if metrics.cache_read_tokens > metrics.cache_write_tokens: + return "resolved_cache_hot" + return "resolved_cache_cold" + return "resolved" + if getattr(metrics, "resolved", None) is False: + if strict and metrics.judge_scores: + return "failed_judged" + if metrics.output_tokens == 0: + return "failed_silent" + if allow_partial: + return "failed_partial" + return "failed" + if metrics.answer: + return "answered_no_verdict" + if metrics.num_tool_calls > 0: + return "in_progress" + return "noop" From 476a776b1407fecc41fee309d7c0efcbab22ec0d Mon Sep 17 00:00:00 2001 From: RaghavChamadiya Date: Tue, 19 May 2026 20:10:04 +0530 Subject: [PATCH 2/4] trigger: resync PR for bot smoke From 241381e7a6cf8350c6b4f0051b0992494423a999 Mon Sep 17 00:00:00 2001 From: RaghavChamadiya Date: Tue, 19 May 2026 20:11:57 +0530 Subject: [PATCH 3/4] trigger: second resync From 971e1479a087849b40e9895f994deacd0292aac0 Mon Sep 17 00:00:00 2001 From: RaghavChamadiya Date: Tue, 19 May 2026 22:47:33 +0530 Subject: [PATCH 4/4] trigger: webhook URL change smoke