From cbb9907135300250c26a1f131e66f5f7a781ab34 Mon Sep 17 00:00:00 2001 From: Agent Date: Wed, 1 Apr 2026 10:12:12 +0000 Subject: [PATCH] fix: add architect-bot to FORGE_BOT_USERNAMES default and fix duplicate detection exclusion --- .woodpecker/detect-duplicates.py | 28 ++++++++++++++++++---------- lib/env.sh | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.woodpecker/detect-duplicates.py b/.woodpecker/detect-duplicates.py index cf4cb80..bd3f74a 100644 --- a/.woodpecker/detect-duplicates.py +++ b/.woodpecker/detect-duplicates.py @@ -180,11 +180,15 @@ def collect_findings(root): """ root = Path(root) # Skip architect scripts for duplicate detection (stub formulas, see #99) - EXCLUDED_FILES = {"architect/architect-run.sh"} - sh_files = sorted( - p for p in root.rglob("*.sh") - if ".git" not in p.parts and str(p) not in EXCLUDED_FILES - ) + EXCLUDED_SUFFIXES = ("architect/architect-run.sh",) + + def is_excluded(p): + """Check if path should be excluded by suffix match.""" + return p.suffix == ".sh" and ".git" not in p.parts and any( + str(p).endswith(suffix) for suffix in EXCLUDED_SUFFIXES + ) + + sh_files = sorted(p for p in root.rglob("*.sh") if not is_excluded(p)) ap_hits = check_anti_patterns(sh_files) dup_groups = check_duplicates(sh_files) @@ -242,11 +246,15 @@ def print_duplicates(groups, label=""): def main() -> int: # Skip architect scripts for duplicate detection (stub formulas, see #99) - EXCLUDED_FILES = {"architect/architect-run.sh"} - sh_files = sorted( - p for p in Path(".").rglob("*.sh") - if ".git" not in p.parts and str(p) not in EXCLUDED_FILES - ) + EXCLUDED_SUFFIXES = ("architect/architect-run.sh",) + + def is_excluded(p): + """Check if path should be excluded by suffix match.""" + return p.suffix == ".sh" and ".git" not in p.parts and any( + str(p).endswith(suffix) for suffix in EXCLUDED_SUFFIXES + ) + + sh_files = sorted(p for p in Path(".").rglob("*.sh") if not is_excluded(p)) if not sh_files: print("No .sh files found.") diff --git a/lib/env.sh b/lib/env.sh index 33d7737..cc0906c 100755 --- a/lib/env.sh +++ b/lib/env.sh @@ -98,7 +98,7 @@ export FORGE_PREDICTOR_TOKEN="${FORGE_PREDICTOR_TOKEN:-${FORGE_TOKEN}}" export FORGE_ARCHITECT_TOKEN="${FORGE_ARCHITECT_TOKEN:-${FORGE_TOKEN}}" # Bot usernames filter: FORGE_BOT_USERNAMES > legacy CODEBERG_BOT_USERNAMES -export FORGE_BOT_USERNAMES="${FORGE_BOT_USERNAMES:-${CODEBERG_BOT_USERNAMES:-dev-bot,review-bot,planner-bot,gardener-bot,vault-bot,supervisor-bot,predictor-bot}}" +export FORGE_BOT_USERNAMES="${FORGE_BOT_USERNAMES:-${CODEBERG_BOT_USERNAMES:-dev-bot,review-bot,planner-bot,gardener-bot,vault-bot,supervisor-bot,predictor-bot,architect-bot}}" export CODEBERG_BOT_USERNAMES="${FORGE_BOT_USERNAMES}" # backwards compat # Project config (FORGE_* preferred, CODEBERG_* fallback)