WBS-7.3 F12/F13: distribution_risk 두 공식 역할 분리 확정(KEEP_BOTH)
GAS calcDistributionRiskRow_의 "THIN_ADAPTER: delegated to Python" 주석이 틀린 주석이었음을 발견 — GAS(DISTRIBUTION_RISK_SCORE_V1, 점수식 BUY 차단 게이트)와 Python calc_distribution_detector_per_ticker(DISTRIBUTION_SELL_DETECTOR_V1, 6신호 카운트, PRE_DISTRIBUTION_EARLY_WARNING 정밀도 보완)는 이미 spec에 서로 다른 고유 formula_id로 등록된 독립 공식이었다. "GAS가 Python의 중복" 이라는 ledger 전제가 거짓이었을 뿐, 코드는 원래부터 올바르게 분리돼 있었다. 사용자 결정(둘 다 유지, 역할 분리)에 따라: - GAS 소스의 잘못된 주석 정정(gdf_03_portfolio_gates.gs) + 번들 재생성 - 양쪽 formula_registry에 상호 related_formula 참조 추가(향후 혼동 방지) - governance/gas_logic_migration_ledger_v1.yaml: migration_action을 DELETE_DISTRIBUTION_RISK_GAS → KEEP_BOTH_SEPARATE_ROLES로 변경, DONE
This commit is contained in:
@@ -26,6 +26,16 @@ unclassified_findings: 0
|
||||
# 특히 F11(stop_loss_gate)은 ledger 자체가 "critical path — must match
|
||||
# validate_stop_loss_policy_v1 spec"로 명시한 항목이다. 후속 전용 스프린트에서
|
||||
# parity 테스트를 먼저 구축한 뒤 착수해야 한다.
|
||||
#
|
||||
# WBS-7.3 후속(2026-06-22):
|
||||
# - F11(stop_loss_gate): formulas/stop_loss_gate_v1.py로 포팅 완료 + GAS 원본을
|
||||
# Node로 직접 실행해 대조하는 실제 parity 테스트(tests/parity/) 구축·PASS.
|
||||
# 나머지 미착수 5건(F02~F06/F07/F10/F15)에 동일 방법론 적용 가능.
|
||||
# - F12/F13: 더 깊이 조사한 결과 GAS와 Python(calc_distribution_detector_per_ticker)이
|
||||
# 서로 다른 formula_id(DISTRIBUTION_RISK_SCORE_V1 vs DISTRIBUTION_SELL_DETECTOR_V1)로
|
||||
# spec에 이미 등록된 독립 공식이었음을 확인 — "삭제 가능한 중복"이라는 전제 자체가
|
||||
# 틀렸다. 사용자 결정: 둘 다 유지, 역할 분리. GAS의 잘못된 "delegated to Python"
|
||||
# 주석을 정정하고 양쪽 formula_registry에 상호 참조를 추가해 종결(DONE).
|
||||
|
||||
# Canonical classification of GAS thin-adapter findings identified by
|
||||
# validate_gas_thin_adapter_v1.py. Each finding is classified by what type
|
||||
@@ -132,16 +142,23 @@ findings:
|
||||
classification: decision_logic
|
||||
migration_action: MIGRATE_STOP_BREACH_DECISION
|
||||
target_file: formulas/stop_loss_gate_v1.py
|
||||
status: TODO
|
||||
status: DONE
|
||||
resolved_2026_06_22: >
|
||||
formulas/stop_loss_gate_v1.py:classify_order_type()로 포팅 완료. ledger의
|
||||
"critical path — must match validate_stop_loss_policy_v1 spec" 경고에 따라
|
||||
transcription을 신뢰하지 않고 tests/parity/test_classify_order_type_parity_v1.py를
|
||||
작성 — 매 테스트 실행마다 GAS 원본(gdf_03_portfolio_gates.gs)에서 함수 소스를
|
||||
그대로 추출해 Node로 실행하고 Python 포트와 12개 케이스(stopBreach가 BUY보다
|
||||
우선하는 엣지케이스 포함)로 대조한다. GAS 원본이 바뀌면 이 테스트가 즉시 잡아낸다.
|
||||
|
||||
- id: F12
|
||||
file: src/gas_adapter_parts/gdf_03_portfolio_gates.gs
|
||||
line: 2128
|
||||
text: "[\"distribution_risk_score\"]: Math.min(100, Math.max(0, score)),"
|
||||
classification: score_logic
|
||||
migration_action: DELETE_DISTRIBUTION_RISK_GAS
|
||||
migration_action: KEEP_BOTH_SEPARATE_ROLES
|
||||
target_file: formulas/distribution_risk_v1.py
|
||||
status: TODO
|
||||
status: DONE
|
||||
notes: Python canonical (build_distribution_risk_v1.py) already exists; GAS version is duplicate
|
||||
reviewed_2026_06_21: >
|
||||
원본 인용("build_distribution_risk_v1.py")은 존재하지 않는 파일이다 — 실제로는
|
||||
@@ -151,16 +168,44 @@ findings:
|
||||
없다(tests/parity, tests/regression 전수 검색 결과 0건). "verify parity before
|
||||
delete" 조건이 충족되지 않아 GAS 삭제를 보류한다 — 전용 parity 테스트 작성이
|
||||
선행되어야 한다(WBS-7.3 후속 스프린트).
|
||||
reviewed_2026_06_22: >
|
||||
한 단계 더 깊이 확인한 결과 migration_action(DELETE) 전제 자체가 틀렸다.
|
||||
calcDistributionRiskRow_(gdf_03:2069) 바로 위에 "THIN_ADAPTER: delegated to
|
||||
Python — src/quant_engine/inject_computed_harness.py:calc_distribution_detector_per_ticker"
|
||||
주석이 있어 실제로 그 함수를 열어봤다. GAS는 수급/거래량/캔들모양/섹터상대약세 등
|
||||
10개 가산조건(0~100점)으로 distribution_risk_score + anti_distribution_state
|
||||
(BLOCK_BUY/TRIM_REVIEW/PASS)를 산출하고, Python(calc_distribution_detector_per_ticker)은
|
||||
RSI14/OBV20일기울기/전일급등갭하락 등 완전히 다른 6개 신호를 카운트해
|
||||
signals_count + distribution_verdict(DISTRIBUTION_CONFIRMED/PRE_WARNING/CLEAR)를
|
||||
산출한다 — 입력도 출력 스키마도 다른 독립적인 두 로직이다. "GAS가 Python의
|
||||
중복"이라는 전제가 거짓이므로 parity 테스트 자체가 성립하지 않는다(같은 것을
|
||||
계산하려는 게 아니므로). 이건 "테스트를 만들면 풀리는 문제"가 아니라
|
||||
"두 판단 로직 중 무엇을 canonical로 할지" 또는 "둘 다 유지하되 역할을 분리할지"를
|
||||
결정해야 하는 아키텍처 의사결정 사안 — 사용자 결정 없이 어느 쪽도 삭제하지 않는다.
|
||||
resolved_2026_06_22: >
|
||||
사용자 결정: "둘 다 일단 유지하고 역할 분리". 실제로 두 공식은 이미 spec에
|
||||
서로 다른 formula_id로 등록되어 있었다 — GAS=DISTRIBUTION_RISK_SCORE_V1
|
||||
(spec/13b_harness_formulas.yaml:365, BUY/STAGED_BUY/ADD_ON 차단 점수식),
|
||||
Python calc_distribution_detector_per_ticker=DISTRIBUTION_SELL_DETECTOR_V1
|
||||
(spec/13_formula_registry.yaml:2758, PRE_DISTRIBUTION_EARLY_WARNING 2신호의
|
||||
정밀도 보완용 6신호 감지기, _addTickerGates_ 내 FLOW_ACCELERATION_V1 직후 적용).
|
||||
혼란의 원인은 GAS 소스의 잘못된 "THIN_ADAPTER: delegated to Python" 주석뿐이었다 —
|
||||
이를 정정하고(gdf_03_portfolio_gates.gs:2070) 두 formula_registry 항목에 상호
|
||||
related_formula 참조를 추가해 향후 동일 오해를 방지했다. migration_action을
|
||||
DELETE에서 KEEP_BOTH_SEPARATE_ROLES로 변경, status DONE(추가 작업 불필요 —
|
||||
코드는 이미 올바르게 분리되어 있었고 문서만 정정).
|
||||
|
||||
- id: F13
|
||||
file: src/gas_adapter_parts/gdf_03_portfolio_gates.gs
|
||||
line: 2132
|
||||
text: "formula_id: 'DISTRIBUTION_RISK_SCORE_V1'"
|
||||
classification: pure_mapping
|
||||
migration_action: DELETE_DISTRIBUTION_RISK_GAS
|
||||
status: TODO
|
||||
migration_action: KEEP_BOTH_SEPARATE_ROLES
|
||||
status: DONE
|
||||
notes: formula_id tag stays with Python canonical; remove from GAS
|
||||
reviewed_2026_06_21: "F12와 동일 사유로 보류 — parity 테스트 선행 필요."
|
||||
reviewed_2026_06_22: "F12와 동일 — migration_action 전제 자체가 틀렸음(divergent implementation, 삭제 대상 아님). 아키텍처 결정 보류."
|
||||
resolved_2026_06_22: "F12와 동일 — 사용자 결정(둘 다 유지, 역할 분리)에 따라 KEEP_BOTH_SEPARATE_ROLES로 종결. formula_id='DISTRIBUTION_RISK_SCORE_V1' 태그는 그대로 유지(이미 올바른 고유 ID)."
|
||||
|
||||
- id: F14
|
||||
file: src/gas_adapter_parts/gdf_03_portfolio_gates.gs
|
||||
|
||||
Reference in New Issue
Block a user