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

nordisk/dwarves

.nornir/status-badge-design.md

status badge — design

Class: design · Function axis: f0 the badge feature (the whole) · f1 the pure renderer (brokkr::badge) · f2 the latest-run selector · f3 the Badge gRPC RPC · f4 the dwarves badge CLI verb (fat + thin) Strict: this file states only what the status badge IS — its parts and why they are shaped this way. Sibling how-to: status-badge-guide.md; zero-knowledge walkthrough: status-badge-for-idiots.md.

A status badge is the shields-style pill (⟨ pipeline │ passing ⟩) a README or dashboard <img>s to show a pipeline's health at a glance. dwarves already carried the renderer — brokkr::badge::svg — but it was orphaned: reachable only from its own unit test, wired to no CLI verb and no RPC. The parity spec flagged this twice (D2: "badge still pending its RPC"; D1 wishlist: Badge "remains open"). This feature closes both by making the primitive reachable fat (the local warehouse) and thin (over gRPC) through one shared renderer.

The system as one — the function map (f0)

part lives in what it is
f1 renderer crates/dwarves/src/brokkr/badge.rs svg(label, status) → a self-contained SVG pill; color_for/status_text map each RunStatus to its shields colour+word
f2 selector crates/dwarves/src/brokkr/badge.rs latest_status(runs, project, pipeline) → the newest matching run's Option<RunStatus> (pure)
f3 Badge RPC crates/dwarves/src/server.rs · proto/dwarf.proto DwarfSvc::badge: read_runs → selector → renderer → BadgeReply{svg,status,label,found}
f4 CLI verb crates/dwarves/src/main.rs dwarves badge <pipeline>: fat badge_cmd (local warehouse), thin thin_badge (the Badge RPC)

Why it is shaped this way

Place in the nordisk constellation

The badge is a dwarves-owned forge surface (the CI half of the parity map). It reads dwarves' own historized runs (store::read_runs, the JSONL/Iceberg-shaped ledger) — no nornir dependency, no warehouse of its own beyond the run history it already keeps. A future nornir/holger dashboard embeds the same SVG over the Badge RPC (thin gRPC), the same cross-app pattern as nornir-funnel-embed.

Deferred