code wiki / (root) / nx_swarm_lib.nx

nx_swarm_lib.nx

buildroot/runtime/nx_swarm_lib.nx

5816 B172 linesdepth 3pulls 3 transitivereach 6 importersview sourcekind librarytopic swarm
docsdependenciesstructsconstsfunctions

about

nx_swarm_lib.nx -- SWARM FABRIC shared lib: the NODE-row contract (validate/freshness), bounded reads, and the CLI path law. Single source of truth for the fabric wire format -- consumed by nx_swarm_beat (store) + nx_swarm_place (placement brain). Extracted 2026-07-15 (SF-R2). Row contract (v2 positional, emitted by nx_node_beacon): NODE <name> <cpu> <load> <ncpu> <lpc> <memu> <mema> <memt> <conns> <ts_us> <temp_mc> <batt_pct> license_tier: ORIGINAL

dependencies 2 imports · 6 importers

nx_syscalls.nx nx_framed_append.nx nx_swarm_lib.nx nx_swarm_coord.nx nx_swarm_job.nx nx_swarm_maturity.nx nx_swarm_pack.nx nx_swarm_place.nx nx_swarm_tile.nx

imports: nx_syscalls.nxnx_framed_append.nx

imported by: nx_swarm_coord.nxnx_swarm_job.nxnx_swarm_maturity.nxnx_swarm_pack.nxnx_swarm_place.nxnx_swarm_tile.nx

structs

none

consts

9const K_MAGIC_60000000: i64 = 60000000
10const K_MAGIC_1000000: i64 = 1000000

functions

13func sb_path_ok(p: *u8) -> i64
called by 3: mainmainmain calls 1: fa_len
47func sb_read(path: *u8, buf: *u8, cap: i64) -> i64
63func sb_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: mt_file_has calls 1: fa_len
78func sb_pint(buf: *u8, n: i64, p: i64, vout: *i64, pend: *i64) -> i64
99func sb_validate(row: *u8, n: i64, nso: *i64, nlo: *i64, tso: *i64) -> i64
147func sb_fields(row: *u8, n: i64, f: *i64) -> i64
167func sb_fresh(ts: i64, now: i64, window_sec: i64) -> i64
called by 1: sp_score