nx_maint_ingest.nx
buildroot/runtime/nx_maint_ingest.nx
about
nx_maint_ingest.nx -- the HARDWARE-facing ingest rung (R1) of the maintenance
platform. Turns a raw sensor reading from ANY source into the normalized,
typed sample the physics kernels consume, and routes each sensor KIND to its
kernel. This is the rung the 5 kernels were floating above -- it closes the
hardware -> kernel path (R0 driver -> R1 ingest -> R2 kernel).
Operator (2026-06-23): build the platform "from the hardware rung up, each
rung." Sensing doctrine (operator-chosen): sovereign-DIY PREFERRED, support
any source (Emporia/Sense/OBD/manual) vendor-agnostically; UNKNOWN is
first-class (recorded for later, never dropped) -- the IoT-brain doctrine.
NO-FLOAT: normalization is a DATA-DRIVEN affine transform (scale_num/scale_den
+ offset live in the source config #11, not hardcoded per-vendor guesses --
honest: we don't invent vendor wire formats; the per-vendor DRIVER (R0)
supplies the raw value + its scale).
NEVER-BRICK (#26): reads a value, normalizes, routes; writes nothing,
commands no sensor. Read-only by construction.
genealogy_id: project-maintenance-platform-sclass-2026-06-23 (R1 hardware-ingest rung)
license_tier: ORIGINAL
nx_capability_claims:
needs: [pointer_arithmetic]
provides: [vendor_agnostic_sensor_ingest, kind_to_kernel_routing,
data_driven_normalize, unknown_sensor_first_class]
safety: [no_floating_point, no_syscall, bounded_iteration,
read_only_no_device_write, no_firmware_write_by_construction,
sealed_enum]
verdict: [sealed_enum, no_silent_failure, unknown_recorded_not_dropped]
license: ORIGINAL
kind: maintenance_runtime_primitive
dependencies 0 imports · 2 importers
imports: none
imported by: nx_maint_ingest_test.nxnx_maint_unify.nx
structs
| 75 | struct SensorReading |
| 85 | struct NormSample |
consts
| 35 | const NX_SENSOR_UNKNOWN: i64 = 0 |
| 36 | const NX_SENSOR_TEMP: i64 = 1 |
| 37 | const NX_SENSOR_CURRENT: i64 = 2 |
| 38 | const NX_SENSOR_VOLTAGE: i64 = 3 |
| 39 | const NX_SENSOR_VIBRATION: i64 = 4 |
| 40 | const NX_SENSOR_PRESSURE: i64 = 5 |
| 41 | const NX_SENSOR_FLOW: i64 = 6 |
| 42 | const NX_SENSOR_RUNTIME: i64 = 7 |
| 43 | const NX_SENSOR_USAGE: i64 = 8 |
| 44 | const NX_SENSOR_N: i64 = 9 |
| 47 | const NX_SRC_UNKNOWN: i64 = 0 |
| 48 | const NX_SRC_SOVEREIGN_DIY: i64 = 1 |
| 49 | const NX_SRC_EMPORIA: i64 = 2 |
| 50 | const NX_SRC_SENSE: i64 = 3 |
| 51 | const NX_SRC_OBD: i64 = 4 |
| 52 | const NX_SRC_MANUAL: i64 = 5 |
| 53 | const NX_SRC_N: i64 = 6 |
| 56 | const NX_MK_THERMAL: i64 = 0 |
| 57 | const NX_MK_ROTATING: i64 = 1 |
| 58 | const NX_MK_CONSUMABLE: i64 = 2 |
| 59 | const NX_MK_FLUID: i64 = 3 |
| 60 | const NX_MK_ELECTRICAL: i64 = 4 |
| 61 | const NX_MK_NONE: i64 = 9 // unrecognized kind -> no kernel (first-class) |
functions
| 63 | func nx_sensor_kind_is_valid(k: i64) -> i64 called by 1: main |
| 68 | func nx_src_is_valid(s: i64) -> i64 called by 1: main |
| 93 | func nx_maint_sensor_kernel(kind: i64) -> i64 |
| 107 | func nx_maint_ingest(r: *SensorReading, out: *NormSample) -> i64 |