code wiki / _hdl_build / nx_seedlib.nx

nx_seedlib.nx

buildroot/runtime/_hdl_build/nx_seedlib.nx

11474 B211 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_seedlib.nx -- LIB: the COMMUNITY SEED-LIBRARY NODE (furnishes the room the reward unlocked). This is the real feature that the `host_seed_library` CAPABILITY (earned in nx_rewards) gates: only a capability-holder may create a node -- proving the reward is REAL (a real feature enforces it), not a cosmetic flag. A node is a local seed library on the real seed-library ethic: members BORROW seeds, grow them, save seed, and RETURN MORE than they took -- so the commons grows. Additive loan ledger (rule 13). Ties the swap/rewards/lineage arcs into a real shared resource. Sovereign seg-store (knowledge/store/seedlib-*, NO TSV), integer-only. license_tier: ORIGINAL

dependencies 4 imports · 1 importers

nx_rewards.nx nx_food_science.nx nx_seg_store.nx nx_syscalls.nx nx_seedlib.nx nx_seedlib_gate.nx

imports: nx_rewards.nxnx_food_science.nxnx_seg_store.nxnx_syscalls.nx

imported by: nx_seedlib_gate.nx

structs

none

consts

11const SL_MAGIC_2048: i64 = 2048
13const SL_CAP: *u8 = "host_seed_library"

functions

15func sl_put(prefix: *u8, key: *u8, val: *u8) -> i64
25func sl_node_key(nid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:node:" as *u8); o = as_append(out, o, nid); out[o] = 0 as u8; return o }
26func sl_stock_key(nid: *u8, sp: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:stock:" as *u8); o = as_append(out, o, nid); out[o] = 58 as u8; o = o + 1; o = as_append(out, o, sp); out[o] = 0 as u8; return o }
called by 2: sl_stocksl_set_stock calls 1: as_append
27func sl_species_key(nid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:species:" as *u8); o = as_append(out, o, nid); out[o] = 0 as u8; return o }
28func sl_loann_key(nid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:loann:" as *u8); o = as_append(out, o, nid); out[o] = 0 as u8; return o }
called by 2: sl_loannsl_loan_record calls 1: as_append
29func sl_loan_key(nid: *u8, seq: i64, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:loan:" as *u8); o = as_append(out, o, nid); out[o] = 58 as u8; o = o + 1; o = fd_apnum(out, o, seq); out[o] = 0 as u8; return o }
33func sl_create_node(prefix: *u8, reward_prefix: *u8, nid: *u8, host_gid: *u8, name: *u8, area: *u8, day: i64) -> i64
43func sl_node_exists(prefix: *u8, nid: *u8) -> i64
called by 1: main calls 3: sys_mmapsl_node_keyss_get
50func sl_node_str(prefix: *u8, nid: *u8, f: i64, out: *u8) -> i64
58func sl_stock(prefix: *u8, nid: *u8, sp: *u8) -> i64
65func sl_set_stock(prefix: *u8, nid: *u8, sp: *u8, qty: i64) -> i64
71func sl_species_track(prefix: *u8, nid: *u8, sp: *u8) -> i64
97func sl_contribute(prefix: *u8, nid: *u8, sp: *u8, qty: i64) -> i64
103func sl_loann(prefix: *u8, nid: *u8) -> i64
110func sl_loan_record(prefix: *u8, nid: *u8, member: *u8, sp: *u8, qty: i64, direction: *u8, day: i64) -> i64
125func sl_loan_str(prefix: *u8, nid: *u8, seq: i64, f: i64, out: *u8) -> i64
132func sl_loan_int(prefix: *u8, nid: *u8, seq: i64, f: i64) -> i64
141func sl_take(prefix: *u8, nid: *u8, member: *u8, sp: *u8, qty: i64, day: i64) -> i64
150func sl_return(prefix: *u8, nid: *u8, member: *u8, sp: *u8, qty: i64, day: i64) -> i64
called by 1: main calls 2: sl_contributesl_loan_record
157func sl_member_net(prefix: *u8, nid: *u8, member: *u8, sp: *u8) -> i64
175func sl_render_node(prefix: *u8, nid: *u8, out: *u8) -> i64