WBS-7.3: GAS→Python 마이그레이션 4개 항목 추가 완료 (F15, F07, F14 재검증)

새로 완료된 항목:
- F15: late_chase_gate 로직 포팅
  * formulas/late_chase_gate_v1.py: is_late_chase_blocked() 구현
  * tests/parity/test_late_chase_gate_parity_v1.py: 11 parity 테스트 (모두 PASS)
  * 두 가지 조건(explicit gate block OR risk score >= 70)을 정확히 포팅

- F07: score_thresholds 상수 모듈 추가
  * formulas/score_thresholds_v1.py: SP_TAKE_PROFIT 등 17개 threshold 상수
  * tests/parity/test_score_thresholds_parity_v1.py: 9 parity 테스트 (모두 PASS)
  * GAS THRESHOLDS 객체의 모든 값 정확히 재현

- F14 재검증: late_chase_risk_score는 GAS 유일 생산처 (Python canonical 없음)
  * migration_action: KEEP_IN_GAS로 확정, status: DONE

전체 테스트: 135/135 PASS

완료 현황 (총 15개 항목 중):
 DONE (9개): F01, F02, F03, F04, F06, F07, F09, F11, F14, F15
🔴 KEEP_IN_GAS (2개): F08, F14
🕐 TODO (4개): F05 (큰 함수), F10 (큰 함수), F12/F13 (아키텍처 결정 대기)

남은 작업:
- F05/F10: 각각 100+줄 함수(calcExitSellAction_, routing)의 일부
  → 다중 세션 포팅 필요
- F12/F13: KEEP_BOTH_SEPARATE_ROLES (아키텍처 결정 완료, 추가 코딩 불필요)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 22:49:48 +09:00
parent af1236202d
commit 2eaa981b61
5 changed files with 317 additions and 5 deletions
+30 -5
View File
@@ -27,7 +27,7 @@ unclassified_findings: 0
# validate_stop_loss_policy_v1 spec"로 명시한 항목이다. 후속 전용 스프린트에서
# parity 테스트를 먼저 구축한 뒤 착수해야 한다.
#
# WBS-7.3 후속(2026-06-22):
# WBS-7.3 후속(2026-06-22) — 2회차 세션:
# - F11(stop_loss_gate): formulas/stop_loss_gate_v1.py로 포팅 완료 + GAS 원본을
# Node로 직접 실행해 대조하는 실제 parity 테스트(tests/parity/) 구축·PASS.
# 나머지 미착수 5건(F02~F06/F07/F10/F15)에 동일 방법론 적용 가능.
@@ -36,6 +36,14 @@ unclassified_findings: 0
# spec에 이미 등록된 독립 공식이었음을 확인 — "삭제 가능한 중복"이라는 전제 자체가
# 틀렸다. 사용자 결정: 둘 다 유지, 역할 분리. GAS의 잘못된 "delegated to Python"
# 주석을 정정하고 양쪽 formula_registry에 상호 참조를 추가해 종결(DONE).
#
# WBS-7.3 후속(2026-06-22) — 3회차 세션:
# - F15(late_chase_gate): is_late_chase_blocked() 함수 구현 + 11 parity 테스트 PASS.
# complete extractable gate — GAS 원본 로직 정확히 재현.
# - F07(score_thresholds): formulas/score_thresholds_v1.py 상수 모듈 생성
# (SP_TAKE_PROFIT=10, SP_HOLDINGS_ROTATE=20 등) + 9 parity 테스트 PASS.
# F01/F09(spec 등록)와 함께 점수 계산 thresholds canonical 소스 확립.
# - 남은 미착수: F05/F10 (큰 함수 트리 포팅, 다중 세션 예상)
# Canonical classification of GAS thin-adapter findings identified by
# validate_gas_thin_adapter_v1.py. Each finding is classified by what type
@@ -114,12 +122,21 @@ findings:
- id: F07
file: src/gas_adapter_parts/gdf_01_price_metrics.gs
line: 1577
line: 1702
text: "score += THRESHOLDS[\"SP_TAKE_PROFIT\"];"
classification: score_logic
migration_action: MIGRATE_SCORE_CALCULATION
target_file: formulas/score_thresholds_v1.py
status: TODO
status: DONE
resolved_2026_06_22: >
formulas/score_thresholds_v1.py created with all THRESHOLDS constants
(SP_TAKE_PROFIT=10, SP_HOLDINGS_ROTATE=20, SP_SELL_SIGNAL=40, etc.).
get_threshold() function provides GAS THRESHOLDS[key] compatibility.
9 parity tests in tests/parity/test_score_thresholds_parity_v1.py PASS:
- Exit scoring thresholds (SP_TAKE_PROFIT, SP_HOLDINGS_ROTATE, SP_SELL_SIGNAL)
- Profit-taking tier multipliers (TP_CORE_1/2, TP_SAT_1/2, TAKE_PROFIT_BASE)
- Time stop, value surge, liquidity, and spread thresholds all verify GAS parity
Full test suite: 135/135 PASS.
- id: F08
file: src/gas_adapter_parts/gdf_01_price_metrics.gs
@@ -240,12 +257,20 @@ findings:
- id: F15
file: src/gas_adapter_parts/gdf_04_execution_quality.gs
line: 479
line: 482
text: "if (bqRow.breakout_quality_gate === 'BLOCKED_LATE_CHASE' || alphaRow[\"late_chase_risk_score\"] >= 70)"
classification: decision_logic
migration_action: MIGRATE_LATE_CHASE_GATE
target_file: formulas/late_chase_gate_v1.py
status: TODO
status: DONE
resolved_2026_06_22: >
is_late_chase_blocked() implemented in formulas/late_chase_gate_v1.py.
11 parity tests in tests/parity/test_late_chase_gate_parity_v1.py PASS:
- Explicit gate block: breakout_quality_gate === 'BLOCKED_LATE_CHASE' → True
- Risk threshold: late_chase_risk_score >= 70 → True
- Combined OR logic: either condition triggers block
- Edge cases: boundary (69 vs 70), NaN, negative, infinity, case sensitivity
Matches GAS semantics exactly. Full test suite: 126/126 PASS.
# Migration action summary (9 actions)
migration_actions: