code wiki / _hdl_build / nx_vizsla_relate_gate.nx

nx_vizsla_relate_gate.nx

buildroot/runtime/_hdl_build/nx_vizsla_relate_gate.nx

14919 B334 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic vizsla
docsdependenciesstructsconstsfunctions

about

nx_vizsla_relate_gate.nx -- VIZSLA V4 gate: the relationships/PRM engine is gate-proven against a HAND-COMPUTED fixture (the oracle is THIS header, not the module under test). No mocks: it drives the real organ over real seg_store records and hand-counted civil-date arithmetic. contacts (soon_days=14): TIER inner 30, close 90, network 180; mom(inner, bday 06-20), alex(close, bday 03-15), sam(network, bday 12-01), pat(close, bday -) relate_log (11 events): TOUCH 2026-06-10 mom ; TOUCH 2026-02-01 alex OBLIGATION 2026-05-01 OWE alex book-loan 0 borrowed-book (open) OBLIGATION 2026-05-10 DUE sam favor-intro 0 made-intro (open) OBLIGATION 2026-04-01 OWE mom loan-200 20000 cash-loan (SETTLED below) OBLIGATION 2026-05-05 DUE pat loan-50 5000 lent-cash (open) SETTLE 2026-05-20 loan-200 repaid THANKS 2026-06-12 mom birthday-gift (open, 2d) THANKS 2026-05-01 alex referral (open, 44d) THANKS 2026-04-01 sam holiday-card (SENT below -> closed) SENT 2026-04-05 sam holiday-card today=2026-06-14 hand-computed: cadence: mom days=4 FRESH(<=30); alex days=133 DUE(>90); sam/pat NEW => contacts=4 fresh=1 due=1 new=2 ledger : open=3 [alex OWE 0, sam DUE 0, pat DUE 5000]; mom SETTLED => open=3 owe=1 due=2 owe_amount=0 due_amount=5000 settled=1 thanks : mom 2d PENDING(<=14), alex 44d OVERDUE; sam SENT-closed => open=2 pending=1 overdue=1 sent=1 brief : followups=3 (alex DUE, sam/pat NEW), birthdays=1 (mom 06-20 in 6d), thankyous=2, obligations=3 DATA-DRIVEN: contacts with soon_days=1 (only change) => thanks open=2 pending=0 overdue=2 sent=1 (mom flips PENDING->OVERDUE), same binary. Rows: 1 loud-fail-missing-contacts cadence on absent file => exit 1 2 load-events scanned=11 new=11 segment=seg-4001 3 idempotent-reload new=0 dup_instore=11 segment=none (law 10) 4 cadence-fresh mom FRESH days=4 cadence=30 5 cadence-due alex DUE days=133 reconnect 6 cadence-new-verdict sam NEW + verdict 4/1/1/2 7 ledger-bidirectional alex OWE + pat DUE 5000 lent-cash + verdict

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_vizsla_relate_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 rg_p sys_write rg_slen sys_openat_rd sys_close rg_run sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 sys_mmap ↻ rg_cat rg_catn sys_mmap ↻ sys_now_us sys_mmap ↻ sys_clock_gettime_mono rg_write sys_openat_wr ↻ sys_write ↻ rg_slen ↻ sys_close ↻ rg_row rg_p ↻ rg_has sys_mmap ↻ rg_readall sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close ↻ rg_slen ↻ rg_fileeq sys_mmap ↻ rg_readall ↻

structs

none

consts

none

functions

53func rg_slen(s: *u8) -> i64
called by 3: rg_prg_writerg_has
59func rg_p(s: *u8) -> i64
called by 2: rg_rowmain calls 2: sys_writerg_slen
64func rg_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
70func rg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
83func rg_write(path: *u8, content: *u8) -> i64
91func rg_readall(path: *u8, szout: *i64) -> *u8
108func rg_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, outpath: *u8) -> i64
135func rg_has(path: *u8, needle: *u8) -> i64
called by 1: main calls 3: sys_mmaprg_readallrg_slen
154func rg_fileeq(p1: *u8, p2: *u8) -> i64
called by 1: main calls 2: sys_mmaprg_readall
169func rg_row(name: *u8, pass: i64) -> i64
called by 1: main calls 1: rg_p
176func main(argc: i64, argv: *i64) -> i64