code wiki / _hdl_build / nx_impact.nx
nx_impact.nx
buildroot/runtime/_hdl_build/nx_impact.nx
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
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
| 16 | func im_money(dst: *u8, off: i64, cents: i64) -> i64 called by 8: cm_emit_tier_tablefc_render_badgeg_moneyim_render_compareg_moneylk_render_item+2 calls 1: fd_apnum |
| 26 | func im_key(item: *u8, source: *u8, out: *u8) -> i64 |
| 35 | func im_field_int(prefix: *u8, item: *u8, source: *u8, f: i64) -> i64 |
| 44 | func im_field_str(prefix: *u8, item: *u8, source: *u8, f: i64, out: *u8) -> i64 |
| 51 | func im_pesticide(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 1) } |
| 52 | func im_carbon(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 2) } |
| 53 | func im_water(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 3) } |
| 54 | func im_soil(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 4) } |
| 55 | func im_price(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 5) } |
| 56 | func im_cogs(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_field_int(prefix, item, src, 6) } |
| 59 | func im_clean(prefix: *u8, item: *u8, src: *u8) -> i64 { return 100 - im_pesticide(prefix, item, src) } called by 10: cm_clean_gapcm_emit_tier_tablemainfc_render_badgeim_triple_winmain+4 calls 1: im_pesticide |
| 61 | func im_greener(prefix: *u8, item: *u8, a: *u8, b: *u8) -> i64 |
| 68 | func im_savings(prefix: *u8, item: *u8, a: *u8, b: *u8) -> i64 { return im_price(prefix, item, b) - im_price(prefix, item, a) } called by 10: cm_emit_tier_tablefc_build_savingsfc_render_badgemainim_render_comparemain+4 calls 1: im_price |
| 70 | func im_margin(prefix: *u8, item: *u8, src: *u8) -> i64 { return im_price(prefix, item, src) - im_cogs(prefix, item, src) } |
| 72 | func im_triple_win(prefix: *u8, item: *u8) -> i64 called by 4: cm_tier_triple_winsmainmainpd_all_triple_win calls 4: im_cleanim_greenerim_priceim_margin |
| 80 | func im_seed(prefix: *u8) -> i64 |
| 109 | func im_render_compare(prefix: *u8, item: *u8, out: *u8) -> i64 |