code wiki / (root) / nx_game_chat_gate.nx

nx_game_chat_gate.nx

buildroot/runtime/nx_game_chat_gate.nx

12831 B273 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic game
docsdependenciesstructsconstsfunctions

about

nx_game_chat_gate.nx -- REFEREE for C12 (nx_game_chat, contract gc_room_wire). END-TO-END: builds isolated confs under /tmp/gcgate (game defs + a chatstore conf whose store_root is the fixture), forks the PROMOTED organs, and proves the done-rule: two clients exchange moves and chat through the C1 store with the game's own rules as the referee. THE TOOTH THAT MATTERS IS T10: a move row injected DIRECTLY through nx_chat_store -- bypassing the move verb entirely, the race/hostile-client case -- must be COUNTED AND IGNORED by the replay. A wire anyone can write to is untrusted by construction; the deterministic replay is the authority. Also proven: a full connect-four playthrough to a win, out-of-turn/illegal/full-column/occupied refusals, chat interleaving without disturbing state, the reserved mv: prefix, byte-identical deterministic emits, and the place-mode engine from the ttt conf row (data-driven: two games, one engine, zero game-specific code paths beyond the conf mode). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_gate_verdict.nx nx_game_chat_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 gcg_write sys_openat_wr gcg_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 gcg_read sys_openat_rd sys_read sys_close ↻ gv_check gv_puts ↻

structs

none

consts

16const GCG_CAP: i64 = 65536

functions

17func gcg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: gcg_writegcg_count
18func gcg_write(path: *u8, s: *u8) -> i64
27func gcg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
35func gcg_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: gcg_len
48func main(argc: i64, argv: *i64) -> i64