crates/monetize-ui-web/src/lib.rs
//! The monetize operator console.
//!
//! Client-side rendered: the pages ask `monetize-ui-server` over same-origin
//! JSON and server-sent events, and it does the talking to monetize.
//!
//! # This console must REFLECT the base model, not just obey it
//!
//! `docs/v2/06-data-model.md` §6.1 at the repo root is the law; §"What this means for the
//! CONSOLE" is written for this crate. The short form, because it is what
//! reviews of this crate turn on:
//!
//! * **Show the transaction, never a balance.** An attempt is
//! `Reserved → Ensured → Captured`, or it is released. No credit, no account
//! balance, no "top up" — every byte bought is owned by one order.
//! * **Never render a number the ledger cannot rebuild.** A figure that cannot
//! be recomputed by folding rows is a lie waiting to happen.
//! * **Absence is not zero.** A meter with no reading is unmeasured; a cap with
//! no number is *uncapped* — its own state, never an empty bar and never a
//! full one; an unanswered capacity question is "a measurement that did not
//! happen", not "a full disk".
//! * **Sold is not bought.** `caps` are what the tenant is allowed (the order),
//! `resources` what monetize bought for it (the delta's iron), and the box's
//! own pool what was there before monetize existed. BACKED BY shows the
//! second, distinct from the first; a quote shows the price beside the cost.
//! * **A refusal names what is missing AND what to do about it.** A sealed data
//! set must never read as "buy more disk".
//! * **Colour carries [`fmt::Enforcement`] meaning, not decoration.** A wall
//! escalates; a measured meter never alarms; provisioned iron is the kernel's.
//! * This console **measures nothing**. It renders what the product counted.
//!
//! [`fmt`] holds every decision worth testing and touches no browser API, so it
//! compiles and runs under `cargo test` on the host. Everything that needs a DOM
//! is gated on `wasm32`, which is also what lets `cargo build --workspace` succeed.
pub mod accounts;
pub mod estate;
pub mod fmt;
pub mod guardian;
pub mod model;
/// "Logs" on a narrated test site: its boxes' DEV-NARRATE boot logs (host-testable).
pub mod narrate;
/// The box's plugins: "Update plugins" (host-testable).
pub mod plugins;
/// "Update this box" (owner 2026-10-18).
pub mod self_box;
/// The test button's decisions (host-testable).
pub mod sites;
pub mod test_buy;
#[cfg(target_arch = "wasm32")]
pub mod api;
#[cfg(target_arch = "wasm32")]
pub mod app;
/// CODE RED on every page (2026-10-18).
pub mod code_red;
#[cfg(target_arch = "wasm32")]
pub mod feed;
#[cfg(target_arch = "wasm32")]
pub mod pages;
#[cfg(target_arch = "wasm32")]
pub mod passkey;
#[cfg(target_arch = "wasm32")]
pub mod ui;
#[cfg(target_arch = "wasm32")]
pub use app::App;