code wiki / (root) / nx_chat_store_gate.nx

nx_chat_store_gate.nx

buildroot/runtime/nx_chat_store_gate.nx

23015 B504 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic chat
docsdependenciesstructsconstsfunctions

about

nx_chat_store_gate.nx -- REFEREE for C1 (nx_chat_store, contract cs_store_forward). END-TO-END: writes its own fixture conf (store_root pointed at /tmp/csgate/ so production planes are never touched -- a gate must not share its fixture with a production beat), forks the PROMOTED elf per verb, and reads every answer back from the store through the organ itself. It proves the DONE-RULE pre-declared in comms.plan before the organ existed: "a message sent to an offline member is delivered on reconnect byte-identical and in order; history survives room close; additive-only with soft-delete; REFUSES loudly at its conf-named size budget instead of silently dropping." Process-survival is structural here: EVERY verb is its own fork, so anything T6 replays was written by an earlier, already-dead process. NEGATIVE CONTROLS: reopen, regress, budget-msgs, budget-bytes, body-too-big, room-absent (absent is not empty), bad-kind, double-delete. Fixture rooms are epoch-suffixed so every run is fresh (idempotent gate law) and live in /tmp. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_gate_verdict.nx nx_chat_store_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 csg_write sys_openat_wr csg_len sys_write ↻ sys_close sys_mmap ↻ csg_read sys_openat_rd sys_read sys_close ↻ gv_check gv_puts ↻ sys_now_realtime_ms sys_mmap ↻ sys_clock_gettime_real gv_cat gv_catn sys_mmap ↻ sys_munmap

structs

none

consts

17const CSG_CAP: i64 = 65536

functions

18func csg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
19func csg_write(path: *u8, s: *u8) -> i64
28func csg_read(path: *u8, buf: *u8, cap: i64) -> i64
36func csg_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 2: csg_seghexmain calls 1: csg_len
49func csg_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: csg_len
64func csg_seghex(room: *u8, needle: *u8, buf: *u8, cap: i64) -> i64
81func main(argc: i64, argv: *i64) -> i64