strategy: align model exit signal policy with v2 spec (#369) #388
Reference in New Issue
Block a user
Delete Branch "feature/issue-369-model-exit-signal-spec-sync"
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?
Traceability
REQ-V2-004TASK-V2-006TEST-ACC-011Summary
model_exit_signal이 상태머신EXITED직접 조건으로 사용되던 경로를 제거해 보조 트리거 사양(단독 청산 금지)과 정합화했습니다.evaluate_exit()에서model_liquidity_exit직접 청산 reason 분기를 제거했습니다.should_exit=False를 강제했습니다.REQ-V2-004상태를✅ 완료로 동기화하고, requirements registry 버전을 갱신했습니다.Validation
python3 scripts/session_handover_check.py --strictruff check src/strategy/position_state_machine.py src/strategy/exit_rules.py tests/test_strategy_state_machine.py tests/test_strategy_exit_rules.pypytest -q tests/test_strategy_state_machine.py tests/test_strategy_exit_rules.pypython3 scripts/validate_ouroboros_docs.pypython3 scripts/validate_docs_sync.pyBASE=$(git merge-base origin/feature/v3-session-policy-stream HEAD); python3 scripts/validate_governance_assets.py "$BASE...HEAD"PR #388 코드 리뷰 — strategy: align model exit signal policy with v2 spec (#369)
범위: model_exit_signal을 직접 청산 트리거에서 제거 → "assist-only" 정책으로 재분류
✅ 통과 항목
1. 정책 변경 구현
2. 테스트 커버리지
3. 문서: REQ-V2-004 ⚠️ → ✅, 버전 1.0.9
⚠️ 소견 1 — model_exit_signal이 현재 dead signal 상태 (Non-blocking)
변경 후 model_exit_signal의 수명 주기:
즉 계산은 되지만 아무 효과가 없는 상태입니다.
주석에서 "assist-only"라고 명시했지만, 현재 "간접적 보조" 역할도 구현되어 있지 않습니다.
권장: StateTransitionInput에서 model_exit_signal 필드를 제거하거나, 실제 assist 역할(예: ATR 멀티플라이어 강화, arm_pct 하향 조정 등)을 구현하거나, 주석에 "미래 구현 예정 (placeholder)" 명시.
⚠️ 소견 2 — REQ-V2-004 ✅ 완료 표시 타당성 (Non-blocking)
"4중 청산 로직 (Hard/BE/ATR Trailing/Model)"에서 Model 컴포넌트가
현재 동작하지 않는 상태인데 ✅ 완료로 표시됩니다.
"스펙 정합화 완료"라는 의미라면 비고에 "Model = assist-only (직접 EXIT 미트리거)"를 추가해 향후 감사 시 혼선을 방지하기를 권장합니다.
결론
LGTM — 정책 변경 명확, 테스트 통과.
소견 1의 dead signal 처리 방향(제거/구현/주석)을 결정해 후속 PR로 추적하기를 권장합니다.
리뷰 반영했습니다. (비블로킹 소견 2건)
model_exit_signal을 단순 전달값으로 두지 않고,assist-only동작으로 연결했습니다.model_exit_signal은 직접 EXIT를 유발하지 않고,HOLDING -> BE_LOCK승격 보조로만 작동합니다.evaluate_exit()reason에model_assist_be_lock를 추가해 관측 가능하게 했습니다.REQ-V2-004항목 설명에Model assist-only, 직접 EXIT 미트리거를 명시했습니다.1.0.10으로 갱신했습니다.검증:
ruff check src/strategy/position_state_machine.py src/strategy/exit_rules.py tests/test_strategy_state_machine.py tests/test_strategy_exit_rules.pypytest -q tests/test_strategy_state_machine.py tests/test_strategy_exit_rules.py(7 passed)python3 scripts/validate_ouroboros_docs.pypython3 scripts/validate_docs_sync.pyBASE=$(git merge-base origin/feature/v3-session-policy-stream HEAD); python3 scripts/validate_governance_assets.py "$BASE...HEAD"추가 리뷰 — strategy: implement model assist be-lock path and clarify audit note
커밋:
5e4c94b✅ 소견 반영 확인
소견 1 (dead signal 구현)
model_exit_signal의 실제 "assist" 동작 구현:
position_state_machine.py:
elif inp.model_exit_signal:
# Model signal assists risk posture by tightening to BE_LOCK.
target = PositionState.BE_LOCK
exit_rules.py:
elif model_exit_signal and next_state == PositionState.BE_LOCK:
reason = "model_assist_be_lock"
단조성(monotonic) 보장 확인
소견 2 (감사 문서 비고)
REQ-V2-004 설명이 "4중 청산 로직 (Hard/BE/ATR Trailing/Model assist-only, 직접 EXIT 미트리거)"로 업데이트됨 ✅
✅ 테스트 커버리지
로컬 실행: 7 passed in 0.02s ✅
결론
LGTM — 소견 모두 반영. 머지 준비 완료.