fix(engine): loader rejects non-numeric vector elements (parity with mutation)

Replace the FixedSizeList arm's as_f64().unwrap_or(0.0) coercion with a
loud per-row OmniError::manifest in the loader's own style (property
name included, mutation path's "elements must be numeric" phrasing).
The red test turns green; the whole validators suite stays green.

Closes iss-loader-vector-element-coercion.
This commit is contained in:
aaltshuler 2026-07-05 05:07:59 +03:00 committed by Andrew Altshuler
parent abc92998bb
commit fd32460eac

View file

@ -907,9 +907,18 @@ fn build_column_from_json(
)));
}
for val in arr {
builder
.values()
.append_value(val.as_f64().unwrap_or(0.0) as f32);
// Parity with the mutation path: non-numeric elements
// (null — what json! emits for a non-finite float —
// strings, bools) are rejected loudly, never coerced
// to 0.0, which would silently corrupt the vector's
// direction while passing every dimension check.
let Some(v) = val.as_f64() else {
return Err(OmniError::manifest(format!(
"vector property '{}' elements must be numeric, got {}",
name, val
)));
};
builder.values().append_value(v as f32);
}
builder.append(true);
} else if nullable {