submit

fun submit(spec: RunSpec, attachments: List<RunAttachmentIfc> = emptyList(), validate: Boolean = true): RunHandle(source)

Submit a run for asynchronous execution.

Validation runs before dispatch by default — RunConfigurationValidator for non-optimization specs, OptimizationConfigurationValidator for RunSpec.Optimization. Validation errors and unsupported session-level combinations return an already-failed handle rather than throwing, so UI code can handle all outcomes through the same event/result protocol.

For RunSpec.Optimization, a Solver is built from ksl.app.config.optimization.OptimizationRunConfiguration via OptimizationSolverFactory and then submitted to OptimizationOrchestrator.

Attachments are currently supported only for RunSpec.Single. Non-empty attachments on other specs fail immediately with a configuration error.