feat(#2392): group boot sweep + reconciles under one boot dag

This commit is contained in:
damocles 2026-07-13 11:34:42 +02:00 committed by mara
commit 16f69ca890
6 changed files with 111 additions and 23 deletions

View file

@ -94,6 +94,9 @@ pub(super) async fn run_node(coord: &Arc<Coordinator>, claim: &Claim) -> Result<
NodeKind::WriteDropin => run_write_dropin(coord, claim).await,
NodeKind::WritePermFile => run_write_perm_file(coord, claim, &ctx).await,
NodeKind::ApprovalDeploy => run_approval_deploy(coord, claim).await,
// A pure grouping anchor (boot root): no work, completes immediately so
// its child DAGs settle it and the boot tree resolves.
NodeKind::Noop => Ok(NodeOutput::default()),
}
}

View file

@ -125,6 +125,12 @@ pub enum NodeKind {
/// deploy stays inside `actions.rs` in v1 — deliberately not
/// modeled as scheduler nodes (see the design doc §9).
ApprovalDeploy,
/// No-op anchor that completes immediately with no work. It exists so a
/// boot's `StartupSweep` + per-agent `Reconcile` child DAGs can hang off
/// one root (`parent_id`) and render as a single boot tree on the
/// dashboard. Holds no lease and no build slot; the child DAGs it anchors
/// still run concurrently — the grouping is a display link, not a dep edge.
Noop,
}
impl NodeKind {
@ -144,6 +150,7 @@ impl NodeKind {
NodeKind::WriteDropin => "write_dropin",
NodeKind::WritePermFile => "write_perm_file",
NodeKind::ApprovalDeploy => "approval_deploy",
NodeKind::Noop => "noop",
}
}

View file

@ -281,6 +281,30 @@ pub fn meta_update(
/// Boot-time sweep parent: bump meta's hyperhive input (non-fatal),
/// then fan out `Rebuild` children for the precomputed stale agent
/// list (topology-sorted by the caller).
/// Boot-time root anchor DAG: a single [`NodeKind::Noop`] node that groups
/// this boot's `StartupSweep` + per-agent `Reconcile` child DAGs (linked via
/// `parent_id`) into one tree so the dashboard renders the boot as one entry.
/// Holds no lease and does no work — the children it anchors still run
/// concurrently. `auto_update::run` submits it first (when there's any boot
/// work), then parents the sweep + reconciles onto its id.
pub fn boot_root(reason: String) -> DagSpec {
DagSpec {
template: Template::Boot,
agent: "hyperhive".to_owned(),
source: Source::AutoUpdate,
reason,
parent_id: None,
approval_id: None,
inputs: Vec::new(),
perm_payload: None,
transient: None,
nodes: vec![NodeSpec {
kind: NodeKind::Noop,
deps: Vec::new(),
}],
}
}
pub fn startup_sweep(reason: String, stale_agents: Vec<String>) -> DagSpec {
DagSpec {
template: Template::StartupSweep,