nx_consumable.nx
buildroot/runtime/nx_consumable.nx
about
nx_consumable.nx -- consumable-depletion kernel (#3 of the 4 physics kernels).
The "REPLACE" intelligence: severity-weighted cumulative consumption vs the
consumable's rated life -> remaining life + a replace verdict, for engine
oil / brake pads / air+oil+water filters / printer toner / etc.
THE EXCEED (independent + condition-aware): an OEM gives a FIXED interval
("change oil every 8000") and a smart-monitor gives a vendor black box. We
track ACTUAL severity-weighted consumption -> gentle highway use EXTENDS life
(don't waste money replacing early); severe stop-and-go / towing / dust
SHORTENS it (replace before damage). SAME mileage, opposite verdict by
measured duty. Generalizes the printer-toner ledger (measure real coverage,
ignore the lying gauge) to every consumable.
NEVER-BRICK (#26): reads usage, emits a verdict; writes nothing. Read-only.
genealogy_id: project-maintenance-platform-sclass-2026-06-23 (kernel #3) + printer-toner ledger
license_tier: ORIGINAL
nx_capability_claims:
needs: [pointer_arithmetic]
provides: [consumable_remaining_life, severity_weighted_consumption,
condition_aware_replace_verdict, vendor_independent_interval]
safety: [no_floating_point, no_syscall, bounded_iteration,
read_only_no_device_write, no_firmware_write_by_construction,
sealed_enum_verdict]
verdict: [sealed_enum_cons, no_silent_failure]
license: ORIGINAL
kind: maintenance_runtime_primitive
dependencies 0 imports · 3 importers
imports: none
imported by: nx_batt_intake_test.nxnx_consumable_test.nxnx_maint_unify.nx
structs
| 45 | struct ConsSpec |
| 51 | struct ConsEff |
consts
| 30 | const NX_CONS_INSUFFICIENT_DATA: i64 = 0 |
| 31 | const NX_CONS_OK: i64 = 1 // healthy remaining life |
| 32 | const NX_CONS_DUE_SOON: i64 = 2 // within the soon threshold |
| 33 | const NX_CONS_DUE: i64 = 3 // at / just past rated life |
| 34 | const NX_CONS_OVERDUE: i64 = 4 // well past life -> risk |
| 35 | const NX_CONS_BAD_ARG: i64 = 5 |
| 36 | const NX_CONS_N: i64 = 6 |
functions
| 38 | func nx_cons_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 62 | func nx_cons_analyze(usage: *i64, severity_x100: *i64, n: i64, |