dotbabel

ADR-0012 — Structured error contract

Status: Accepted (2026-04-14)

Context

The legacy validator surface (pre-0.2.0) pushed raw strings into result.errors. Consumers who wanted to react programmatically — gate CI on a specific kind of failure, or route a subset of errors to a different channel — had two bad options:

  1. Regex the stderr prose. Brittle. Any message wording change is implicitly a breaking change that CI consumers feel immediately.
  2. Read the source and hardcode the call-site line numbers. Worse.

Decision

Every validator emits ValidationError instances, not strings. A single source of truth lives at plugins/dotbabel/src/lib/errors.mjs:

Consequences

Alternatives considered

Revisit triggers