sprawling-kernel 0.0.9

Every decision of a sprawling city - addresses, events, gates, plans and errors - with nothing that touches a disk.
Documentation
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// Copyright (c) 2026 2youg1 and the sprawling contributors

//! AxError, the one error shape of the whole city, and
//! AxCode, the closed set of 35 error codes.
//! The part `crates/kernel/spec/Error.lean` specifies this module.
//!
//! Invariants owned here:
//! - every wire spelling (`E_…`) has exactly one authority: [`AxCode::as_str`];
//!   serde delegates to it in both directions, so enum and wire cannot drift.
//! - a gate refusal always carries the three mandatory parts (rule,
//!   violation, alternative): [`AxError::refusal`] is the only path that
//!   sets them and [`AxError::failure`] cannot.
//! - every constructed error says what to do next: both constructors
//!   return an [`ErrorDraft`], and [`ErrorDraft::with_recovery`] is the
//!   only way to obtain an [`AxError`].
//! - `retry` defaults to `Retry::No`; a caller must opt in explicitly
//!   (fail-closed).
//!
//! The carrier-event declaration (`AxCode::carrier`) lives together with
//! `kernel::event` because it names `EventKind`.

mod code;
mod provider;
mod refusal;
mod shape;

pub use code::{AxCode, Carrier};
pub use provider::ProviderFailureKind;
pub use refusal::GateRefusal;
pub use shape::{AxError, ErrorDraft, Retry};