code wiki / (root) / nx_refcorpus.nx

nx_refcorpus.nx

buildroot/runtime/nx_refcorpus.nx

10635 B234 linesdepth 2pulls 2 transitivereach 5 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_refcorpus.nx -- THE MEASURED-FACTS PLANE + ITS ADMISSION CONTRACT. WHY THIS EXISTS. The Reciprocal Corpus Program (published 2026-08-04 at /code/research_reciprocal_corpus_program) makes two promises in public: (1) we retain ZERO asset bytes from any reference corpus -- only measurements; (2) we publish only AGGREGATE statistics, never anything reconstructable to one creator. A promise in prose is worth nothing. This organ is where those promises become MECHANICAL: every fact entering the corpus store passes an admission contract that REFUSES anything that could carry asset payload or describe too few sources, and the gate proves the refusals fire. ★THE CORE INSIGHT: a measurement is SMALL AND PLAIN. A vertex count, a texel resolution, a slider mean -- these are short numeric or short-label values. Asset payload (base64 texture, mesh blob, embedded binary) is LONG or NON-PLAIN. So an admission rule of "short + plain + declared sample size" is not a heuristic dressed as a guarantee: it is a structural wall that a payload cannot pass through while every legitimate measurement passes trivially. ROW SHAPE (append-only journal; a journal, not a registry -- ws_sync.jrnl precedent): epoch <TAB> source <TAB> fact_key <TAB> value <TAB> unit <TAB> n <TAB> provenance <TAB> license nx_refcorpus put <source> <fact_key> <value> <unit> <n> <provenance> <license> nx_refcorpus admit <value> <n> -- dry-run the contract, print the verdict nx_refcorpus list [max] license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 5 importers

nx_syscalls.nx nx_refcorpus.nx nx_mediafacts.nx nx_mediafacts_gate.nx nx_modelfacts.nx nx_refcorpus_gate.nx nx_varfacts.nx

imports: nx_syscalls.nx

imported by: nx_mediafacts.nxnx_mediafacts_gate.nxnx_modelfacts.nxnx_refcorpus_gate.nxnx_varfacts.nx

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

main rc_e sys_write rc_slen sys_exit rc_atoi rc_admit rc_slen ↻ rc_w sys_write ↻ rc_slen ↻ rc_num sys_write ↻ sys_mmap rc_slen ↻ rc_reason rc_e ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_write ↻ rc_put_row rc_admit ↻ rc_reason ↻ rc_e ↻ rc_slen ↻ sys_mmap ↻ rc_appn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real rc_apps sys_openat_append sys_write ↻ sys_close ↻

structs

none

consts

26const RC_MAGIC_1024: i64 = 1024
28const RC_JRNL: *u8 = "knowledge/status/refcorpus.jrnl"
31const RC_MAX_VAL: i64 = 64
32const RC_MAX_FIELD: i64 = 160
36const RC_KMIN: i64 = 8
37const RC_MODE: i64 = 0x1a4
38const RC_EXIT_USAGE: i64 = 2
39const RC_EXIT_REFUSED: i64 = 5
40const RC_EXIT_IO: i64 = 1

functions

42func rc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
43func rc_w(s: *u8) -> i64 { sys_write(1, s, rc_slen(s)); return 0 }
called by 2: rc_put_rowmain calls 2: sys_writerc_slen
44func rc_e(s: *u8) -> i64 { sys_write(2, s, rc_slen(s)); return 0 }
45func rc_num(v: i64) -> i64
called by 2: rc_put_rowmain calls 2: sys_writesys_mmap
58func rc_atoi(s: *u8) -> i64
called by 1: main
81func rc_admit(value: *u8, n: i64) -> i64
called by 4: mainrc_put_rowmainmain calls 1: rc_slen
106func rc_reason(code: i64) -> i64
called by 2: rc_put_rowmain calls 1: rc_e
114func rc_apps(buf: *u8, p: i64, s: *u8) -> i64
called by 1: rc_put_row
120func rc_appn(buf: *u8, p: i64, v: i64) -> i64
called by 1: rc_put_row calls 1: sys_mmap
138func rc_put_row(src: *u8, key: *u8, val: *u8, unit: *u8, n: i64, prov: *u8, lic: *u8) -> i64
186func main(argc: i64, argv: *i64) -> i64