Expand description
Supercov-owned Ruby obligation discovery.
Prism (Ruby’s own parser) supplies syntax and exact byte ranges. Supercov owns the denominator: every statement, method, decision and branch obligation is decided here, ahead of the run, from source alone.
Alongside the shared CoverageManifest this module emits a probe plan
for the stdlib-only Ruby runtime. Ruby’s Coverage module already reports
lines, if/unless/case/&. branches and method entry with byte
columns, so those obligations are proven by matching its keys (shifted for
the text the runtime inserts). What Coverage cannot see — the operands of
&&/|| for MC/DC, ||=, loop entry, rescue flow and a second statement
on a line — is proven by probe calls the runtime splices into the source in
memory at load time. No insertion contains a newline, so line numbers,
backtraces and the stdlib line table stay exact.
Structs§
- Branch
KeyPlan - Case
Clause Plan - Case
NoMatch Plan - Case
Plan caseclauses are tested in order, so a clause was missed exactly when a later clause (or the implicit else) was selected. The runtime derives that per phase from the selected counts.- Derived
Logical - Edit
- One text insertion the runtime applies to the original source before compiling it. Offsets are bytes into the original file; the runtime applies insertions from the end of the file backwards, so offsets stay valid.
- Handler
Target - Loop
Target - Method
KeyPlan - Plan
Span - Ruby
File Obligations - Ruby
File Plan - Ruby
Probe Plan - Stdlib
Decision - Stdlib
Key - A
Coveragebranch key: the group type (if,case,&.,while), the branch type (then,else,when,in,body) and the branch span in post-insertion coordinates.
Enums§
- Condition
Tree - Short-circuit structure of a decision. Leaves are condition indexes.
- KeyKind
- A source span in one-based lines and zero-based byte columns, the units
Ruby’s
Coveragemodule reports. Serialized as[[line, col], [line, col]]. What a stdlib key’s span names. - Probe
Target - What a probe call reports. The runtime looks the key up and records the obligations named here.
- Ruby
Instrumenter Error
Constants§
- BEGIN_
BODY_ LIMITATION - RUBY_
PROBE_ PLAN_ VERSION - RUBY_
PROBE_ RECEIVER - Global the runtime binds its probe receiver to. Chosen to be unpronounceable in application code.
Functions§
- apply_
edits - Apply a plan’s edits to the original source the way the runtime does.
- build_
ruby_ obligations - Build the complete obligation manifest and probe plan for one Ruby file.
next_probenumbers probes uniquely across the whole project.