code wiki / _hdl_build / nx_printer_ctl_gate.nx

nx_printer_ctl_gate.nx

buildroot/runtime/_hdl_build/nx_printer_ctl_gate.nx

12748 B262 linesdepth 8pulls 13 transitivereach 0 importersview sourcekind gate/prooftopic printer
docsdependenciesstructsconstsfunctions

about

nx_printer_ctl_gate.nx -- gate for the sovereign printer-control organ. Proves the composed capability WITHOUT live hardware (the QIDI is offline per the LAN research probe): pure-logic teeth (dotted-IP parse, the NEVER-BRICK safe-endpoint allowlist) + REAL loopback roundtrips through a fork'd fake Moonraker server (bytes over the real kernel TCP stack via the production nx_mr_*_ipv4 path -- the exact code nx_printer_ctl runs). T1 dotted-IPv4 parse -> correct packed value T2 malformed IPs rejected (fail-closed) T3 NEVER-BRICK: every verb maps ONLY to a safe control endpoint; a raw-gcode / script verb has NO route (cannot reach a firmware-write path) T4 GET /printer/info roundtrip -> HTTP 200 over real loopback T5 POST /printer/emergency_stop roundtrip -> HTTP 200 (Content-Length: 0) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_tls13_io.nx nx_moonraker_client.nx nx_moonraker_io.nx nx_printer_ctl_lib.nx nx_gate_verdict.nx nx_printer_ctl_gate.nx

imports: nx_syscalls.nxnx_tls13_io.nxnx_moonraker_client.nxnx_moonraker_io.nxnx_printer_ctl_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 gv_head gv_puts sys_write pctl_parse_ip gv_check gv_puts ↻ pctl_streq pctl_verb_path pctl_verb_is_get pctl_verb_id pctl_streq ↻ g_roundtrip tcp_listen_loopback sys_socket sys_setsockopt sys_bind sys_listen sys_fork sys_mmap ↻ pctl_build_host pctl_cat pctl_catn sys_mmap ↻ pctl_call pctl_verb_path ↻ pctl_slen pctl_verb_is_get ↻ nx_mr_get_ipv4 nx_mr_build_get_request nx_mr_write_cstr nx_mr_write_bytes nx_mr_tcp_connect_ipv4 sys_socket ↻ sys_mmap ↻ nx_connect_bounded nx_fcntl sys_connect

structs

none

consts

none

functions

25func g_contains(buf: *u8, len: i64, needle: *u8) -> i64
called by 2: g_roundtripmain
46func g_roundtrip(id: i64, port: i64) -> i64
112func main() -> i64