code wiki / (root) / nx_varcensus.nx

nx_varcensus.nx

buildroot/runtime/nx_varcensus.nx

63035 B1365 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind tooltopic varcensus
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_varfacts_lib.nx nx_varcensus_lib.nx nx_varcensus.nx

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

main vc_w vc_wn sys_write vc_slen sys_exit vc_streq vc_names sys_openat_rd vc_w ↻ sys_lseek sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ vc_window vf_eocd_window sys_mmap ↻ vc_pread sys_lseek ↻ sys_read sys_munmap vf_cd_locate vf_u32 vf_u16 sys_close vc_cat vc_state_name vc_catn

structs

none

consts

24const VC_FD_OUT: i64 = 1
25const VC_FD_ERR: i64 = 2
26const VC_EXIT_OK: i64 = 0
27const VC_EXIT_IO: i64 = 1
28const VC_EXIT_USAGE: i64 = 2
29const VC_EXIT_MISMATCH: i64 = 3
30const VC_EXIT_REFUSED: i64 = 4
31const VC_SEEK_SET: i64 = 0
32const VC_SEEK_END: i64 = 2
33const VC_DEC: i64 = 10
34const VC_ASCII_0: i64 = 48
35const VC_ASCII_MINUS: i64 = 45
36const VC_PRINT_LO: i64 = 32
37const VC_DEL: i64 = 127
38const VC_QMARK: i64 = 63
39const VC_PAD: i64 = 16
40const VC_LINE_ROOM: i64 = 1024
41const VC_ST_N: i64 = 4
42const VC_ST_SIZE: i64 = 0
43const VC_ST_LOC: i64 = 1
44const VC_ST_WIN: i64 = 2
45const VC_ST_READFAIL: i64 = 9
46const VC_SHOW_STR_MAX: i64 = 80
47const VC_SHOW_ELEMS: i64 = 5
48const VC_MB_LEN: i64 = 0
49const VC_MB_STATE: i64 = 1
50const VC_MB_FOUND: i64 = 2
51const VC_MB_METHOD: i64 = 3
52const VC_MB_N: i64 = 4
53const VC_META_NAME: *u8 = "meta.json"
54const VC_DEPS_KEY: *u8 = "dependencies"
55const VC_CONTENT_KEY: *u8 = "contentList"
56const VC_LIC_KEY: *u8 = "licenseType"
57const VC_CREATOR_KEY: *u8 = "creatorName"
58const VC_PACKAGE_KEY: *u8 = "packageName"
59const VC_PROGVER_KEY: *u8 = "programVersion"
62const VC_PATH_MAX: i64 = 4096 // Linux PATH_MAX: a longer path cannot be opened by name at all (counted, never skipped silently)
63const VC_DENT_BUF: i64 = 65536 // one getdents64 batch; the walk loops until the call returns 0
64const VC_NAME_BUF: i64 = 65536 // a ZIP member name length is a u16, so no member name is longer
65const VC_STAT_BUF: i64 = 144
66const VC_S_MODE: i64 = 24
67const VC_S_IFMT: i64 = 0xf000
68const VC_S_IFDIR: i64 = 0x4000
69const VC_S_IFREG: i64 = 0x8000
70const VC_DT_UNKNOWN: i64 = 0
71const VC_FLAG_UTF8: i64 = 2048
72const VC_LEGACY_LIC: i64 = 64
73const VC_NLETTERS: i64 = 26
74const VC_ASCII_UPPER_A: i64 = 65
75const VC_TAB: i64 = 9
76const VC_LF: i64 = 10
77const VC_SLASH: i64 = 47
78const VC_DOT: i64 = 46
79const VC_ROW_SEP: i64 = 44
80const VC_EQ: i64 = 61
82const VC_P_OK: i64 = 0
83const VC_P_NOEOCD: i64 = 1
84const VC_P_ZIP64: i64 = 2
85const VC_P_WINDOW: i64 = 3
86const VC_P_SHORT: i64 = 4
87const VC_P_READFAIL: i64 = 5
88const VC_P_RECORD: i64 = 6
89const VC_P_UNOPENABLE: i64 = 7
94const VC_P_EMPTY: i64 = 8
95const VC_P_NOEOCD_PK: i64 = 9
96const VC_P_NOEOCD_OTHER: i64 = 10
97const VC_P_N: i64 = 11
98const VC_HEAD_LEN: i64 = 4
100const VC_M_PARSED: i64 = 0
101const VC_M_ABSENT: i64 = 1
102const VC_M_UNREADABLE: i64 = 2
103const VC_M_UNPARSED: i64 = 3
104const VC_M_N: i64 = 4
106const VC_W_DIRS: i64 = 0
107const VC_W_DIRS_UNREADABLE: i64 = 1
108const VC_W_VARS: i64 = 2
109const VC_W_VARS_TOP: i64 = 3
110const VC_W_OTHER_FILES: i64 = 4
111const VC_W_SYMLINKS: i64 = 5
112const VC_W_OTHER_TYPES: i64 = 6
113const VC_W_TOO_LONG: i64 = 7
114const VC_W_N: i64 = 8
116const VC_L_AGREE: i64 = 0
117const VC_L_DISAGREE: i64 = 1
118const VC_L_LEGACY_ONLY: i64 = 2
119const VC_L_DIRECT_ONLY: i64 = 3
120const VC_L_NEITHER: i64 = 4
121const VC_L_N: i64 = 5

functions

123func vc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
124func vc_streq(a: *u8, b: *u8) -> i64
called by 2: vc_walkmain
130func vc_wn(fd: i64, s: *u8, n: i64) -> i64
141func vc_w(fd: i64, s: *u8) -> i64 { return vc_wn(fd, s, vc_slen(s)) }
142func vc_cat(b: *u8, o: i64, s: *u8) -> i64
147func vc_catn(b: *u8, o: i64, v: i64) -> i64
called by 2: vc_namesvc_meta
160func vc_catb(b: *u8, o: i64, src: *u8, s: i64, n: i64) -> i64
called by 2: vc_namesvc_meta
173func vc_pread(fd: i64, off: i64, len: i64, buf: *u8) -> i64
186func vc_state_name(s: i64) -> *u8
called by 2: vc_namesvc_meta
195func vc_pstate_name(s: i64) -> *u8
called by 1: vc_census
211func vc_rank_before(c: *i64, x: i64, y: i64) -> i64
221func vc_counter_sorted_tsv(a: *i64, c: *i64) -> i64
255func vc_pstate_of(loc: i64) -> i64
called by 1: vc_census
263func vc_md_name(s: i64) -> *u8
called by 1: vc_meta
269func vc_kind_name(k: i64) -> *u8
called by 1: vc_meta
280func vc_window(fd: i64, size: i64, box: *i64, st: *i64) -> *u8
307func vc_meta_read(fd: i64, size: i64, win: *u8, winn: i64, box: *i64, mbox: *i64) -> *u8
356func vc_names(path: *u8) -> i64
436func vc_meta(path: *u8) -> i64
584func vc_cmp(a: *u8, b: *u8) -> i64
596func vc_sort(paths: *i64, offs: *i64) -> i64
called by 1: vc_census calls 3: vcl_vec_nvc_cmpvcl_at
620func vc_ext_key(s: *u8, n: i64, out: *u8) -> i64
called by 2: vc_walkvc_census calls 2: vc_catvcl_lc
639func vc_prefix2_key(s: *u8, n: i64, out: *u8) -> i64
called by 1: vc_census calls 1: vc_cat
658func vc_walk(root: *u8, paths: *i64, offs: *i64, exts: *i64, ws: *i64, unread: *i64) -> i64
767func vc_write_out(dir: *u8, name: *u8, a: *i64, total: *i64) -> i64
784func vc_kv(a: *i64, k: *u8, v: i64) -> i64
called by 1: vc_census calls 3: vcl_appcvcl_appsvcl_appn
793func vc_get_str(data: *u8, n: i64, obj: i64, key: *u8, jm: *i64, out: *u8) -> i64
802func vc_app_counts(a: *i64, rs: *i64, axis: i64, counts: *i64, nclass: i64) -> i64
819func vc_counter_tsv(a: *i64, c: *i64, prefix: *u8) -> i64
832func vc_census(root: *u8, outdir: *u8, rulespath: *u8) -> i64
1346func main(argc: i64, argv: *i64) -> i64