code wiki / (root) / nx_idea_genealogist.nx

nx_idea_genealogist.nx

buildroot/runtime/nx_idea_genealogist.nx

18054 B387 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic idea
docsdependenciesstructsconstsfunctions

about

nx_idea_genealogist.nx -- the IDEA/ATTRIBUTION genealogist (top-down): records WHO/WHAT/WHERE/ WHY/WHEN/HOW an insight came from and the idea->idea chain that produced it, then BRIDGES each idea into the bottom-up code/math tree via realized_in (an id that must resolve in lineage.tsv or math_genealogy.tsv). Sibling to nx_math_genealogist / nx_oracle_genealogist / nx_genesis_lineage. AUTHOR=ORGAN: this organ authors the registry rows; Claude does NOT hand-write idea_genealogy.tsv. The 5W1H + edges are SOURCED DATA in knowledge/specs/idea_genealogy.spec.tsv (transcribed from well-established public attributions). This organ, modelled on nx_genesis_lineage: 1. reads the spec (field delimiter '|', rewritten to TAB on emit), 2. loads idea_ids already in idea_genealogy.tsv (idempotency: present idea = SKIPPED), 3. loads the BRIDGE universe = lineage.tsv field0 (child ids) + math_genealogy.tsv field1 (foundation ids), 4. validates each row and REFUSES only a real lie -- a broken descends_from (idea-chain to nothing) or a SOURCED row with an empty source (fabricated citation). An unresolved realized_in is NOT refused: it is a RECORD-HINT that names a no-orphans gap. 5. appends the surviving rows to idea_genealogy.tsv and logs an IDEAGENEAL verdict. Idempotent (rerun = emitted=0 skipped=N), additive-only (append, never overwrite -- rule 13). Sovereign syscalls only. module: nishi-core.genealogy.idea_genealogist capability: GENEALOGY license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_idea_genealogist.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 ig_streq sys_mmap sys_openat_rd ig_w sys_write sys_exit sys_read sys_close ig_field ig_load_field sys_mmap ↻ sys_openat_rd ↻ sys_read ↻ sys_close ↻ sys_openat_wr ig_wheader ig_w ↻ sys_mmap ↻ sys_openat_append ig_in_set ig_streq ↻ ig_desc_valid sys_mmap ↻ ig_in_set ↻ ig_bridge sys_mmap ↻ ig_in_set ↻ ig_append sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_renameat ig_report ig_w ↻ ig_wn sys_mmap ↻ sys_write ↻

structs

none

consts

23const IG_MAGIC_8192: i64 = 8192
24const IG_MAGIC_1048576: i64 = 1048576
25const IG_MAGIC_1048575: i64 = 1048575
26const IG_MAGIC_262144: i64 = 262144
27const IG_MAGIC_262143: i64 = 262143
28const IG_MAGIC_1024: i64 = 1024
30const IG_SPEC: *u8 = "knowledge/specs/idea_genealogy.spec.tsv"
31const IG_OUT: *u8 = "knowledge/registry/idea_genealogy.tsv"
32const IG_LIN: *u8 = "knowledge/registry/lineage.tsv"
33const IG_MATHG: *u8 = "knowledge/registry/math_genealogy.tsv"
34const IG_LOG: *u8 = "knowledge/status/idea_genealogy.log"
35const IG_IDCAP: i64 = 64

functions

37func ig_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 3: ig_wheaderig_reportmain calls 1: sys_write
38func ig_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48 as u8;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 }
called by 1: ig_report calls 2: sys_mmapsys_write
41func ig_wheader(fd: i64) -> i64
called by 1: main calls 2: ig_wsys_mmap
60func ig_streq(a: *u8, b: *u8) -> i64
called by 2: ig_in_setmain
66func ig_in_set(arena: i64, cnt: i64, idcap: i64, name: *u8) -> i64
called by 3: ig_desc_validig_bridgemain calls 1: ig_streq
73func ig_field(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8, outcap: i64) -> i64
called by 1: main
93func ig_desc_valid(parents: *u8, ea: i64, ec: i64, ba: i64, bc: i64, idcap: i64) -> i64
called by 1: main calls 2: sys_mmapig_in_set
122func ig_bridge(realized: *u8, br: i64, brc: i64, idcap: i64) -> i64
called by 1: main calls 2: sys_mmapig_in_set
156func ig_append(fd: i64, buf: *u8, ls: i64, le: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
171func ig_load_field(path: *u8, fidx: i64, arena: i64, base: i64, idcap: i64, maxc: i64) -> i64
223func ig_report(fd: i64, nl: i64, emitted: i64, skipped: i64, refused: i64, hints: i64, bridged: i64, credit_only: i64, epoch: i64, ok: i64) -> i64
called by 1: main calls 2: ig_wig_wn
236func main(argc: i64, argv: *i64) -> i64