feat(#2591): add NodeKind::Dag DAG-container variant

This commit is contained in:
atlas 2026-07-20 22:16:27 +02:00 committed by mara
commit 8834161fb9
2 changed files with 25 additions and 0 deletions

View file

@ -103,6 +103,10 @@ pub(super) async fn run_node(coord: &Arc<Coordinator>, claim: &Claim) -> Result<
NodeKind::ResolveApproval => run_resolve_approval(coord, claim).await,
NodeKind::EmitRebuilt => Ok(run_emit_rebuilt(coord, claim)),
NodeKind::RevertIntent => run_revert_intent(coord, claim).await,
// Pure grouping container — no work; completing it lets it reach
// `Finishing` so its child template nodes start. The DAG's terminal
// hook fires when the container itself rolls up terminal.
NodeKind::Dag { .. } => Ok(NodeOutput::default()),
}
}

View file

@ -14,6 +14,8 @@
pub use hive_sh4re::jobs::{DagView, NodeId, PermPayload, Source, State, Template};
use serde::Serialize;
use crate::coordinator::TransientKind;
/// When a dependency edge is considered satisfied.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
@ -154,6 +156,24 @@ pub enum NodeKind {
/// means "don't do it". Noop on any non-cancelled outcome. Appended weak-dep
/// on the tails; slot/lease-exempt.
RevertIntent,
/// The **DAG container** node: one per submitted DAG, carrying the group's
/// domain metadata. Every template node hangs *under* it (its subtree), so
/// the container's `NodeId` **is** the DAG id, its rolled-up state **is** the
/// DAG state, and it reaching terminal **is** the completion signal that
/// fires the DAG's inline hook (approval-resolve / rebuilt-emit /
/// intent-revert, dispatched off `template`). Pure grouping — lease- and
/// build-slot-exempt; the executor instant-completes it (`Done`) so it
/// reaches `Finishing` and its children start.
Dag {
template: Template,
source: Source,
reason: String,
transient: Option<TransientKind>,
approval_id: Option<i64>,
inputs: Vec<String>,
perm_payload: Option<PermPayload>,
created_at: i64,
},
}
impl NodeKind {
@ -179,6 +199,7 @@ impl NodeKind {
NodeKind::ResolveApproval => "resolve_approval",
NodeKind::EmitRebuilt => "emit_rebuilt",
NodeKind::RevertIntent => "revert_intent",
NodeKind::Dag { .. } => "dag",
}
}