no-dynamic-builtins
Use explicit typed state instead of dynamic Python builtin access.
Why
Dynamic namespace inspection, source compilation, and string-based attribute reads and writes hide dependencies from type checking and refactoring. The strict policy also rejects executor/debugger references that can otherwise escape their native call checks through an alias.
Fix
Pass typed state explicitly, use explicit imports and declared attributes, and keep source as data. A required compiler or plugin boundary needs a local, explained suppression.
Examples
def read(value, field): return getattr(value, field, None)from dataclasses import dataclass
@dataclass(frozen=True)class User: name: str
def read(value: User) -> str: return value.namedef model_name(settings: object) -> str: return settings.model if hasattr(settings, "model") else "default"from dataclasses import dataclass
@dataclassclass LLMSettings: model: str
def model_name(settings: LLMSettings) -> str: return settings.modelFormerly: no-hasattr