code wiki / (root) / nx_restart_guard_gate.nx

nx_restart_guard_gate.nx

buildroot/runtime/nx_restart_guard_gate.nx

3802 B61 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. exit 0 = all pass, N = assertion N failed. Prints the incumbent comparison (organ-graded, not self-scored). 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)

dependencies 2 imports · 0 importers

nx_restart_guard.nx nx_assert.nx nx_restart_guard_gate.nx

imports: nx_restart_guard.nxnx_assert.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main rg_should_restart rg_backoff_ms nx_puts_err sys_write nx_puti_err sys_mmap sys_write ↻ rg_waits rg_should_restart ↻ rg_backoff_ms ↻

structs

none

consts

none

functions

13func rg_waits(n: i64, gap_ms: i64, cap_ms: i64, base_ms: i64) -> i64
called by 1: main calls 1: rg_should_restart
21func main() -> i64