code wiki / (root) / _idea_genealogy_gate.nx

_idea_genealogy_gate.nx

buildroot/runtime/_idea_genealogy_gate.nx

7822 B182 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic idea
docsdependenciesstructsconstsfunctions

about

_idea_genealogy_gate.nx -- the no-mocks tamper gate for nx_idea_genealogist. AUTHOR=ORGAN, NO MOCKS: this gate FORKS + EXECVEs the REAL built elf (/tmp/nx_idea_genealogist.sov.elf) over a /tmp SCRATCH WORLD (epoch-unique filenames -> immune to the openat_wr no-TRUNC stale-tail landmine), passing scratch spec/out/log via the organ's argv path-override while pointing the BRIDGE at the REAL lineage.tsv + math_genealogy.tsv. The real registry is NEVER touched. It asserts the organ's contract end-to-end: C0 GOOD (2 valid rows, bridge resolves) -> exit 0 (GREEN) + 2 rows emitted C1 SOURCED-empty (source_status=SOURCED, empty source) -> exit 1 (RED, liar-kill) C2 broken-chain (descends_from points at a ghost idea) -> exit 1 (RED) C3 bad-credit (credit_class not a declared posture) -> exit 1 (RED) C4 idempotent (rerun C0 over the populated scratch out) -> exit 0 + STILL 2 rows (emitted=0) TAMPER-PROOF: the gate is GREEN only if every tamper world is RED AND the good world is GREEN -- a toothless organ that accepted a lie would flip the gate RED. Sovereign syscalls only. module: nishi-core.genealogy.idea_genealogy_gate depends: nishi-core.genealogy.idea_genealogist capability: GATE license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _idea_genealogy_gate.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 sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ gg_mkpath gg_catstr gg_catnum sys_mmap ↻ gg_writefile sys_openat_wr sys_write sys_close gg_run sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 gg_count_rows sys_mmap ↻ sys_openat_rd sys_read sys_close ↻ gg_report gg_w sys_write ↻ gg_wn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close ↻ sys_exit ↻

structs

none

consts

24const ELF: *u8 = "/tmp/nx_idea_genealogist.sov.elf"
25const LIN: *u8 = "knowledge/registry/lineage.tsv"
26const MATHG: *u8 = "knowledge/registry/math_genealogy.tsv"
27const GATELOG: *u8 = "knowledge/status/idea_genealogy_gate.log"

functions

29func gg_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 1: gg_report calls 1: sys_write
30func gg_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: gg_report calls 2: sys_mmapsys_write
32func gg_catstr(buf: *u8, pos: i64, s: *u8) -> i64
called by 1: gg_mkpath
37func gg_catnum(buf: *u8, pos: i64, v: i64) -> i64
called by 1: gg_mkpath calls 1: sys_mmap
48func gg_mkpath(buf: *u8, epoch: i64, tag: *u8) -> i64
called by 1: main calls 2: gg_catstrgg_catnum
57func gg_writefile(path: *u8, content: *u8) -> i64
67func gg_count_rows(path: *u8) -> i64
87func gg_run(elf: *u8, spec: *u8, out: *u8, log: *u8, lin: *u8, mathg: *u8) -> i64
113func gg_report(fd: i64, r0: i64, rows0: i64, r1: i64, r2: i64, r3: i64, r4: i64, rows1: i64, epoch: i64, ok: i64) -> i64
called by 1: main calls 2: gg_wgg_wn
126func main() -> i64