///|
pub fn augment_optimal(
  candidates : Plan,
  model : Array[Term],
  fixed_indices : Array[Int32],
  total_runs : Int32,
  passes~ : Int32 = 4,
) -> OptimalResult raise DesignError {
  optimal_budget(candidates, model, total_runs, passes)
  if fixed_indices.length() > total_runs {
    raise Budget("fixed runs exceed final run budget")
  }
  for j, i in fixed_indices {
    if i < 0 || i >= candidates.runs.length() {
      raise Invalid("fixed candidate index out of range")
    }
    for k in 0.. OptimalResult raise DesignError {
  optimal_budget(candidates, model, initial.length(), passes)
  if locked_prefix < 0 || locked_prefix > initial.length() {
    raise Invalid("invalid locked prefix")
  }
  for j, i in initial {
    if i < 0 || i >= candidates.runs.length() {
      raise Invalid("selection index out of range")
    }
    for k in 0..