nextRunSubdir

fun nextRunSubdir(analysisDir: Path): Path(source)

Find the next unused run-NNN subdirectory under analysisDir.

Pattern: run-001, run-002, … Numbers are zero-padded to 3 digits. Returns run-001 when analysisDir doesn't exist yet or has no matching subdirectories; otherwise returns run-<max+1> so a fresh run never overwrites a prior one.

Numbers ≥ 1000 keep growing — the format-string still produces a unique name, just one digit longer than the typical three-digit form.

The directory is not created by this helper. Callers create it at submit time after the path is committed.