process

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func IsExactStdoutLimitExitCode(err error, exitCode int) bool

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

func IsOnlyStdoutLimitExceeded(err error) bool

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

func (OS) DuplexCapability() error

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) Run

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL