code wiki / (root) / nx_restart_guard_gate.nx

nx_restart_guard_gate.nx

buildroot/runtime/nx_restart_guard_gate.nx

9034 B117 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic restart
docsdependenciesstructsconstsfunctions

about

nx_restart_guard_gate.nx -- KAT + measured-vs-systemd scorecard for the supervisor crash-loop guard. MIGRATED 2026-09-02 onto nx_gate_verdict (D001): every tooth is a named gv_check, so /api/gate_run reads the verdict from the exit code and harness.jrnl records a frame. Before this the gate returned N for the failing assertion and printed its own verdict line, which /api/promote correctly refused. The teeth and their numbers are unchanged. T1 healthy (restarts spread > interval) -> never trips T2 crash-loop (6 restarts in 10s, burst=5) -> 1st-5th allowed, 6th TRIPS (give up) T3 recovery (quiet > interval) -> window resets, restart allowed again T4 exponential backoff (base*2^(n-1), capped) vs systemd's fixed RestartSec T5 DETERMINISM (the exceed): same timestamps -> identical trip point on a re-run (replayable) T6-T10 bind-grace: alive-but-never-listening (debt 1788361379, the 16 h /search outage class) T11-T15 stale-cycle liveness: alive-by-NAME is not alive (the orphan /status child of a dead fleet supervisor) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_restart_guard.nx nx_gate_verdict.nx nx_restart_guard_gate.nx

imports: nx_syscalls.nxnx_restart_guard.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 ↻ rg_should_restart rg_backoff_ms gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_check gv_puts ↻ rg_waits sys_mmap ↻ rg_should_restart ↻ rg_backoff_ms ↻ rg_bind_grace_expired rg_stale_cycle rg_silent_stale gv_verdict gv_note_bare_rate gv_bare_rate

structs

none

consts

none

functions

18func rg_waits(n: i64, gap_ms: i64, cap_ms: i64, base_ms: i64) -> i64
called by 1: main calls 2: sys_mmaprg_should_restart
26func main() -> i64