Files
sic/cmd
Claude (noether) 940c3525ef sicd: port the wire protocol to the Go daemon (cmd/sicd)
The Go daemon is what actually runs on 30+ fleet hosts; until now it had none of the
wire-protocol work that went into the Python reference (gateway/sicd) — which is why sic
still ate a bare -- and silently wrote zero-byte files in production. This ports it: preamble
+ nested netstring peeling (one layer per hop), payload -> child stdin then remaining stdin
pumped through (the zero-byte-file fix), bare -- survives as opaque payload, malformed frame
-> exit 1, no deadlock above the 64 KiB pipe buffer, short writes looped, EPIPE handled,
signal-killed child -> exit 128+WTERMSIG. Built by the bullpen room (@testdesigner -> @godev
-> @reviewer), the first Go work the room could grade.

CHECKPOINT commit, green but NOT final: 28/28 Go, 24/24 Python, go vet clean. @reviewer's
third pass found four divergences from the reference that a fix round is about to address —
recorded here so the checkpoint is honest:
  1. (must-fix, security) the Go netstring parser accepts frames the reference REJECTS and
     executes them: trailing data after the comma, a +-prefixed length, and no 1<<24 cap. A
     malformed frame that fails closed on a Python hop currently runs on a Go hop. The Python
     suite does not pin these either — both suites need the malformed cases added.
  2. (must-fix) the read-error path os.Exit(1)s without reaping the child, leaving it detached
     and still writing to inherited stdout after sicd reports its status.
  3. (test) an EPIPE test's premise is wrong in Go (LookPath fails at Start, so the payload
     write never happens); the path is really covered by the signal test.
  4. (test) the pty EIO test is synchronized only by a 300 ms sleep.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 05:37:53 +02:00
..