code wiki / _hdl_build / nx_store_put.nx

nx_store_put.nx

buildroot/runtime/_hdl_build/nx_store_put.nx

25486 B513 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic store
docsdependenciesstructsconstsfunctions

about

nx_store_put.nx -- THE UNIFIED INFORMATION-PLANE WRITE VERB (operator 2026-07-18: "it shouldnt be on the tsv we are supposed to use a unified nishi information management plane system thats better than git ... not just debt it should be new feature capable"). Row-level, provenanced, additive writes DIRECTLY against any 7-col seg-store plane (id title sev status owner scope note) -- debt-, work- (features), or any sibling prefix. Flat staging files demote to bootstrap/recovery; the LIVE write path is this verb. BETTER-THAN-GIT properties, in-plane: every mutation appends a revision to <prefix minus '-'>hist- as epoch<TAB>actor<TAB>verb<TAB>id<TAB>old-row<TAB>new-row (inner tabs -> '|'), so history + provenance live in the SOVEREIGN plane itself -- no working tree, no index, no merge dance; row-independent writes cannot conflict, and the full before/after of every row is queryable. nx_store_put <prefix> put <actor> <id> <field>... (N-col: id + 1..15 fields, ANY plane schema incl the 9-col frontier -- v2 uplevel 07-18, operator: "stop engaging with the tsv") nx_store_put <prefix> setcol <actor> <id> <colidx> <value> (flip ONE cell, e.g. frontier status col5 T->D) nx_store_put <prefix> close <actor> <id> <closing-note> (7-col convention: col3 open->closed, note appended) nx_store_put <prefix> load (dump the plane) nx_store_put <prefix> hist (dump the revision plane) put on an unseeded prefix BOOTSTRAPS the plane (first row creates it -- no staging file needed). close/setcol are FAIL-CLOSED: unknown id (or colidx past the row) -> exit 4, store untouched. Whole-store last-writer-wins per write; writers serialized socially by session claims (flock = next rung). license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_store_put.nx

imports: nx_store_seed_lib.nxnx_seg_store.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 nsp_werr sys_write nsp_slen sys_exit sts_lock sts_mm sys_mmap sts_werr sys_write ↻ sys_exit ↻ ss_cat sys_openat_append sts_werr ↻ sys_flock nsp_eqs sys_mmap ↻ sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat ↻ sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_cat ↻ ss_loadfile sys_map_file ss_readall ss_load_aux2 sys_mmap ↻ ss_cat ↻ ss_loadfile ↻ ss_r32 sys_munmap

structs

none

consts

25const NSP_MAGIC_4096: i64 = 4096
27const NSP_CAP: i64 = 1048576
28const NSP_NL: i64 = 10
29const NSP_TAB: i64 = 9
30const NSP_PIPE: i64 = 124
31const NSP_DASH: i64 = 45
32const NSP_NCOL: i64 = 7
33const NSP_PAIR: i64 = 2
34const NSP_SP_BYTES: i64 = 128
35const NSP_STDERR: i64 = 2
36const NSP_PFXCAP: i64 = 256
37const NSP_MSGCAP: i64 = 256
38const NSP_ARGC_PUT_MIN: i64 = 6 // prog prefix put actor id + at least 1 more field
39const NSP_ARGC_PUT_MAX: i64 = 20 // id + up to 15 fields (16-col plane cap)
40const NSP_ARGC_CLOSE: i64 = 6 // prog prefix close actor id note
41const NSP_ARGC_SETCOL: i64 = 7 // prog prefix setcol actor id colidx value
42const NSP_ARGC_MIN: i64 = 3
43const NSP_MAXCOL: i64 = 16 // max columns a plane row may carry
44const NSP_SP2_BYTES: i64 = 256 // 16 cols * 2 slots * 8B
45const NSP_EXIT_USAGE: i64 = 2
46const NSP_EXIT_IO: i64 = 1
47const NSP_EXIT_REFUSED: i64 = 4
49const NSP_F_ACTOR: i64 = 3
50const NSP_F_ID: i64 = 4
51const NSP_F_LAST: i64 = 10
53const NSP_C_ID: i64 = 4
54const NSP_C_NOTE: i64 = 5
56const NSP_COL_STATUS: i64 = 3
57const NSP_COL_NOTE: i64 = 6

functions

59func nsp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
60func nsp_werr(s: *u8) -> i64 { sys_write(NSP_STDERR, s, nsp_slen(s)); return 0 }
61func nsp_eqs(a: *u8, b: *u8) -> i64
called by 1: main
68func nsp_slice_eqs(q: *u8, a: i64, b: i64, s: *u8) -> i64
called by 1: main calls 1: nsp_slen
76func nsp_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64
called by 1: main
91func nsp_cat_slice(d: *u8, o: i64, q: *u8, a: i64, b: i64) -> i64
called by 1: main
98func nsp_cat_slice_pipe(d: *u8, o: i64, q: *u8, a: i64, b: i64) -> i64
called by 1: nsp_hist_append
111func nsp_hist_prefix(prefix: *u8, out: *u8) -> i64
called by 2: nsp_hist_appendmain calls 2: nsp_slenss_cat
121func nsp_hist_append(prefix: *u8, actor: *u8, verb: *u8, id: *u8, q: *u8, olda: i64, oldb: i64, neu: *u8, na: i64, nb: i64) -> i64
161func nsp_atoi(s: *u8) -> i64
called by 1: main
172func nsp_report(verb: *u8, id: *u8, replaced: i64, rows: i64) -> i64
called by 1: main calls 4: sys_mmapss_catss_catnsys_write
198func nsp_would_shrink(prefix: *u8, rows: i64) -> i64
called by 1: main calls 3: sys_mmapss_getsts_atoi
207func nsp_refuse_shrink(vname: *u8) -> i64
called by 1: main calls 1: nsp_werr
214func main(argc: i64, argv: *i64) -> i64