Expand description
World-effect detection: classifies effectful Python calls (fs/net/db, process
control, env read/write, concurrency, time, random, logging, stdin) plus bare
assert/raise statements, emitting an Effect per signal.
This is the libcst analog of fxrank-lang-rust/fxrank-lang-ts’s
detect/calls.rs. It does not own traversal — the walk_own_body driver
in detect/mod.rs decides which nodes are evaluated in the enclosing body and
calls back through the EffectSink trait; this module classifies and pushes.
§Resolution
A call’s callee is rendered to a dotted string (os.getenv, requests.get).
The leading root name is resolved through Imports so an aliased import
(import numpy as np) maps back to its module, and the import a.b.c root-key
convention is honored (root a → "a.b.c"). Bare builtins (open, input,
print) need no import. Method-name-only signals (.commit(), .to_csv()) are
receiver-type-unknown → Heuristic.
Functions§
- detect
- Detect world effects (IO, process, env, time, random, logging, panic) charged to
unit’s own body, per the driver’s attribution rules.