Adding a strategy meant editing six places that had to agree: the StrategyId
union and a parallel Set in args.ts, STRATEGY_LABELS and a nine-branch
STRATEGY_FACTORIES in strategy-runner.ts, plus an inline id union and
BASE_STRATEGIES in App.tsx. runEngine's type parameter was additionally bounded
by a union of all nine snapshot types.
They had already drifted: the CLI gated basis on isBasisSupportedExchangeId
while the menu checked only isBasisStrategyEnabled, so the menu offered basis
on exchanges where startStrategy would throw.
- strategy-ids.ts: the id list and alias parsing, dependency-free so CLI arg
parsing does not pull in every engine.
- registry.ts: one definition per strategy (labels, symbol, engine factory, and
a single unavailableReason both the menu and the runner consult), keyed by a
total Record so a new id will not compile until it is defined.
- StrategyEngine/StrategySnapshot interfaces replace the snapshot union;
runEngine now depends only on the contract. All nine engines already satisfied
it — no engine changed.
- App.tsx keeps only the id -> Ink view map, also a total Record.
Menu order preserved. 8 new tests, one pinning menu/CLI availability agreement.
234 pass; tsc clean. -242 lines.