code wiki / _hdl_build / nx_genesis_lineage.nx

nx_genesis_lineage.nx

buildroot/runtime/_hdl_build/nx_genesis_lineage.nx

10324 B244 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic genesis
docsdependenciesstructsconstsfunctions

about

nx_genesis_lineage.nx -- the GENESIS-SPINE lineage emitter (closes X-GEN-LINEAGE w=9, the cardinal hidden corner: the genesis/adam toolchain has ZERO rows in lineage.tsv so "the engine cannot see its own birth", BOOTSTRAP_MAP s4 #5 = WIKI_STRUCTURE s4 #10). AUTHOR=ORGAN: the ORGAN authors the registry rows; Claude does NOT hand-write lineage. The parent->child edges + genetics are SOURCED DATA in knowledge/specs/genesis_descent.spec.tsv (transcribed from the anchored BOOTSTRAP_MAP s3 descent table). This organ: 1. reads the spec (field delimiter '|', rewritten to TAB on emit), 2. loads the children already in lineage.tsv (idempotency: a child already present is SKIPPED), 3. REFUSES any row whose parent is neither the spore, an existing lineage child, nor a batch sibling -- it will never author a BROKEN LINK (the wiki's author-time "born with a home or not at all" guard, applied to genealogy), 4. appends the surviving rows to lineage.tsv and logs a GENLINEAGE verdict. The independent PROOF that the chain actually roots at the spore is nx_root_trace (separate organ); a wrong edge here cannot go green there. Idempotent (rerun = emitted=0 skipped=N), additive-only (append, never overwrite -- rule 13). Sovereign syscalls only. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_genesis_lineage.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_openat_rd gl_w sys_write sys_exit sys_read sys_close gl_field gl_load_children sys_mmap ↻ sys_openat_rd ↻ sys_read ↻ sys_close ↻ sys_openat_append gl_in_set gl_streq gl_validate sys_mmap ↻ gl_in_set ↻ gl_append sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gl_report gl_w ↻ gl_wn nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

19const GL_MAGIC_4096: i64 = 4096
20const GL_MAGIC_1048576: i64 = 1048576
21const GL_MAGIC_1048575: i64 = 1048575
22const GL_MAGIC_131072: i64 = 131072
23const GL_MAGIC_131071: i64 = 131071
25const GL_SPEC: *u8 = "knowledge/specs/genesis_descent.spec.tsv"
26const GL_LIN: *u8 = "knowledge/registry/lineage.tsv"
27const GL_LOG: *u8 = "knowledge/status/genesis_lineage.log"
28const GL_IDCAP: i64 = 48

functions

30func gl_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 2: gl_reportmain calls 1: sys_write
35func gl_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 1: gl_report calls 1: nxi_fd
37func gl_streq(a: *u8, b: *u8) -> i64
called by 1: gl_in_set
43func gl_in_set(arena: i64, cnt: i64, idcap: i64, name: *u8) -> i64
called by 2: gl_validatemain calls 1: gl_streq
50func gl_field(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8, outcap: i64) -> i64
called by 1: main
70func gl_validate(parents: *u8, ea: i64, ec: i64, ba: i64, bc: i64, idcap: i64) -> i64
called by 1: main calls 2: sys_mmapgl_in_set
99func gl_append(fd: i64, buf: *u8, ls: i64, le: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
114func gl_load_children(path: *u8, arena: i64, idcap: i64, maxc: i64) -> i64
153func gl_report(fd: i64, nl: i64, emitted: i64, skipped: i64, refused: i64, epoch: i64, ok: i64) -> i64
called by 1: main calls 2: gl_wgl_wn
163func main(argc: i64, argv: *i64) -> i64