nx_maint_action.nx
buildroot/runtime/nx_maint_action.nx
about
nx_maint_action.nx -- R5: diagnosis -> action. Turns a kernel verdict + the
R4 trend into an actionable plan: probable CAUSE, recommended ACTION
(monitor / fix-DIY / fix-pro / replace consumable|component|unit / shut down),
DIY-vs-pro split (feeds the two R6 fronts), and an urgency.
Operator (2026-06-23): "from the hardware rung up each rung." This is R5 on
top of R3's unified severity + R4's trend -- it completes monitor->diagnose->ACT.
Rules that matter:
- SAFETY OVERRIDE: any verdict that unifies to SAFETY (overload, ground-
fault, overheat, burst) -> SHUTDOWN_SAFETY + call a pro, regardless of
kernel. The R3 safety guarantee drives this.
- PREDICTIVE ESCALATION: a WORSENING trend turns a "monitor" into a "fix
now" and bumps urgency -- act before failure (the R4 trend earns its keep).
(Starter maintenance playbook -- the cause/action mappings are real field
practice; in production they live in svc-config #11, refined per asset.)
NEVER-BRICK (#26): emits a recommendation; takes no action, writes nothing.
genealogy_id: project-maintenance-platform-sclass-2026-06-23 (R5 action)
license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_maint_unify.nxnx_maint_ledger.nx
imported by: nx_maint_action_test.nxnx_maint_render.nxnx_maint_simloop.nxnx_obd_dtc.nx
structs
| 151 | struct ActionPlan |
consts
| 28 | const NX_ACT_NONE: i64 = 0 |
| 29 | const NX_ACT_MONITOR: i64 = 1 |
| 30 | const NX_ACT_FIX_DIY: i64 = 2 |
| 31 | const NX_ACT_FIX_PRO: i64 = 3 |
| 32 | const NX_ACT_REPLACE_CONSUMABLE: i64 = 4 |
| 33 | const NX_ACT_REPLACE_COMPONENT: i64 = 5 |
| 34 | const NX_ACT_REPLACE_UNIT: i64 = 6 |
| 35 | const NX_ACT_SHUTDOWN_SAFETY: i64 = 7 |
| 36 | const NX_ACT_N: i64 = 8 |
| 39 | const NX_CAUSE_NONE: i64 = 0 |
| 40 | const NX_CAUSE_OVERSIZED: i64 = 1 |
| 41 | const NX_CAUSE_DIRTY_FILTER: i64 = 2 |
| 42 | const NX_CAUSE_CONTROL_CAL: i64 = 3 |
| 43 | const NX_CAUSE_IMBALANCE: i64 = 4 |
| 44 | const NX_CAUSE_BEARING: i64 = 5 |
| 45 | const NX_CAUSE_CONSUMABLE_SPENT: i64 = 6 |
| 46 | const NX_CAUSE_SEAL_LEAK: i64 = 7 |
| 47 | const NX_CAUSE_PUMP_OR_BIGLEAK: i64 = 8 |
| 48 | const NX_CAUSE_CIRCUIT_LOAD: i64 = 9 |
| 49 | const NX_CAUSE_VOLTAGE_SUPPLY: i64 = 10 |
| 50 | const NX_CAUSE_SAFETY_HAZARD: i64 = 11 |
| 51 | const NX_CAUSE_N: i64 = 12 |
functions
| 53 | func nx_action_is_valid(a: i64) -> i64 called by 1: main |
| 61 | func nx_action_is_diy(a: i64) -> i64 |
| 70 | func nx_act_thermal(v: i64) -> i64 called by 1: nx_action_for |
| 76 | func nx_act_rot(v: i64) -> i64 called by 1: nx_action_for |
| 82 | func nx_act_cons(v: i64) -> i64 called by 1: nx_action_for |
| 88 | func nx_act_fluid(v: i64) -> i64 called by 1: nx_action_for |
| 94 | func nx_act_elec(v: i64) -> i64 called by 1: nx_action_for |
| 102 | func nx_cause_thermal(v: i64) -> i64 called by 1: nx_cause_for |
| 108 | func nx_cause_rot(v: i64) -> i64 called by 1: nx_cause_for |
| 114 | func nx_cause_cons(v: i64) -> i64 called by 1: nx_cause_for |
| 120 | func nx_cause_fluid(v: i64) -> i64 called by 1: nx_cause_for |
| 126 | func nx_cause_elec(v: i64) -> i64 called by 1: nx_cause_for |
| 133 | func nx_action_for(kernel: i64, verdict: i64) -> i64 |
| 141 | func nx_cause_for(kernel: i64, verdict: i64) -> i64 called by 1: nx_plan_for calls 5: nx_cause_thermalnx_cause_rotnx_cause_consnx_cause_fluidnx_cause_elec |
| 158 | func nx_plan_for(kernel: i64, verdict: i64, trend: i64, out: *ActionPlan) -> i64 |