code wiki / _hdl_build / nx_vizsla_docgen.nx

nx_vizsla_docgen.nx

buildroot/runtime/_hdl_build/nx_vizsla_docgen.nx

10652 B295 linesdepth 8pulls 16 transitivereach 0 importersview sourcekind tooltopic vizsla
docsdependenciesstructsconstsfunctions

about

nx_vizsla_docgen.nx -- NISHI VIZSLA OFFICE DOCUMENT GENERATION: turn coordination data into a real office document and FILE it in the never-lose doc manager. Operator 2026-07-08: "office ... along with document management and all the other things". This is the bridge that ties the three named domains: COORDINATION (a venue booking / plan / event supplies the fields) -> OFFICE (a valid .docx via nx_docx) -> DOCUMENT MANAGEMENT (a versioned, rel-linked doc: record nx_vizsla_doc reads back byte-exact). GENERIC by design (rule 22, no venue/plan reader duplication): the input is a simple fields file -- line 1 = the document TITLE (first paragraph) lines 2..N = one paragraph each (e.g. "Venue: Lakeside Pavilion"); blank lines skipped so venue agreements, invite letters, plan summaries, meeting notes are all the SAME organ over different fields (produced by the venue/plan/group boards). Output = a real Word .docx stored as a doc: record. Command: build <docprefix> <docid> <doctype> <rel> <date> <fieldsfile> [segid] -> writes a .docx (nx_docx docx_write) + stores it in <docprefix> as doc:<cid> (doctype/rel/date), additive + CID-idempotent (re-build identical fields => already stored, new=0). The stored bytes are the exact .docx (byte-exact retrievable via nx_vizsla_doc get; readable via nx_docx read). Loud-fail: missing/empty fieldsfile, bad date, docx build fail, oversize (> 512KB). DRY debt: the doc: record framing is replicated from nx_vizsla_doc's put (both should import a shared nx_vizsla_docstore lib later); the gate CROSS-CHECKS it by reading the record back with the REAL doc organ. spec: knowledge/research/2026-06-22-vizsla-sclass-roadmap.md license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_docx.nx nx_vizsla_docgen.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nxnx_docx.nx

imported by: nobody (leaf or entry point)

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

main dg_p sys_write dg_slen dg_eq dg_cmd_build dg_p ↻ dg_datedays sys_mmap dg_atoi sys_now_us sys_mmap ↻ sys_clock_gettime_mono sys_mmap ↻ dg_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close dg_cat dg_catn sys_mmap ↻ dg_store_doc sys_mmap ↻ dg_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_final blk_set_byte ↻

structs

none

consts

26const K_MAGIC_1970: i64 = 1970
27const K_MAGIC_65536: i64 = 65536
28const K_MAGIC_4096: i64 = 4096
29const K_MAGIC_524288: i64 = 524288
30const K_MAGIC_1024: i64 = 1024

functions

32func dg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
33func dg_p(s: *u8) -> i64 { sys_write(1, s, dg_slen(s)); return 0 }
called by 2: dg_cmd_buildmain calls 2: sys_writedg_slen
35func dg_eq(a: *u8, b: *u8) -> i64
called by 1: main
46func dg_dup(s: *u8) -> *u8
calls 2: dg_slensys_mmap
54func dg_atoi(s: *u8) -> i64
called by 1: dg_cmd_build
65func dg_cat(dst: *u8, off: i64, s: *u8) -> i64
71func dg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: dg_cmd_build calls 1: sys_mmap
84func dg_datedays(s: *u8) -> i64
called by 1: dg_cmd_build calls 1: sys_mmap
118func dg_readall(path: *u8, szout: *i64) -> *u8
137func dg_store_doc(prefix: *u8, docid: *u8, dtype: *u8, rel: *u8, date: *u8, content: *u8, csz: i64, segid: i64) -> i64
202func dg_cmd_build(argc: i64, argv: *i64) -> i64
289func main(argc: i64, argv: *i64) -> i64