From d58185b8a83877db8e1f6ff0814e220983fb4728 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Sun, 3 May 2026 01:30:05 -0700 Subject: [PATCH] chore(workspace): remove dead defensive block in load_skills AST gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Self-review of PR #2553 caught an unreachable defensive block at test_load_skills_call_sites.py:99-103: the inner check guarded `call.func.__class__.__name__ == "Name"` from a FunctionDef, but `_find_load_skills_calls` already filters its return type to `ast.Call` — `FunctionDef` cannot reach that loop body. The block was a no-op `pass` with a misleading comment. Removing keeps the gate behaviorally identical; tests still pass. Same five-axis review pass that turned this up also approved the substantive logic of #2553, so no behavior change here. Co-Authored-By: Claude Opus 4.7 (1M context) --- workspace/tests/test_load_skills_call_sites.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/workspace/tests/test_load_skills_call_sites.py b/workspace/tests/test_load_skills_call_sites.py index f64d1da9..8005526e 100644 --- a/workspace/tests/test_load_skills_call_sites.py +++ b/workspace/tests/test_load_skills_call_sites.py @@ -96,11 +96,6 @@ def test_every_runtime_load_skills_call_passes_current_runtime(): continue for call in _find_load_skills_calls(tree): - if call.func.__class__.__name__ == "Name" and call.func.id == "load_skills": - # Skip the function DEFINITION itself (it appears as a - # FunctionDef, not a Call — but the Call check ensures - # we only trip on actual invocations). Defensive. - pass if not _has_current_runtime_kwarg(call): violations.append((py.relative_to(WORKSPACE_DIR.parent), call.lineno))