pub fn optimize_plan(
blueprint: &AuditBlueprint,
overlay: &GenerationOverlay,
preconditions: &HashMap<String, Vec<String>>,
constraints: &ResourceConstraints,
) -> OptimizedPlanExpand description
Select an optimal subset of procedures under resource constraints.
ยงAlgorithm
- Collect all procedures from the blueprint.
- Build a lookup by procedure id.
- Expand
must_includewith transitive preconditions (BFS). - Remove
must_exclude(warn if it is a dependency of a must-include). - If the mandatory set already exceeds the budget, return it as-is.
- Score remaining procedures by discriminator coverage per hour and greedily add while budget allows.
- Compute coverage, critical path, and role hours.