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, not polarity, and/or trees and trigger lines the stdlib-only Python runtime needs to map sys.monitoring events back onto those obligations. 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. Leaves are condition indexes. A negated node models not (a and b): CPython still emits one jump per operand, so the operands stay separate conditions and the negation applies to the node’s result.
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.