code wiki / (root) / nx_intake_keep.nx

nx_intake_keep.nx

buildroot/runtime/nx_intake_keep.nx

5475 B136 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic intake
docsdependenciesstructsconstsfunctions

about

nx_intake_keep.nx -- keep the public intake route ALIVE, without touching the supervisor. THE PROBLEM. nx_site_intake_serve answers :8033 and every contact form on every generated site depends on it -- the meal pages literally suppress their forms when it stops answering. But it is NOT in nx_hostctl's guard list, and that list is COMPILED IN, so adding it means rebuilding and deploying the supervisor. WHY NOT JUST DEPLOY THE SUPERVISOR. Measured, not assumed: hostctl's source is unchanged since 2026-07-31, yet a fresh build differs from the live binary by +26,232 bytes -- so the delta is the TOOLCHAIN, not the source. Rebuilding the supervisor means shipping whatever nx_cc has become, and nx_cc had an escaped gate mutant land in it on 2026-08-06. A defect in a page is a page; a defect in the thing that respawns every daemon is the host. That trade is bad at any blast radius, so this takes the other road. THE OTHER ROAD. The tickless clock is ALREADY supervised by hostctl and dispatches from a DATA registry (knowledge/store/clockjobs-, added via nx_store_put, read-only to the clock). So supervision becomes a row, not a recompile -- the same "new capability is data" move the rest of this lane runs on. FAIL-SAFE BY CONSTRUCTION: it spawns ONLY when the port refuses a connection, so a healthy daemon is never disturbed and two keepers racing cannot produce two servers (the loser's bind fails and it exits). INSTRUMENTED SO A HEALTHY RUN IS STILL VISIBLE: spawns append to a log (rare, meaningful), while every successful check REWRITES a heartbeat file. A log alone would show zero rows on a healthy system and zero rows on a dead keeper -- indistinguishable. The heartbeat is what separates "nothing to do" from "not running". license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_intake_keep.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_now_realtime_sec 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_clock_gettime_real ik_port_open sys_socket sys_mmap ↻ sys_connect sys_close ik_beat sys_openat_wr sys_mmap ↻ ik_cat ik_catn ik_catn ↻ sys_mmap ↻ sys_write ↻ sys_close ↻ ik_p sys_write ↻ sys_exit ↻ sys_fork sys_mmap ↻ sys_execve ik_log sys_openat_append

structs

none

consts

26const IK_PORT: i64 = 8033
27const IK_MODE: i64 = 420
28const IK_ELF: *u8 = "./nx_site_intake_serve.elf" as *u8
29const IK_LOG: *u8 = "knowledge/status/intake_keep.log" as *u8
30const IK_BEAT: *u8 = "knowledge/status/intake_keep.beat" as *u8

functions

32func ik_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
33func ik_n(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
46func ik_cat(d: *u8, o: i64, s: *u8) -> i64 { var x: i64 = o; var i: i64 = 0; while s[i] != (0 as u8) { d[x] = s[i]; x = x + 1; i = i + 1 } return x }
called by 2: ik_beatik_log
47func ik_catn(d: *u8, o: i64, v: i64) -> i64
62func ik_port_open(port: i64) -> i64
79func ik_beat(now: i64) -> i64
91func ik_log(now: i64, pid: i64) -> i64
104func main(argc: i64, argv: *i64) -> i64