Title here
Summary here
Status: Accepted Date: 2025-12-01 Supersedes: N/A Superseded by: N/A
AWF is a CLI tool used in scripts and CI pipelines. Consumers need to programmatically distinguish error categories to decide retry strategy, user messaging, and escalation. A single non-zero exit code forces callers to parse stderr text, which is fragile and locale-dependent.
| Option | Pros | Cons |
|---|---|---|
| Fixed exit code taxonomy (1-4) | Scriptable, simple, universal | Limited to 4 categories, no sub-codes |
| Structured JSON error output | Rich metadata, extensible | Requires parsing, breaks simple $? checks |
| Single non-zero exit (1) | Simplest implementation | No differentiation, useless for automation |
Map exit codes to four error categories:
| Code | Category | Examples |
|---|---|---|
1 | User error | Bad input, missing file, invalid workflow name |
2 | Configuration error | Invalid config, missing dependency, bad YAML |
3 | Execution error | Command failed, timeout, agent error |
4 | System error | IO failure, permissions, disk full |
Rules:
What becomes easier:
awf run X || case $? in 1) ... 2) ... esacWhat becomes harder:
| Principle | Status | Justification |
|---|---|---|
| Error Taxonomy | Compliant | This ADR defines the principle |
| Go Idioms | Compliant | Custom error types with Error() method |
| Security First | Compliant | Error messages never leak secrets |