code wiki / _hdl_build / nx_staghyg_gate.nx

nx_staghyg_gate.nx

buildroot/runtime/_hdl_build/nx_staghyg_gate.nx

21691 B351 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_staghyg_gate.nx -- prove the staging-hygiene guard REFUSES a backwards promote, does NOT refuse a legitimate one, and -- the tooth this gate earned the hard way -- does NOT refuse an ORDINARY EDIT. Inherits the nx_gate_verdict base class (D001/L009: gv_ctr/gv_head/gv_check/gv_bite/gv_verdict) so nx_gate_green can judge it and it records a harness frame. DETERMINISTIC BY CONSTRUCTION: every fixture mtime is set explicitly via sys_utimensat and `now` is passed to sg_classify as a parameter, so there are NO sleeps and NO filesystem-resolution races. Each tooth writes its OWN file names, so nothing depends on whether the write helper truncates. THE cfg BELOW IS THE SHIPPED POLICY, NOT A CONVENIENT ONE. An earlier version of this gate passed 10/10 against thresholds the shipped conf did not use, which proves the mechanism and says nothing about the rule operators actually meet. T4 and T8 prove it FIRES; T11 proves it STAYS SILENT on a one-run edit -- and T11 exists because the first tuning refused the very build that introduced it. A guard that fires on routine work is not strict, it is training people to bypass it. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_staging_guard.nx nx_staghyg_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_staging_guard.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 ↻ sys_mmap ↻ gt_odd gv_head gv_puts sys_write ↻ gt_tokens sys_openat_wr gt_wfd sys_write ↻ gt_wnfd sys_mmap ↻ sys_write ↻ sys_munmap sys_write ↻ sys_close gt_set_mtime sys_mmap ↻ sys_utimensat sg_classify sg_file_evidence sys_mmap_try sys_fstatat sys_munmap_direct

structs

none

consts

21const GT_NOW: i64 = 1800000000
22const GT_DAY: i64 = 86400

functions

24func gt_wfd(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: gt_tokens calls 1: sys_write
25func gt_wnfd(fd: i64, v: i64) -> i64
45func gt_tokens(path: *u8, prefix: *u8, n: i64, pad: i64, odd: *i64) -> i64
64func gt_odd(o: *i64, start: i64, count: i64) -> i64 { o[0] = start; o[1] = count; return 0 }
called by 1: main
66func gt_fill(dst: *u8, s: *u8) -> i64
called by 1: main
72func gt_set_mtime(path: *u8, sec: i64) -> i64
called by 1: main calls 2: sys_mmapsys_utimensat
78func main() -> i64