code wiki / (root) / nx_maint_ingest.nx

nx_maint_ingest.nx

buildroot/runtime/nx_maint_ingest.nx

4914 B126 linesdepth 0pulls 0 transitivereach 15 importersview sourcekind librarytopic maint
docsdependenciesstructsconstsfunctions

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

nx_maint_ingest.nx nx_maint_ingest_test.nx nx_maint_unify.nx

imports: none

imported by: nx_maint_ingest_test.nxnx_maint_unify.nx

structs

75struct SensorReading
85struct NormSample

consts

35const NX_SENSOR_UNKNOWN: i64 = 0
36const NX_SENSOR_TEMP: i64 = 1
37const NX_SENSOR_CURRENT: i64 = 2
38const NX_SENSOR_VOLTAGE: i64 = 3
39const NX_SENSOR_VIBRATION: i64 = 4
40const NX_SENSOR_PRESSURE: i64 = 5
41const NX_SENSOR_FLOW: i64 = 6
42const NX_SENSOR_RUNTIME: i64 = 7
43const NX_SENSOR_USAGE: i64 = 8
44const NX_SENSOR_N: i64 = 9
47const NX_SRC_UNKNOWN: i64 = 0
48const NX_SRC_SOVEREIGN_DIY: i64 = 1
49const NX_SRC_EMPORIA: i64 = 2
50const NX_SRC_SENSE: i64 = 3
51const NX_SRC_OBD: i64 = 4
52const NX_SRC_MANUAL: i64 = 5
53const NX_SRC_N: i64 = 6
56const NX_MK_THERMAL: i64 = 0
57const NX_MK_ROTATING: i64 = 1
58const NX_MK_CONSUMABLE: i64 = 2
59const NX_MK_FLUID: i64 = 3
60const NX_MK_ELECTRICAL: i64 = 4
61const NX_MK_NONE: i64 = 9 // unrecognized kind -> no kernel (first-class)

functions

63func nx_sensor_kind_is_valid(k: i64) -> i64
called by 1: main
68func nx_src_is_valid(s: i64) -> i64
called by 1: main
93func nx_maint_sensor_kernel(kind: i64) -> i64
called by 2: nx_maint_ingestmain
107func nx_maint_ingest(r: *SensorReading, out: *NormSample) -> i64
called by 1: main calls 1: nx_maint_sensor_kernel