code wiki / _hdl_build / nx_price.nx
nx_price.nx
buildroot/runtime/_hdl_build/nx_price.nx
about
nx_price.nx -- LIB: PRICE TRACKING across stores (R-PRICE, pillar 3 of seed-to-feed). Operator: "the tracking
of prices but stores in the area for stores across america and how they are doing as far as prices." A
sovereign price registry (knowledge/store/price-*, NO TSV, integer cents no-float): stores with an AREA, and
date-stamped price OBSERVATIONS per item. "How a store is doing" = a measured competitiveness INDEX vs the
area median (100 = exactly the area median; <100 = cheaper than median = better for the shopper). Finds the
cheapest store / basket per area = where to buy for least (the affordability arc).
HONEST: prices are RECORDED observations with a date + source (rule 23), NOT live-scraped or claimed real-time;
the index is computed from those recorded numbers. Ties to [[project-nishi-food-branch-2026-06-22]] affordability.
license_tier: ORIGINAL
dependencies 3 imports · 5 importers
imports: nx_food_science.nxnx_seg_store.nxnx_syscalls.nx
imported by: nx_link.nxnx_price_gate.nxnx_price_hist.nxnx_rewards_gate.nxnx_swap_reward_gate.nx
structs
| none |
consts
| none |
functions
| 15 | func pr_put(prefix: *u8, key: *u8, val: *u8) -> i64 called by 3: pr_list_appendpr_add_storepr_set_price calls 5: fd_streq_storess_beginss_addfd_seg_nextss_commit |
| 26 | func pr_split(buf: *u8, len: i64, outtoks: *i64) -> i64 |
| 49 | func pr_list_append(prefix: *u8, key: *u8, token: *u8) -> i64 |
| 72 | func pr_store_key(sid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "price:store:" as *u8); o = as_append(out, o, sid); out[o] = 0 as u8; return o } |
| 73 | func pr_area_key(area: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "price:area:" as *u8); o = as_append(out, o, area); o = as_append(out, o, ":stores" as *u8); out[o] = 0 as u8; return o } |
| 74 | func pr_obs_key(sid: *u8, item: *u8, out: *u8) -> i64 |
| 81 | func pr_add_store(prefix: *u8, sid: *u8, name: *u8, chain: *u8, area: *u8, state: *u8, cite: *u8) -> i64 called by 6: mainmainmainmainmainmain calls 6: sys_mmappr_store_keyas_appendpr_putpr_area_keypr_list_append |
| 97 | func pr_store_field(prefix: *u8, sid: *u8, f: i64, out: *u8) -> i64 called by 3: lk_render_itempr_render_areaph_render_trend calls 4: sys_mmappr_store_keyss_getfd_field |
| 106 | func pr_set_price(prefix: *u8, sid: *u8, item: *u8, cents: i64, date: *u8, unit: *u8, source: *u8) -> i64 |
| 118 | func pr_get_price(prefix: *u8, sid: *u8, item: *u8) -> i64 |
| 129 | func pr_obs_field(prefix: *u8, sid: *u8, item: *u8, f: i64, out: *u8) -> i64 |
| 138 | func pr_area_stores(prefix: *u8, area: *u8, outsids: *i64) -> i64 |
| 147 | func pr_area_prices(prefix: *u8, area: *u8, item: *u8, outvals: *i64) -> i64 |
| 161 | func pr_median(prefix: *u8, area: *u8, item: *u8) -> i64 |
| 181 | func pr_cheapest(prefix: *u8, area: *u8, item: *u8, out_sid: *u8) -> i64 |
| 202 | func pr_basket(prefix: *u8, sid: *u8, items: *i64, nitems: i64) -> i64 |
| 215 | func pr_store_index(prefix: *u8, area: *u8, sid: *u8, items: *i64, nitems: i64) -> i64 |
| 230 | func pr_render_area(prefix: *u8, area: *u8, items: *i64, nitems: i64, out: *u8) -> i64 called by 1: main calls 9: sys_mmappr_area_storespr_basketas_appendas_append_escapedpr_store_field+3 |
| 275 | func im_money_local(dst: *u8, off: i64, cents: i64) -> i64 |