code wiki / _hdl_build / nx_impact.nx

nx_impact.nx

buildroot/runtime/_hdl_build/nx_impact.nx

9657 B129 linesdepth 5pulls 6 transitivereach 16 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_impact.nx -- LIB: the CLEAN + ENVIRONMENTAL IMPACT + VALUE model for the food arc (operator: "measure clean and environmental impact while getting costs LOWER to the customer -- they invest in improving their lives, we gain MORE profit and they spend LESS; starting with strawberries (heavy pesticide conventionally) where ours is the OPPOSITE"). Per food item, per SOURCE (conv / nishi / ...), we store MEASURED impact: pesticide load, carbon, water, soil health, price, and our cost-of-goods. The triple win is then computed and PROVEN, not claimed: cleaner + lower-impact + cheaper for the customer + higher margin for us (vertical integration). Clean = MEASURED from pesticide load, so greenwashing (a clean CLAIM with high residue) is caught. Integer cents / integer indices (no float). Each record CITEs research. license_tier: ORIGINAL Schema: food:impact:<item>:<source> -> name <t> pesticide(0-100) <t> carbon_g_per_kg <t> water_L_per_kg <t> soil_health(0-10, higher=regenerative) <t> price_cents <t> cogs_cents <t> cite

dependencies 4 imports · 6 importers

nx_food_science.nx nx_food_provenance.nx nx_seg_store.nx nx_syscalls.nx nx_impact.nx nx_clean_market.nx nx_food_clean_source.nx nx_impact_gate.nx nx_link.nx nx_produce.nx nx_produce_gate.nx

imports: nx_food_science.nxnx_food_provenance.nxnx_seg_store.nxnx_syscalls.nx

imported by: nx_clean_market.nxnx_food_clean_source.nxnx_impact_gate.nxnx_link.nxnx_produce.nxnx_produce_gate.nx

structs

none

consts

none

functions

16func im_money(dst: *u8, off: i64, cents: i64) -> i64
26func im_key(item: *u8, source: *u8, out: *u8) -> i64
called by 2: im_field_intim_field_str calls 1: as_append
35func im_field_int(prefix: *u8, item: *u8, source: *u8, f: i64) -> i64
44func im_field_str(prefix: *u8, item: *u8, source: *u8, f: i64, out: *u8) -> i64
51func im_pesticide(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 1) }
52func im_carbon(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 2) }
53func im_water(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 3) }
54func im_soil(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 4) }
55func im_price(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 5) }
56func im_cogs(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 6) }
called by 1: im_margin calls 1: im_field_int
59func im_clean(prefix: *u8, item: *u8, src: *u8) -> i64 { return 100 - im_pesticide(prefix, item, src) }
61func im_greener(prefix: *u8, item: *u8, a: *u8, b: *u8) -> i64
68func im_savings(prefix: *u8, item: *u8, a: *u8, b: *u8) -> i64 { return im_price(prefix, item, b) - im_price(prefix, item, a) }
70func im_margin(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_price(prefix, item, src) - im_cogs(prefix, item, src) }
72func im_triple_win(prefix: *u8, item: *u8) -> i64
80func im_seed(prefix: *u8) -> i64
109func im_render_compare(prefix: *u8, item: *u8, out: *u8) -> i64