_idea_genealogy_gate.nx
buildroot/runtime/_idea_genealogy_gate.nx
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
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
structs
| none |
consts
| 24 | const ELF: *u8 = "/tmp/nx_idea_genealogist.sov.elf" |
| 25 | const LIN: *u8 = "knowledge/registry/lineage.tsv" |
| 26 | const MATHG: *u8 = "knowledge/registry/math_genealogy.tsv" |
| 27 | const GATELOG: *u8 = "knowledge/status/idea_genealogy_gate.log" |
functions
| 29 | func 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 } |
| 30 | func 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 } |
| 32 | func gg_catstr(buf: *u8, pos: i64, s: *u8) -> i64 called by 1: gg_mkpath |
| 37 | func gg_catnum(buf: *u8, pos: i64, v: i64) -> i64 |
| 48 | func gg_mkpath(buf: *u8, epoch: i64, tag: *u8) -> i64 |
| 57 | func gg_writefile(path: *u8, content: *u8) -> i64 |
| 67 | func gg_count_rows(path: *u8) -> i64 |
| 87 | func gg_run(elf: *u8, spec: *u8, out: *u8, log: *u8, lin: *u8, mathg: *u8) -> i64 |
| 113 | func gg_report(fd: i64, r0: i64, rows0: i64, r1: i64, r2: i64, r3: i64, r4: i64, rows1: i64, epoch: i64, ok: i64) -> i64 |
| 126 | func main() -> i64 |