code wiki / (root) / nx_sov.nx

nx_sov.nx

buildroot/runtime/nx_sov.nx

12189 B304 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind tooltopic sov
docsdependenciesstructsconstsfunctions

about

nx_sov.nx -- THE STANDARD SOVEREIGN DATA CLI (operator 2026-07-16: "this happens a lot -- make writing nishi ecosystem formats THE STANDARD, integrated into our mcp/apis, interoperable with 3rd party"). Root cause of the recurring no-TSV violations: nx_sov_ledger is a LIBRARY (needs an organ authored) while `cat > x.tsv` is one command -- so sessions under pressure take the flat path. THIS organ makes the sovereign path the one-command path: put <prefix> <key> <value> write a string value (latest-wins) put-file <prefix> <key> <file> write a file's bytes as the value (binary-safe, <=1MiB) get <prefix> <key> print the latest value has <prefix> <key> exit 0 present / 1 absent import <prefix> <tsvfile> INTEROP IN: key<TAB>value rows -> sovereign store, and writes the __ids__ index (newline-joined keys) so nx_memory `index` / export can enumerate export <prefix> <outfile> INTEROP OUT: __ids__ index -> key<TAB>value TSV at the BOUNDARY (a DERIVED VIEW for 3rd parties, never the store) The MCP surface: nx_memory (sibling, S17) already serves READS (stores/get/history/index) over MCP; its put/tombstone write-cap increment will front THIS same store -- one substrate, CLI + MCP two doors. Store = seg_store via nx_sov_ledger (sov_put/sov_get/sov_has). license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_sov_ledger.nx nx_lib_std.nx nx_sov.nx nx_sov_gate.nx

imports: nx_sov_ledger.nxnx_lib_std.nx

imported by: nx_sov_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main std_putln std_puts std_slen sys_write std_streq sov_put_str sov_put ss_begin ss_begin_cap sys_mmap ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻ ss_writefile sys_openat_wr sys_write ↻ sys_close sys_fsync sys_renameat ss_build_keys sys_mmap ↻ ss_r32

structs

none

consts

21const NXSOV_CAP: i64 = 1048576

functions

23func nxsov_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 3: nxsov_importmainmain calls 1: sys_read
44func nxsov_import(prefix: *u8, tsvfile: *u8) -> i64
102func nxsov_export(prefix: *u8, outfile: *u8) -> i64
152func nxsov_fsck(prefix: *u8) -> i64
221func main(argc: i64, argv: *i64) -> i64