nx_swarm_lib.nx
buildroot/runtime/nx_swarm_lib.nx
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 · 11 importers
diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.
imports: nx_syscalls.nxnx_framed_append.nx
imported by: nx_swarm_coord.nxnx_swarm_job.nxnx_swarm_job_evidence_t67.nxnx_swarm_maturity.nxnx_swarm_pack.nxnx_swarm_pack_measured_t68.nxnx_swarm_pack_queue_t68.nxnx_swarm_pack_units_t70.nxnx_swarm_place.nxnx_swarm_place_epoch_t71.nxnx_swarm_tile.nx
structs
| none |
consts
| 9 | const K_MAGIC_60000000: i64 = 60000000 |
| 10 | const K_MAGIC_1000000: i64 = 1000000 |
functions
| 13 | func sb_path_ok(p: *u8) -> i64 |
| 47 | func sb_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 17: mt_grade_dimsmt_auto_matrixmainsk_load_poolsk_load_jobssk_load_pool+11 calls 3: sys_openat_rdsys_readsys_close |
| 63 | func sb_has(buf: *u8, n: i64, needle: *u8) -> i64 |
| 78 | func sb_pint(buf: *u8, n: i64, p: i64, vout: *i64, pend: *i64) -> i64 |
| 99 | func sb_validate(row: *u8, n: i64, nso: *i64, nlo: *i64, tso: *i64) -> i64 called by 7: sb_fieldssk_load_poolsk_load_poolsk_load_poolsk_load_poolsp_pick+1 calls 2: sys_mmapsb_pint |
| 147 | func sb_fields(row: *u8, n: i64, f: *i64) -> i64 called by 11: sk_load_poolsk2_poolsk_load_poolsk2_poolsk_load_poolsk_load_pool+5 calls 3: sys_mmapsb_validatesb_pint |
| 167 | func sb_fresh(ts: i64, now: i64, window_sec: i64) -> i64 |