code wiki / (root) / nx_toolcall_idem_gate.nx

nx_toolcall_idem_gate.nx

buildroot/runtime/nx_toolcall_idem_gate.nx

6304 B91 linesdepth 8pulls 10 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_toolcall_idem_gate.nx -- IN-PROCESS gate over nx_toolcall_idem_lib (/compare/dataio DI4 ta_idempotency_key). Fixtures under /tmp/<gate>/ (never a production plane). Proves: the decision states, the reservation, the replay, the release, the row grammar, the digest naming -- and named negatives (a key with whitespace is refused before anything executes; a second key never sees the first's outcome; two keys never share a digest name). exit: 0 GREEN / 1 RED (gv_verdict law).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_toolcall_idem_lib.nx nx_toolcall_idem_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_toolcall_idem_lib.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 ↻ gk_mkdir sys_mkdir gk_rm sys_unlinkat sys_mmap ↻ ti_key_hex sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_seed_allocated sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte

structs

none

consts

11const TG_DIR: *u8 = "/tmp/nx_toolcall_idem_gate" as *u8
12const TG_LEDGER: *u8 = "/tmp/nx_toolcall_idem_gate/toolcall_idem.jrnl" as *u8
13const TG_NOW: i64 = 1788640000

functions

15func tg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
16func tg_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
called by 1: main
18func main() -> i64