code wiki / _hdl_build / nx_fence_gate.nx

nx_fence_gate.nx

buildroot/runtime/_hdl_build/nx_fence_gate.nx

6659 B120 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_fence_gate.nx -- END-TO-END verifier for nx_fence, the monotonic fence token (2026-08-09). WHY A SEPARATE ORGAN: /api/gate_run REFUSES any target whose name does not end in gate/test/kat -- "executes VERIFIERS ONLY -- that bound is what makes this route never-brick: it cannot reach a daemon, promoter or deployer." nx_fence's in-process selftest could therefore only ever be run by ssh break-glass, and gating must PRECEDE promotion. **** A GATE THAT CANNOT BE RUN BY THE ROUTE THE ESTATE USES TO RUN GATES IS A GATE NOBODY WILL RUN. This is END-TO-END on purpose, not a second copy of the in-process teeth: it FORKS the deployed nx_fence.elf with real fixture journals and asserts EXIT CODES and OUTPUT. That is the half the in-process selftest structurally cannot reach -- argv parsing, the nx_claims fork, and the exit code itself. Emitted through nx_gate_verdict so the exit code CARRIES the verdict: **** A GATE WHOSE EXIT CODE DOES NOT CARRY ITS VERDICT SILENTLY BLESSES EVERY FAILURE IT FINDS (and /api/build's admission guard refuses a gate without the anchor -- it refused THIS file's first draft, correctly). Fixtures are assembled AT RUNTIME under /tmp/nx_fence_gate/: a detector that scans source will find its own fixture, and a teardown does not run when a run crashes. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gatekit_lib.nx nx_gate_verdict.nx nx_fence_gate.nx

imports: nx_syscalls.nxnx_gatekit_lib.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_mmap ↻ gk_cat gk_mkdir sys_mkdir gv_check gv_puts ↻ gk_exists sys_openat_rd sys_close gk_rm sys_unlinkat sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gk_catn sys_mmap ↻ gk_write sys_openat_wr gk_len gk_write_all

structs

none

consts

23const FG_BUF: i64 = 65536
24const FG_SPAN: i64 = 64

functions

26func main(argc: i64, argv: *i64) -> i64