feat(research): cut over canonical runtime and enforce agent budgets

This commit is contained in:
Boki 2026-10-24 16:47:19 -04:00
parent ab08db82fd
commit bbf0dd4453
103 changed files with 6138 additions and 3112 deletions

View file

@ -2,6 +2,7 @@ import { z } from 'zod';
import { BaseHandler, Handler, Operation } from '@stock-bot/handlers';
import { defined } from '@stock-bot/invariants';
import type { BacktestRunner } from '../../backtest/BacktestRunner';
import { LEGACY_EXECUTION_RETIRED } from '../../backtest/execution-engine';
import type { OrchestratorServices } from '../../types';
@Handler('orchestrator')
@ -22,10 +23,7 @@ export class BacktestHandler extends BaseHandler<OrchestratorServices> {
const { runId } = z.object({ runId: z.string().uuid() }).parse(payload);
return this.runner.runQueued(runId);
}
// Old jobs omitted these fields. Normalize the envelope, never the execution result.
const config = { mode: 'backtest', dataFrequency: '1d', ...payload };
const results = await this.runner.runBacktest(config);
return { success: true, backtestId: results.backtestId, runId: results.runId, results };
throw new Error(LEGACY_EXECUTION_RETIRED);
}
@Operation('cancel-backtest')