Expand description
Validated PV/MV range types – the boundary a live OPC DA read or a CLI flag override
must pass through before an untrusted number is treated as a range with a known,
trustworthy shape (finite bounds, correctly ordered, non-zero span). See AGENTS.md’s
“Live-plant safety hardening” section for the review finding this closes (--cycles-count 0 panicking mid-run was the same finding’s other symptom: no externally supplied number
reached the engine validated).
PvRange and MvRange both still expose plain public fields and can be constructed
directly with a struct literal – deliberately, since that’s how already-trusted values
(test fixtures, values reloaded from bhtune-db that were already validated once before
being stored) are constructed elsewhere in the codebase. PvRange::new/MvRange::new
are the validating constructors: the ones any caller reading a number from a live
driver or an external CLI flag/config value must go through.
Structs§
- MvRange
- MV range floor/ceiling (
MvMSL/MvMSHin the legacy app) – the boundscrate::mrft::clamp_relay_amplitudeclamps the relay step within, and the range an initial MV reading must fall inside before a test can safely begin stroking it. - PvRange
- PV scale range, read once before the test starts (
PvSH/PvSLin the legacy app’sReadInitialOPCvalues) – distinct fromMvRange, used only to express the oscillation amplitude as a percentage incore-tuning-math::measure_oscillation.
Enums§
- Range
Error - Why
PvRange::new/MvRange::newrejected a range.