chore(workspace): remove dead defensive block in load_skills AST gate

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) <noreply@anthropic.com>
This commit is contained in:
Hongming Wang 2026-05-03 01:30:05 -07:00
parent 3c0f7de4b9
commit d58185b8a8

View File

@ -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))