code wiki / (root) / nx_ac_monitor.nx

nx_ac_monitor.nx

buildroot/runtime/nx_ac_monitor.nx

6003 B148 linesdepth 3pulls 5 transitivereach 4 importersview sourcekind librarytopic ac
docsdependenciesstructsconstsfunctions

about

nx_ac_monitor.nx -- the PRODUCT BRAIN: one call takes a raw sensor reading and produces the full trustworthy monitoring assessment, with the LIAR-KILLER GATING the diagnosis. THE THESIS IN CODE (operator: "monitoring as a liar killer"): the reading is first stamped by nx_ac_sensor_verify. ONLY a PLAUSIBLE or CORROBORATED reading is allowed to drive a fault verdict or an alert. An impossible or self-contradicting reading returns alert = UNTRUSTED and emits NO fault -- the monitor structurally CANNOT raise a false alarm from a lying sensor, nor silently hide a real one behind a bad reading. Pipeline: reading -> [TRUST gate] -> derive superheat/subcool/split/... -> FDD verdict (nx_ac_fdd) + efficiency drift vs baseline COP -> single sealed alert level (OK / INFO / WARN / CRITICAL / UNTRUSTED) PURE (no syscalls): the caller owns all scratch structs (allocate once, reuse across readings -> daemon-safe, no per-reading allocation). Deterministic -> hard-gateable. NEVER-BRICK #26: read-only advisory, no device/firmware write. genealogy_id: project-hvac-efficiency-sclass-2026-06-23 (R5 unified monitor) + project-nishi-verification-stack-sota-2026-07-14 (trust-gates-output) license_tier: ORIGINAL nx_capability_claims: needs: [nx_ac_sensor_verify, nx_ac_fdd] provides: [unified_ac_monitor, liar_killer_gates_diagnosis, trustworthy_alerting, efficiency_drift_alert, sealed_alert_level] safety: [no_floating_point, no_syscall, bounded_iteration, read_only_no_device_write, sealed_enum_verdict, untrusted_reading_emits_no_fault] verdict: [sealed_enum_alert, no_silent_failure, trust_gates_output] license: ORIGINAL kind: iot_runtime_primitive sss: [S0 (bit-equal), S6 (no cloud), S7 (sealed verdict)]

dependencies 2 imports · 2 importers

nx_ac_sensor_verify.nx nx_ac_fdd.nx nx_ac_monitor.nx nx_ac_monitor_page.nx nx_ac_monitor_test.nx

imports: nx_ac_sensor_verify.nxnx_ac_fdd.nx

imported by: nx_ac_monitor_page.nxnx_ac_monitor_test.nx

structs

54struct MonitorResult

consts

40const NX_ALERT_OK: i64 = 0
41const NX_ALERT_INFO: i64 = 1
42const NX_ALERT_WARN: i64 = 2
43const NX_ALERT_CRITICAL: i64 = 3
44const NX_ALERT_UNTRUSTED: i64 = 4
45const NX_ALERT_N: i64 = 5

functions

47func nx_alert_is_valid(v: i64) -> i64
called by 1: main
67func nx_ac_monitor(rd: *AcReading, av: *AcVerify, fin: *FddInput, fth: *FddThresh,