code wiki / (root) / nx_msg_sync_gate.nx

nx_msg_sync_gate.nx

buildroot/runtime/nx_msg_sync_gate.nx

12769 B264 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_msg_sync_gate.nx -- REFEREE for C2 (nx_msg_sync, contract msy_devsync). END-TO-END: builds a server room and device replicas in /tmp/msgate (nothing production is touched), forks BOTH promoted elfs -- nx_chat_store to author fixtures and READ BACK, nx_msg_sync as the subject -- and proves the pre-declared done-rule: "the same history converges on a second device; a partition-printed reconcile measures zero divergence." THE ANTI-VACUITY DESIGN: convergence is NEVER taken from the syncer's own receipt. T3/T5 compare nx_chat_store fetch output on the server root vs the device root BYTE FOR BYTE -- the consumer is the referee, so a syncer that lied about pulling would fail the tooth it cannot see. NEGATIVE CONTROLS: split-brain divergence refuses (seq named, nothing written) · device-ahead refuses · absent source never conjures · verify itself goes RED on the diverged replica. Fixture rooms are epoch-suffixed; every verb is its own fork, so persistence across process death is structural. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_gate_verdict.nx nx_msg_sync_gate.nx

imports: nx_syscalls.nxnx_tool_run.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mkdir msg_write sys_openat_wr msg_len sys_write ↻ sys_close sys_mmap ↻ sys_now_realtime_ms sys_mmap ↻ sys_clock_gettime_real gv_cat gv_catn sys_mmap ↻ sys_munmap sys_openat_rd sys_read sys_close ↻ gv_check gv_puts ↻ tr_run_capture

structs

none

consts

16const MSG_CAP: i64 = 65536

functions

17func msg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: msg_writemsg_count
18func msg_write(path: *u8, s: *u8) -> i64
27func msg_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: msg_len
40func main(argc: i64, argv: *i64) -> i64