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
- Jobs are read from the jera ledger at
$DWARVES_JOBS_DIR(else<warehouse>/jobs, warehouse =$DWARVES_WAREHOUSEelse~/.dwarves/warehouse). - The fleet is fetched from a running
dwarves-serverat$DWARVES_SERVERover theAgentPoolRPC (bearer$DWARVES_SERVER_TOKEN).
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
- Point at a remote fleet: set
$DWARVES_SERVERto the forge; theAgentPoolreply flows throughagents_from_wireunchanged — aGrpcAgentfleet needs no pane change. - A live remote ledger: today jobs are read from the LOCAL
jobs.redb. A remote forge's ledger needs aJobsread RPC ondwarf.v1(proto + aJobStore::listhandler) + a thin fetch leg here — the fleet leg is the template. See the design's "Deferred" note in the problems file. - Reuse
facett-tablefor the roster instead of the inline egui grid (cosmetic).
Test / gate
cargo test -p dwarves-embed # 12 (5 new)
cargo test -p dwarves-embed --features testmatrix
cargo test -p dwarves-gui