Skip to main content

Module python_instrumenter

Module python_instrumenter 

Source
Expand description

Supercov-owned Python obligation discovery.

Ruff’s Rust parser supplies syntax and exact byte ranges. Supercov owns the denominator: every statement, function, decision and branch obligation is decided here, ahead of the run, from source alone. Alongside the shared CoverageManifest this module emits a probe plan: the source spans and not polarity the stdlib-only Python runtime needs to place a probe for each obligation in the measured modules as they are imported. The runtime never decides what counts; it only reports what it observed.

Structs§

ConditionPlan
DecisionPlan
FunctionPlan
HandlerPlan
LogicalPlan
LoopPlan
MatchCasePlan
MatchNoCasePlan
MatchPlan
PlanSpan
A source span in one-based lines and zero-based UTF-8 byte columns, the same units CPython reports through co_positions(). Serialized as [[line, column], [line, column]] so the runtime unpacks it directly.
PythonFileObligations
PythonFilePlan
PythonProbePlan
StatementPlan
TryPlan

Enums§

ConditionTree
Short-circuit structure of a decision, while the plan is built: leaves are condition indexes, and a negated node models not (a and b), whose operands stay separate conditions. Each BoolOp’s logical branches are derived from it; the runtime never sees the tree itself.
PythonInstrumenterError

Constants§

PYTHON_PROBE_PLAN_VERSION

Functions§

build_python_manifest
Manifest-only view kept for callers that predate the probe plan.
build_python_obligations
Build the complete obligation manifest and runtime probe plan for one Python source file. Limitations are per file; the run-level frontend deduplicates their IDs across files.