src/viz/mod.rs
//! Urðr Threads — egui time-travel visualizer for the warehouse.
//!
//! Reads (read-only) the `release_lineage` and `dep_graph_edges`
//! tables and paints each repo as a swim-lane along the release
//! timeline. Cross-repo dep edges from the snapshot pinned to a
//! release are drawn as woven threads between lanes (the literal
//! Norns motif).
//!
//! Pure Rust — eframe over wgpu/WebGPU on Linux/macOS/Windows. No JS,
//! no WebView, no C deps beyond the platform windowing libs that
//! eframe already brings in.
//!
//! Enable with the `viz` feature; the binary lives at
//! `src/bin/urdr-threads.rs`.
// The pure data model (no egui) is also compiled for the `server` build so the
// `Viz.Timeline` RPC can reuse `build_timeline`. The egui app + its tabs are
// `viz`-only.
pub mod model;
pub use model::{Lane, LaneNode, Timeline, build_timeline, load_timeline};
// Data-only diagram renderers (static SVG / Markdown over the `Timeline` model,
// no egui) — compiled alongside `model` so docs/server/CLI can render the viz
// diagrams headlessly.
pub mod diagram;
// Pure (no-egui) dependency-graph layout + edge classification — the data core
// behind the 🔗 Dep Graph renderer (deep transitive closure, direct-vs-transitive
// classification, click-collapse). Compiled alongside `model` (server build too)
// so the closure / classification logic is unit-testable and the laid-out graph
// structure can be folded into `state_json` (LAW #6).
pub mod depgraph_layout;
// 🩸 Pure (no-egui) data core behind the ORGANIC BLOODSTREAM view — the
// workspace as a circulatory system (crates=organs, dep edges=vessels, call-chain
// =blood flow), plus the recursive external-dep closure walk (deps-of-deps out of
// a Cargo.lock) the drill-down hangs off each organ. Compiled alongside `model`
// (server build too) so the closure/layout is unit-testable and folds into
// `state_json` (LAW #6); the egui host lives in `bloodstream_tab` (viz-only).
pub mod bloodstream;
// The robot-UI-tester control channel (the drive-half). No egui — just the tiny
// command-file contract the running viz polls and the `viz.click` MCP tool
// writes. Compiled in every build (incl. the `nornir-mcp` binary, which writes
// commands) so both sides share the same `VizCommand` type + path resolution.
pub mod control;
// Demo mode — the hands-free guided-tour driver. Pure (no egui), so it compiles
// in every build (matching `control`) and is testable without the `viz` feature.
pub mod demo;
#[cfg(feature = "viz")]
pub mod action_log; // TOTAL user-action log (ring + stderr + /tmp file + durable
// warehouse `viz_actions` sink, N5). Public so the headless
// inject-assert test can drive it end-to-end.
#[cfg(feature = "viz")]
mod app;
#[cfg(feature = "viz")]
pub mod arch_tab;
#[cfg(feature = "viz")]
pub mod preflight; // 🏛 EPIC ARCH wiring board drawn natively in egui; its
// `ArchPayload` serde shape is shared with `remote::fetch_architecture` (the RPC).
#[cfg(feature = "viz")]
pub mod metro_feed; // 🚇 PURE producer: nornir arch::metro chains + surface_coverage
// → facett-graphview MetroMap (the S5b feed for the Metro tab).
// Public so the headless `tests/metro_feed.rs` drives it directly.
#[cfg(feature = "viz")]
pub mod metro_tab; // 🚇 the Metro tab pane — hosts facett-graphview::MetroView,
// fed the producer's MetroMap. Public so the matrix drives it.
#[cfg(feature = "viz")]
pub mod helix_tab; // 🧬 the Time-Helix tab — hosts facett-helix::HelixView, fed a
// Scene built from the workspace's release timelines.
#[cfg(feature = "viz")]
pub mod bloodstream_tab; // 🩸 the Bloodstream tab — the workspace as an organic
// circulatory system (crates=organs, deps=arteries,
// call-chain=blood), painted natively over `bloodstream`,
// with recursive external-dep drill-down. A `Facet`.
#[cfg(feature = "viz")]
mod callgraph;
#[cfg(feature = "viz")]
pub mod funnel3d; // rotating 3-D funnel-plan view (sphere/helix/force); asserted by viz_funnel3d
#[cfg(feature = "viz")]
pub mod funnel_plandag; // funnel Plan-DAG via facett-plandag::PlanDagView (thin adapter)
#[cfg(feature = "viz")]
mod funnel_tab;
#[cfg(feature = "viz")]
mod funnel_view;
#[cfg(feature = "viz")]
pub mod graph; // DepGraphView + its memoized closure are asserted by the perf matrix test
#[cfg(feature = "viz")]
pub mod graph_render; // SHARED pan/zoom graph renderer (arch board + 🧬 release
// dashboard) — now a THIN RE-EXPORT of `facett-graphpan`,
// the leaf that adopted this canvas verbatim (L5).
#[cfg(feature = "viz")]
pub mod gate; // SHARED Gate / Doctor model + gate_json — reused by the 🚀 Release
// pane AND the 🧬 nornir RELEASE DASHBOARD.
#[cfg(feature = "viz")]
pub mod nornir_dashboard; // 🧬 the RELEASE DASHBOARD (Release button + gate-overlaid
// dependency graph + node→history), built on graph_render.
#[cfg(feature = "viz")]
pub mod release_wizard; // 🧙 the guided, gated RELEASE WIZARD the dashboard's Release
// button opens — orchestrates doctor/stage/promote as gates.
#[cfg(feature = "viz")]
pub mod knowledge;
#[cfg(feature = "viz")]
pub mod repo_pane; // 🔁 SHARED per-repo pane empty-state + auto-refresh helper:
// the LAW-2 empty-state classifier (in-route vs not-scanned, from
// the live Viz.Jobs snapshot) + the `should_refetch` throttle that
// replaces every pane's sticky `loaded` latch. Public so the
// headless matrix drives `classify_empty`/`should_refetch` directly.
#[cfg(feature = "viz")]
pub mod nornir_tab;
#[cfg(feature = "viz")]
mod ops_tabs; // 🧬 the `nornir` root pane (server + workspace lifecycle
// operations). Public so the headless viz test matrix drives
// its NornirRootView + state_json directly.
#[cfg(feature = "viz")]
pub mod build_info_live; // 📡 the build-info LIVE-TAIL pane (slice-5 capstone):
// subscribes the §f3 build-info Flight stream per sub-job
// `step_id` via `build::flight_sink::subscribe` and folds
// it into per-step status transitions + the log/metric
// tail. A pure, robot-testable Facet. Public so the
// headless matrix drives ingest + state_json directly.
#[cfg(feature = "viz")]
mod live;
pub mod navigator;
#[cfg(feature = "viz")]
pub mod release_depdag; // release dep-DAG via facett-graphview (thin adapter)
#[cfg(feature = "viz")]
mod release_tab;
#[cfg(feature = "viz")]
mod security_tab; // 🛰 the Warehouse (Constellation) Navigator MODEL — render-agnostic
// hierarchical graph (constellation→repo→crate→module→code) + travel-query surface
// (recency/bugs/release-wave/blast/bottleneck/deepest-chain), consumed by facett's
// Code Vault view via `NavigatorModel::state_json`. Extends the release_depdag seed.
#[cfg(feature = "viz")]
pub mod build_tab; // 🔨 build runner (now a sub-pane of ⚒ Dwarves — N5)
// egui/facett-bound (eframe + facett_brokkr/facett_theme/facett_ui) — only the viz app
// (dwarves_tab) uses it, so gate on `viz`; a headless `server`-only build omits it.
#[cfg(feature = "viz")]
#[cfg(feature = "viz")]
pub mod dwarves_tab; // ⚒ the merged Dwarves tab (build runner + CI forge) — N5
// 🤖 The Claude "SDK": a tiny direct client for the Anthropic Messages API behind
// the `ClaudeTransport` seam (real `reqwest` path gated on `claude`; a fake drives
// CI). Pure types + trait + fake compile with `viz`; public so the headless robot
// test drives a send through the fake.
pub mod claude;
#[cfg(feature = "viz")]
pub mod claude_tab; // 🤖 the Claude tab — a facett-Elm conversation pane over the
// Messages API. Public so the headless robot test drives it.
#[cfg(feature = "viz")]
pub mod models_tab; // 🧠 the Models tab — browse/download LLM+embedding models as
// jobs behind the `ModelDownloader` seam (a fake drives CI).
pub mod test_boot; // 🚀 TEST-BOOT — spin a built target up as a nornir job (Exe/Container/Vm)
// (binary × features × profile × target) + a BUILD button wired to
// `nornir build --attest --seal`. Public so headless tests drive it.
#[cfg(feature = "viz")]
pub mod facett_theme; // ported facett palette family (egui-0.33 vendored) — the
// Test pane's switchable themes + status/health ramps.
#[cfg(feature = "viz")]
pub mod facett_ui; // generic, non-nornir-specific viz widgets (status chips,
// badges, sparklines, zebra rows, health pill, graph node) —
// factored out of the panes, palette-driven, facett-bound when
// egui aligns (D3). See .nornir/theming-and-facett-migration.md.
// egui/facett-bound (super::action_log + facett_theme) — only the viz `app` uses it,
// so gate on `viz`; a headless `server`-only build omits it.
#[cfg(feature = "viz")]
pub mod chat_tab; // 💬 the Chat tab — a local-model chat panel wired to the ACTIVE
// in-process Generator (candle GGUF from /mnt/work4t) + the
// agent-agnostic MCP-to-nornir client config. Robot-drivable via
// chat.input / chat.send; asserted by tests/robot_chat.rs.
// The gRPC THIN CLIENT is not a GUI: `nornir jobs` / `nornir test-results` call
// it from the plain CLI, so gating it on `viz` made
// `--no-default-features --features full-server` fail to build the `nornir`
// binary (5x "cannot find `remote` in `viz`") — the exact feature set
// dwarves-server's path dep uses. It needs `wire-client` (the generated stubs),
// which every server build already turns on; what it does NOT need is eframe.
#[cfg(any(feature = "viz", feature = "wire-client"))]
pub mod remote; // gRPC thin-client (list_workspaces / fetch_timeline / fetch_tables /
// scan_table) — public so the headless viz test matrix can drive it.
#[cfg(feature = "viz")]
mod timetravel;
#[cfg(feature = "viz")]
pub mod trace; // structured IN/OUT/END event stream ($NORNIR_VIZ_TRACE) — the
// machine-readable data the UI actually rendered.
#[cfg(feature = "viz")]
mod mcp_tab;
#[cfg(feature = "viz")]
pub mod warehouse_deck_tab;
#[cfg(feature = "viz")]
mod warehouse_tab; // 🏢 the Warehouse Deck — a facett WarehouseDeck wall
// of N panes (3D graphs + grids + charts) over the
// whole Iceberg warehouse.
#[cfg(feature = "viz")]
pub mod manual_tab; // 📖 nornir's own manual, rendered from docs/book-svg/ via
// the facett-docview vector viewer (multi-core resvg).
// 📦 Holger registry pane — the built-in (married) holger dev pair (/cache +
// /sparring) read via holger's IN-PROCESS functional API. Only compiled when
// holger is actually embedded (the `embed-holger` feature); the 📦 tab degrades
// to a short note otherwise.
#[cfg(all(feature = "viz", feature = "embed-holger"))]
pub mod holger_tab;
#[cfg(feature = "viz")]
pub use app::{Tab, UrdrThreadsApp, client_build};
// 🤖 MOUNT the viz as a WIRE-REMOTE robot-drive target (the full-system-autotest
// fleet's 5th member). Off by default; the `nornir-ui --robot-remote <socket>`
// flag hands the process to `serve_robot_remote` instead of the GUI. Single-threaded
// blocking serve (ROOT LAW #0). See src/viz/robot_remote.rs.
#[cfg(feature = "robot-remote")]
pub mod robot_remote;
// 🎬 EGUI saga replay — route a recorded `ReplayPlan`'s SHARED `Scenario` through
// the live viz so it replays HEADLESS or VISIBLY (the egui sibling of the WEB
// path `crate::robot::replay_plan_to_web_scenario`). Off by default; reached via
// `nornir saga egui-replay`. Needs the robotui `watch` backend. See
// src/viz/saga_replay.rs.
#[cfg(feature = "saga-egui")]
pub mod saga_replay;
// 🧭 LAW 9 (UI-PLANE reachability): nornir-viz modelled as a `UiPlan` (plane per
// Tab) + a native `PlaneDriver` over the live app + the wasm/deployed driver seam.
// The worked example that proves `nornir_testmatrix::uiplane`.
#[cfg(feature = "viz")]
pub mod uiplane_plan;
// 🧭 S3c — the PANE DISCOVERY REGISTRY (`viz_surfaces()`): the formal, stable
// enumeration of every addressable viz surface (one per `Tab::ALL` + the 🧬 tab's
// populate_status/jobs sub-panels) that the atom-walk + functional matrix walk,
// superseding `Tab::ALL` + ad-hoc `state_json` slicing.
#[cfg(feature = "viz")]
pub mod surfaces;
// 🎬 SCENE — the whole Urðr-Threads master shell expressed DECLARATIVELY as a
// `facett_app::scene::Scene` (menubar + a tree of foldable/draggable/drawer panes
// + nav routes), rendered by `scene::render` DRIVING the existing panes. The
// draggable master/detail split (workspace | Time-machine inspector), the
// foldable action-log drawer, and the responsive phone override live here. Public
// so the headless scene unit tests + the robot harness drive the builder + its
// accessors directly. See `.nornir/scene-design.md`.
#[cfg(feature = "viz")]
pub mod shell_scene;
#[cfg(feature = "viz")]
pub use shell_scene::nornir_shell_scene;