Add real-time progress feedback to multi-run simulations
Balance Check / balance-simulation (push) Successful in 11m24s
Balance Check / multi-run-balance (push) Successful in 26m35s
CI / build-and-push (push) Successful in 34s

Switch from exec() to spawn() for streaming stderr, add onProgress
callback to runner, and emit per-run progress lines from workers.
CI now shows live percentage, tick count, and era during long runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 17:42:37 -04:00
parent 04d8a4e883
commit db034687d6
3 changed files with 36 additions and 11 deletions
+6 -2
View File
@@ -14,6 +14,7 @@ export interface SimulationConfig {
seed?: number;
verbose?: boolean;
silent?: boolean;
onProgress?: (tick: number, totalTicks: number, era: string) => void;
}
export interface EraTransition {
@@ -139,8 +140,11 @@ export function runSimulation(config: SimulationConfig): SimulationResult {
allMetrics.push(collectMetrics(state));
}
if (!config.silent && tick % progressInterval === 0) {
printProgress(tick, config.totalTicks, state, startTime);
if (tick % progressInterval === 0) {
if (!config.silent) {
printProgress(tick, config.totalTicks, state, startTime);
}
config.onProgress?.(tick, config.totalTicks, state.meta.currentEra);
}
}