Documentation
¶
Index ¶
- Variables
- func IsExactStdoutLimitExitCode(err error, exitCode int) bool
- func IsOnlyStdoutLimitExceeded(err error) bool
- type OS
- func (OS) DuplexCapability() error
- func (OS) Run(ctx context.Context, cmd ports.Command) (ports.CommandResult, error)
- func (OS) RunDuplex(ctx context.Context, command ports.Command, ...) error
- func (OS) RunDuplexWithPlannedShutdown(ctx context.Context, command ports.Command, ...) error
- func (OS) RunWithDescendantExitGrace(ctx context.Context, cmd ports.Command, treeExitGrace time.Duration) (ports.CommandResult, error)
- func (OS) RunWithTreeExitGrace(ctx context.Context, cmd ports.Command, treeExitGrace time.Duration) (ports.CommandResult, error)
Constants ¶
This section is empty.
Variables ¶
var ErrStdoutLimitExceeded = errors.New("command stdout exceeded configured limit")
ErrStdoutLimitExceeded reports that a command produced more stdout than its caller allowed the runner to retain. The runner stops consuming output so the supervised producer terminates at the configured bound.
Functions ¶
func IsExactStdoutLimitExitCode ¶
IsExactStdoutLimitExitCode recognizes the runner's direct nonzero-exit marker without accepting ordinary wrappers or joins with another cause. Callers may use it only when a specific trusted executable defines that exit code as its broken-pipe status.
func IsOnlyStdoutLimitExceeded ¶
IsOnlyStdoutLimitExceeded distinguishes a sole wrapped output-limit cause from a joined containment, cancellation, or execution failure.
Types ¶
type OS ¶
type OS struct{}
func (OS) DuplexCapability ¶
DuplexCapability proves that both duplex lifecycle modes can place a child and every process it creates inside a kernel-enforced containment boundary. Callers use this before materializing package state or invoking a native client mutation.
func (OS) RunDuplex ¶
func (OS) RunDuplex(ctx context.Context, command ports.Command, exchange func(io.Writer, io.Reader) error) error
RunDuplex runs one bounded-lifetime interactive exchange over a child's standard input and output. A successful exchange closes stdin and gives the child a bounded opportunity to report its own exit status. Platform cleanup is explicit and is always performed before the single Wait reaps the leader. It supervises the trusted, pinned client and its observable descendants; it is not an arbitrary hostile-process sandbox.
func (OS) RunDuplexWithPlannedShutdown ¶
func (OS) RunDuplexWithPlannedShutdown(ctx context.Context, command ports.Command, exchange func(io.Writer, io.Reader) error) error
RunDuplexWithPlannedShutdown runs an exchange whose nil return explicitly requests termination of a deliberately long-lived process tree. It is for protocols such as Kiro ACP where completing the verified exchange, rather than natural process exit, is the success boundary. Requested termination is successful only when containment proves the leader and every descendant are gone before the leader's sole reap.
func (OS) RunWithDescendantExitGrace ¶
func (OS) RunWithDescendantExitGrace(ctx context.Context, cmd ports.Command, treeExitGrace time.Duration) (ports.CommandResult, error)
RunWithDescendantExitGrace preserves the ordinary runner's full descendant containment while allowing a trusted one-shot client a longer bounded grace for naturally exiting helpers. Forced cleanup remains an error.
func (OS) RunWithTreeExitGrace ¶
func (OS) RunWithTreeExitGrace(ctx context.Context, cmd ports.Command, treeExitGrace time.Duration) (ports.CommandResult, error)
RunWithTreeExitGrace is used for trusted commands such as Git that may leave a protocol/helper process completing natural shutdown after the leader exits. The grace never converts forced cleanup into success.