nx_cost_anatomy.nx
buildroot/runtime/nx_cost_anatomy.nx
about
nx_cost_anatomy.nx -- data-driven COST-ANATOMY + INFLATION-ATTRIBUTION engine. Generalizes nx_cost_decompose
(which hard-coded a battery) into an engine that reads a per-good cost-layer PACK (knowledge/anatomy/<good>.pack)
and answers WHERE each retail dollar goes AND WHY the price rose -- attributing the increase to DRIVER CLASSES
(farm/labor/energy/freight/materials/margin/rent/policy). Mode `all` aggregates across every good in packs.list to
surface the SYSTEMIC ROOT of everyday-goods inflation. LIAR-KILLED: layers must sum to an INDEPENDENT retail
anchor (a mis-entered layer breaks it), every layer maps to a KNOWN driver class (no silent other), attribution
conserves (sum of class deltas == measured increase), >=1 grounded anchor, driver-link non-empty, neg-control
(a bogus class does NOT map to a real bucket). Magnitudes tagged grounded/estimate; estimates reground via the
researcher (USDA ERS food-dollar, BLS CPI). Build: _offc/nx_sov_build_run.elf nx_cost_anatomy license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 12 | func gp(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 13 | func gn(v0: i64) -> i64 |
| 19 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: analyze_pack |
| 20 | func streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 21 | func startswith(s: *u8, pfx: *u8) -> i64 { var i: i64 = 0; while pfx[i] != (0 as u8) { if s[i] != pfx[i] { return 0 } i = i + 1 } return 1 } called by 1: analyze_pack |
| 22 | func pint(s: *u8) -> i64 called by 1: analyze_pack |
| 30 | func ev_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 42 | func field_count(line: *u8, ln: i64) -> i64 { var n: i64 = 1; var i: i64 = 0; while i < ln { if line[i] == (124 as u8) { n = n + 1 } i = i + 1 } return n } called by 1: analyze_pack |
| 44 | func field_k(line: *u8, ln: i64, kk: i64, dst: *u8, cap: i64) -> i64 called by 1: analyze_pack |
| 59 | func class_idx(n: *u8) -> i64 |
| 71 | func class_name(i: i64) -> *u8 |
| 84 | func print_classes(cd: *i64, total: i64) -> i64 |
| 107 | func analyze_pack(good: *u8, single: i64, cacc: *i64, out: *i64) -> i64 |
| 204 | func main(argc: i64, argv: *i64) -> i64 |