Fix post-cluster neutral strength ablation

This commit is contained in:
2026-07-12 23:51:28 +02:00
parent 8df76d3288
commit b891122936
4 changed files with 64 additions and 1 deletions
+24
View File
@@ -156,6 +156,28 @@ def _sr_research_variant() -> str:
return value
def _apply_zone_strength_variant(zone_levels: list[Any], sr_variant: str) -> list[Any]:
"""Apply post-cluster research controls without changing zone geometry."""
if sr_variant == "legacy_geometry_neutral":
# Neutrality must be enforced after the shared zone cluster: its legacy
# sum mode can otherwise turn two 50-strength constituents back into a
# 100-strength target and silently invalidate the ablation.
for level in zone_levels:
level.strength = 50
return zone_levels
def _apply_zone_strength_variant(zone_levels: list[Any], sr_variant: str) -> list[Any]:
"""Apply post-cluster research controls without changing zone geometry."""
if sr_variant == "legacy_geometry_neutral":
# Neutrality must be enforced after the shared zone cluster: its legacy
# sum mode can otherwise turn two 50-strength constituents back into a
# 100-strength target and silently invalidate the ablation.
for level in zone_levels:
level.strength = 50
return zone_levels
def _backtest_entry_bounds() -> tuple[date | None, date | None]:
"""Optional research-only entry bounds used to protect validation data."""
parsed: list[date | None] = []
@@ -328,6 +350,8 @@ def _window_setups(
entry,
strength_mode=zone_strength_mode,
)
zone_levels = _apply_zone_strength_variant(zone_levels, sr_variant)
zone_levels = _apply_zone_strength_variant(zone_levels, sr_variant)
targets = target_generator.generate_targets(direction, entry, stop, zone_levels, atr)
if not targets:
fallback_k = _atr_target_fallback_k()