feat(research): retry failed experiment trials with retained history

This commit is contained in:
Boki 2026-10-24 10:56:58 -04:00
parent 6f64ef62ba
commit b373410320
32 changed files with 3336 additions and 61 deletions

View file

@ -64,7 +64,7 @@ async function fixture(poolMax = 4, withExperiments = true) {
'18-backtest-strategy-versions.sql',
'19-canonical-research.sql',
'21-run-reproduction.sql',
...(withExperiments ? ['22-experiments.sql'] : []),
...(withExperiments ? ['22-experiments.sql', '23-experiment-retries.sql'] : []),
]) {
await pool.query(
readFileSync(new URL(`../../database/postgres/init/${name}`, import.meta.url), 'utf8')
@ -702,6 +702,13 @@ describe.skipIf(!url)('retained-input experiments', () => {
expect((await f.api.getReproductionComparison(reproduction.id)).status).toBe('match');
const ordinary = await f.api.createRun({ backtestId: f.draft.id }, receipt());
expect(ordinary.status).toBe('pending');
// The current experiment reader includes retry counters introduced after SQL22.
await f.pool.query(
readFileSync(
new URL('../../database/postgres/init/23-experiment-retries.sql', import.meta.url),
'utf8'
)
);
const input = { backtestId: f.draft.id, name: 'After upgrade', grid: {} };
const preview = await f.experiments.preview(input);
expect(