import { config } from '../config/index.js'; import type { BacktestMode } from './types.js'; export function assertBacktestMode(mode: string | undefined): asserts mode is BacktestMode { if (mode !== 'backtest') { throw new Error('Backtest guard rejection: mode must be "backtest".'); } } export function assertBacktestFeatureEnabled(): void { if (!config.ENABLE_BACKTEST) { throw new Error('Backtest feature is disabled. Set ENABLE_BACKTEST=true to enable.'); } }