top of page

A Command Printed “Done”: Did the Business Operation Actually Succeed?

Oct 26
3 min read

A script launches a report command and searches its output for the word “done.” The command exits with an error after printing an earlier progress message, but the wrapper reports success. In another workflow, a harmless diagnostic message on standard error causes a successful operation to be marked failed.


Process status, output text and the business result are related but distinct signals. A reliable wrapper should interpret each according to the command’s documented contract.


Start with the return code


Python’s subprocess documentation describes the returned process status and the check=True option, which raises CalledProcessError for a nonzero exit code. Standard output and standard error can be captured separately. A zero status typically indicates successful process execution.


Check the specific command’s documented meanings. Some tools use distinct nonzero statuses for expected conditions such as a negative search result. Do not replace a documented contract with a universal rule based only on whether text appeared in a particular stream.


Define success at three levels


At the process level, did the program start, finish and return an expected status? At the output level, did it produce a result in the required format? At the business level, does that result satisfy the intended operation?


A report command may return zero while producing an empty report that is valid for one request and unexpected for another. The wrapper needs the business expectation to distinguish those cases. It should not fabricate records to make the output look complete.


Illustrative example: progress before failure


Suppose a command prints “preparation done,” then fails while writing the final file. A wrapper that searches for “done” can mistake progress for completion. The exit status and final artifact check reveal the unresolved operation.


Use an isolated test command that emits a progress line and returns a nonzero status. Confirm that the wrapper reports the failure and does not publish a stale file left by an earlier run.


Illustrative example: diagnostics on standard error


Another command writes a diagnostic notice to standard error but completes with its documented success status and a valid report. A wrapper that treats any standard-error bytes as failure rejects useful work.


Capture diagnostics for review, but classify the result using the actual contract. If particular warnings require intervention, identify those conditions explicitly rather than equating the entire stream with a failed business action.


Inspect the produced artifact


Validate the expected format, required fields, scope and completeness of the output. Tie the artifact to the current invocation through an appropriate run identifier, unique destination or other verified mechanism. An old file at the expected path is not evidence that the current run created it.


For structured output, use a parser and schema or business validation suited to the format. Avoid mixing progress messages with machine-readable results unless the command explicitly documents a framing protocol.


The machine-readable error contract guide offers the same general distinction for APIs: a caller needs stable, interpretable outcomes rather than guesses based on human wording.


Handle incomplete execution explicitly


Set a timeout appropriate to the operation and understand the process-management behavior of the chosen interface. A timeout or terminated process does not prove that external side effects were rolled back. Reconcile consequential work before retrying.


Preserve enough diagnostics to investigate without logging credentials or unrelated payloads. Record the command identity, relevant version, return status and output-validation result. Treat launch failures separately from commands that started and returned an error.


Test success, expected negative outcomes, malformed output, nonzero failure and timeout in a harmless environment. Include a stale artifact to ensure the wrapper does not confuse old evidence with new success.


Start by replacing the single “command succeeded” flag with the three checks: process status, output validity and business completion. The resulting report can then explain exactly what happened and what remains unresolved.


Editorial note


Prepared with AI assistance. Primary sources and the FutureOS article inventory were checked on October 26, 2026. Examples are illustrative, not customer results. FutureOS is described as being in prelaunch in its current introduction. This guide does not claim an available product feature, integration or service, and no independent expert review is claimed.


Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page