code wiki / _hdl_build / nx_vizsla_docgen.nx
nx_vizsla_docgen.nx
buildroot/runtime/_hdl_build/nx_vizsla_docgen.nx
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
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
structs
| none |
consts
| 26 | const K_MAGIC_1970: i64 = 1970 |
| 27 | const K_MAGIC_65536: i64 = 65536 |
| 28 | const K_MAGIC_4096: i64 = 4096 |
| 29 | const K_MAGIC_524288: i64 = 524288 |
| 30 | const K_MAGIC_1024: i64 = 1024 |
functions
| 32 | func dg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 33 | func dg_p(s: *u8) -> i64 { sys_write(1, s, dg_slen(s)); return 0 } |
| 35 | func dg_eq(a: *u8, b: *u8) -> i64 called by 1: main |
| 46 | func dg_dup(s: *u8) -> *u8 |
| 54 | func dg_atoi(s: *u8) -> i64 called by 1: dg_cmd_build |
| 65 | func dg_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 71 | func dg_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 84 | func dg_datedays(s: *u8) -> i64 |
| 118 | func dg_readall(path: *u8, szout: *i64) -> *u8 |
| 137 | func dg_store_doc(prefix: *u8, docid: *u8, dtype: *u8, rel: *u8, date: *u8, content: *u8, csz: i64, segid: i64) -> i64 |
| 202 | func dg_cmd_build(argc: i64, argv: *i64) -> i64 |
| 289 | func main(argc: i64, argv: *i64) -> i64 |