Freeze historical datasets and qualify backtest instrument identities

This commit is contained in:
Boki 2026-10-20 23:59:15 -04:00
parent 63c3856797
commit d6b09eb635
43 changed files with 2249 additions and 1230 deletions

View file

@ -1,6 +1,7 @@
import { Hono, type Handler } from 'hono';
import { z } from 'zod';
import { defined } from '@stock-bot/invariants';
import { HistoricalDataRequestError } from '@stock-bot/types';
import { parseBacktestRequest } from '../../backtest/BacktestRunner';
import { BacktestCancelledError } from '../../backtest/execution-engine';
import { BacktestConflictError } from '../../backtest/run-repository';
@ -43,6 +44,9 @@ export function createBacktestRoutes(container: IServiceContainer): Hono {
400
);
}
if (error instanceof HistoricalDataRequestError) {
return c.json({ error: error.message }, 400);
}
container.logger.error('Error running backtest:', error);
return c.json(