nx_varcensus.nx
buildroot/runtime/nx_varcensus.nx
about
nx_varcensus.nx -- THE VaM CORPUS CENSUS SURFACE (laptop-local lane, 2026-09-11).
nx_varcensus names <file.var> one row per central-directory record (the package's own manifest)
nx_varcensus meta <file.var> meta.json's DIRECT top-level members: key, kind, size; short strings
nx_varcensus census <dir> <outdir> <rules.conf> EVERY .var under <dir>, recursively, into TSV reports + a summary
WHY A SECOND CLI BESIDE nx_varfacts: nx_varfacts is the refcorpus WRITER (it imports nx_refcorpus for rc_put_row and the
NAS plane); this surface runs where the corpus lives (the laptop) and writes reports. Both consume the ONE walk in
nx_varfacts_lib (vf_cd_locate / vf_cd_entry / vf_member_data / vf_json_*): no second zip reader and no second JSON reader
exist here, and the classifier is DATA (nx_varcensus_lib rules). ASSET BYTES ARE NEVER OPENED: the only member this organ
reads is meta.json, the package describing itself; images and video are never decoded, viewed or copied out.
THE CENSUS CONTRACT (each asserted, each printed with its sum):
packages walked = ok + no_eocd + zip64_eocd + window + short + read_fail + record_refused + unopenable
for the OK packages: members = sum over role classes = sum over format classes; meta parsed + absent + unreadable +
unparsed = ok packages; licence label rows sum to ok packages. A package that is not OK is named in unreadable.tsv.
A meta string longer than VC_SHOW_STR_MAX prints its LENGTH only in the meta verb -- free text is not needed to learn a
schema, and the bound is announced on every row it applies to (shown=0), never silent.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_varfacts_lib.nxnx_varcensus_lib.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
| 24 | const VC_FD_OUT: i64 = 1 |
| 25 | const VC_FD_ERR: i64 = 2 |
| 26 | const VC_EXIT_OK: i64 = 0 |
| 27 | const VC_EXIT_IO: i64 = 1 |
| 28 | const VC_EXIT_USAGE: i64 = 2 |
| 29 | const VC_EXIT_MISMATCH: i64 = 3 |
| 30 | const VC_EXIT_REFUSED: i64 = 4 |
| 31 | const VC_SEEK_SET: i64 = 0 |
| 32 | const VC_SEEK_END: i64 = 2 |
| 33 | const VC_DEC: i64 = 10 |
| 34 | const VC_ASCII_0: i64 = 48 |
| 35 | const VC_ASCII_MINUS: i64 = 45 |
| 36 | const VC_PRINT_LO: i64 = 32 |
| 37 | const VC_DEL: i64 = 127 |
| 38 | const VC_QMARK: i64 = 63 |
| 39 | const VC_PAD: i64 = 16 |
| 40 | const VC_LINE_ROOM: i64 = 1024 |
| 41 | const VC_ST_N: i64 = 4 |
| 42 | const VC_ST_SIZE: i64 = 0 |
| 43 | const VC_ST_LOC: i64 = 1 |
| 44 | const VC_ST_WIN: i64 = 2 |
| 45 | const VC_ST_READFAIL: i64 = 9 |
| 46 | const VC_SHOW_STR_MAX: i64 = 80 |
| 47 | const VC_SHOW_ELEMS: i64 = 5 |
| 48 | const VC_MB_LEN: i64 = 0 |
| 49 | const VC_MB_STATE: i64 = 1 |
| 50 | const VC_MB_FOUND: i64 = 2 |
| 51 | const VC_MB_METHOD: i64 = 3 |
| 52 | const VC_MB_N: i64 = 4 |
| 53 | const VC_META_NAME: *u8 = "meta.json" |
| 54 | const VC_DEPS_KEY: *u8 = "dependencies" |
| 55 | const VC_CONTENT_KEY: *u8 = "contentList" |
| 56 | const VC_LIC_KEY: *u8 = "licenseType" |
| 57 | const VC_CREATOR_KEY: *u8 = "creatorName" |
| 58 | const VC_PACKAGE_KEY: *u8 = "packageName" |
| 59 | const VC_PROGVER_KEY: *u8 = "programVersion" |
| 62 | const VC_PATH_MAX: i64 = 4096 // Linux PATH_MAX: a longer path cannot be opened by name at all (counted, never skipped silently) |
| 63 | const VC_DENT_BUF: i64 = 65536 // one getdents64 batch; the walk loops until the call returns 0 |
| 64 | const VC_NAME_BUF: i64 = 65536 // a ZIP member name length is a u16, so no member name is longer |
| 65 | const VC_STAT_BUF: i64 = 144 |
| 66 | const VC_S_MODE: i64 = 24 |
| 67 | const VC_S_IFMT: i64 = 0xf000 |
| 68 | const VC_S_IFDIR: i64 = 0x4000 |
| 69 | const VC_S_IFREG: i64 = 0x8000 |
| 70 | const VC_DT_UNKNOWN: i64 = 0 |
| 71 | const VC_FLAG_UTF8: i64 = 2048 |
| 72 | const VC_LEGACY_LIC: i64 = 64 |
| 73 | const VC_NLETTERS: i64 = 26 |
| 74 | const VC_ASCII_UPPER_A: i64 = 65 |
| 75 | const VC_TAB: i64 = 9 |
| 76 | const VC_LF: i64 = 10 |
| 77 | const VC_SLASH: i64 = 47 |
| 78 | const VC_DOT: i64 = 46 |
| 79 | const VC_ROW_SEP: i64 = 44 |
| 80 | const VC_EQ: i64 = 61 |
| 82 | const VC_P_OK: i64 = 0 |
| 83 | const VC_P_NOEOCD: i64 = 1 |
| 84 | const VC_P_ZIP64: i64 = 2 |
| 85 | const VC_P_WINDOW: i64 = 3 |
| 86 | const VC_P_SHORT: i64 = 4 |
| 87 | const VC_P_READFAIL: i64 = 5 |
| 88 | const VC_P_RECORD: i64 = 6 |
| 89 | const VC_P_UNOPENABLE: i64 = 7 |
| 94 | const VC_P_EMPTY: i64 = 8 |
| 95 | const VC_P_NOEOCD_PK: i64 = 9 |
| 96 | const VC_P_NOEOCD_OTHER: i64 = 10 |
| 97 | const VC_P_N: i64 = 11 |
| 98 | const VC_HEAD_LEN: i64 = 4 |
| 100 | const VC_M_PARSED: i64 = 0 |
| 101 | const VC_M_ABSENT: i64 = 1 |
| 102 | const VC_M_UNREADABLE: i64 = 2 |
| 103 | const VC_M_UNPARSED: i64 = 3 |
| 104 | const VC_M_N: i64 = 4 |
| 106 | const VC_W_DIRS: i64 = 0 |
| 107 | const VC_W_DIRS_UNREADABLE: i64 = 1 |
| 108 | const VC_W_VARS: i64 = 2 |
| 109 | const VC_W_VARS_TOP: i64 = 3 |
| 110 | const VC_W_OTHER_FILES: i64 = 4 |
| 111 | const VC_W_SYMLINKS: i64 = 5 |
| 112 | const VC_W_OTHER_TYPES: i64 = 6 |
| 113 | const VC_W_TOO_LONG: i64 = 7 |
| 114 | const VC_W_N: i64 = 8 |
| 116 | const VC_L_AGREE: i64 = 0 |
| 117 | const VC_L_DISAGREE: i64 = 1 |
| 118 | const VC_L_LEGACY_ONLY: i64 = 2 |
| 119 | const VC_L_DIRECT_ONLY: i64 = 3 |
| 120 | const VC_L_NEITHER: i64 = 4 |
| 121 | const VC_L_N: i64 = 5 |
functions
| 123 | func vc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 124 | func vc_streq(a: *u8, b: *u8) -> i64 |
| 130 | func vc_wn(fd: i64, s: *u8, n: i64) -> i64 |
| 141 | func vc_w(fd: i64, s: *u8) -> i64 { return vc_wn(fd, s, vc_slen(s)) } |
| 142 | func vc_cat(b: *u8, o: i64, s: *u8) -> i64 |
| 147 | func vc_catn(b: *u8, o: i64, v: i64) -> i64 |
| 160 | func vc_catb(b: *u8, o: i64, src: *u8, s: i64, n: i64) -> i64 |
| 173 | func vc_pread(fd: i64, off: i64, len: i64, buf: *u8) -> i64 |
| 186 | func vc_state_name(s: i64) -> *u8 |
| 195 | func vc_pstate_name(s: i64) -> *u8 called by 1: vc_census |
| 211 | func vc_rank_before(c: *i64, x: i64, y: i64) -> i64 |
| 221 | func vc_counter_sorted_tsv(a: *i64, c: *i64) -> i64 called by 1: vc_census calls 10: vcl_counter_nsys_mmapvc_rank_beforevcl_appcleanvcl_counter_keyvcl_counter_klen+4 |
| 255 | func vc_pstate_of(loc: i64) -> i64 called by 1: vc_census |
| 263 | func vc_md_name(s: i64) -> *u8 called by 1: vc_meta |
| 269 | func vc_kind_name(k: i64) -> *u8 called by 1: vc_meta |
| 280 | func vc_window(fd: i64, size: i64, box: *i64, st: *i64) -> *u8 |
| 307 | func vc_meta_read(fd: i64, size: i64, win: *u8, winn: i64, box: *i64, mbox: *i64) -> *u8 |
| 356 | func vc_names(path: *u8) -> i64 |
| 436 | func vc_meta(path: *u8) -> i64 |
| 584 | func vc_cmp(a: *u8, b: *u8) -> i64 |
| 596 | func vc_sort(paths: *i64, offs: *i64) -> i64 |
| 620 | func vc_ext_key(s: *u8, n: i64, out: *u8) -> i64 |
| 639 | func vc_prefix2_key(s: *u8, n: i64, out: *u8) -> i64 |
| 658 | func vc_walk(root: *u8, paths: *i64, offs: *i64, exts: *i64, ws: *i64, unread: *i64) -> i64 |
| 767 | func vc_write_out(dir: *u8, name: *u8, a: *i64, total: *i64) -> i64 |
| 784 | func vc_kv(a: *i64, k: *u8, v: i64) -> i64 |
| 793 | func vc_get_str(data: *u8, n: i64, obj: i64, key: *u8, jm: *i64, out: *u8) -> i64 |
| 802 | func vc_app_counts(a: *i64, rs: *i64, axis: i64, counts: *i64, nclass: i64) -> i64 |
| 819 | func vc_counter_tsv(a: *i64, c: *i64, prefix: *u8) -> i64 |
| 832 | func vc_census(root: *u8, outdir: *u8, rulespath: *u8) -> i64 |
| 1346 | func main(argc: i64, argv: *i64) -> i64 |