import { BacktestRunner } from '../../apps/stock/orchestrator/src/backtest/BacktestRunner'; import type { BacktestExecutionEngine } from '../../apps/stock/orchestrator/src/backtest/execution-engine'; import type { PostgresBacktestRunRepository } from '../../apps/stock/orchestrator/src/backtest/PostgresBacktestRunRepository'; import type { BacktestRunRepository, UnavailableBacktestRunRepository, } from '../../apps/stock/orchestrator/src/backtest/run-repository'; import { RustBacktestAdapter } from '../../apps/stock/orchestrator/src/backtest/RustBacktestAdapter'; function canonicalDependencies( engine: BacktestExecutionEngine, legacy: Pick, repository: BacktestRunRepository, withoutReplay: Omit, withoutClaim: Omit, withoutDataset: Omit, withoutCompletion: Omit ) { const logger = { error() {} }; new BacktestRunner({ engine, repository, logger }); // @ts-expect-error Canonical replay is mandatory; a legacy playback engine is insufficient. new BacktestRunner({ engine: legacy, repository, logger }); // @ts-expect-error The current runner cannot be composed without canonical execution. new BacktestRunner({ engine: withoutReplay, repository, logger }); // @ts-expect-error Canonical claim custody is mandatory. new BacktestRunner({ engine, repository: withoutClaim, logger }); // @ts-expect-error Retained canonical dataset loading is mandatory. new BacktestRunner({ engine, repository: withoutDataset, logger }); // @ts-expect-error Canonical completion persistence is mandatory. new BacktestRunner({ engine, repository: withoutCompletion, logger }); // @ts-expect-error Current execution does not accept provider storage dependencies. new RustBacktestAdapter({ logger, storage: { getHistoricalBars: async () => [] } }); // @ts-expect-error The canonical runner cannot select a competing engine by name. new BacktestRunner({ engine, repository, logger, engineName: 'typescript' }); } void canonicalDependencies; function canonicalRepositorySurface( repository: PostgresBacktestRunRepository, unavailable: UnavailableBacktestRunRepository ) { // @ts-expect-error Legacy claim/create is an explicit compatibility-only capability. repository.start; // @ts-expect-error Production cannot perform legacy provider lookup/pinning. repository.loadDataset; // @ts-expect-error Admission already binds canonical datasets. repository.freezeDataset; // @ts-expect-error Production cannot persist an independent legacy financial result. repository.complete; // @ts-expect-error Playback controls are retained only by the compatibility writer. repository.updateControl; // @ts-expect-error Shared completion fences are not public writer capabilities. repository.markComplete; // @ts-expect-error Shared transaction locks are protected, not public. repository.ownedTransaction; // @ts-expect-error The unavailable production implementation has the same canonical surface. unavailable.start; } void canonicalRepositorySurface;