requireDouble method
Returns the number at key as a double; throws if missing or
non-numeric.
Implementation
double requireDouble(Map<Object?, Object?> node, String key, String path) {
final v = node[key];
if (v == null) {
_fail('Missing required field: $path');
}
if (v is num) return v.toDouble();
_fail('$path must be a number (got ${v.runtimeType}).');
}