Activation gate: primary target probability floor (>= 20%)
A qualified setup's primary target must now clear MIN_TARGET_PROBABILITY
(20%), shared with the primary-selection floor in recommendation_service
and mirrored in the frontend gate. Closes the read-time hole where a
stale pre-c7a198b row starring a far lottery target (probability pinned
at the 3% clamp floor, R:R inflated by the same distance) qualified
forever: the scanner emits no replacement row and live R:R never decays.
A/B backtest vs c7a198b baseline (same July-3 snapshot): 7 of 1096
qualified setups removed; qualified net avg R 0.202 -> 0.207, hold
Sharpe 2.00 -> 2.02, CAGR +48.8% -> +49.6%, max DD unchanged at -15.8%.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,31 @@ class TestFloors:
|
||||
DEFAULT_GATE,
|
||||
) is True
|
||||
|
||||
def test_lottery_primary_target_fails(self):
|
||||
# A far target pinned at the model's 3% clamp floor: its distance keeps
|
||||
# both stored and live R:R above the gate, so only the probability floor
|
||||
# can reject it (the stale pre-fix lottery-headline case).
|
||||
s = _setup(rr_ratio=3.09, targets=[{"probability": 3.0, "is_primary": True}])
|
||||
assert setup_qualifies(s, DEFAULT_GATE) is False
|
||||
|
||||
def test_probability_at_floor_passes(self):
|
||||
assert setup_qualifies(
|
||||
_setup(targets=[{"probability": 20.0, "is_primary": True}]),
|
||||
DEFAULT_GATE,
|
||||
) is True
|
||||
|
||||
def test_probability_just_below_floor_fails(self):
|
||||
assert setup_qualifies(
|
||||
_setup(targets=[{"probability": 19.9, "is_primary": True}]),
|
||||
DEFAULT_GATE,
|
||||
) is False
|
||||
|
||||
def test_best_target_fallback_below_floor_fails(self):
|
||||
# No starred primary: the fallback takes the best target, which must
|
||||
# still clear the probability floor.
|
||||
s = _setup(targets=[{"probability": 12.0}, {"probability": 8.0}])
|
||||
assert setup_qualifies(s, DEFAULT_GATE) is False
|
||||
|
||||
|
||||
class TestMomentumGate:
|
||||
def test_top_momentum_passes(self):
|
||||
|
||||
Reference in New Issue
Block a user