code wiki / _hdl_build / nx_reorder_gate.nx

nx_reorder_gate.nx

buildroot/runtime/_hdl_build/nx_reorder_gate.nx

8661 B139 linesdepth 6pulls 16 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_shopping.nx nx_pantry.nx nx_inventory.nx nx_food_science.nx nx_publisher.nx nx_syscalls.nx nx_reorder_gate.nx

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

main g_p sys_write fd_seed sys_mmap ss_begin ss_begin_cap sys_mmap ↻ as_len fd_streq_store sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 ss_add ss_add2 ss_w32 ss_len ↻ fd_seg_next sys_mmap ↻ ss_manifest ss_manifest_file sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_commit ss_segid_ok sys_mmap ↻ ss_cat ↻ ss_catn sys_mmap ↻

structs

none

consts

13const RO_FOOD: *u8 = "knowledge/store/food-"
14const RO_INV: *u8 = "knowledge/store/inv-"
15const RO_DOM: *u8 = "home"
16const RO_Q: *u8 = "knowledge/publish/shop-queue.tsv"
17const RO_LED: *u8 = "knowledge/publish/shop-ledger.tsv"
18const RO_STG: *u8 = "knowledge/publish/shop-stage"
19const RO_LIVE: *u8 = "knowledge/publish/shop-live"
20const RO_STAGE_FILE: *u8 = "knowledge/staging/shop/list.html"
21const RO_LIVE_FILE: *u8 = "knowledge/publish/shop-live/shopping-list.html"

functions

23func 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 }
called by 1: main calls 1: sys_write
24func g_i(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
32func 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
33func g_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
35func 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 }
called by 1: main calls 1: g_streq
38func ro_stock(id: *u8, name: *u8, cat: *u8, qty: i64, unit: *u8) -> i64
called by 1: main calls 2: iv_addiv_set_par
44func main() -> i64