fix: BULLISH confidence 임계값 75로 복원 (#205)
Some checks failed
CI / test (pull_request) Has been cancelled

CLAUDE.md 규칙 개정에 따라 BULLISH 시장은 75로 유지.
시장 전망별 임계값: BEARISH=90, NEUTRAL=80, BULLISH=75.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
agentson
2026-02-23 12:30:51 +09:00
parent d6a389e0b7
commit 16b9b6832d
2 changed files with 6 additions and 11 deletions

View File

@@ -505,8 +505,9 @@ async def trading_cycle(
outlook = playbook.market_outlook outlook = playbook.market_outlook
if outlook == MarketOutlook.BEARISH: if outlook == MarketOutlook.BEARISH:
min_confidence = 90 min_confidence = 90
elif outlook == MarketOutlook.BULLISH:
min_confidence = 75
else: else:
# BULLISH/NEUTRAL: use base threshold (min 80 per CLAUDE.md non-negotiable rule)
min_confidence = base_threshold min_confidence = base_threshold
if match.confidence < min_confidence: if match.confidence < min_confidence:
logger.info( logger.info(

View File

@@ -2729,18 +2729,13 @@ class TestMarketOutlookConfidenceThreshold:
assert call_args.kwargs["action"] == "BUY" assert call_args.kwargs["action"] == "BUY"
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_bullish_outlook_uses_same_threshold_as_neutral( async def test_bullish_outlook_lowers_buy_confidence_threshold(
self, self,
mock_broker: MagicMock, mock_broker: MagicMock,
mock_market: MagicMock, mock_market: MagicMock,
mock_telegram: MagicMock, mock_telegram: MagicMock,
) -> None: ) -> None:
"""BUY with confidence 77 should be suppressed even in bullish market. """BUY with confidence 77 should proceed in bullish market (threshold=75)."""
CLAUDE.md non-negotiable rule: confidence < 80 → force HOLD.
BULLISH outlook does NOT lower the threshold below 80.
(issue #205)
"""
engine = MagicMock(spec=ScenarioEngine) engine = MagicMock(spec=ScenarioEngine)
engine.evaluate = MagicMock(return_value=self._make_buy_match_with_confidence(77)) engine.evaluate = MagicMock(return_value=self._make_buy_match_with_confidence(77))
playbook = self._make_playbook_with_outlook("bullish") playbook = self._make_playbook_with_outlook("bullish")
@@ -2772,8 +2767,7 @@ class TestMarketOutlookConfidenceThreshold:
call_args = decision_logger.log_decision.call_args call_args = decision_logger.log_decision.call_args
assert call_args is not None assert call_args is not None
# confidence 77 < 80 → must be suppressed to HOLD assert call_args.kwargs["action"] == "BUY"
assert call_args.kwargs["action"] == "HOLD"
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_bullish_outlook_suppresses_very_low_confidence_buy( async def test_bullish_outlook_suppresses_very_low_confidence_buy(
@@ -2782,7 +2776,7 @@ class TestMarketOutlookConfidenceThreshold:
mock_market: MagicMock, mock_market: MagicMock,
mock_telegram: MagicMock, mock_telegram: MagicMock,
) -> None: ) -> None:
"""BUY with confidence 70 should be suppressed even in bullish market (threshold=80).""" """BUY with confidence 70 should be suppressed even in bullish market (threshold=75)."""
engine = MagicMock(spec=ScenarioEngine) engine = MagicMock(spec=ScenarioEngine)
engine.evaluate = MagicMock(return_value=self._make_buy_match_with_confidence(70)) engine.evaluate = MagicMock(return_value=self._make_buy_match_with_confidence(70))
playbook = self._make_playbook_with_outlook("bullish") playbook = self._make_playbook_with_outlook("bullish")