Commit 422ab04
authored
test(domains): cross-pack domain-validation lane (#482)
Adds tests/test_domain_validation_lane.py: a cross-cutting suite for the
eight domain packs, covering the properties that only show up when packs
are compared with one another or handed input they were never meant to see.
What it pins:
- every pack scores 1.0 on its own good frame, and the engine's reported
layer/severity/check/repair for every rule matches its rules.yaml entry;
- all declared numeric and length bounds are inclusive (lat/lon, Modbus
register, soil pH's two nested bands, description length, runtime);
- an 8x8 wrong-domain matrix: only the diagonal validates, everything
off-diagonal is trust 0.0 / passed False;
- no rule ever reports "passed" for a field that is absent, swept over
every mapped column of every pack;
- the exact arithmetic of _trust_score, per severity weight, plus three
measured reasons the score is not comparable across domains;
- subset-based reference sets never silently rewrite an unrecognised
value (coerce logs "unresolvable");
- version / schema_version reach ValidationReport for all eight packs;
- run_domain never mutates its input, verified with a SHA-256 digest over
columns, index, dtypes and values, on both the unique and non-unique
index paths.
Behaviours the tests record as findings (current behaviour asserted, so a
deliberate fix has one obvious place to update):
- _check_regex stringifies a float64 column as "10000266.0", so FIN-008
and GS1-008 raise false findings for a CSV column with one blank cell,
although retail/_integral_float_text already solves exactly this;
- FIN-006 declares tolerance 0.01 but compares raw binary floats, so a
one-cent imbalance is never within tolerance;
- retail, energy and agriculture report "absent from our documented
subset" as error severity where healthcare reports it as a warning;
- MISSING_REQUIRED_FIELD is an in-band row-label sentinel, so a frame
indexed by that literal string mis-scores;
- a column_map entry naming an absent column or an unknown canonical
field is silently ignored;
- healthcare's describe() has no schema_version before resource detection.1 parent f47d36d commit 422ab04
1 file changed
Lines changed: 1173 additions & 0 deletions
0 commit comments