Skip to content

Exit codes

Each Writ command gives one of these four exit codes.

Code Name Meaning
0 Success The command did the work. For writ issue, the satisfaction clauses passed.
1 Breach A bound stopped the run, an invariant stopped the run, or a remedy stopped the run.
2 Validation The file is not valid, or an argument is wrong.
3 Configuration The engagement configuration is missing or wrong.

Code 1 means that Writ worked correctly and the agent did not finish the work. The terms did their job.

Code 2 means that Writ could not start. The file has a problem.

This difference is important in a script. A run that ends with code 1 gives you a record to read. A run that ends with code 2 has no record, because no run started.

Terminal window
if writ issue bug-fixer.yaml --set failing_test="$TEST"; then
echo "The work is complete."
else
case $? in
1) echo "The run stopped at a limit. Read the record." ;;
2) echo "The writ is not valid." ;;
3) echo "The engagement configuration is wrong." ;;
esac
fi

To make a job fail when a writ is not valid, run writ check. The command gives code 2 for a file that is not valid, and code 0 for a file that is valid.