code wiki / _hdl_build / nx_food_clean_source.nx
nx_food_clean_source.nx
buildroot/runtime/_hdl_build/nx_food_clean_source.nx
about
nx_food_clean_source.nx -- LIB: the CLEAN-SOURCING badge that joins the stir-fry SITE to the impact ECONOMICS
(operator: "we gain more profit and they spend less via them buying from us"). For the vegetables in a chosen
build that Nishi grows regeneratively (present in the impact catalog), it aggregates the per-item customer
savings vs conventional and renders a sovereign no-JS "Clean sourcing" section for the recommendation page --
so the diner SEES, on the same page that picks their dish, that the produce we source is cleaner AND cheaper.
HONEST BY CONSTRUCTION: only ingredients ACTUALLY in the catalog count (im_field_int < 0 == absent), the
section states how many, and a non-catalog ingredient is reported as not-yet-covered -- never a faked number.
The seeded estimates VARY truthfully (onion/garlic are low-residue even conventionally -> small clean gap;
bok choy / snow peas higher -> larger gap), so the badge cannot greenwash. Reuses nx_impact accessors;
integer cents only (no float); each record CITEs the regenerative-agriculture corpus. license_tier: ORIGINAL
dependencies 4 imports · 2 importers
imports: nx_impact.nxnx_food_science.nxnx_seg_store.nxnx_syscalls.nx
imported by: nx_food_clean_source_gate.nxnx_food_site.nx
structs
| none |
consts
| none |
functions
| 19 | func fc_covered(prefix: *u8, slug: *u8) -> i64 |
| 27 | func fc_seed_veg(prefix: *u8) -> i64 |
| 65 | func fc_build_savings(prefix: *u8, h: *i64, build: *i64, roles: *i64, nb: i64) -> i64 |
| 80 | func fc_build_covered(prefix: *u8, h: *i64, build: *i64, roles: *i64, nb: i64) -> i64 |
| 97 | func fc_render_badge(prefix: *u8, h: *i64, build: *i64, roles: *i64, nb: i64, out: *u8, off: i64) -> i64 called by 2: mainfs_render_avail calls 9: fc_build_coveredfc_build_savingsas_appendfc_coveredas_append_escapedfd_apnum+3 |