code wiki / (root) / nx_cost_anatomy.nx

nx_cost_anatomy.nx

buildroot/runtime/nx_cost_anatomy.nx

14751 B278 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic cost
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_cost_anatomy.nx

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

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ streq gp sys_write ↻ analyze_pack sys_mmap ↻ ev_read sys_openat_rd sys_read sys_close gp ↻ startswith pint field_count field_k class_idx streq ↻ slen gn sys_write ↻ sys_mmap ↻ class_name print_classes sys_mmap ↻ gp ↻

structs

none

consts

none

functions

12func gp(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
13func gn(v0: i64) -> i64
19func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: analyze_pack
20func 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 }
called by 2: class_idxmain
21func 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
22func pint(s: *u8) -> i64
called by 1: analyze_pack
30func ev_read(path: *u8, buf: *u8, cap: i64) -> i64
42func 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
44func field_k(line: *u8, ln: i64, kk: i64, dst: *u8, cap: i64) -> i64
called by 1: analyze_pack
59func class_idx(n: *u8) -> i64
called by 2: analyze_packmain calls 1: streq
71func class_name(i: i64) -> *u8
84func print_classes(cd: *i64, total: i64) -> i64
107func analyze_pack(good: *u8, single: i64, cacc: *i64, out: *i64) -> i64
204func main(argc: i64, argv: *i64) -> i64