a73x

6738726c

test: the cross-OS gate closes stdin for the mux verb that proxies

a73x   2026-09-04 10:16

Commit message
test: the cross-OS gate closes stdin for the mux verb that proxies

`mux d endpoint` announces on stdout and then PROXIES — the pipe that
carried the announce IS the QUIC fallback — so inside a script the remote
`sh -s` is reading off stdin it drains the rest of that script. Leg 7's
two assertions after it never ran, and the leg failed comparing a pid's
exe against an empty string.

It is the same hazard the ssh `-n` rule already covers, so the helper's
comment now states the general form: anything inside one of these scripts
that reads stdin gets it closed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SakwJEwD9dXBoRP5kWbemW

test/xos.sh
Old New
@@ -109,10 +109,14 @@ cd $HOME
109 # line there arrives as ONE argument and ssh answers "keyword batchmode 109 # line there arrives as ONE argument and ssh answers "keyword batchmode
110 # extra arguments at end of line". 110 # extra arguments at end of line".
111 # 111 #
112 # The rule for a script handed to this: any ssh INSIDE it takes -n. The 112 # The rule for a script handed to this: anything INSIDE it that reads stdin
113 # remote sh is reading its own script off stdin, and an ssh that does not 113 # gets it closed — `-n` for an ssh, `</dev/null` for the rest. The remote sh
114 # close its stdin swallows the rest of that script — silently, with a 0 114 # is reading its own script off stdin, and a command that drains stdin
115 # exit, so the lines after it simply never run. 115 # swallows the lines after it, silently and with a 0 exit, so they simply
116 # never run. `mux d endpoint` is one of those: it announces on stdout and
117 # then PROXIES, which is the whole point of the pipe that carried the
118 # announce being the QUIC fallback, and it ate the two assertions after it
119 # the first time this gate ran leg 7.
116 # 120 #
117 # The quoting rule is that there is NO quoting: the script rides this 121 # The quoting rule is that there is NO quoting: the script rides this
118 # shell's stdin all the way to the remote `sh -s` and no shell in between 122 # shell's stdin all the way to the remote `sh -s` and no shell in between
@@ -431,7 +435,7 @@ L
431 # answers — and leg 5 would then be grading the ssh fallback while reporting 435 # answers — and leg 5 would then be grading the ssh fallback while reporting
432 # QUIC. 436 # QUIC.
433 ANN=$(lssh 30 <<'L' 437 ANN=$(lssh 30 <<'L'
434 ~/.local/bin/mux d endpoint 438 ~/.local/bin/mux d endpoint </dev/null
435 L 439 L
436 ) 440 )
437 case "$ANN" in 441 case "$ANN" in
@@ -563,7 +567,7 @@ MSTATE=$(mssh 90 <<M
563 . \$HOME/xos/os_oracle.sh 567 . \$HOME/xos/os_oracle.sh
564 echo "pid=\$(pgrep -x mux | head -1)" 568 echo "pid=\$(pgrep -x mux | head -1)"
565 echo "n=\$(pgrep -x mux | wc -l | tr -d ' ')" 569 echo "n=\$(pgrep -x mux | wc -l | tr -d ' ')"
566 echo "announce=\$(\$HOME/.local/bin/mux d endpoint 2>&1 | head -1)" 570 echo "announce=\$(\$HOME/.local/bin/mux d endpoint </dev/null 2>&1 | head -1)"
567 echo "want=\$(real_path \$HOME/.local/bin/mux)" 571 echo "want=\$(real_path \$HOME/.local/bin/mux)"
568 udp_local_bound $QUIC_HEX && echo "udp=bound" || echo "udp=none" 572 udp_local_bound $QUIC_HEX && echo "udp=bound" || echo "udp=none"
569 M 573 M