code wiki / (root) / nx_genealogist_gapscan.nx

nx_genealogist_gapscan.nx

buildroot/runtime/nx_genealogist_gapscan.nx

8335 B188 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_genealogist_gapscan.nx -- the Nishi GENEALOGIST's gap-scanner (FamilySearch-for-code: "find the missing gaps"), sovereign NishiLang (raw syscalls, no shell/sed/awk). (renamed from nx_genealogist to un-shadow the DISTINCT _hdl_build/nx_genealogist anti-DUPLICATION library -- that one prevents rebuilding what exists; this one finds what is MISSING. Two facets, one old name.) Mechanizes the Genealogist leg of the "what comes next" plan: it scans a registry of modules for GAP MARKERS (TODO_SILICON = an unbuilt/stub silicon path; SEED = a not-yet-matured module) and reports which modules carry which. Each gap it finds is fused (in NISHI_WHAT_COMES_NEXT.md) with the RESEARCHER's target for that capability (NISHI_RESEARCH_BASIS.md) to produce a ranked next-step -- so the roadmap is DERIVED from code-state x research, not hand-curated, and re-derives itself as we build (gaps shrink, plan updates). DATA-DRIVEN (Cardinal 11, fixed 2026-06-16): the scan targets and the DRY threshold are NO LONGER hardcoded. The old organ baked `let N=4` / `let M=6` + two arrays of absolute paths straight into code -- the exact magic-number / data-in-code smell. Now the target list lives in DATA (knowledge/registry/genealogist_targets.tsv: kind<TAB>name<TAB>path), the counts are DERIVED from the row count, and the DRY threshold is one named const. Add/remove a module = edit the data file, no code change (Cardinal 25); the scan re-derives from current data every run (fresh, not a baked snapshot). Bounded length-safe substring scan over the raw file bytes (sys_read_file), so it never over-reads. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_genealogist_gapscan.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write sys_mmap g_scan sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close g_field g_streq g_file_has sys_mmap ↻ sys_read_file ↻ g_find g_strlen g_puts ↻ sys_exit g_putn sys_write ↻ sys_mmap ↻ g_file_has ↻

structs

none

consts

28const G_TGT_FILE: *u8 = "knowledge/registry/genealogist_targets.tsv"
32const G_DUP_DRY_THRESHOLD: i64 = 3

functions

34func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: g_scanmain calls 1: sys_write
35func g_putn(n: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
45func g_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } return n }
called by 1: g_find
47func g_streq(a: *u8, b: *u8) -> i64
called by 1: g_scan
55func g_find(hay: *u8, hlen: i64, needle: *u8) -> i64
called by 1: g_file_has calls 1: g_strlen
73func g_file_has(path: *u8, marker: *u8) -> i64
84func g_field(b: *u8, ls: i64, le: i64, f: i64, out: *u8) -> i64
called by 1: g_scan
103func g_scan(tgtfile: *u8, outs: *i64) -> i64
158func main() -> i64