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

nordisk/dwarves

.nornir/jobs-fleet-pane-guide.md

live jobs + agent-fleet pane — guide

Class: guide · how to USE + EXTEND the Live-Jobs+fleet cockpit pane. What it IS: jobs-fleet-pane-design.md. Beginner: jobs-fleet-pane-for-idiots.md.

Run it

The pane ships as the Jobs (live) tab of the native demo:

cargo run -p dwarves-gui

Make the ledger real, then watch it:

dwarves --warehouse /tmp/wh run /path/to/repo   # writes a ci_build job to /tmp/wh/jobs
DWARVES_JOBS_DIR=/tmp/wh/jobs cargo run -p dwarves-gui   # the Jobs (live) tab shows it

Empty ledger / offline server ⇒ the pane shows a marked fixture (fixture (ledger empty) / fixture (fleet offline)), never a blank pane or a panic.

The controls

Top strip: ⟳ Refresh (re-read ledger + re-fetch fleet), ● live / ⏸ paused (toggle the 2s auto-poll), the job count + source + the node roll-up. Below it the fleet roster (● loki linux-x64 cargo,heavy 12c idle), then the shared jobs tree (sort by column, fold a parent run to hide its dispatched steps, select a row).

Drive it headless (robot / thin client)

use facett_core::Facet;
let mut p = dwarves_embed::JobsFleetPanel::new(endpoint, token, ledger_root);
p.update_json(r#"{"auto_poll": false}"#);   // pause polling
p.update_json(r#"{"fold": "#1042"}"#);       // fold a run
p.update_json(r#"{"sort": "elapsed"}"#);     // sort the jobs
let s = p.state_json();
assert_eq!(s["source"], "ledger");
assert!(s["nodes"].as_array().unwrap().iter().any(|n| n == "loki"));

state_json keys: source (ledger|fixture), job_count, nodes/node_count, fleet_source (pool|fixture), agent_count, online_agents, agents[], auto_poll, and jobs (the shared JobList's fold-aware tree). update_json: {refresh}/{poll}, {auto_poll}, and the forwarded {sort|fold|select|kind_filter}.

Extend it

Test / gate

cargo test -p dwarves-embed                 # 12 (5 new)
cargo test -p dwarves-embed --features testmatrix
cargo test -p dwarves-gui