tools: fail() prints ON FAILURE lines on stderr after ERROR (#143)
CI / verify (push) Successful in 1m15s
Release / release (push) Successful in 37s

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2

Files changed:
- AGENTS.md
- CHANGES.md
- VERSION
- tools/CONTRACT.md
- tools/chemenu/cli.py
- tools/chemenu/cli_contract.py
- tools/chemenu/commands/_util.py
- tools/chemenu/tests/test_cli.py
- tools/chemenu/tests/test_cli_contract.py
- tools/chemenu/tests/test_util.py
This commit is contained in:
torben committed 2026-09-26 14:53:51 +02:00
1 parent 5fe6003929
commit 63f566ff05
10 files changed
+403 -19

No files matched your search

+4 -1
View File
@@ -291,7 +291,10 @@ Every `tools/wikitool` call has exactly four outcomes:
1. **Success (exit 0).** Continue.
2. **Validation error (exit 1 with an `ERROR` line).** Not transient - re-running unchanged
fails identically. Read the message, fix the cause, retry **once** with corrected input.
fails identically. The `ERROR` line on stdout is followed by the command's ON FAILURE
reaction(s) on stderr - the same text `wikitool <cmd> -h` prints, without a second call -
or a bare `see: wikitool <cmd> -h` pointer where the record has none yet. Read the
message, fix the cause, retry **once** with corrected input.
3. **User clearance required (exit 42).** Not an error and not yours to resolve: show the
command's output to the user verbatim and stop. See [Gates](#gates).
4. **Unexpected error (timeout, crash, interrupted process).** Do not guess whether it