Share backtest request contracts and isolate stored result mapping

This commit is contained in:
Boki 2026-10-21 23:57:48 -04:00
parent 007e35c747
commit 420c47704e
21 changed files with 777 additions and 244 deletions

View file

@ -1,8 +1,9 @@
import { EventEmitter } from 'node:events';
import { parseBacktestRequest } from '@stock-bot/stock-config/backtest';
import { resolveDataset, type DatasetResolver } from '../data/historical-dataset';
import { PREPARATION_BATCH_SIZE, preparationCheckpoint } from '../data/preparation';
import { StorageService } from '../services/StorageService';
import { BacktestConfigSchema, type BacktestConfig, type OrchestratorServices } from '../types';
import type { BacktestConfig, OrchestratorServices } from '../types';
import {
BacktestCancelledError,
BacktestTimeoutError,
@ -58,7 +59,7 @@ export class RustBacktestAdapter extends EventEmitter implements BacktestExecuti
this.closing ? 'Native backtest engine is shutting down' : 'Backtest already running'
);
}
const config = BacktestConfigSchema.parse(input);
const config = parseBacktestRequest(input);
const controller = new AbortController();
let finished!: () => void;
this.active = {