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

@ -20,9 +20,9 @@ export async function createContainer(
}
const role =
options.role === undefined
? settings?.defaultMode === 'backtest'
? 'research-only'
: 'paper'
? settings?.defaultMode === 'paper'
? 'paper'
: 'research-only'
: options.role;
const configuredEngine = config.services?.orchestrator?.backtesting?.useRustEngine;
const useRustEngine = configuredEngine === undefined ? true : configuredEngine;
@ -35,6 +35,11 @@ export async function createContainer(
settings?.canonicalPaper === undefined
? undefined
: validatePaperConfiguration(paperConfigurationSchema.parse(settings.canonicalPaper));
if (role === 'paper' && !canonicalPaper) {
throw new Error(
'Paper composition requires explicit canonicalPaper configuration; accounts are never migrated automatically'
);
}
if (canonicalPaper && !config.database?.postgres?.enabled) {
throw new Error('Canonical paper requires durable PostgreSQL custody');
}
@ -57,7 +62,6 @@ export async function createContainer(
syntheticSeed: config.services?.orchestrator?.backtesting?.syntheticSeed ?? 42,
nativeExecutionTimeoutMs: config.services?.orchestrator?.backtesting?.executionTimeoutMs,
canonicalPaper,
paperTradingCapital: settings?.paperTradingCapital,
});
return container.resolve('serviceContainer') as OrchestratorServices;
}