Rule files are YAML with embedded R expressions for complex logic. The
top-level key checks holds a list of rules; each rule has
id, type, an optional severity and
dimension, and type-specific fields: range
(variable, min/max), set (variable,
values), expr (an R expression evaluated per record in a
restricted environment), skip_logic (when
{variable, equals} and then_not_required, marking
skipped items as not administered for the missing-items detector), or a
detector type (missing_items, straightlining,
response_time, trap_items, score_anomaly) whose
fields are passed to the matching detect_*() function.