System: add a binary subprocess session #44

Open
opened 2026-12-03 10:24:26 +00:00 by faumaray · 0 comments
Owner

Context: canonical Git and CI runners need incremental binary I/O with child processes. Forge tracks this as VL-PROC-01.

Current behavior: Child exposes pipe descriptors and lifecycle control; communicate_blocking takes complete input and accumulates capped output; streaming callbacks deliver lines. SystemAsync::ProcessManager also consumes complete input. ByteStream and Driver::adopt_fd provide binary foundations, but there is no high-level binary session.

Need: incremental binary stdin, independently drained stdout/stderr, finite buffering, NUL-safe transfer, and distinguishable EOF, exit, timeout, cancellation and truncation.

Proposed API: a portable Process::BinarySession facade with write_stdin, read_stdout, read_stderr, close_stdin, wait and cancellation. Operations return transferred counts or structured failures; opposite directions can progress concurrently. Reuse Child and the existing IO facilities; do not introduce a replacement executor or a System/IO dependency cycle.

Tests/gate: binary round trips larger than pipe capacity, stderr flooding, slow sinks, half-close, descendant-held pipes, cancellation races, exact cleanup. Preserve the capture/line APIs. Forge gates M06, M14 and M15 on this.

Context: canonical Git and CI runners need incremental binary I/O with child processes. Forge tracks this as VL-PROC-01. Current behavior: Child exposes pipe descriptors and lifecycle control; communicate_blocking takes complete input and accumulates capped output; streaming callbacks deliver lines. SystemAsync::ProcessManager also consumes complete input. ByteStream and Driver::adopt_fd provide binary foundations, but there is no high-level binary session. Need: incremental binary stdin, independently drained stdout/stderr, finite buffering, NUL-safe transfer, and distinguishable EOF, exit, timeout, cancellation and truncation. Proposed API: a portable Process::BinarySession facade with write_stdin, read_stdout, read_stderr, close_stdin, wait and cancellation. Operations return transferred counts or structured failures; opposite directions can progress concurrently. Reuse Child and the existing IO facilities; do not introduce a replacement executor or a System/IO dependency cycle. Tests/gate: binary round trips larger than pipe capacity, stderr flooding, slow sinks, half-close, descendant-held pipes, cancellation races, exact cleanup. Preserve the capture/line APIs. Forge gates M06, M14 and M15 on this.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#44