code wiki / (root) / nx_maint_action.nx

nx_maint_action.nx

buildroot/runtime/nx_maint_action.nx

7685 B191 linesdepth 3pulls 8 transitivereach 9 importersview sourcekind librarytopic maint
docsdependenciesstructsconstsfunctions

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

nx_maint_unify.nx nx_maint_ledger.nx nx_maint_action.nx nx_maint_action_test.nx nx_maint_render.nx nx_maint_simloop.nx nx_obd_dtc.nx

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

151struct ActionPlan

consts

28const NX_ACT_NONE: i64 = 0
29const NX_ACT_MONITOR: i64 = 1
30const NX_ACT_FIX_DIY: i64 = 2
31const NX_ACT_FIX_PRO: i64 = 3
32const NX_ACT_REPLACE_CONSUMABLE: i64 = 4
33const NX_ACT_REPLACE_COMPONENT: i64 = 5
34const NX_ACT_REPLACE_UNIT: i64 = 6
35const NX_ACT_SHUTDOWN_SAFETY: i64 = 7
36const NX_ACT_N: i64 = 8
39const NX_CAUSE_NONE: i64 = 0
40const NX_CAUSE_OVERSIZED: i64 = 1
41const NX_CAUSE_DIRTY_FILTER: i64 = 2
42const NX_CAUSE_CONTROL_CAL: i64 = 3
43const NX_CAUSE_IMBALANCE: i64 = 4
44const NX_CAUSE_BEARING: i64 = 5
45const NX_CAUSE_CONSUMABLE_SPENT: i64 = 6
46const NX_CAUSE_SEAL_LEAK: i64 = 7
47const NX_CAUSE_PUMP_OR_BIGLEAK: i64 = 8
48const NX_CAUSE_CIRCUIT_LOAD: i64 = 9
49const NX_CAUSE_VOLTAGE_SUPPLY: i64 = 10
50const NX_CAUSE_SAFETY_HAZARD: i64 = 11
51const NX_CAUSE_N: i64 = 12

functions

53func nx_action_is_valid(a: i64) -> i64
called by 1: main
61func nx_action_is_diy(a: i64) -> i64
called by 2: nx_plan_formain
70func nx_act_thermal(v: i64) -> i64
called by 1: nx_action_for
76func nx_act_rot(v: i64) -> i64
called by 1: nx_action_for
82func nx_act_cons(v: i64) -> i64
called by 1: nx_action_for
88func nx_act_fluid(v: i64) -> i64
called by 1: nx_action_for
94func nx_act_elec(v: i64) -> i64
called by 1: nx_action_for
102func nx_cause_thermal(v: i64) -> i64
called by 1: nx_cause_for
108func nx_cause_rot(v: i64) -> i64
called by 1: nx_cause_for
114func nx_cause_cons(v: i64) -> i64
called by 1: nx_cause_for
120func nx_cause_fluid(v: i64) -> i64
called by 1: nx_cause_for
126func nx_cause_elec(v: i64) -> i64
called by 1: nx_cause_for
133func nx_action_for(kernel: i64, verdict: i64) -> i64
141func nx_cause_for(kernel: i64, verdict: i64) -> i64
158func nx_plan_for(kernel: i64, verdict: i64, trend: i64, out: *ActionPlan) -> i64