feat(research): cut over canonical runtime and enforce agent budgets
This commit is contained in:
parent
ab08db82fd
commit
bbf0dd4453
103 changed files with 6138 additions and 3112 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import type { CanonicalRunCapability } from '@stock-bot/stock-config/canonical-research';
|
||||
import {
|
||||
catalogExecutionReason,
|
||||
supportedLegacyStrategy,
|
||||
} from '@/features/strategies/components/StrategySelection';
|
||||
import { catalogExecutionReason } from '@/features/strategies/components/StrategySelection';
|
||||
import { backtestApiV2, RunResultsUnavailableError } from '../services/backtestApiV2';
|
||||
import type {
|
||||
Backtest,
|
||||
|
|
@ -423,30 +420,30 @@ export function useBacktestV2() {
|
|||
}, []);
|
||||
|
||||
const createRun = useCallback(
|
||||
async (speedMultiplier: number | null = null) => {
|
||||
async (_speedMultiplier: number | null = null) => {
|
||||
if (!backtest || backtest.id !== loadedBacktestId.current || submission.current?.pending) {
|
||||
return undefined;
|
||||
}
|
||||
if (backtest.archivedAt && !submission.current) {
|
||||
setSubmissionError('Restore this archived backtest before starting a new run.');
|
||||
return undefined;
|
||||
}
|
||||
if (catalog && !canonicalCapability?.available && !submission.current) {
|
||||
setSubmissionError(
|
||||
capabilityError ?? canonicalCapability?.reason ?? catalogExecutionReason
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
if (!catalog && !supportedLegacyStrategy(backtest.strategy) && !submission.current) {
|
||||
if (!catalog && !submission.current) {
|
||||
setSubmissionError(
|
||||
'This legacy strategy is not supported for new submissions by this form.'
|
||||
'Legacy execution is retired. Create a catalog backtest to run with retained canonical inputs.'
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
if (backtest.archivedAt && !submission.current) {
|
||||
setSubmissionError('Restore this archived backtest before starting a new run.');
|
||||
return undefined;
|
||||
}
|
||||
const intent = (submission.current ??= {
|
||||
backtestId: backtest.id,
|
||||
key: crypto.randomUUID(),
|
||||
body: { speedMultiplier: catalog ? null : speedMultiplier },
|
||||
body: { speedMultiplier: null },
|
||||
pending: false,
|
||||
});
|
||||
intent.pending = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue