code wiki / (root) / nx_fsops_write_gate.nx

nx_fsops_write_gate.nx

buildroot/runtime/nx_fsops_write_gate.nx

14962 B209 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic fsops
docsdependenciesstructsconstsfunctions

about

nx_fsops_write_gate.nx -- END-TO-END gate for the estate's WRITE PATH (the binary behind the nx_fs_write tool). Until 2026-09-05 this organ -- every seat's edit, append and write -- had NO gate at all. This one forks the SUBJECT ARTIFACT on a fixture tree under /tmp/<gate>/ and proves the idempotency-key contract added the same day (/compare/dataio DI4): a keyed write applied once is returned, not re-applied, on a retry carrying the same key; a different key or no key keeps today's behaviour exactly (a neg-control each), and a REFUSAL never poisons a key. The subject is forked IN PLACE by an absolute path (NAS /tmp is noexec); only its CWD is inside the fixture, which is where its CWD-relative ledger knowledge/status/fswrite_idem.jrnl lands. exit: 0 GREEN / 1 RED (gv_verdict law).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_fsops_write_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.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 ↻ wg_exists sys_openat_rd sys_close gv_puts ↻ gv_check gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_puts ↻ gv_num ↻ gv_journal

structs

none

consts

13const WG_OUT: i64 = 65536
14const WG_PATH: i64 = 512
15const WG_MODE_755: i64 = 493
16const WG_MODE_644: i64 = 420
17const WG_DIR: *u8 = "/tmp/nx_fsops_write_gate" as *u8

functions

19func wg_find(q: *u8, n: i64, lit: *u8) -> i64
called by 1: main
33func wg_exists(path: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
39func wg_size(path: *u8) -> i64
46func wg_write_text(path: *u8, s: *u8) -> i64
56func wg_artifact(path: *u8) -> i64
75func wg_equal(a: *u8, b: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
87func wg_run(sub: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, cout: *u8, colen: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
102func main(argc: i64, argv: *i64) -> i64