job_queue: submit boot-time forge/matrix/webhook/knowledge sweeps as DAG nodes

This commit is contained in:
damocles 2026-08-14 01:58:26 +02:00 committed by mara
commit f367fa518e
3 changed files with 124 additions and 1 deletions

View file

@ -313,9 +313,33 @@ pub async fn run(coord: Arc<Coordinator>) -> Result<()> {
let fanout: Vec<String> = fanout.into_iter().map(|(name, _)| name).collect();
submit_boot_tree(&coord, any_stale, fanout, drifted, n_deferred, n_skipped);
submit_startup_sweep_nodes(&coord);
Ok(())
}
/// Submit the boot-time forge/matrix/webhook/knowledge sweeps as DAG nodes —
/// `ForgeSweep`, `MatrixSweep`, `WebhookRegister`, `KnowledgePull`. Unlike
/// [`submit_boot_tree`] this runs on **every** boot, quiet or not: these
/// aren't config-drift work, they're startup housekeeping that always needs
/// to happen, and the point of moving them here is exactly so they show up
/// as real work on the dashboard instead of an invisible `tokio::spawn` that
/// only surfaces on failure. Four independent, build-slot- and lease-exempt
/// roots — no dependency edges between them, matching the existing
/// `Reconcile`-root pattern in [`boot_nodes`].
fn submit_startup_sweep_nodes(coord: &Arc<Coordinator>) {
use crate::job_queue::NodeKind;
if let Err(e) = coord.job_queue.insert_job(|b| {
let _ = b.node(NodeKind::ForgeSweep);
let _ = b.node(NodeKind::MatrixSweep);
let _ = b.node(NodeKind::WebhookRegister);
let _ = b.node(NodeKind::KnowledgePull);
Vec::new()
}) {
tracing::warn!(error = ?e, "boot: startup sweep DAG insert failed");
}
}
/// The boot DAG's node declarations, split out of [`submit_boot_tree`] so they
/// can be exercised without a live [`Coordinator`].
///