code wiki / _hdl_build / nx_reorder_gate.nx
nx_reorder_gate.nx
buildroot/runtime/_hdl_build/nx_reorder_gate.nx
about
nx_reorder_gate.nx -- GATE: R-REORDER. The supply-chain management layer that closes the loop: par levels ->
low-stock detection -> a shopping list generated from what a meal plan consumed. Proves: T1 par set/get,
T2 low-stock detection (qty<par, with correct buy quantity), T3 meal-plan integration (consuming ingredients
drops them below par -> onto the list), T4 sovereign shopping-list render, T5 SHIPPED via publisher.
license_tier: ORIGINAL
dependencies 6 imports · 0 importers
imports: nx_shopping.nxnx_pantry.nxnx_inventory.nxnx_food_science.nxnx_publisher.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const RO_FOOD: *u8 = "knowledge/store/food-" |
| 14 | const RO_INV: *u8 = "knowledge/store/inv-" |
| 15 | const RO_DOM: *u8 = "home" |
| 16 | const RO_Q: *u8 = "knowledge/publish/shop-queue.tsv" |
| 17 | const RO_LED: *u8 = "knowledge/publish/shop-ledger.tsv" |
| 18 | const RO_STG: *u8 = "knowledge/publish/shop-stage" |
| 19 | const RO_LIVE: *u8 = "knowledge/publish/shop-live" |
| 20 | const RO_STAGE_FILE: *u8 = "knowledge/staging/shop/list.html" |
| 21 | const RO_LIVE_FILE: *u8 = "knowledge/publish/shop-live/shopping-list.html" |
functions
| 23 | func g_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 24 | func g_i(v: i64) -> i64 |
| 32 | func g_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 1: g_need |
| 33 | func g_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 35 | func g_need(ids: *i64, need: *i64, n: i64, target: *u8) -> i64 { var i: i64 = 0; while i < n { if g_streq(ids[i] as *u8, target) == 1 { return need[i] } i = i + 1 } return 0 - 1 } |
| 38 | func ro_stock(id: *u8, name: *u8, cat: *u8, qty: i64, unit: *u8) -> i64 |
| 44 | func main() -> i64 |