code wiki / (root) / nx_compare_results_lib.nx

nx_compare_results_lib.nx

buildroot/runtime/nx_compare_results_lib.nx

17522 B352 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind librarytopic compare
docsdependenciesstructsconstsfunctions

about

nx_compare_results_lib.nx -- ONE HOME FOR A BOARD'S RESULTS (ecosystem EC64, 2026-09-17). Operator 2026-09-17, asked where the twin renders could be seen: "i dont want them strewn about like we had with /world pages". A board's results are DATA -- buildroot/knowledge/compare/<dom>.results -- and this lib renders them as ONE page, /compare/<dom>/results/, grouped by kind, newest first, every image behind the estate's one click-to-open primitive (nx_reveal_lib). A result row: result|<slug>|<kind>|<YYYY-MM-DD>|<class>|<title>|<report href or ->|<image href or ->|<headline> slug is the identity: a later row with the same slug SUPERSEDES the earlier one (history stays in the file, the page shows the current one, and the receipt counts what was superseded). A row with the wrong field count is MALFORMED and named by line number; it never becomes a card. No pipes in text fields. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_reveal_lib.nx nx_compare_results_lib.nx nx_compare_results.nx nx_compare_results_gate.nx nx_twinreport_gate.nx

imports: nx_syscalls.nxnx_reveal_lib.nx

imported by: nx_compare_results.nxnx_compare_results_gate.nxnx_twinreport_gate.nx

structs

none

consts

14const CRES_FIELDS: i64 = 9
15const CRES_F_TAG: i64 = 0
16const CRES_F_SLUG: i64 = 1
17const CRES_F_KIND: i64 = 2
18const CRES_F_DATE: i64 = 3
19const CRES_F_CLASS: i64 = 4
20const CRES_F_TITLE: i64 = 5
21const CRES_F_PAGE: i64 = 6
22const CRES_F_IMAGE: i64 = 7
23const CRES_F_HEAD: i64 = 8
24const CRES_TAG: *u8 = "result"
25const CRES_NONE: *u8 = "-"
26const CRES_I64: i64 = 8
27const CRES_MODE644: i64 = 420
29const CRES_ROW_W: i64 = 19
30const CRES_ROW_LIVE: i64 = 18
32const CRES_R_LINES: i64 = 0
33const CRES_R_ROWS: i64 = 1
34const CRES_R_MALFORMED: i64 = 2
35const CRES_R_SUPERSEDED: i64 = 3
36const CRES_R_LIVE: i64 = 4
37const CRES_R_KINDS: i64 = 5
38const CRES_R_OPEN: i64 = 6
39const CRES_R_CLICK: i64 = 7
40const CRES_R_GATED: i64 = 8
41const CRES_R_UNKNOWN: i64 = 9
42const CRES_R_ADULT: i64 = 10
43const CRES_R_BARE: i64 = 11
44const CRES_R_HTML_BYTES: i64 = 12
45const CRES_R_FIRST_BAD_LINE: i64 = 13
46const CRES_R_N: i64 = 14
47const CRES_E_READ: i64 = 0 - 3
48const CRES_E_NOROWS: i64 = 0 - 4
49const CRES_E_WRITE: i64 = 0 - 5
50const CRES_E_OVERFLOW: i64 = 0 - 6
51const CRES_E_BARE: i64 = 0 - 7
54const CRES_GROW: i64 = 6
55const CRES_PER_ROW: i64 = 2048
56const CRES_FIXED: i64 = 32768
57const CRES_PATHB: i64 = 1024
58const CRES_CH_HASH: i64 = 35 // the fragment mark, written as a byte: the lexer reads that character inside a literal as a comment

functions

60func cres_streq_span(buf: *u8, s1: i64, e1: i64, s2: i64, e2: i64) -> i64
66func cres_span_cstr(buf: *u8, s: i64, e: i64) -> *u8
called by 2: cres_cardcres_any_adult calls 1: sys_mmap
73func cres_count_lines(buf: *u8, n: i64) -> i64
82func cres_parse(buf: *u8, n: i64, rows: *i64, rep: *i64) -> i64
149func cres_f(out: *u8, o: i64, cap: i64, buf: *u8, rows: *i64, r: i64, f: i64) -> i64
152func cres_f_is_none(buf: *u8, rows: *i64, r: i64, f: i64) -> i64
called by 2: cres_cardcres_any_adult calls 1: rvl_span_is
156func cres_kind_first(buf: *u8, rows: *i64, nrows: i64, r: i64) -> i64
called by 1: cres_render calls 1: cres_streq_span
166func cres_kind_count(buf: *u8, rows: *i64, nrows: i64, r: i64) -> i64
called by 1: cres_render calls 1: cres_streq_span
177func cres_catn(out: *u8, o: i64, cap: i64, v: i64) -> i64
called by 2: crc_putncres_render calls 2: sys_mmaprvl_cat
190func cres_card(out: *u8, o: i64, cap: i64, buf: *u8, rows: *i64, r: i64, pol: *u8, pn: i64, tally: *i64) -> i64
216func cres_any_adult(buf: *u8, rows: *i64, nrows: i64, pol: *u8, pn: i64) -> i64
230func cres_render(dom: *u8, buf: *u8, n: i64, pol: *u8, pn: i64, out: *u8, cap: i64, rep: *i64) -> i64
320func cres_write(path: *u8, buf: *u8, n: i64) -> i64
336func cres_emit_file(dom: *u8, results_path: *u8, out_path: *u8, rep: *i64) -> i64