Dashboard › opencode › Distillation
f70f98bc-5834-4651-9531-1e27eae0dc6e["lore_tm_v1_lkRGl7u1AQkOTdY_S9o2iphKIRVw8WtcObTjrdPtaYw","lore_tm_v1_LxPXzIIk_1J9oflwQQbcHe8jjYBxY04OeZACGK-MxBo","lore_tm_v1_WVCL3S7RAGQq2HLb5oE7qEhMXVna7oH403cctPTg65Q","lore_tm_v1_wPcfWb2iOxiT3p0d_ASfFBXtVGRAVtASaviVsLmUxhg","lore_tm_v1_2z-ecF4rbIV1Mu1wbvMv-rZTzzXwSJYOXmNnQT5lHJs","lore_tm_v1_yKcMhSyngz1PFKUpB65Tg8-ydHrjXOIb0-ogGQgBn90","lore_tm_v1_zNI4BHUDrcDYE2YFGwWgYMeP2cA0KkVnBvPkvdkuwRw"]
Date: Sep 8, 2026
in_progress; four high-priority tasks remained pending: 1. trace plugin/transport/helper/supervisor/systemd-unit/cutover protocol end to end, 2. verify pinned Go, godbus, go-systemd, Node APIs, systemd property semantics, and binary provenance, 3. run unprivileged tests and reproducible source builds and compare binary hashes, 4. review tests/documents for realism and issue the classified verdict./home/byk/.local/share/opencode-v2-pilot/supervisor/ROOT-ACCEPTANCE.md, 2. /home/byk/.local/share/opencode-v2-pilot/supervisor/PROTOCOL.md, 3. /home/byk/.local/share/opencode-v2-pilot/supervisor/bin/opencode-pty-client, 4. /home/byk/.local/share/opencode-v2-pilot/supervisor/bin/opencode-pty-launcher, 5. /home/byk/.local/share/opencode-v2-pilot/supervisor/bin/opencode-pty-supervisor, 6. /home/byk/.local/share/opencode-v2-pilot/supervisor/opencode-pty.slice, 7. /home/byk/.local/share/opencode-v2-pilot/supervisor/opencode-pty-supervisor.service, 8. /home/byk/.local/share/opencode-v2-pilot/supervisor/go.sum, 9. /home/byk/.local/share/opencode-v2-pilot/supervisor/cmd/client/main_test.go, 10. /home/byk/.local/share/opencode-v2-pilot/supervisor/cmd/client/main.go, 11. /home/byk/.local/share/opencode-v2-pilot/supervisor/cmd/supervisor/main.go, 12. /home/byk/.local/share/opencode-v2-pilot/supervisor/go.mod, 13. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/auth_test.go, 14. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/server.go, 15. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/auth.go, 16. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/systemd.go, 17. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/server_test.go, 18. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/systemd_test.go, 19. /home/byk/.local/share/opencode-v2-pilot/supervisor/cmd/launcher/main.go, 20. /home/byk/.local/share/opencode-v2-pilot/supervisor/cmd/launcher/main_test.go, 21. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/protocol/frame_test.go, 22. /home/byk/.local/share/opencode-v2-pilot/supervisor/internal/protocol/frame.go./home/byk/.local/share/opencode-v2-pilot/supervisor/go.mod defines module opencode-pty-supervisor, Go 1.22, and pins github.com/coreos/go-systemd/v22 v22.5.0, github.com/godbus/dbus/v5 v5.1.0, and golang.org/x/sys v0.20.0./home/byk/.local/share/opencode-v2-pilot/supervisor/internal/protocol/frame.go defines a 12-byte OPTY protocol header, version 1, MaxFrameSize = 70 * 1024, MaxIOPayloadSize = 32 * 1024, and frame types in exact order: TypeStart=1, TypeInput=2, TypeOutput=3, TypeExit=4, TypeError=5, TypeStarted=6, TypeStop=7, TypeStopped=8.internal/protocol/frame.go are MaxArgs=128, MaxCommandSize=4096, MaxArgSize=16384, MaxArgsSize=65536, and MaxRuntimeSec=3600; START contains Device uint64, Inode uint64, RuntimeSec uint32, Command string, and Args []string.EncodeStart() and DecodeStart() reject empty commands, NUL-containing or invalid-UTF-8 commands/arguments, oversized commands/arguments/aggregate argument data, more than 128 arguments, runtimes over 3600 seconds, malformed lengths, trailing payload bytes, and frames over 70 KiB. Header parsing rejects wrong magic/version, nonzero reserved bytes 6β7, oversized payloads, and unknown frame types./home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/auth.go authenticates Unix peers using both SO_PEERCRED and SO_PEERPIDFD, requires positive PID plus exact expected UID/GID, and validates the peer PID against systemdβs current client-service MainPID; it also requires ActiveState="active", SubState="running", exact expectedClientCgroup, and a 16-byte InvocationID.authenticatedPeer.Recheck() verifies pidfd liveness with unix.PidfdSendSignal(peer.pidfd, 0, nil, 0), fetches fresh ClientState, reruns identity validation, and rejects an InvocationID change during admission. peerIdentity() applies close-on-exec to the obtained pidfd, and authenticatedPeer.Close() closes it once and sets it to -1./home/byk/.local/share/opencode-v2-pilot/supervisor/internal/supervisor/server.go configures /run/opencode-pty/supervisor.sock, maxSessions=16, maxUnauthenticated=32, maxAdmissionsPerMinute=120, socketBufferSize=128 * 1024, and handshakeTimeout=5s; NewServer() resolves account byk to the expected UID/GID.Server.Serve() requires effective UID 0, treats startup CleanupOrphans() failure as fatal before listening, removes an existing socket only when it is actually a socket, creates the Unix listener, and chmods the socket to 0660.server.go: authenticate peer β receive and validate START plus exactly one cwd fd β clear the deadline β generate opencode-pty-<32 lowercase hex digits>.service-style random unit name from 16 cryptographic random bytes β create a CLOEXEC Unix stream socket pair β recheck authenticated peer identity β call manager.Start() with command, args, transferred stream, cwd, and runtime β close the transferred stream locally β emit TypeStarted containing the unit name.receiveStart() accumulates ancillary rights across exact header/payload reads, rejects MSG_TRUNC/MSG_CTRUNC, rejects more than one received fd, requires a TypeStart frame and exactly one fd, wraps it as approved-cwd, and verifies it is a directory whose Stat_t.Dev and inode exactly match the START payload. Recvmsg uses MSG_CMSG_CLOEXEC.server.go: copyInput() accepts only nonempty TypeInput payloads up to protocol.MaxIOPayloadSize, except an empty TypeStop triggers errStopRequested; copyOutput() emits PTY reads as TypeOutput frames up to 32 KiB; frameWriter serializes writes with a mutex and applies operationTimeout as the write deadline.serveSession() concurrently runs client-input copying, PTY-output copying, disconnect watching, and manager.Wait(). Disconnect detection duplicates the socket fd with F_DUPFD_CLOEXEC, polls every 250 ms for POLLRDHUP|POLLHUP|POLLERR, and reports client disconnection on EOF/hangup.outputDrainTimeout, shuts down the stream on drain timeout, then emits TypeStopped. Normal unit completion calls cleanup, drains final PTY output under the same timeout, then emits TypeExit; encodeExit() serializes one byte of ExecMainCode, four bytes of ExecMainStatus, a four-byte result-string length, then the result bytes.sync.Once; cleanup failures after session errors are escalated through server.fail(), which logs the error, sends one fatal error via fatalOnce, and closes the listener and all tracked client connections. Protocol error text is truncated to 32 KiB while preserving valid UTF-8.