Optimization Orchestrator
Orchestrates a simulation-optimization run driven by a pre-configured Solver.
Low-level API note: application and UI code should prefer KSLAppSession, which owns scope lifecycle, validation, warning emission, and dispatch across all supported run modes. This orchestrator remains public so lower-level tests and advanced integrations can exercise optimization execution directly.
Hooks Solver.iterationEmitter to emit one RunEvent.IterationCompleted per solver iteration, carrying the best inputs and estimated objective value found so far. The full per-iteration SolverStateSnapshot history is collected and returned in RunResult.OptimizationCompleted.iterationHistory for convergence analysis.
The returned RunHandle emits:
one RunEvent.IterationCompleted after each solver iteration
a terminal RunEvent.RunCompleted (or RunEvent.RunFailed)
The resolved RunResult is RunResult.OptimizationCompleted carrying the OrchestratorSummary, the best SolverStateSnapshot, and the full iteration history. Per-oracle-call simulation snapshots are not surfaced (the evaluator abstraction makes them non-trivial to intercept).
Thread note: Solver.runAllIterations is synchronous and runs on the coroutine's thread. Since SimulationDispatcher.default is IO-backed, blocking one thread while the solver runs is acceptable.