Saltar al contenido principal

ADR 035 — Engine selection and registry

  • Status: Accepted (2026-08-10) — ratified in chat / field ADR package (first-class module + Nautilus)
  • Related: ADR 034, principal plan

Context​

R1/R2 propose metaclass interception to rebind _run_engine. R3 and repo practice favor explicit composition:

  • Backtests: BaseBacktestEngine + EngineCapabilities + _ENGINE_SHORTCUTS.
  • Worker: Executor (final execute) + ExecutorRouter.select_backend.
  • Components: @register, RLComponent, InfrastructureProviderMeta, etc.

ExecutionProfile is duplicated: worker Enum vs orchestration PortableModel — medium translation gap.

Decision​

  1. Engine selection uses explicit protocol + registry/factory/config (batch / replay / paper / live / profile enums). No SimulationMeta.
  2. New engines subclass existing bases and register; they implement only _execute_impl / engine run — never fork risk/idempotency pipelines.
  3. MONEY plane always routes to NativeExecutor (existing rule) — never Ray/Dask/Spark.
  4. Own a single ExecutionProfile translator (Phase 2) so worker and orchestration profiles remain interoperable without dual divergent enums forever. Prefer promoting a shared portable definition into alphaswarm_core or a facade module — not a third copy.

Consequences​

  • Typecheckers/DI/tests see the selected engine explicitly.
  • Golden replay tests become the parity mechanism, not class-construction magic.
  • CI should reject new SimulationMeta introductions.