code wiki / _hdl_build / nx_vizsla_doc.nx

nx_vizsla_doc.nx

buildroot/runtime/_hdl_build/nx_vizsla_doc.nx

19499 B554 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tooltopic vizsla
docsdependenciesstructsconstsfunctions

about

nx_vizsla_doc.nx -- NISHI VIZSLA DOCUMENT MANAGEMENT: never-lose documents on the additive plane. Operator 2026-07-08: "mcp level apis along with document management". Documents (venue contracts, invite letters, mail-merge output, plans) live as CID records on the SAME tamper-evident seg_store plane as everything else: ADDITIVE-ONLY (law 13 -- a new upload of the same docid = a NEW VERSION, old bytes never destroyed), content-addressed (identical re-put dedups = idempotent law 10), byte-exact round-trip (binary-safe: values are length-prefixed, not NUL-terminated). Docs link to the coordination entities via rel (venue:lakeday / plan:summer / event:launch / -). Commands: put <prefix> <docid> <file> <doctype> <rel> <date YYYY-MM-DD> [segid] get <prefix> <docid> <out> latest version bytes -> out (byte-exact) history <prefix> <docid> every version: date + bytes + doctype + rel list <prefix> <rel|-> latest version per docid (rel-filtered or all) Loud-fail: missing file, bad date, unknown docid, oversize (> DOC_MAX -- honest cap, chunking = a later rung), empty store on list. DOC_MAX = 524288 bytes (contracts/letters/exports; large media belongs to the gallery plane). spec: knowledge/research/2026-06-22-vizsla-sclass-roadmap.md license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_vizsla_doc.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

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

main vd_p sys_write vd_slen vd_eq vd_cmd_put vd_p ↻ vd_datedays sys_mmap vd_atoi sys_now_us sys_mmap ↻ sys_clock_gettime_mono sys_mmap ↻ ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close vd_slen ↻ ss_w32 cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ cid_from_digest sys_munmap

structs

none

consts

21const K_MAGIC_1970: i64 = 1970
22const K_MAGIC_146097: i64 = 146097
23const K_MAGIC_719468: i64 = 719468
24const K_MAGIC_524288: i64 = 524288
25const K_MAGIC_4096: i64 = 4096
26const K_MAGIC_1024: i64 = 1024
27const K_MAGIC_65536: i64 = 65536

functions

29func vd_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
30func vd_p(s: *u8) -> i64 { sys_write(1, s, vd_slen(s)); return 0 }
32func vd_eq(a: *u8, b: *u8) -> i64
43func vd_dup(s: *u8) -> *u8
called by 1: vd_gather calls 2: vd_slensys_mmap
51func vd_atoi(s: *u8) -> i64
called by 1: vd_cmd_put
62func vd_cat(dst: *u8, off: i64, s: *u8) -> i64
68func vd_catn(dst: *u8, off: i64, v: i64) -> i64
81func vd_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64
called by 2: vd_field_spanvd_iskind calls 1: vd_slen
92func vd_field_span(rec: *u8, rl: i64, want: *u8, offp: *i64, lenp: *i64) -> i64
called by 2: vd_fieldvd_gather calls 2: ss_r32vd_kmemeq
114func vd_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64
called by 1: vd_gather calls 2: sys_mmapvd_field_span
128func vd_iskind(b: *u8, koff: i64, kl: i64, pfx: *u8) -> i64
called by 1: vd_gather calls 1: vd_kmemeq
133func vd_datedays(s: *u8) -> i64
called by 2: vd_cmd_putvd_gather calls 1: sys_mmap
174func vd_find(list: *i64, n: i64, s: *u8) -> i64
called by 1: vd_cmd_list calls 1: vd_eq
186func vd_cmd_put(argc: i64, argv: *i64) -> i64
302func vd_gather(prefix: *u8, st: *i64) -> i64
378func vd_alloc_state() -> *i64
394func vd_latest(st: *i64, docid: *u8) -> i64
called by 2: vd_cmd_getvd_cmd_list calls 1: vd_eq
411func vd_cmd_get(argc: i64, argv: *i64) -> i64
448func vd_cmd_history(argc: i64, argv: *i64) -> i64
491func vd_cmd_list(argc: i64, argv: *i64) -> i64
545func main(argc: i64, argv: *i64) -> i64