Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/gunnar

crates/gunnar-repair/src/lib.rs

//! # gunnar-repair — the ONE implementation of gunnar's repair verbs
//!
//! 5.4 resilience (owner 2026-10-10): the estate repairs itself where it can, and
//! every caller runs the same code —
//!
//! * the estate's **boot check** ([`diagnose`]: "data lost; recharge from twin
//!   available"; recharges by itself only when the estate opted into auto-fix),
//! * the local **admin console** (gunnar-ui-server's Twin panel),
//! * a **monetize order** the estate PULLS and verifies ([`order`]): monetize never
//!   calls into an estate.
//!
//! | verb | here |
//! |---|---|
//! | review_twin | [`review_twin`] (pure, over [`TwinHead`]/[`MainStatus`]) |
//! | recharge_from_twin | [`plan_recharge`] (pure) + [`pump::recharge_from_twin`] (feature `pump`) |
//! | fence_primary | [`fence::fence_primary`] (feature `pump`) |
//! | adopt_twin | [`adopt::adopt_twin`] |
//! | boot check / pulled order | [`exec::boot_check`] / [`exec::execute`] (feature `pump`) |
//! | the pull channel (report, orders, ask) | monetize-estate-side's shared pump, with [`fleet::GunnarBox`] as its executor (feature `fleet`) |
//! | rebuild the main (the guard: may its data be destroyed?) | [`rebuild::judge`] (pure) |
//! | sign_in_again (S10: the estate mints and mails a resend link) | monetize-estate-side's `sign_in` (re-exported, feature `fleet`) + `exec::Estate::sign_in_again` (feature `pump`) |
//!
//! The default build is pure (serde only): the wasm guest links it too.
#![doc(
    html_logo_url = "https://gunnar.rs/download/gunnar.webp",
    html_favicon_url = "https://gunnar.rs/download/favicon.svg"
)]

pub mod adopt;
pub mod order;
pub mod plan;
pub mod rebuild;
pub mod review;
pub mod view;

#[cfg(feature = "pump")]
pub mod exec;
#[cfg(feature = "pump")]
pub mod fence;
#[cfg(feature = "pump")]
pub mod pump;

pub use order::{decode, Order, OrderAck};
pub use plan::{
    as_of, finished_on_the_box, freshness, plan_recharge, primary_answers, source_is_a_twin,
    too_small_for_the_base, BaseAsk, RechargeOpts, RechargePlan, Refusal, RefusalCode, TwinBase,
    DEFAULT_MAX_SILENCE_MS, FOLLOWER_NOT_RUNNING, KIND_SNAPSHOT_AT, LOST_IN_A_RELAY,
    STALE_AFTER_MS,
};
#[cfg(feature = "pump")]
pub use pump::{recharge_from_twin, Fault, Phase, Receipt};
pub use review::{diagnose, review_twin, Finding, Health, Loss, TwinReview, DATA_LOST_LINE};
pub use view::{AsMainStatus, AsRestored, AsTwinHead, Chunk, MainStatus, Restored, TwinHead};
#[cfg(feature = "fleet")]
pub mod fleet;
#[cfg(feature = "grpc")]
pub mod grpc;
#[cfg(feature = "proto")]
pub mod proto;
/// **The sign-in-again link** a sold main mints and mails (the order's checks, the lifetime,
/// the link, the mail's words): monetize-estate-side's, the one Holger's boxes use. Gunnar's
/// copy went with the publish (2026-10-26).
#[cfg(feature = "fleet")]
pub use monetize_estate_side::sign_in;