code wiki / (root) / nx_field_discover.nx

nx_field_discover.nx

buildroot/runtime/nx_field_discover.nx

16972 B280 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic field
docsdependenciesstructsconstsfunctions

about

nx_field_discover.nx -- DISCOVER THE FIELD FOR ONE /compare DOMAIN (/compare/fieldwatch FW1, 2026-09-05): the thin program over nx_field_lib. Reads buildroot/knowledge/compare/<dom>.seeds (seed|key|url|kind|why[|Display Name]), mirrors every seed through the sovereign fetcher (provenance-pinned into knowledge/fetched/cmp_field_<dom>_<key>.<ext>), runs the kind's extractor over the mirror, and writes buildroot/knowledge/compare/<dom>.field -- the population of rivals with evidence counts, which the compare emitter renders and against which a matrix's columns are measured as a subset. KINDS: wiki-raw gh-topic md-list are DISCOVERY seeds (the industry's own lists, read mechanically); named is a DECLARED member of the population (operator correction 2026-09-05: Nexus Mods, LoversLab and the other major modding communities were absent from every discovered list, so the population is ENUMERATED as data, every member's home page mirrored and pinned, and the discovery seeds CORROBORATE it -- a member also named by a public list carries seeds_hit >= 2). Usage: nx_field_discover <dom> [--nofetch] --nofetch reuses the mirrors already on disk (no network) Receipt: FIELD-OK dom= seeds= fetched= reused= failed= named= candidates= mentions= capped= bytes= (partition printed) Exits: 0 ok | 2 usage | 3 refused (no seeds file, no seed rows, output unwritable) | 4 every seed failed license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_field_lib.nx nx_field_discover.nx

imports: nx_syscalls.nxnx_tool_run.nxnx_field_lib.nx

imported by: nobody (leaf or entry point)

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

main fd_err sys_write fd_slen sys_chdir 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 ↻ fd_out sys_write ↻ fd_slen ↻ fd_streq sys_mmap ↻ fd_cat fd_exists sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close fl_tbl_new sys_mmap ↻ fd_count_seed_rows fd_span_eq fd_kind_code

structs

none

consts

19const FD_ROOT: *u8 = "/volume1/homes/elderwesto/nishihost/"
20const FD_FETCHER: *u8 = "/volume1/homes/elderwesto/nishihost/_offc/nx_research_fetch.elf"
21const FD_SEEDS_DIR: *u8 = "buildroot/knowledge/compare/"
22const FD_MIRROR_DIR: *u8 = "knowledge/fetched/"
23const FD_MIRROR_PFX: *u8 = "cmp_field_"
24const FD_PATH_CAP: i64 = 1024
25const FD_KEY_CAP: i64 = 96
30const FD_SEED_F: i64 = 6 // seed|key|url|kind|why|Display Name -- the sixth field is read only for kind named
31const FD_SEED_MIN: i64 = 5 // a row needs at least seed|key|url|kind|why
32const FD_F_NAME: i64 = 5 // index of the Display Name field
33const FD_CAPCAP: i64 = 262144
34const FD_ARGVN: i64 = 8
35const FD_MODE: i64 = 0x1a4
36const FD_EXIT_USAGE: i64 = 2
37const FD_EXIT_REFUSE: i64 = 3
38const FD_EXIT_ALLFAIL: i64 = 4
39const FD_CH_NL: i64 = 10
40const FD_CH_PIPE: i64 = 124
41const FD_CH_HASH: i64 = 35
42const FD_CH_MINUS: i64 = 45
43const FD_OUTFD: i64 = 1
44const FD_ERRFD: i64 = 2

functions

46func fd_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
48func fd_count_seed_rows(sb: *u8, sn: i64) -> i64
called by 1: main
59func fd_out(s: *u8) -> i64 { sys_write(FD_OUTFD, s, fd_slen(s)); return 0 }
called by 1: main calls 2: sys_writefd_slen
60func fd_err(s: *u8) -> i64 { sys_write(FD_ERRFD, s, fd_slen(s)); return 0 }
called by 1: main calls 2: sys_writefd_slen
61func fd_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { if off + i < FD_PATH_CAP - 1 { dst[off + i] = s[i] } i = i + 1 } var o: i64 = off + i; if o > FD_PATH_CAP - 1 { o = FD_PATH_CAP - 1 } dst[o] = 0 as u8; return o }
called by 1: main
62func fd_catn(dst: *u8, off: i64, b: *u8, s: i64, e: i64) -> i64 { var i: i64 = 0; while s + i < e { if off + i < FD_PATH_CAP - 1 { dst[off + i] = b[s + i] } i = i + 1 } var o: i64 = off + i; if o > FD_PATH_CAP - 1 { o = FD_PATH_CAP - 1 } dst[o] = 0 as u8; return o }
called by 1: main
63func fd_span_eq(b: *u8, s: i64, e: i64, lit: *u8) -> i64
called by 2: fd_kind_codemain
69func fd_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 }
called by 1: main
70func fd_kind_code(b: *u8, s: i64, e: i64) -> i64
called by 1: main calls 1: fd_span_eq
77func fd_ext(kind: i64) -> *u8
called by 1: main
83func fd_exists(path: *u8, lenout: *i64) -> *u8
called by 1: main calls 2: sys_mmapsys_read_file
93func fd_same(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
100func fd_fetch(url: *u8, dest: *u8, cap: *u8, olen: *i64) -> i64
called by 1: main calls 3: sys_mmaptr_run_capturefd_slen
121func main(argc: i64, argv: *i64) -> i64