Default online backtest to production GTL

This commit is contained in:
2026-07-13 16:51:55 +02:00
parent 8e09f239c8
commit 9d362bd568
4 changed files with 25 additions and 2 deletions
+5
View File
@@ -459,6 +459,11 @@ metrics. Keep the SSH tunnel open only while creating the snapshot; the backtest
run itself is local/offline. `backtest_snapshots/` and generated backtest reports run itself is local/offline. `backtest_snapshots/` and generated backtest reports
are git-ignored. are git-ignored.
Without a research override, both this runner and the scheduled/Admin online
backtest use `explicit_target_ladder`, matching the live scanner's gate-target
path. Clean Structural S/R detector arms must be selected explicitly with
`--sr-variant`; they are not production backtest defaults.
### Archived GTL tuning decision ### Archived GTL tuning decision
The completed replacement, cohort-composition, and strength-sensitivity The completed replacement, cohort-composition, and strength-sensitivity
+11 -2
View File
@@ -176,8 +176,17 @@ SR_RESEARCH_VARIANTS = {
def _sr_research_variant() -> str: def _sr_research_variant() -> str:
"""S/R policy arm for local research; never read by the live scanner.""" """Backtest target policy; research arms require an explicit override.
value = os.getenv("BACKTEST_SR_VARIANT", "rewrite").strip().lower()
The unconfigured online/scheduled backtest must replay the same transient
Gate Target Ladder as the live scanner. Clean Structural S/R remains an
opt-in research arm here because it is intentionally chart/alert structure,
not the production gate's target source.
"""
value = os.getenv(
"BACKTEST_SR_VARIANT",
EXPLICIT_TARGET_LADDER_VARIANT,
).strip().lower()
if value not in SR_RESEARCH_VARIANTS: if value not in SR_RESEARCH_VARIANTS:
allowed = ", ".join(sorted(SR_RESEARCH_VARIANTS)) allowed = ", ".join(sorted(SR_RESEARCH_VARIANTS))
raise ValueError(f"Unknown BACKTEST_SR_VARIANT={value!r}; expected one of {allowed}") raise ValueError(f"Unknown BACKTEST_SR_VARIANT={value!r}; expected one of {allowed}")
+6
View File
@@ -912,6 +912,12 @@ model. This snapshot is now exhausted for GTL fitting; any future challenger
must be pre-registered and evaluated on genuinely new forward data rather than must be pre-registered and evaluated on genuinely new forward data rather than
another iteration over the same history. another iteration over the same history.
The scheduled/Admin online backtest and the unconfigured local snapshot
backtest therefore default to `explicit_target_ladder`. Structural detector
variants remain explicit research overrides. After deployment, rerun the Admin
backtest once to replace any cached report produced by the former `rewrite`
default.
The temporary GTL matrix scripts, configurable detector branches, and The temporary GTL matrix scripts, configurable detector branches, and
confirmation hooks were removed after this decision. The normal snapshot confirmation hooks were removed after this decision. The normal snapshot
backtester and frozen `explicit_target_ladder` parity arm remain. backtester and frozen `explicit_target_ladder` parity arm remain.
+3
View File
@@ -793,6 +793,9 @@ def test_window_setups_too_short_returns_empty():
def test_sr_research_variant_is_explicit_and_validated(monkeypatch): def test_sr_research_variant_is_explicit_and_validated(monkeypatch):
monkeypatch.delenv("BACKTEST_SR_VARIANT", raising=False)
assert bt._sr_research_variant() == bt.EXPLICIT_TARGET_LADDER_VARIANT
for variant in ( for variant in (
"production_control", "production_control",
"legacy_range_grid_touch", "legacy_range_grid_touch",