feat: phase1 상태기계/청산엔진/kill-switch 구현 (#275) #276
Reference in New Issue
Block a user
Delete Branch "feature/issue-275-phase1-state-exit-killswitch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
TASK-CODE-001: 상태기계 모듈 추가 (PositionState, 승격 우선순위, EXIT 우선)TASK-CODE-002: Hard Stop/BE Lock/ATR Trailing/모델보조 결합 청산 엔진 추가TASK-CODE-003: Kill Switch 오케스트레이터 추가 (src/core/risk_manager.py미수정)src/main.py에 신규 청산엔진/kill-switch 최소 침투 연동REQ/TASK/TEST Mapping
REQ-V2-001~003->TASK-CODE-001->tests/test_strategy_state_machine.pyREQ-V2-004->TASK-CODE-002->tests/test_strategy_exit_rules.pyREQ-V2-008->TASK-CODE-003->tests/test_kill_switch.pyValidation
pytest -q tests/test_strategy_state_machine.py tests/test_strategy_exit_rules.py tests/test_kill_switch.pypytest -q tests/test_main.py -k "hold_overridden_to_sell_when_stop_loss_triggered or hold_overridden_to_sell_when_take_profit_triggered or hold_not_overridden_when_between_stop_loss_and_take_profit or stop_loss_not_triggered_when_current_price_is_zero or sell_circuit_breaker_still_applies"pytest -q(pass: 896, fail: 0)python3 scripts/validate_ouroboros_docs.pySafety
src/core/risk_manager.pyunchangedCloses #275
[Reviewer Agent 피드백]
판정: Not Ready (검증 승인 전 수정 필요)
[Development Agent 논의/대응]
리뷰어 피드백 3건 모두 수용합니다. Main Agent 확인 하에 다음 순서로 수정 진행합니다.
수정 후:
[Development Agent 논의 종료 보고]
Main Agent 확인 하에 Reviewer 피드백 3건을 반영 완료했습니다.
trading_cycle,run_daily_session)clear_block()즉시 해제 제거trading_cycle내부 CB 알림 제거(상위 루프에서 단일 알림)KILL_SWITCH.trigger()결과report.errors를critical로그로 관측 가능화이제 검증 에이전트 동작 체크를 의뢰합니다.
[Verifier Agent 동작 체크 결과]
Main Agent 확인 요청에 따라 재검증 완료했습니다.
검증 항목:
pytest -q tests/test_kill_switch.py tests/test_strategy_state_machine.py tests/test_strategy_exit_rules.py-> PASSpytest -q tests/test_main.py -k "kill_switch_block_skips_actionable_order_execution or sell_circuit_breaker_still_applies or hold_overridden_to_sell_when_stop_loss_triggered or hold_overridden_to_sell_when_take_profit_triggered"-> PASSpytest -q(전체 회귀) -> PASSpython3 scripts/validate_ouroboros_docs.py-> PASS판정: