Files
audita/docs/integrations/subprocess.md

2.0 KiB

Subprocess Integration

This guide explains how a parent process can invoke Audita and consume its results. The CLI reference owns command syntax, streams, and exit semantics; configuration owns discovery and precedence.

Invocation

Use an argument array with the transcript path and required glossary argument, following the process examples. For machine workflows, select explicit transcript and report destinations rather than depending on the working directory or run-directory retention. Supplying a configuration path also makes file selection predictable; only explicitly referenced credential variables are read from the environment.

Resolve the executable deliberately and set the child's working directory so relative input/output paths and reported artifact paths have a known base. Read stdout and stderr concurrently to avoid pipe blocking, and impose timeout or cancellation in the parent process when needed.

Result Handling

Interpret the exit result according to the CLI output and exit contract. Consume transcript/report data through the output-file contract, and treat stderr as human-readable detail. The report supplements the exit result: it may be absent after early failures, and output may have been written before a later reporting or cleanup failure.

If processing fails, preserve available evidence and follow operations recovery. For reports retained outside the run directory, account for the artifact lifecycle before dereferencing reported paths. Neither the existence of an output file nor a diagnostics path alone establishes successful completion.