code wiki / _hdl_build / nx_store_put.nx
nx_store_put.nx
buildroot/runtime/_hdl_build/nx_store_put.nx
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
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
structs
| none |
consts
| 25 | const NSP_MAGIC_4096: i64 = 4096 |
| 27 | const NSP_CAP: i64 = 1048576 |
| 28 | const NSP_NL: i64 = 10 |
| 29 | const NSP_TAB: i64 = 9 |
| 30 | const NSP_PIPE: i64 = 124 |
| 31 | const NSP_DASH: i64 = 45 |
| 32 | const NSP_NCOL: i64 = 7 |
| 33 | const NSP_PAIR: i64 = 2 |
| 34 | const NSP_SP_BYTES: i64 = 128 |
| 35 | const NSP_STDERR: i64 = 2 |
| 36 | const NSP_PFXCAP: i64 = 256 |
| 37 | const NSP_MSGCAP: i64 = 256 |
| 38 | const NSP_ARGC_PUT_MIN: i64 = 6 // prog prefix put actor id + at least 1 more field |
| 39 | const NSP_ARGC_PUT_MAX: i64 = 20 // id + up to 15 fields (16-col plane cap) |
| 40 | const NSP_ARGC_CLOSE: i64 = 6 // prog prefix close actor id note |
| 41 | const NSP_ARGC_SETCOL: i64 = 7 // prog prefix setcol actor id colidx value |
| 42 | const NSP_ARGC_MIN: i64 = 3 |
| 43 | const NSP_MAXCOL: i64 = 16 // max columns a plane row may carry |
| 44 | const NSP_SP2_BYTES: i64 = 256 // 16 cols * 2 slots * 8B |
| 45 | const NSP_EXIT_USAGE: i64 = 2 |
| 46 | const NSP_EXIT_IO: i64 = 1 |
| 47 | const NSP_EXIT_REFUSED: i64 = 4 |
| 49 | const NSP_F_ACTOR: i64 = 3 |
| 50 | const NSP_F_ID: i64 = 4 |
| 51 | const NSP_F_LAST: i64 = 10 |
| 53 | const NSP_C_ID: i64 = 4 |
| 54 | const NSP_C_NOTE: i64 = 5 |
| 56 | const NSP_COL_STATUS: i64 = 3 |
| 57 | const NSP_COL_NOTE: i64 = 6 |
functions
| 59 | func nsp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 60 | func nsp_werr(s: *u8) -> i64 { sys_write(NSP_STDERR, s, nsp_slen(s)); return 0 } |
| 61 | func nsp_eqs(a: *u8, b: *u8) -> i64 called by 1: main |
| 68 | func nsp_slice_eqs(q: *u8, a: i64, b: i64, s: *u8) -> i64 |
| 76 | func nsp_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64 called by 1: main |
| 91 | func nsp_cat_slice(d: *u8, o: i64, q: *u8, a: i64, b: i64) -> i64 called by 1: main |
| 98 | func nsp_cat_slice_pipe(d: *u8, o: i64, q: *u8, a: i64, b: i64) -> i64 called by 1: nsp_hist_append |
| 111 | func nsp_hist_prefix(prefix: *u8, out: *u8) -> i64 |
| 121 | func nsp_hist_append(prefix: *u8, actor: *u8, verb: *u8, id: *u8, q: *u8, olda: i64, oldb: i64, neu: *u8, na: i64, nb: i64) -> i64 called by 1: main calls 8: sys_mmapnsp_hist_prefixss_catnsys_now_realtime_secss_catnsp_cat_slice_pipe+2 |
| 161 | func nsp_atoi(s: *u8) -> i64 called by 1: main |
| 172 | func nsp_report(verb: *u8, id: *u8, replaced: i64, rows: i64) -> i64 |
| 198 | func nsp_would_shrink(prefix: *u8, rows: i64) -> i64 |
| 207 | func nsp_refuse_shrink(vname: *u8) -> i64 |
| 214 | func main(argc: i64, argv: *i64) -> i64 |