feat(soak): populate scenario + scenario registry

Partitions sessions into N rooms, runs gamesPerRoom games per room
in parallel via Promise.allSettled so a failure in one room never
unwinds the others. Errors roll up into ScenarioResult.errors.

Verified via tsx: listScenarios() returns [populate], getScenario()
resolves by name and returns undefined for unknown names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-11 17:23:56 -04:00
parent 722934bdf2
commit 2c20b6c7b5
2 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/**
* Scenario registry — name → Scenario mapping.
*
* Runner looks up scenarios by name. Add a new scenario by importing
* it here and adding an entry to `registry`. No filesystem scanning,
* no magic.
*/
import type { Scenario } from '../core/types';
import populate from './populate';
const registry: Record<string, Scenario> = {
populate,
};
export function getScenario(name: string): Scenario | undefined {
return registry[name];
}
export function listScenarios(): Scenario[] {
return Object.values(registry);
}