Skip to content

Structured error output #47

@8bitAlex

Description

@8bitAlex

Current errors are human-readable strings. Agents need machine-parseable errors to pivot and recover.

Proposed format

{
  "error": {
    "code": "REPO_NOT_CLONED",
    "message": "Repository 'api-gateway' is not cloned locally",
    "repo": "api-gateway",
    "hint": "Run `raid install` to clone all repos in the active profile"
  }
}

Requirements

  • Stable error code enum (documented)
  • Human-readable hint field for terminal users
  • Distinct exit codes for error categories:
    • 0 success
    • 1 generic failure
    • 2 config/validation error
    • 3 task execution failure
    • 4 network/clone failure
    • 5 not-found (repo, profile, task)
  • Errors emitted as JSON when --json flag is active

Acceptance criteria

  • Error code enum defined and documented
  • Exit code table in README
  • JSON errors match the schema from Issue Add build and test badges to README #2
  • Existing error sites refactored to use structured errors
  • Error code enum is treated as semver-stable: codes never renamed or repurposed across minor versions; new codes additive only

Metadata

Metadata

Assignees

No one assigned

    Labels

    v1-betaScope for the v1 beta — clearing all of these ships v1.0

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions