code wiki / (root) / nx_ac_sensor_verify.nx

nx_ac_sensor_verify.nx

buildroot/runtime/nx_ac_sensor_verify.nx

12798 B291 linesdepth 2pulls 3 transitivereach 7 importersview sourcekind librarytopic ac
docsdependenciesstructsconstsfunctions

about

nx_ac_sensor_verify.nx -- the reading-level LIAR-KILLER: the trust backbone of the sovereign AC monitoring product. Operator: monitoring "as a liar killer ... for a real product." A monitor is only worth trusting if a reading that is physically impossible, or that a second independent sensor contradicts, is REJECTED before it drives an alert (or silently HIDES a fault). This organ stamps every reading bundle with a sealed-enum trust verdict + a machine-readable reason, and surfaces the derived telemetry (superheat / subcool / split / COP / Carnot / capacity). TWO INDEPENDENT DISCIPLINES (both required for SOTA-grade trust): A. PHYSICS INVARIANTS -- a reading that violates thermodynamics cannot be trusted no matter how confident the sensor is: 1 humidity reading outside 0..100% RH (impossible sensor value) 2 supply-air enthalpy > return-air enthalpy while drawing power in cooling mode (the evaporator cannot ADD enthalpy -> swapped sensors) 3 refrigerant superheat far below 0 (flooded coil / bad probe) 4 refrigerant subcooling far below 0 5 measured COP above the Carnot ceiling Tc/(Th-Tc) (thermodynamically impossible -> a spoofed/miswired power or flow sensor) 7 condenser liquid-line colder than outdoor ambient (heat cannot flow from cold to hot -> impossible) B. CROSS-SENSOR INDEPENDENCE (the nx_research_crossval discipline applied to physical sensors): a second reading corroborates ONLY if it comes from a DISTINCT source (same-source echo != corroboration); independent disagreement is surfaced as CONFLICTED, never silently averaged. The FDD verdict (short-cycling / degraded / etc.) is a SEPARATE organ (nx_hvac_efficiency): this one asks only "can this reading be trusted?", not "is the equipment healthy?". A plausible-but-faulty reading (e.g. compressor drawing power yet delivering ~0 cooling) PASSES the liar-killer (it is physically self-consistent) and is classified downstream by the FDD. NO-FLOAT integer; NO syscalls (deterministic, canned-input gateable). NEVER-BRICK #26: read-only, no device/firmware write. genealogy_id: project-hvac-efficiency-sclass-2026-06-23 + project-nishi-verification-stack-sota-2026-07-14 (crossval independence) + project-nishi-sensor-gap-census-2026-07-14 (liar-killer axis-1) license_tier: ORIGINAL

dependencies 3 imports · 3 importers

nx_hvac_efficiency.nx nx_psychrometrics.nx nx_ac_enthalpy_metrics.nx nx_ac_sensor_verify.nx nx_ac_monitor.nx nx_ac_monitor_census.nx nx_ac_sensor_verify_test.nx

imports: nx_hvac_efficiency.nxnx_psychrometrics.nxnx_ac_enthalpy_metrics.nx

imported by: nx_ac_monitor.nxnx_ac_monitor_census.nxnx_ac_sensor_verify_test.nx

structs

81struct AcReading
102struct AcVerify

consts

58const NX_MAGIC_1200: i64 = 1200
61const NX_ACV_ABSENT: i64 = -1000000
64const NX_ACV_INSUFFICIENT_DATA: i64 = 0
65const NX_ACV_PLAUSIBLE: i64 = 1 // physics OK, single source
66const NX_ACV_CORROBORATED: i64 = 2 // physics OK + independent agreement
67const NX_ACV_IMPLAUSIBLE_PHYSICS: i64 = 3 // a hard invariant violated
68const NX_ACV_CONFLICTED: i64 = 4 // independent sensors disagree
69const NX_ACV_BAD_ARG: i64 = 5 // non-cooling mode / bad args
70const NX_ACV_N: i64 = 6
115const NX_ACV_R_NONE: i64 = 0
116const NX_ACV_R_RH_RANGE: i64 = 1 // humidity outside 0..100%
117const NX_ACV_R_REVERSED: i64 = 2 // supply enthalpy > return under power
118const NX_ACV_R_SUPERHEAT: i64 = 3 // superheat far below 0
119const NX_ACV_R_SUBCOOL: i64 = 4 // subcooling far below 0
120const NX_ACV_R_CARNOT: i64 = 5 // COP above Carnot ceiling
121const NX_ACV_R_LIQUID_AMB: i64 = 7 // liquid line colder than ambient
122const NX_ACV_R_CONFLICT: i64 = 8 // independent sensors disagree

functions

72func nx_acv_verdict_is_valid(v: i64) -> i64
called by 1: main
129func nx_acv_corroborate(a_val: i64, a_src: i64, b_val: i64, b_src: i64, tol: i64) -> i64
called by 1: nx_acv_verify
140func nx_acv_verify(r: *AcReading, out: *AcVerify) -> i64