code wiki / (root) / nx_mcp_stdio_gate_t174.nx

nx_mcp_stdio_gate_t174.nx

buildroot/runtime/nx_mcp_stdio_gate_t174.nx

9891 B197 linesdepth 8pulls 19 transitivereach 0 importersview sourcekind tooltopic mcp
docsdependenciesstructsconstsfunctions

about

nx_mcp_stdio_gate.nx -- lane conn, 2026-09-11. PROVES the connector's per-request failure semantics with REAL child processes, in-process (the connector's main-bearing file cannot be imported, so the recovery + emit logic it drives lives in nx_mcp_pending, which this gate imports directly): * a worker that dies WITHOUT self-reporting (a crash, or the SIGALRM deadline that kills it) becomes a CORRELATED JSON-RPC error for THAT id and the loop CONTINUES (mp_recover_pump returns >= 0); * the emitted error carries the RIGHT id and the JSON-RPC error shape; * a LATER request still succeeds after the failure; * the deadline (death by SIGALRM) maps to the -32012 deadline error, not a generic one; * mo_prefix_id extracts a top-level id from a truncated request prefix (string, number, truncated, nested-only) -- the input to the oversized/malformed -32600 path; * a NEG-CONTROL: a SUCCESSFUL worker is forwarded verbatim and NEVER decorated with an error. BITE-PROVED MANUALLY (recorded in the lane transcript, not via a forked subject elf since the subject is in-process): reverting the failed_slot mechanism so mp_recover_pump returns -1 on any rp_pump -1 makes failing-child-continues + later-request-succeeds go RED; restoring the fix returns them GREEN. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_mcp_pending_http_t174.nx nx_gate_verdict.nx nx_mcp_stdio_gate_t174.nx

imports: nx_mcp_pending_http_t174.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_plan_new sys_mmap ↻ gv_plan_name_eq mo_prefix_id nx_ascii_is_digit g_slen gv_plan_check gv_plan_take gv_plan_name_eq ↻ gv_check gv_puts sys_write ↻ mpe_write_error mpe_write_error_detail mpe_slen mpe_cat mpe_catb mpe_cat_esc mpe_catn rp_write g_contains g_slen ↻ g_run_planted

structs

none

consts

none

functions

22func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
25func g_contains(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: g_slen
42func g_run_planted(p: *NxRequestPool, rows: *u8, control: *NxMcpControl, line: *u8, mode: i64, payload: *u8, buf: *u8, cap: i64, outn: *i64) -> i64
81func main() -> i64