mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Per review (Khalim): lift the full-SAP detection out of the SAP-Schema-16.x branch into a single top-level gate in from_api_response, and key it on the gov-API's own assessment_type declaration rather than the structural sap_opening_types proxy. - _is_full_sap_assessment(data): assessment_type == "SAP" — the authoritative SAP-vs-RdSAP classification. Verified to separate the entire fixture corpus: every full-SAP schema (SAP-Schema-17.x/18.x + the broken LIG 16.x) is "SAP"; every reduced cert (RdSAP-Schema-* and reduced SAP-Schema-16.x, incl. sap_16_0.json) is "RdSAP". data_type / sap_opening_types agree but are derived shape artifacts; assessment_type is the meaning. - A cert that is full-SAP by assessment_type but whose schema_type LABEL is not a recognised full-SAP schema is a *broken schema type* (label disagrees with the assessment). _record_broken_schema_type logs it — visible, not silently rerouted — so unreliable labels surface and coverage grows as new mislabels appear. Generalises beyond 16.x to any future mislabel. - _from_full_sap maps it via the full-SAP 17.1 mapper (real measured openings, no defaulting; only `tenure` defaulted). Correctly-labelled full-SAP certs keep their dedicated branches (one-mapper-per-schema convention); reduced certs are unchanged. Tests: broken cert routed AND recorded; correctly-labelled full-SAP not recorded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| epc | ||
| __init__.py | ||
| datatypes.py | ||
| enums.py | ||