Skip to main content

Crate spacedb_console

Crate spacedb_console 

Source
Expand description

§spacedb-console — the operator’s read-model

The substance of an operations console is not pixels — it is the logic that turns raw fleet / access / audit / settlement Observations into the four boards a SpaceDB business is run from:

  1. Fleet Health (FleetHealth) — durability + availability: under-replicated, at-risk and lost shards, quorum loss, lag; one Green/Amber/Red rollup.
  2. Access & Audit (AccessOverview) — human vs AI-agent capabilities, expirations, revocations, per-agent activity, denials.
  3. Economics (Economics) — revenue, spend per customer, per-rail split, agent budget burn-down, unsettled claims.
  4. Alerts (Alert) — the page-me surface, severity-sorted.

Dashboard::assemble computes all four from one snapshot; Dashboard::render_text prints them. A Dioxus/WASM shell binds the same fields to a UI:

ⓘ
// in the Dioxus shell (compiles to wasm32, not part of the tested core):
let dash = Dashboard::assemble(&observations, &Config::at(now));
rsx! {
    HealthBadge { status: dash.health.status }
    for alert in dash.alerts { AlertRow { alert } }
    EconomicsPanel { economics: dash.economics }
}

Open-core (MIT). Fed by observation DTOs, so it stays decoupled and testable.

Structs§

AccessOverview
The security board.
AgentActivity
One agent’s recent footprint in the audit log.
AgentBudgetObs
An agent’s remaining spend against its granted budget.
Alert
AlertThresholds
Thresholds for what counts as alert-worthy.
AuditObs
An audit-log entry — who did what, and whether it was allowed.
BudgetStatus
One agent’s budget burn-down.
CapabilityObs
An issued capability (human or AI agent).
Config
Operator-tunable thresholds for the whole dashboard.
Dashboard
The four boards.
Economics
The business board.
FleetHealth
The durability + availability picture for the whole fleet.
HomeObs
A home computer in the fleet.
LagObs
A collection’s convergence lag on some replica.
Observations
One snapshot of everything the console observes.
RailBreakdown
Revenue split across the three rails.
SettledObs
A settled usage receipt — revenue credited to a hosting home for a customer.
ShardObs
A stored shard and its replication standing.
StrongObs
A strong-tier collection’s quorum standing.

Enums§

AlertKind
HealthStatus
The single-glance rollup.
Resource
The class of a resource — the settlement bucket.
Severity
Sort order is the variant order: Critical < Warning < Info, so sorting ascending puts the worst first.

Functions§

assess_fleet
Assess fleet health from observations. A collection is “stale” if its lag exceeds lag_ops_warn.
derive_alerts
Derive the full alert list, sorted worst-first.
rollup_access
Roll up active capabilities and audit activity. A capability counts as “expiring soon” if it expires within expiry_window of now.
rollup_economics
Roll up settled receipts and agent budgets. budget_low_pct is the remaining-percentage threshold below which an agent is flagged low.