refactor(backtest): isolate legacy persistence capabilities (CL33)

This commit is contained in:
Boki 2026-10-28 14:45:12 -04:00
parent 24487d35da
commit ec582bd5e8
14 changed files with 413 additions and 311 deletions

View file

@ -3,7 +3,11 @@ import type {
BacktestExecutionEngine,
LegacyBacktestExecutionEngine,
} from '../../apps/stock/orchestrator/src/backtest/execution-engine';
import type { BacktestRunRepository } from '../../apps/stock/orchestrator/src/backtest/run-repository';
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(
@ -34,3 +38,27 @@ function canonicalDependencies(
}
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;