From 97071bc0ed77d9e1f2f91011bbea9e1f6f989d2d Mon Sep 17 00:00:00 2001 From: RaghavChamadiya Date: Mon, 22 Jun 2026 23:31:19 +0530 Subject: [PATCH 1/2] test: clean fixture + bot health-gate config for smoke test --- .repowise/bot.yaml | 9 +++++++++ scratch/health_gate_smoke/tidy.py | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .repowise/bot.yaml create mode 100644 scratch/health_gate_smoke/tidy.py diff --git a/.repowise/bot.yaml b/.repowise/bot.yaml new file mode 100644 index 000000000..2caf913f5 --- /dev/null +++ b/.repowise/bot.yaml @@ -0,0 +1,9 @@ +# Smoke-test config for the Repowise bot health gate (throwaway PR). +bot: + comment_mode: always + health_gate: + mode: blocking + repo_drop_block: 0.3 + min_new_file_score: 7.0 + block_on_introduced: true + block_ai_regression: true diff --git a/scratch/health_gate_smoke/tidy.py b/scratch/health_gate_smoke/tidy.py new file mode 100644 index 000000000..5e37689d0 --- /dev/null +++ b/scratch/health_gate_smoke/tidy.py @@ -0,0 +1,17 @@ +"""Smoke-test fixture: a clean, healthy module (human-authored side). + +Part of a throwaway PR to exercise the Repowise bot health gate. Safe to +delete; not imported anywhere. +""" + +from __future__ import annotations + + +def add(a: int, b: int) -> int: + """Return the sum of two integers.""" + return a + b + + +def greet(name: str) -> str: + """Return a friendly greeting.""" + return f"Hello, {name}!" From 79ee24cbc3fdf0ebd42601747570b1c7e0c477b9 Mon Sep 17 00:00:00 2001 From: RaghavChamadiya Date: Mon, 22 Jun 2026 23:31:19 +0530 Subject: [PATCH 2/2] test: add deliberately unhealthy fixture Generated with Claude Code --- scratch/health_gate_smoke/messy.py | 71 ++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 scratch/health_gate_smoke/messy.py diff --git a/scratch/health_gate_smoke/messy.py b/scratch/health_gate_smoke/messy.py new file mode 100644 index 000000000..270946373 --- /dev/null +++ b/scratch/health_gate_smoke/messy.py @@ -0,0 +1,71 @@ +"""Smoke-test fixture: a deliberately unhealthy module (AI-authored side). + +Part of a throwaway PR to exercise the Repowise bot health gate. This function +is intentionally gnarly (high cyclomatic complexity, deep nesting, long body, +compound conditionals) so it scores poorly and trips several biomarkers. Safe +to delete; not imported anywhere. +""" + +from __future__ import annotations + + +def process(mode, a, b, c, d, e, flags): # noqa: C901 - intentionally complex + total = 0 + for i in range(a): + if mode == "x" and flags and (a > b or c < d): + for j in range(b): + if j % 2 == 0 and c > 0: + if d > e or (a + b) > (c + d): + if e > 0 and flags: + if a > 1 and b > 1 and c > 1: + total += i * j + elif a < 0 or b < 0 or c < 0: + total -= i + else: + total += 1 + else: + total += 2 + elif d < e: + total -= j + else: + total += 3 + elif j % 3 == 0: + total += j + else: + total -= 1 + elif mode == "y": + if a == 1: + total += 10 + elif a == 2: + total += 20 + elif a == 3: + total += 30 + elif a == 4: + total += 40 + elif a == 5: + total += 50 + elif a == 6: + total += 60 + else: + total += 70 + elif mode == "z" and (b > c or d > e): + if c == 0: + total += 100 + elif c == 1: + total += 200 + elif c == 2: + total += 300 + else: + total += 400 + elif mode == "w": + total += a + b + c + d + e + else: + if flags and a: + total += 1 + elif b and c: + total += 2 + elif d and e: + total += 3 + else: + total -= 5 + return total