code wiki / (root) / nx_maint_rul.nx

nx_maint_rul.nx

buildroot/runtime/nx_maint_rul.nx

4048 B108 linesdepth 0pulls 0 transitivereach 3 importersview sourcekind librarytopic maint
docsdependenciesstructsconstsfunctions

about

nx_maint_rul.nx -- remaining-useful-life (RUL) PROGNOSTICS: the learning loop's prediction. From an asset's health-metric HISTORY (the R4 ledger), estimate the wear rate (first-order system identification) and PREDICT time-to-failure, so the platform acts BEFORE failure -- proactive, not reactive. Operator (2026-06-23): "full learning loop ... close the feedback loops on physical things for wear and tear." Researcher-grounded (knowledge/fetched/ maint_c_prognostics, maint_c_condmon, maint_e_sysid, maint_e_bathtub): prognostics/RUL estimate condition + remaining life from the trend. THE EXCEED: OBD / Sense report the PRESENT (reactive -- "it's broken now"). We predict the FUTURE from the trend (proactive -- "it will hit failure in ~N"). Augury does this at enterprise price/cloud; we do it sovereign + cheap + broad. Method (integer/no-float): wear_rate = decline / span (first-order); RUL = (current - failure_threshold) / wear_rate. A flat/improving trend -> STABLE (no predicted failure). Honest: first-order linear extrapolation; nonlinear degradation (bathtub end-of-life knee) + Kalman state estimation = next. NEVER-BRICK (#26): reads a metric series, predicts; no syscalls, no writes. genealogy_id: project-maintenance-platform-sclass-2026-06-23 (RUL prognostics; researcher-grounded) license_tier: ORIGINAL

dependencies 0 imports · 2 importers

nx_maint_rul.nx nx_maint_rul_test.nx nx_maint_simpage.nx

imports: none

imported by: nx_maint_rul_test.nxnx_maint_simpage.nx

structs

41struct RulSpec
48struct RulEst

consts

25const NX_RUL_INSUFFICIENT: i64 = 0
26const NX_RUL_STABLE: i64 = 1 // not wearing -> no predicted failure
27const NX_RUL_PLENTY: i64 = 2 // long life remaining
28const NX_RUL_PLAN: i64 = 3 // plan the maintenance
29const NX_RUL_SOON: i64 = 4 // schedule soon
30const NX_RUL_IMMINENT: i64 = 5 // failure imminent
31const NX_RUL_FAILED: i64 = 6 // already past the failure threshold
32const NX_RUL_BAD_ARG: i64 = 7
33const NX_RUL_N: i64 = 8

functions

35func nx_rul_verdict_is_valid(v: i64) -> i64
called by 1: main
57func nx_rul_estimate(metric: *i64, t: *i64, n: i64, spec: *RulSpec, out: *RulEst) -> i64
called by 2: mainmain