nemo_flow_adaptive/types/plan.rs
1// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Adaptive execution-plan data models.
5
6use serde::{Deserialize, Serialize};
7
8use crate::types::metadata::MetadataEnvelope;
9
10/// Group of tools that have been observed to run in parallel.
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct ParallelGroup {
13 /// Stable identifier for the parallel group.
14 pub group_id: String,
15 /// Tool names that belong to the group.
16 pub tool_names: Vec<String>,
17}
18
19/// Learned execution plan for an agent.
20///
21/// The plan captures discovered tool fan-outs and the metadata template used to
22/// expose those discoveries to later runs.
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct ExecutionPlan {
25 /// Agent identifier the plan applies to.
26 pub agent_id: String,
27 /// Parallel groups learned for the agent.
28 pub parallel_groups: Vec<ParallelGroup>,
29 /// Metadata template emitted alongside the plan.
30 pub metadata_template: MetadataEnvelope,
31}