nx_tmplstale_lib.nx
buildroot/runtime/nx_tmplstale_lib.nx
about
nx_tmplstale_lib.nx -- THE CLERK DESK: template registry, document lineage and TEMPLATE STALENESS
over nx_docgen_lib (LP6 dg_tmpl_list / LP7 dg_assemble_lineage / LP8 dg_tmpl_stale on /compare/legalpractice).
The gap this closes: nx_docgen stores clauses and templates on the immutable plane and assembles a
content-addressed document, but NOTHING records which clause TEXT a document was built from, so a
revised clause silently leaves every earlier engagement letter and every template that references it
out of date. Here every template put snapshots the CID of each clause it references, and every
assembly writes a LINEAGE record (template, document CID, clause CIDs). Staleness is then a pure
comparison: current clause CID != recorded CID names the stale template or document. The output is a
WORKLIST (every stale row named), never a count; a listing that would not fit its buffer REFUSES
(-1) rather than truncating, because a short worklist reads as a finished desk. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_docgen_lib.nx
imported by: nx_tmplstale.nxnx_tmplstale_gate.nx
structs
| none |
consts
| 14 | const TS_CIDLEN: i64 = 69 |
| 15 | const TS_LINEBUF: i64 = 512 |
| 16 | const TS_KEYBUF: i64 = 128 |
| 17 | const TS_TEXTBUF: i64 = 8192 |
| 18 | const TS_NL: i64 = 10 |
| 19 | const TS_TAB: i64 = 9 |
| 20 | const TS_SP: i64 = 32 |
| 21 | const TS_COMMA: i64 = 44 |
| 22 | const TS_COLON: i64 = 58 |
| 23 | const TS_ZERO: i64 = 48 |
| 24 | const TS_NINE: i64 = 57 |
| 25 | const TS_CIDSHORT: i64 = 21 |
| 26 | const TS_ROWRESERVE: i64 = 24 |
functions
| 28 | func ts_cat(dst: *u8, o: i64, s: *u8) -> i64 { return mt_catcopy(dst, o, s) } |
| 31 | func ts_slice(src: *u8, a: i64, b: i64, dst: *u8) -> i64 |
| 40 | func ts_clause_cid(prefix: *u8, id: *u8, cid: *u8) -> i64 |
| 50 | func ts_snapshot_clauses(prefix: *u8, csv: *u8, csvlen: i64, out: *u8, o0: i64) -> i64 |
| 76 | func ts_atoi(s: *u8) -> i64 called by 1: ts_tmpl_list |
| 89 | func ts_tmpl_put(prefix: *u8, id: *u8, csv: *u8, epoch: i64) -> i64 |
| 102 | func ts_tmpl_list(prefix: *u8, out: *u8, cap: i64) -> i64 |
| 151 | func ts_assemble_lineage(prefix: *u8, tmpl_id: *u8, docid: *u8, mergerec: *u8, mergelen: i64, out: *u8) -> i64 |
| 176 | func ts_scan_stale(prefix: *u8, rec: *u8, reclen: i64, kind: *u8, subject: *u8, out: *u8, o0: i64, cap: i64, stale: *i64) -> i64 |
| 233 | func ts_scan_index(prefix: *u8, kp: *u8, idxkey: *u8, kind: *u8, out: *u8, o0: i64, cap: i64, stale: *i64) -> i64 |
| 266 | func dg_tmpl_stale(prefix: *u8, out: *u8, cap: i64) -> i64 |
| 278 | func dg_tmpl_list(prefix: *u8, out: *u8, cap: i64) -> i64 { return ts_tmpl_list(prefix, out, cap) } |
| 281 | func dg_assemble_lineage(prefix: *u8, tmpl_id: *u8, docid: *u8, mergerec: *u8, mergelen: i64, out: *u8) -> i64 |