code wiki / (root) / nx_consumable.nx

nx_consumable.nx

buildroot/runtime/nx_consumable.nx

4519 B119 linesdepth 0pulls 0 transitivereach 16 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_consumable.nx nx_batt_intake_test.nx nx_consumable_test.nx nx_maint_unify.nx

imports: none

imported by: nx_batt_intake_test.nxnx_consumable_test.nxnx_maint_unify.nx

structs

45struct ConsSpec
51struct ConsEff

consts

30const NX_CONS_INSUFFICIENT_DATA: i64 = 0
31const NX_CONS_OK: i64 = 1 // healthy remaining life
32const NX_CONS_DUE_SOON: i64 = 2 // within the soon threshold
33const NX_CONS_DUE: i64 = 3 // at / just past rated life
34const NX_CONS_OVERDUE: i64 = 4 // well past life -> risk
35const NX_CONS_BAD_ARG: i64 = 5
36const NX_CONS_N: i64 = 6

functions

38func nx_cons_verdict_is_valid(v: i64) -> i64
called by 1: main
62func nx_cons_analyze(usage: *i64, severity_x100: *i64, n: i64,
called by 2: mainmain