feat: 리밸런싱 엔진 V1 + GAS 버그 수정 (2026-06-13)

주요 변경:
- tools/build_rebalance_engine_v1.py: REBALANCE_ENGINE_V1 신규
  * account_snapshot 직접 합산(_build_snap_position_map) → 소수주 분리 행 병합
  * 레짐 소스 macro.REGIME_PRELIM 최우선 (GAS 와 동일)
- src/gas_adapter_parts/gdf_06_rebalance.gs: runRebalanceSheet_() 신규
  * Logger.log / getSpreadsheet_() 로 run_all 연동 수정
- src/gas_adapter_parts/gdc_01_fetch_fundamentals.gs
  * _mergePositionRecord_(): 소수주 중복 행 합산 신규
  * parseInt → parseFloat (qty, availQty)
- src/gas_adapter_parts/gdf_01_price_metrics.gs
  * 미보유 종목 SELL_READY → WATCH_EXIT_SIGNAL
- spec/41_release_dag.yaml: build_rebalance_sheet 노드 추가 (step_count 63)
- spec/51_formula_lifecycle_registry.yaml: REBALANCE_ENGINE_V1 등록

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-13 13:20:14 +09:00
commit ee3e799de1
1474 changed files with 176087 additions and 0 deletions
+948
View File
@@ -0,0 +1,948 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: cash
formulas:
MARKET_RISK_SCORE_V1:
purpose: 시장 위험 점수 MRS를 0~10으로 계산
inputs:
- field: vix_close
unit: index_points
- field: kospi_close
unit: index_points
- field: kospi_ma20
unit: index_points
- field: usd_krw
unit: KRW_per_USD
- field: usd_jpy_2d_change_pct
unit: percent
- field: credit_stress_status
unit: none
components:
vix_score:
rules:
- if: vix_close < 18
points: 0
- if: 18 <= vix_close <= 25
points: 2
- if: 25 < vix_close <= 35
points: 3
- if: vix_close > 35
points: 4
missing_points: 4
kospi_score:
rules:
- if: kospi_close >= kospi_ma20
points: 0
- if: kospi_close < kospi_ma20
points: 2
missing_points: 2
usd_krw_score:
rules:
- if: usd_krw < 1400
points: 0
- if: 1400 <= usd_krw <= 1450
points: 1
- if: usd_krw > 1450
points: 2
missing_points: 2
usd_jpy_score:
rules:
- if: usd_jpy_2d_change_pct > -1
points: 0
- if: usd_jpy_2d_change_pct <= -1
points: 1
missing_points: 1
credit_score:
rules:
- if: credit_stress_status == 'none'
points: 0
- if: credit_stress_status in ['caution', 'stress', 'DATA_MISSING']
points: 1
missing_points: 1
expression: min(10, vix_score + kospi_score + usd_krw_score + usd_jpy_score +
credit_score)
output:
field: market_risk_score
unit: points_0_10
missing_policy: 컴포넌트별 missing_points를 적용한다.
canonical_ref: spec/risk/market_risk_cash.yaml:risk_control.market_risk_score_based_cash
owner: quant_team
lifecycle_state: active
input_fields:
- vix_close
- kospi_close
- kospi_ma20
- usd_krw
- usd_jpy_2d_change_pct
- credit_stress_status
output_fields:
- market_risk_score
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
TARGET_CASH_PCT_V1:
purpose: MRS 기반 목표 현금비중 계산
inputs:
- field: market_risk_score
unit: points_0_10
- field: cash_floor_regime_min_pct
unit: percent
optional: true
expression: max(5 + (market_risk_score / 10) * 15, cash_floor_regime_min_pct)
output:
field: target_cash_pct
unit: percent
missing_policy: market_risk_score 미산출 시 MARKET_RISK_SCORE_V1을 먼저 실행. 그래도 불가하면
15% 및 신규매수 보류.
canonical_ref: spec/risk/market_risk_cash.yaml:risk_control.market_risk_score_based_cash
owner: quant_team
lifecycle_state: active
input_fields:
- market_risk_score
- cash_floor_regime_min_pct
output_fields:
- target_cash_pct
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EXPECTED_EDGE_V1:
purpose: 비용과 신뢰도 차감 후 기대우위 계산
inputs:
- field: target_price
unit: KRW_per_share
- field: entry_price
unit: KRW_per_share
- field: stop_price
unit: KRW_per_share
- field: bayesian_confidence_multiplier
unit: ratio
- field: execution_cost_rate
unit: ratio
expression: ((target_price - entry_price) / (entry_price - stop_price)) * bayesian_confidence_multiplier
- execution_cost_rate
output:
field: expected_edge
unit: ratio
validation:
- target_price > entry_price
- entry_price > stop_price
- bayesian_confidence_multiplier >= 0
- execution_cost_rate >= 0
gates:
- if: expected_edge >= 1.5
action: EDGE_PASS
- if: expected_edge < 1.5
action: NO_A_GRADE_NO_IMMEDIATE_BUY
missing_policy: NO_EXPECTED_EDGE. A등급·즉시매수 금지.
canonical_ref: spec/strategy/entry_core.yaml:entry_timing_guardrails.numeric_gates.expected_edge_floor
owner: quant_team
lifecycle_state: active
input_fields:
- target_price
- entry_price
- stop_price
- bayesian_confidence_multiplier
- execution_cost_rate
output_fields:
- expected_edge
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_RATIOS_V1:
purpose: 현금비중·매수가능현금·거래 후 현금비중 계산 (D+2 정산현금 단독 기준)
inputs:
- field: settlement_cash
unit: KRW
note: '사용자 지침: D+2 정산현금만이 현금이다.'
- field: reserved_order_amount
unit: KRW
- field: planned_buy_amount
unit: KRW
- field: sell_cash_proceeds_d2
unit: KRW
- field: total_asset
unit: KRW
outputs:
settlement_cash_ratio: settlement_cash / total_asset * 100
total_cash_ratio: settlement_cash / total_asset * 100
buy_power_cash: settlement_cash - reserved_order_amount
buy_power_ratio: (settlement_cash - reserved_order_amount) / total_asset * 100
post_trade_total_cash_ratio: (settlement_cash - planned_buy_amount + sell_cash_proceeds_d2)
/ total_asset * 100
output:
field: cash_ratio_set
unit: object
missing_policy:
settlement_cash: NO_CASH_CHECK
total_asset: NO_CASH_CHECK
reserved_order_amount: 0
sell_cash_proceeds_d2: 0
canonical_ref: spec/risk/portfolio_exposure.yaml:portfolio_exposure_framework.cash_floor.numeric_definitions
owner: quant_team
lifecycle_state: active
input_fields:
- settlement_cash
- reserved_order_amount
- planned_buy_amount
- sell_cash_proceeds_d2
- total_asset
output_fields:
- cash_ratio_set
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
TICK_NORMALIZER_V1:
purpose: '한국 KRX 호가 단위(tick size) 기준으로 지정가를 내림 정규화. HTS에 입력 불가능한 소수점·단위 불일치 가격(예:
144,568원, 25,886원)을 차단. 모든 주문 유형에 floor(내림) 적용 — 매수는 낮은 가격(유리), 손절·익절은 체결 확률
우선.
'
applicable: 모든 지정가(매수·손절·익절·trailing_stop) 출력 전 최종 패스. HS008 강제.
inputs:
- field: raw_price
unit: KRW_per_share
tick_table:
- condition: 0 < raw_price < 2000
tick_size: 1
example: 1,500원 → 1원 단위
- condition: 2000 <= raw_price < 5000
tick_size: 5
example: 3,750원 → 5원 단위
- condition: 5000 <= raw_price < 20000
tick_size: 10
example: 12,345원 → 10원 단위
- condition: 20000 <= raw_price < 50000
tick_size: 50
example: 35,780원 → 50원 단위
- condition: 50000 <= raw_price < 200000
tick_size: 100
example: 144,568원 → 100원 단위
- condition: 200000 <= raw_price < 500000
tick_size: 500
example: 196,800원 → 500원 단위
- condition: raw_price >= 500000
tick_size: 1000
example: 650,000원 → 1,000원 단위
expression: floor(raw_price / tick_size) * tick_size
output:
field: tick_normalized_price
unit: KRW_per_share
examples:
- raw_price: 144568
tick_size: 100
result: 144500
note: 50만 원 미만 → 100원 단위
- raw_price: 25886
tick_size: 50
result: 25850
note: 5만 원 미만 → 50원 단위
- raw_price: 196800
tick_size: 500
result: 196500
note: 20만 원 이상 → 500원 단위
- raw_price: 12340
tick_size: 10
result: 12340
note: 이미 정규화됨 — 변경 없음
missing_policy:
raw_price: NO_TICK_PRICE — 해당 행 INVALID_TICK 처리
prohibition:
- 소수점 포함 가격을 TICK_NORMALIZER_V1 없이 플레이북에 기재 금지
- tick_size 오산출로 500원 단위 종목에 100원 단위 적용 금지
- 정규화 전 raw_price를 HTS 입력 가격으로 제시 금지
canonical_ref: spec/00_execution_contract.yaml:hard_stops.HS008_TICK_NORMALIZED_REQUIRED
version: 2026-05-18_AUDIT_RESPONSE_V2
owner: quant_team
lifecycle_state: active
input_fields:
- raw_price
output_fields:
- tick_normalized_price
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SATELLITE_FAILURE_GATE_V1:
purpose: '위성 포지션 전체 중 BROKEN/CLOSE_POSITION 비율이 임계값을 초과하면 TRIGGERED를 발동, 위성 전체
신규매수를 자동 차단하고 정리 대상 종목을 cashPreservePlan에 자동 포함한다. 개별 종목 판단의 합산이 아닌 ''집단 실패''
신호로 포트폴리오 전체를 방어한다.
'
applicable: calcApexExecutionHarness_ 내에서 포트폴리오 집계 후 실행.
inputs:
- field: satellite_holdings[].composite_verdict
unit: enum
- field: satellite_holdings[].rs_verdict
unit: enum
- field: satellite_holdings[].ret20d
unit: ratio
optional: true
- field: satellite_holdings[].excess_ret_10d
unit: pct
optional: true
trigger_conditions:
condA: rs_verdict=BROKEN 또는 composite_verdict=CLOSE_POSITION인 위성 수 >= 3
condB: composite_verdict IN [REDUCE_CANDIDATE, EXIT_REVIEW, CLOSE_POSITION]
비율 >= 60%
condC: 위성 평균 20D 수익률 <= -10% AND 평균 초과낙폭 >= 8%
trigger: condA OR condB OR condC
output:
field: sfg_v1
unit: enum [TRIGGERED, CLEAR]
additional_fields:
- sfg_reason: 트리거된 조건 코드
- sfg_broken_count: BROKEN/CLOSE_POSITION 위성 수
- sfg_failure_rate: 실패율 0.0~1.0
sfg_action:
TRIGGERED:
- '모든 위성 신규 BUY: BLOCKED (rag_v1 결과 무관)'
- 'composite_verdict=CLOSE_POSITION 위성: 매도 1순위 지정'
- 'composite_verdict=EXIT_REVIEW 위성: rebound_wait_qty 활성화'
CLEAR: 정상 판단 흐름 유지
clear_conditions:
- sfg_broken_count < 2
- sfg_failure_rate < 0.40
clear_conditions_note: 두 조건 모두 충족 시 TRIGGERED → CLEAR 해제. 1회 반등으로 해제 금지.
ground_truth: harness
llm_allowed: cite_only
prohibition:
- sfg_v1 = TRIGGERED 상태에서 LLM이 '이 위성은 괜찮으니 매수' 판단 금지
- sfg_broken_count를 LLM이 직접 집계 금지 — 하네스 출력값만 인용
- TRIGGERED 해제를 위한 조건 없이 '상황이 나아졌으니' 임의 해제 금지
canonical_ref: spec/13_formula_registry.yaml:COMPOSITE_VERDICT_V1
version: 2026-05-21_CLA_HARNESS_V1
owner: quant_team
lifecycle_state: active
input_fields:
- satellite_holdings[].composite_verdict
- satellite_holdings[].rs_verdict
- satellite_holdings[].ret20d
- satellite_holdings[].excess_ret_10d
output_fields:
- sfg_v1
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_CREATION_PURPOSE_LOCK_V1:
purpose: 현금 만들기 또는 위성 편입 재원 마련만을 이유로 코어/주도주 매도를 생성하지 못하게 한다.
inputs:
- field: composite_verdict
unit: enum
- field: rs_verdict
unit: enum
- field: brt_verdict
unit: enum
- field: excess_drawdown_pctp
unit: pct_points
optional: true
- field: recovery_ratio_20d
unit: ratio
optional: true
- field: sfg_v1
unit: enum
optional: true
valid_sell_reasons:
- composite_verdict IN [REDUCE_CANDIDATE, EXIT_REVIEW, CLOSE_POSITION]
- stop_breach_gate = BREACH
- rs_verdict = BROKEN 또는 brt_verdict = BROKEN
- excess_drawdown_pctp >= 10 AND recovery_ratio_20d < 0.50
- sfg_v1 = TRIGGERED
invalid_sell_reasons:
- cash_floor 미달 단독
- 섹터/클러스터 비중 초과 단독
- 위성 신규 편입 재원 확보
reinvestment_gate: SAQG_V1=ELIGIBLE AND RAG_V1=PASS AND 신규 후보가 매도 후보보다 기대값 우위일
때만 재투자 허용
output:
field: cash_creation_purpose_lock
additional_fields:
- sell_reason_validity
- reinvestment_allowed
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_CCPL_V1
owner: quant_team
lifecycle_state: active
input_fields:
- composite_verdict
- rs_verdict
- brt_verdict
- excess_drawdown_pctp
- recovery_ratio_20d
- sfg_v1
output_fields:
- cash_creation_purpose_lock
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_RECOVERY_OPTIMIZER_V1:
purpose: '목표 현금 회복액에 최소 주식가치 훼손으로 도달하는 최적 매도 조합을 결정론적 산출. LLM이 "63주+24주+19주+1주"
즉석 계산(HS011 위반) 재발 방지.
'
applicable: CASH_SHORTFALL_V1 및 H2 sell_priority 확정 후 실행.
inputs:
- field: cash_shortfall_target_krw
unit: KRW
note: G1 CASH_SHORTFALL_V1 확정값
- field: cash_shortfall_min_krw
unit: KRW
note: G1 확정값
- field: sell_candidates_json
unit: list
note: H2 regime_rank 순서
- field: immediate_sell_qty
unit: shares
note: K2 산출값 또는 holding_qty
- field: sell_limit_price
unit: KRW_per_share
- field: holding_qty
unit: shares
algorithm:
step1: H2 regime_rank 순서로 expected_krw = immediate_sell_qty × sell_limit_price
누적
step2: cumulative_krw >= cash_shortfall_min_krw 도달 시 중단
step3: shortfall 미달 시 다음 H2 순위 종목 추가
step4: 모두 소진 후 shortfall 잔여 시 EMERGENCY 경보 + emergency_full_sell 재판정
output:
field: cash_recovery_plan_json
schema:
target_krw: KRW
min_krw: KRW
plan_status: enum [SUFFICIENT, PARTIAL, EMERGENCY]
sell_sequence:
- ticker: 종목코드
qty: shares (정수)
limit_price: KRW_per_share
expected_krw: KRW
cumulative_krw: KRW
formula: CASH_RECOVERY_OPTIMIZER_V1
gap_remaining_krw: KRW
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 '약 N원 필요하니 X주 팔자' 즉석 계산 금지 (HS011)
- sell_sequence[] 배열 임의 재정렬·종목 변경 금지
- plan_status=EMERGENCY이면 K2 emergency_full_sell 재판정 없이 전량매도 지시 금지
canonical_ref: AGENTS.md:Direction A2, G1, G2, H2
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- cash_shortfall_target_krw
- cash_shortfall_min_krw
- sell_candidates_json
- immediate_sell_qty
- sell_limit_price
- holding_qty
output_fields:
- cash_recovery_plan_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SELL_WATERFALL_ENGINE_V1:
purpose: '"주식가치를 크게 훼손하지 않으면서 반등 시 수익까지 고려"하는 현금확보 매도 표준화. K2(50/50 분할)를 확장한 4단계
체계. CASH_RECOVERY_OPTIMIZER_V1과 연동.
'
applicable: CASH_RECOVERY_OPTIMIZER_V1 직후. 현금 부족 시 자동 발동.
inputs:
- field: cash_recovery_plan_json
unit: json
note: CASH_RECOVERY_OPTIMIZER_V1 산출
- field: emergency_full_sell
unit: boolean
note: K2 산출값
- field: oversold_gate
unit: enum
note: K2 oversold 판정
- field: rsi14
unit: score
- field: close
unit: KRW_per_share
- field: prev_close
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
stage_logic:
stage_4_emergency:
condition: emergency_full_sell == true
action: H2 최우선 종목 전량 즉시 매도 (시장가 -1tick)
purpose: 마진콜·D+2 결제 위기 방지
stage_1_immediate_trim:
condition: emergency_full_sell == false
action: H2 1순위 50% 즉시 지정가 매도
limit_price_formula: 'prev_close - 0.3 * atr20 (OVERSOLD 구간: prev_close +
0.5 * atr20)'
prerequisite: SELL_PRICE_SANITY_V1 PASS 필수
stage_2_rebound_wait:
condition: stage_1 실행 후
action: 나머지 50% 반등 트리거 대기
rebound_trigger_price: prev_close + 0.5 * atr20 (tick 정규화)
rebound_tp_price: prev_close + 1.0 * atr20 (반등 수익 포착)
deadline: 3 영업일. 초과 시 stage_1 가격으로 자동 전환.
stage_3_cascading_trim:
condition: stage_1+2 후 cash_shortfall 잔여
action: H2 2순위→3순위 순서로 stage_1/2 반복
stop_condition: cumulative_krw >= cash_shortfall_min_krw
output:
field: waterfall_plan_json
schema:
current_stage: int 1~4
stage_label: enum [IMMEDIATE_TRIM, REBOUND_WAIT, CASCADING_TRIM, EMERGENCY_EXIT]
sell_sequence:
- ticker: 종목코드
stage: int
qty: shares
limit_price: KRW_per_share (stage2는 null)
rebound_trigger_price: KRW_per_share (stage2만)
rebound_tp_price: KRW_per_share (stage2만)
deadline: date (stage2만)
expected_immediate_krw: KRW
expected_rebound_tp_krw: KRW
total_recovery_potential_krw: KRW
ground_truth: harness
llm_allowed: cite_only
prohibition:
- waterfall_plan_json.sell_sequence 순서 임의 변경 금지
- stage 건너뜀 금지 (stage1→stage3 직행 금지)
- rebound_wait_qty를 '현금이 급하다'는 이유로 즉시 매도 전환 금지 (K2 연동)
- rebound_tp_price가 있으면 HTS 주문표에 '반등 익절가' 컬럼 필수 표기
canonical_ref: AGENTS.md:Direction C1, K2
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- cash_recovery_plan_json
- emergency_full_sell
- oversold_gate
- rsi14
- close
- prev_close
- atr20
output_fields:
- waterfall_plan_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SMART_MONEY_LIQUIDITY_GATE_V1:
purpose: '스마트머니·유동성 차단 게이트. SM001(외국인+기관 동시 순매도→BLOCK_BUY), SM002(5일 평균 거래대금 <
50억→LIMIT_QUANTITY), SM003(RSI14>70 AND flow_credit<0.3→BLOCK_BUY) 결정론 구현. FINAL_JUDGMENT_GATE_V1의
J04 입력.
'
output:
file: Temp/smart_money_liquidity_gate_v1.json
expected_outputs:
- gate
- coverage_pct
- ticker_count
llm_allowed: cite_only
version: 2026-05-28_PHASE6
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASHFLOW_STABILITY_GATE_V1:
purpose: 영업/잉여 현금흐름 및 회계 위험으로 현금흐름 안정성 게이트를 잠금.
inputs:
- field: operating_cf_krw
unit: KRW
optional: true
- field: free_cf_krw
unit: KRW
optional: true
- field: accrual_ratio_pct
unit: percent
optional: true
output:
field: cashflow_stability_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL54
owner: quant_team
lifecycle_state: active
input_fields:
- operating_cf_krw
- free_cf_krw
- accrual_ratio_pct
output_fields:
- cashflow_stability_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SMART_CASH_RECOVERY_V3:
purpose: '국면별 동적 rebound_factor + 유동성 라벨(DEEP/NORMAL/THIN/FROZEN) 기반으로 선제매도 분할
방식(exec_mode)을 결정론적으로 산출한다. 설거지·지하실 매도를 차단하고 반등 수익을 포착한다. SCRS-V2 V3 확장판.
'
inputs:
- field: value_preservation_scorer_v1_json
unit: json
- field: scrs_v2_json
unit: json
- field: market_regime_state
unit: label
- field: macro_risk_regime
unit: label
- field: ATR20
unit: KRW_per_share
- field: AvgTradeValue_5D_M
unit: KRW_hundred_million
- field: Spread_Pct
unit: percent
output:
field: smart_cash_recovery_v3_json
expected_outputs:
- gate
- regime
- rebound_factor_atr
- distinct_exec_modes
llm_allowed: cite_only
version: 2026-05-27_PHASE1
owner: quant_team
lifecycle_state: active
input_fields:
- value_preservation_scorer_v1_json
- scrs_v2_json
- market_regime_state
- macro_risk_regime
- ATR20
- AvgTradeValue_5D_M
- Spread_Pct
output_fields:
- smart_cash_recovery_v3_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
LIQUIDITY_FLOW_SIGNAL_V1:
purpose: 'AvgTradeValue_20D_M 기반으로 종목별 유동성을 DEEP/NORMAL/THIN/FROZEN으로 분류하고 매도
실행 모드(MARKET_OK/LIMIT_NEAR_BID/TWAP_SPLIT/HOLD)를 결정한다.
'
output:
field: liquidity_flow_signal_v1_json
expected_outputs:
- gate
- label_diversity
- row_count
llm_allowed: cite_only
version: 2026-05-27_PHASE3
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields:
- liquidity_flow_signal_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASHFLOW_QUALITY_SIGNAL_V1:
purpose: 'OCF/FCF 기반 현금흐름 안정성을 결정론적으로 라벨링한다. ROBUST/STABLE/VOLATILE/RISKY/DATA_MISSING
라벨과 ACCOUNTING_RISK 플래그(OCF < NI 의심)를 산출한다.
'
output:
field: cashflow_quality_signal_v1_json
expected_outputs:
- gate
- accounting_risk_count
- data_missing_pct
llm_allowed: cite_only
version: 2026-05-27_PHASE2B
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields:
- cashflow_quality_signal_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EXECUTION_METHOD_LADDER_V1:
purpose: '매도 실행 방식 계약표. NORMAL_LIQUIDITY / HIGH_LIQUIDITY_BREACH / OVERSOLD_REBOUND
/ EMERGENCY 의 order_type, split_count, trigger_rule 을 단일 표로 고정한다. LLM은 ladder를
재해석하지 않고 Temp/sell_execution_timing_lock_v2.json 과 Temp/sell_waterfall_engine_v2.json
을 복사 참조만 한다.
'
inputs:
- field: sell_timing_verdict
unit: enum
- field: sell_waterfall_gate
unit: enum
- field: smart_cash_recovery_gate
unit: enum
output:
file: Temp/execution_method_ladder_v1.json
expected_outputs:
- gate
- market_order_default_count
- emergency_full_sell_without_flag_count
llm_allowed: cite_only
version: 2026-06-06_PHASE6
owner: quant_team
lifecycle_state: active
input_fields:
- sell_timing_verdict
- sell_waterfall_gate
- smart_cash_recovery_gate
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CANONICAL_METRICS_V1:
purpose: 'spec/25_canonical_metrics_registry.yaml에 정의된 논리 지표(cluster_pct, cash_min_required_krw
등)를 단일 정규 원천에서 산출해 Temp/canonical_metrics_v1.json으로 제공. 렌더러가 여러 JSON 객체에서 같은
지표를 중복 읽어 불일치 값을 출력하는 버그를 차단한다(단일 진실원천 아키텍처).
'
input_fields:
- semiconductor_cluster_json.combined_pct
- cash_recovery_display_json.min_required_krw
- trim_plan_to_min_cash_json[].accumulated_krw
- scrs_v2_json.selected_combo[].immediate_qty
- prices_json[].profit_pct
- prices_json[].stop_price
- prices_json[].tp1_price
- proposal_reference_json[].proposed_limit_price_krw
- sell_quantities_json[].sell_qty
expected_outputs:
- metrics.cluster_pct
- metrics.cash_min_required_krw
- metrics.cash_reference_total_krw
- per_ticker.scrs_immediate_qty
- per_ticker.scrs_rebound_qty
- per_ticker.ticker_profit_pct
- per_ticker.ticker_stop_price
- per_ticker.ticker_limit_price
- per_ticker.ticker_base_qty
- per_ticker.ticker_tp1_price
- resolved_count
- unresolved
- gate
llm_allowed: cite_only
version: 2026-05-29_PHASE7
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
REGIME_CASH_UPLIFT_V1:
purpose: '국면별 최소 현금비율 상향값을 산출해 cash floor의 하한을 정한다.
'
inputs:
- field: market_regime
unit: enum
- field: market_risk_score
unit: score_0_10
output:
field: regime_cash_uplift_min_pct
input_fields:
- market_regime
- market_risk_score
expected_outputs:
- regime_cash_uplift_min_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- regime_cash_uplift_min_pct
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_FLOOR_V1:
purpose: '목표 현금비중과 현금 부족액의 최소 기준을 확정한다.
'
inputs:
- field: total_asset
unit: KRW
- field: settlement_cash_d2_krw
unit: KRW
- field: market_risk_score
unit: score_0_10
output:
field: cash_floor_min_pct
input_fields:
- total_asset
- settlement_cash_d2
- market_risk_score
expected_outputs:
- cash_floor_min_pct
- cash_shortfall_min_krw
- cash_shortfall_target_krw
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- cash_floor_min_pct
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_RAISE_PARETO_EXECUTOR_V2:
purpose: '현금 확보 매도에서 파레토 최적 종목·수량 조합을 산출한다.
'
input_fields:
- sell_candidates
- cash_shortfall_krw
- value_damage_weights
expected_outputs:
- pareto_sell_plan
- cash_raise_efficiency
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_RAISE_VALUE_OPTIMIZER_V3:
purpose: '현금확보 매도의 가치 손실을 최소화하는 종목·수량·실행방식을 결정한다.
'
input_fields:
- sell_candidates
- cash_shortfall_krw
- rebound_potential
expected_outputs:
- optimized_sell_plan
- value_damage_pct
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_RECOVERY_OPTIMIZER_V4:
purpose: 'TRIM 우선순위·K2 분할·반등 대기를 결합해 현금 회복 실행 계획을 산출한다.
'
input_fields:
- trim_candidates
- cash_shortfall_krw
- rebound_trigger_prices
expected_outputs:
- cash_recovery_plan
- expected_recovery_krw
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CASH_RECOVERY_V1:
purpose: '현금 부족액 대비 단순 비례 매도 계획을 산출한다 (V4로 대체됨, 하위호환 유지).
'
input_fields:
- sell_candidates
- cash_shortfall_krw
expected_outputs:
- recovery_sell_qty
- recovery_krw
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SELL_SLIPPAGE_BUDGET_FACTOR_V1:
purpose: 현금확보 매도 ADV 5% 참여율 한도 TWAP 분할 — 설거지·주식가치 훼손 최소화 (Direction VD1)
agents_md_ref: 'Direction VD1: VALUE_DAMAGE_RAW_GATE_V1 — TWAP 참여율 의무'
inputs:
- field: adv20
unit: KRW
note: 20일 평균 거래대금
- field: current_price
unit: KRW_per_share
- field: sell_qty
unit: shares
- field: emergency_full_sell
unit: boolean
optional: true
expression: max_child_qty = floor(adv20 * 0.05 / current_price); n_slices = ceil(sell_qty
/ max_child_qty); participation_rate = sell_qty * current_price / adv20
components:
adv_participation_cap:
value: 0.05
unit: ratio
calibration_status: EXPERT_PRIOR
note: ADV 5% 초과 단일 주문은 시장충격 위험. TWAP 분할 의무.
output:
max_child_qty: floor(ADV20 x 0.05 / price)
n_slices: ceil(qty / max_child_qty)
participation_rate: qty x price / ADV20
twap_required: participation_rate > 0.05
hard_override:
- condition: emergency_full_sell == true
action: TWAP 의무 면제 — 단, hts_limit_price 산출 의무 유지
gate:
INVALID_SELL_NO_LIMIT: hts_limit_price=null AND emergency_full_sell!=true
TWAP_REQUIRED: participation_rate > 0.05 AND emergency_full_sell!=true
missing_policy: adv20 미확인 시 TWAP_REQUIRED 보수적 적용
implementation: tools/build_value_preservation_scorer_v1.py:NF4
calibration_ref: spec/calibration_registry.yaml:NF4 (EXPERT_PRIOR)
version: 2026-06-04_NF4
owner: quant_team
lifecycle_state: active
input_fields:
- adv20
- current_price
- sell_qty
- emergency_full_sell
output_fields: []
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
+854
View File
@@ -0,0 +1,854 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: entry
formulas:
SEA_TIMING_V1:
purpose: 장중 VWAP 및 거래량 프로파일을 이용한 최적의 엑싯(Exit) 타이밍 포착
inputs:
- field: current_price
unit: KRW_per_share
- field: vwap
unit: KRW_per_share
optional: true
note: 장중 거래량 가중 평균가
- field: rsi_15m
unit: points
optional: true
note: 15분봉 RSI
- field: volume_climax
unit: boolean
optional: true
note: 단기 거래량 폭증 여부
rules:
- if: current_price < vwap AND volume_climax == true
action: EXIT_NOW
label: 반등_종료_확인
- if: rsi_15m < 30 AND current_price < vwap
action: EXIT_DELAY_FOR_REBOUND
label: 지하실_매도_방지
output:
field: sea_action_tag
unit: string
owner: quant_team
lifecycle_state: active
input_fields:
- current_price
- vwap
- rsi_15m
- volume_climax
output_fields:
- sea_action_tag
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
BREAKOUT_QUALITY_GATE_V2:
purpose: '신고가 돌파 이후 3일 이상 달린 종목, MA20 대비 10% 이상 괴리, 갭업+거래량 미동반, RSI 과매수, 이미 매도신호
발생 조합을 정량 점수로 차단. N2(VOLUME_BREAKOUT_CONFIRM_V1)보다 넓은 뒷박 방지 범위를 커버한다. BUY 게이트
체인 Gate 4에서 BREAKOUT_QUALITY_GATE_V2 != BLOCKED_LATE_CHASE 조건으로 사용.
'
applicable: 매수 후보 종목 분석 시 항상 실행. 신규 BUY 전 Gate 4 필수 통과.
inputs:
- field: close
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: ret_3d
unit: percent
note: 3거래일 수익률 (%)
- field: ret_1d
unit: percent
note: 전일 대비 수익률 (%)
- field: disparity
unit: percent
note: (close/MA20 - 1) × 100
- field: rsi14
unit: points
optional: true
- field: volume
unit: shares
optional: true
- field: avg_volume_5d
unit: shares
optional: true
- field: timing_score_exit
unit: points_0_100
optional: true
- field: distribution_risk_score
unit: points_0_100
optional: true
- field: late_chase_risk_score
unit: points_0_100
optional: true
scoring:
penalties:
- condition: ret_3d >= 7
score: -30
label: 3일_7%이상_달림
- condition: disparity > 10
score: -25
label: MA20_10%이상_괴리
- condition: ret_1d >= 4 AND volume < avg_volume_5d * 0.9
score: -40
label: 갭업+거래량_미동반
- condition: rsi14 > 75
score: -20
label: RSI_과매수
- condition: timing_score_exit >= 50
score: -50
label: 매도신호_이미_발생
- condition: distribution_risk_score >= 70
score: -35
label: 분배위험_고
- condition: late_chase_risk_score >= 70
score: -30
label: 뒷박위험_고
bonuses:
- condition: volume >= avg_vol_5d * 1.5 AND ret_1d >= 2 AND ret_3d < 5
score: 25
label: 거래량_동반_초기돌파
- condition: disparity >= 0 AND disparity < 6
score: 15
label: MA20_적정_괴리
- condition: rsi14 >= 45 AND rsi14 <= 65
score: 10
label: RSI_적정_구간
base_score: 50
states:
BLOCKED_LATE_CHASE: base_score + penalties + bonuses < 10 → 뒷박 완전 차단
WATCH_COOLING_OFF: 10 <= total_score < 40 → 과열 식힘 대기
PILOT_ALLOWED: total_score >= 40 → 파일럿 진입 허용 (다른 게이트 통과
필요)
output:
field: breakout_quality_gate
unit: enum [BLOCKED_LATE_CHASE, WATCH_COOLING_OFF, PILOT_ALLOWED]
additional_fields:
- breakout_quality_score
- breakout_quality_reasons
missing_policy:
ret_3d: DATA_MISSING — WATCH_COOLING_OFF으로 보수 처리
ma20: DATA_MISSING — BLOCKED_LATE_CHASE 처리
all_optional_missing: 기본 점수(50)에서 페널티 없이 PILOT_ALLOWED 가능하나 DATA_MISSING 태그
필수
prohibition:
- BLOCKED_LATE_CHASE 상태에서 LLM이 '좋아 보이니까 매수' 서술 절대 금지
- base_score를 LLM이 재계산하거나 패널티를 임의 무시 금지
- disparity·ret_3d 데이터 없이 PILOT_ALLOWED 판정 금지
harness_lock: true
llm_override: forbidden
canonical_ref: AGENTS.md:Direction N2 (VOLUME_BREAKOUT_CONFIRM_V1) 확장
version: 2026-05-20_HARNESS_V5
owner: quant_team
lifecycle_state: active
input_fields:
- close
- ma20
- ret_3d
- ret_1d
- disparity
- rsi14
- volume
- avg_volume_5d
- timing_score_exit
- distribution_risk_score
- late_chase_risk_score
output_fields:
- breakout_quality_gate
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
FOLLOW_THROUGH_DAY_CONFIRM_V1:
purpose: 'O''Neil Follow-Through Day 개념을 정량화한다. 돌파 첫날(Day 1)에는 WATCH_FOLLOW_THROUGH_PENDING,
확인일(Day 2~7 이내 +1.5% 이상 상승 + 거래량 직전 돌파일 대비 90% 이상)에만 BUY_PILOT_ALLOWED. 7일 이후에도
미확인이면 FOLLOW_THROUGH_FAIL로 리셋. 첫날 돌파 즉시 BUY 지시를 구조적으로 차단해 설거지 손실을 방지한다.
'
applicable: 신규 BUY 후보 분석 시 항상 실행. Gate 4b로 BREAKOUT_QUALITY_GATE_V2 이후 적용.
inputs:
- field: days_since_breakout
unit: trading_days
note: 0 = 돌파 당일. GAS 추적값 또는 data_feed 컬럼.
- field: ret_since_breakout
unit: pct
note: 돌파일 종가 대비 현재 수익률
- field: vol_today
unit: shares
note: 당일 거래량
- field: vol_breakout_day
unit: shares
note: 돌파일 거래량 (backdata에서 참조)
- field: close
unit: KRW_per_share
optional: true
- field: ma20
unit: KRW_per_share
optional: true
states:
BREAKOUT_DAY_1:
condition: days_since_breakout == 0
result: WATCH_FOLLOW_THROUGH_PENDING
note: 돌파 당일 BUY 절대 금지. 다음 거래일 재확인 대기.
FOLLOW_THROUGH_OK:
condition: days_since_breakout >= 2 AND days_since_breakout <= 7 AND ret_since_breakout
>= 1.5 AND vol_today >= vol_breakout_day * 0.9
result: BUY_PILOT_ALLOWED
note: 확인일 조건 충족 — 파일럿 진입 허용.
FOLLOW_THROUGH_FAIL:
condition: days_since_breakout > 7 OR (days_since_breakout >= 2 AND ret_since_breakout
< 0)
result: WATCH_RESET_REQUIRED
note: FTD 실패 또는 7일 초과. 추격 금지, 재설정 대기.
EXTENDED_FOLLOW:
condition: days_since_breakout > 7 AND ret_since_breakout >= 0
result: WATCH_TOO_LATE
note: 7일 이후 상승 유지 중이지만 확인일 놓침. 뒷박 위험.
PENDING_DATA:
condition: days_since_breakout IS NULL
result: WATCH_NO_BREAKOUT_TRACKED
note: 돌파 추적 데이터 없음. DATA_MISSING 태그 필수.
output:
fields:
follow_through_day_state: WATCH_FOLLOW_THROUGH_PENDING / BUY_PILOT_ALLOWED
/ WATCH_RESET_REQUIRED / WATCH_TOO_LATE / WATCH_NO_BREAKOUT_TRACKED
days_since_breakout: 추적된 돌파 경과 거래일 수
ret_since_breakout: 돌파일 종가 대비 현재 수익률 %
vol_ratio_vs_breakout_day: vol_today / vol_breakout_day 비율
missing_policy:
days_since_breakout: null → WATCH_NO_BREAKOUT_TRACKED. BUY 진행 가능하나 DATA_MISSING
표기.
vol_breakout_day: null → vol 조건 충족 여부 판정 불가. DATA_MISSING, 타 조건만으로 판정.
prohibition:
- days_since_breakout=0(돌파 당일) 종목을 LLM이 즉시 BUY_PILOT_ALLOWED로 판정 금지
- FOLLOW_THROUGH_FAIL 상태를 '좋은 종목이니 예외 허용' 서술로 우회 금지
- days_since_breakout·ret_since_breakout을 LLM이 임의 계산 금지 (GAS 하네스값 인용)
harness_lock: true
llm_override: forbidden
canonical_ref: engine_harness_upgrade_proposal_result.txt:2-B
version: 2026-05-20_HARNESS_V5
owner: quant_team
lifecycle_state: active
input_fields:
- days_since_breakout
- ret_since_breakout
- vol_today
- vol_breakout_day
- close
- ma20
output_fields: []
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EXECUTION_QUALITY_SCORE_V1:
purpose: '실제 주문 실행 후 T+1/T+3/T+5 결과를 정량 채점해 엔진 임계치 자동 개선 루프를 만든다. POOR 등급 누적 시
Late Chase 임계치 강화, Entry 임계치 완화 등을 자동 제안한다. 채점 결과는 proposal_evaluation_history.json에
누적 저장된다.
'
applicable: daily-feedback-report 실행 시. T+1 결과 확정 후 자동 업데이트.
inputs: []
scoring:
buy_entry_quality:
description: 매수 진입 타이밍 채점 (최대 +20, 최소 -35)
components:
- condition: next_1d_ret >= 0
score: +1 per 0.5% (최대 +10)
- condition: next_3d_max_favorable
score: +1 per 1% (최대 +10)
- condition: would_trigger_stop_t1=true
score: -20
note: T+1 손절 발생
- condition: breakout_confirmed=true
score: 5
- condition: late_chase_confirmed=true
score: -15
sell_exit_quality:
description: 매도 타이밍 채점 (최대 +25, 최소 -20)
components:
- condition: sold_above_ma20=true
score: 10
- condition: rebound_after_sell_3d > 0
score: -(rebound_pct × 2)
note: 팔고 오른 경우 감점
- condition: sold_near_support=true
score: -10
- condition: cash_recovered_target=true
score: 15
cash_raise_quality:
description: 현금확보 경로 채점
components:
- condition: cash_target_achieved=true
score: 10
- condition: core_position_preserved=true
score: 5
- condition: route_used=ROUTE_A
score: 5
- condition: route_used=ROUTE_B
score: 3
- condition: route_used=ROUTE_C
score: 0
- condition: route_used=ROUTE_D
score: -5
grades:
EXCELLENT: total_score >= 15
GOOD: 5 <= total_score < 15
NEUTRAL: -5 <= total_score < 5
POOR: total_score < -5
outcome_classification:
FALSE_BUY_TIMING: BUY_PILOT_ALLOWED 후 T+1 손절 → Late Chase 임계치 강화 제안
MISSED_ENTRY: WATCH_ONLY 후 +3% 이상 → Entry 임계치 완화 제안
TRUE_NEGATIVE: BUY_BLOCKED_T1 후 하락 → 공식 유효성 확인
PORTFOLIO_GUARD_EFFECTIVE: SELL_OR_TRIM 후 현금 회복 → 규칙 유지
output:
fields:
execution_quality_score: 총 채점 점수
execution_quality_grade: EXCELLENT / GOOD / NEUTRAL / POOR
execution_quality_outcome: 결과 분류 enum
threshold_adjustment_proposals: POOR 시 임계치 조정 제안 목록
storage:
file: Temp/proposal_evaluation_history.json
auto_run: npm run daily-feedback-report
prohibition:
- execution_quality_grade를 LLM이 임의 산정 금지
- threshold_adjustment_proposals를 LLM이 즉각 반영 금지 — 제안만 출력
- 채점 데이터 없이 '실행 품질 양호'로 단정 금지
harness_lock: true
llm_override: forbidden
canonical_ref: engine_harness_upgrade_proposal_result.txt:2-E
version: 2026-05-20_HARNESS_V5
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
REPLACEMENT_ALPHA_GATE_V1:
purpose: '위성 신규매수 전 코어 대비 알파 우위 여부를 기계적으로 검증한다. 코어보다 약한 위성에 현금을 투입하는 ''설거지 추가매수''를
원천 차단. CLA 레짐 또는 CLUSTER_HOLD_ONLY 상태에서 RAG_V1 FAIL이면 allowed_action = HOLD
강제.
'
applicable: 위성 신규 BUY 주문 생성 전 calcFinalDecision_ 내에서 실행.
inputs:
- field: rs_verdict
unit: enum
note: RS_VERDICT_V1 결과
- field: ss001_grade
unit: enum [A,B,C,D]
- field: excess_ret_10d
unit: pct
note: KOSPI 대비 초과 10D 수익률
- field: portfolioStats.coreAvgSS001
unit: points_0_100
optional: true
note: 코어 종목 평균 SS001 정규화 점수
conditions_all_required_for_PASS:
condA: rs_verdict IN [LEADER, MARKET]
condB: 'ss001_norm_score >= (coreAvgSS001 - 10) # coreAvgSS001 미확인 시 60 적용'
condC: excess_ret_10d >= -5
condD: excess_ret_10d >= 0 OR rs_verdict == LEADER
output:
field: rag_v1
unit: enum [PASS, FAIL, EXEMPT]
additional_fields:
- rag_reason
rag_reason_codes:
rs_verdict_weak: condA 실패 — rs_verdict가 LAGGARD 또는 BROKEN
ss001_below_core: condB 실패 — SS001이 코어 평균보다 10점 이상 낮음
excess_ret_breach: condC 실패 — 10일 초과수익률 -5% 이하
rs_slope_negative: condD 실패 — 초과수익률 음수이고 LEADER도 아님
core_exempt: 코어 종목 — RAG 미적용
pass: 모든 조건 충족
gate_action:
FAIL: allowed_action을 BUY에서 HOLD로 강제 전환
PASS: 정상 진행
EXEMPT: 코어 종목 — 판정 없이 통과
ground_truth: harness
llm_allowed: cite_only
prohibition:
- rag_v1 = FAIL인 종목에 LLM이 '이번만 예외'로 BUY 허용 금지
- portfolioStats.coreAvgSS001 미확인 상태에서 condB를 LLM이 임의 계산 금지
canonical_ref: spec/11_market_regime.yaml:CONCENTRATED_LEADER_ADVANCE
version: 2026-05-21_CLA_HARNESS_V1
owner: quant_team
lifecycle_state: active
input_fields:
- rs_verdict
- ss001_grade
- excess_ret_10d
- portfolioStats.coreAvgSS001
output_fields:
- rag_v1
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SATELLITE_ALPHA_QUALITY_GATE_V1:
purpose: 위성 후보가 BUY 후보로 노출되기 전 5개 필터로 ELIGIBLE/WATCHLIST_ONLY/EXCLUDED를 확정한다.
inputs:
- field: position_class
unit: enum [core,satellite]
- field: ss001_grade
unit: enum [A,B,C,D]
- field: price.ret20D
unit: pct
- field: globalKospiRet20D_
unit: pct
- field: recovery_ratio_20d
unit: ratio
- field: recovery_ratio_5d
unit: ratio
- field: excess_drawdown_pctp
unit: pct_points
- field: frg_5d_sh
unit: shares
- field: inst_5d_sh
unit: shares
- field: rs_verdict
unit: enum
filters:
F1_relative_return: price.ret20D > globalKospiRet20D_
F2_recovery_power: recovery_ratio_20d >= 1.20 OR recovery_ratio_5d >= 1.30
F3_downside_protection: excess_drawdown_pctp <= 5
F4_institutional_flow: frg_5d_sh > 0 OR inst_5d_sh > 0
F5_sector_leadership: rs_verdict IN [LEADER, MARKET]
classification:
ELIGIBLE: total_penalty == 0
WATCHLIST_ONLY: total_penalty IN [1,2] AND F1/F2/F3 중 하나만 실패
EXCLUDED: total_penalty >= 3 OR F1/F2/F3 중 2개 이상 실패 OR ss001_grade=D OR rs_verdict=BROKEN
gate_action:
ELIGIBLE: BUY 후보 표기 가능. RAG_V1 추가 통과 필요.
WATCHLIST_ONLY: WATCH만 허용. BUY/파일럿 서술 금지.
EXCLUDED: BUY 후보 및 주문표에서 제거. 보유 종목이면 정리 검토 입력.
output:
field: saqg_v1
additional_fields:
- saqg_penalty
- saqg_failed_filters
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_SAQG_V1
owner: quant_team
lifecycle_state: active
input_fields:
- position_class
- ss001_grade
- price.ret20D
- globalKospiRet20D_
- recovery_ratio_20d
- recovery_ratio_5d
- excess_drawdown_pctp
- frg_5d_sh
- inst_5d_sh
- rs_verdict
output_fields:
- saqg_v1
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ALPHA_EVALUATION_WINDOW_V1:
purpose: 위성 추천 성과를 T+20/T+60에서 삼성전자·SK하이닉스 대비 초과수익으로 평가한다. T+1 단독 평가는 금지한다.
inputs:
- field: entry_date
unit: date
- field: position_class
unit: enum [core,satellite]
- field: t20_return_pct
unit: pct
optional: true
- field: t60_return_pct
unit: pct
optional: true
- field: benchmark_core_return_pct
unit: pct
optional: true
gates:
T20_ALPHA_FAIL: t20_vs_core_pctp < -3
T60_ALPHA_FAIL: t60_vs_core_pctp < -5
PASS: benchmark excess return >= 0
missing_policy: 성과 창 미도래 또는 데이터 누락 시 DATA_MISSING — LLM 대체 산출 금지.
output:
field: alpha_evaluation_window_json
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_AEW_V1
owner: quant_team
lifecycle_state: active
input_fields:
- entry_date
- position_class
- t20_return_pct
- t60_return_pct
- benchmark_core_return_pct
output_fields:
- alpha_evaluation_window_json
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ALPHA_FEEDBACK_LOOP_V1:
purpose: 'monthly_history의 AEW_V1 성과 데이터를 분석해 SAQG_V1 필터 임계값 조정 권고를 생성한다. 임계값
자동 변경 금지. 하네스는 권고만 생성하고 사용자가 settings 파일에서 확인 승인.
'
applicable: 월 1회 settings 업데이트 배치 시 실행.
inputs:
- field: alpha_evaluation_window_json
unit: array
- field: saqg_v1
unit: enum
- field: brt_verdict
unit: enum
- field: market_regime
unit: string
analysis:
eligible_t20_fail_rate: ELIGIBLE 케이스 중 t20_vs_samsung_pctp < -3 비율
by_filter_combination: F1+F2+F3 통과 조합별 T+20 실패율 분포
feedback_recommendation:
threshold_tighten:
condition: ELIGIBLE T+20 알파 실패율 > 50%
recommendation: 'SAQG F1/F2/F3 임계값 강화 권고 (예: F2 recovery_ratio 1.20 -> 1.35)'
threshold_relax:
condition: ELIGIBLE T+20 성공률 > 70% AND 최근 12건 이상
recommendation: 'SAQG F3 임계값 완화 검토 (예: excess_drawdown 5%p -> 7%p)'
output_fields:
- field: alpha_feedback_json
subfields:
- eligible_t20_fail_rate
- eligible_t60_fail_rate
- recommended_filter_adjustments
- cases_analyzed
hard_rules:
- 임계값 자동 변경 금지 - 권고(RECOMMENDATION) 출력만
- cases_analyzed < 10이면 DATA_INSUFFICIENT - 권고 생성 금지
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 alpha_feedback_json 없이 SAQG 임계값 변경 임의 권고 금지
output:
field: alpha_feedback_json
additional_fields:
- eligible_t20_fail_rate
- eligible_t60_fail_rate
- cases_analyzed
- grade_count
version: 2026-05-21_AFL_V1
owner: quant_team
lifecycle_state: active
input_fields:
- alpha_evaluation_window_json
- saqg_v1
- brt_verdict
- market_regime
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PULLBACK_ENTRY_TRIGGER_V1:
purpose: '뒷박 상태(ANTI_CHASING_VELOCITY BLOCK)에서 풀백 조건이 충족되면 자동 진입 트리거를 생성. "지금
사면 뒷박 → 풀백 기다려 적정 가격에 진입"을 결정론적으로 산출.
'
applicable: ANTI_CHASING_VELOCITY_V1 직후. BLOCK_CHASE 종목에만 적용.
inputs:
- field: velocity_1d
unit: percent
- field: close
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: volume
unit: shares
- field: avg_volume_5d
unit: shares
- field: alpha_lead_score
unit: score_0_100
- field: anti_chasing_status
unit: enum
conditions:
COND_1: velocity_1d < -1.5% (조정 시작 확인)
COND_2: close <= ma20 * 1.02 (이동평균 근접)
COND_3: volume >= avg_volume_5d * 0.7 (거래량 급감 없음)
COND_4: alpha_lead_score >= 70 (기본 품질 유지)
COND_5: anti_chasing_velocity_status != BLOCK_* (속도 차단 해제)
state_machine:
WAIT_PULLBACK: BLOCK_CHASE 상태이나 COND 미충족
PULLBACK_ENTRY_READY: COND 1~5 모두 충족 → T1 체결 허용
STALE_PULLBACK_EXPIRED: entry_date + 15 영업일 초과 → 트리거 만료
expressions:
pullback_trigger_price: max(ma20, prevClose - 0.5 * atr20), tick 정규화
pullback_expiry_date: entry_date + 15 영업일
output:
field: pullback_state
values:
- WAIT_PULLBACK
- PULLBACK_ENTRY_READY
- STALE_PULLBACK_EXPIRED
- NOT_APPLICABLE
additional_fields:
- pullback_trigger_price
- pullback_expiry_date
- conditions_met
ground_truth: harness
llm_allowed: cite_only
prohibition:
- WAIT_PULLBACK 상태에서 LLM이 즉시 BUY 지시 금지
- STALE_PULLBACK_EXPIRED 후 만료된 트리거로 매수 금지
- pullback_trigger_price를 LLM이 재계산 금지
canonical_ref: AGENTS.md:Direction B2, K1
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- velocity_1d
- close
- ma20
- volume
- avg_volume_5d
- alpha_lead_score
- anti_chasing_status
output_fields:
- pullback_state
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SELL_EXECUTION_TIMING_V1:
purpose: '장중 가격 움직임에 따라 매도 주문 유형과 타이밍을 결정론적으로 판정. 장초반 패닉 매도, 반등 직전 저점 투매 방지.
'
applicable: SELL_WATERFALL_ENGINE_V1 직후. INTRADAY_ACTION_MATRIX_V1 연동.
inputs:
- field: gap_down_pct
unit: percent
note: (yesterday_close - today_open) / yesterday_close * 100
- field: intraday_drop
unit: percent
note: (today_open - current_price) / today_open * 100
- field: rsi14
unit: score
- field: intraday_change
unit: percent
- field: time_slot_label
unit: enum
note: INTRADAY_ACTION_MATRIX_V1 출력
timing_table:
GAP_DOWN_EMERGENCY:
condition: gap_down_pct > 3
recommended_order_type: MARKET_SELL
note: 장전 갭하락 비상. 지정가 고집 금지.
OVERSOLD_REBOUND:
condition: intraday_drop > 2 AND rsi14 < 35
recommended_order_type: STAGED_SELL_K2
note: K2 단계2 발동. 전량 즉시 매도 금지.
SIDEWAYS_TRIM:
condition: abs(intraday_change) <= 0.5
recommended_order_type: LIMIT_TRIM
note: 강보합 구간 최적 지정가 TRIM.
RALLY_TP:
condition: intraday_change > 1.5
recommended_order_type: TP_LIMIT_SELL
note: 장중 상승 시 TP 지정가 익절 우선. 손절가 주문 취소.
CLOSE_OPTIMAL:
condition: abs(intraday_change) <= 0.5 AND time_slot_label == CLOSE_VERIFY
recommended_order_type: ATR_LIMIT_SELL
note: 종가 근처 ATR 기반 최적 지정가.
output:
field: sell_timing_verdict
additional_fields:
- recommended_order_type
- timing_reason_code
ground_truth: harness
llm_allowed: cite_only
prohibition:
- OVERSOLD_REBOUND 상태에서 전량 즉시 매도 지시 금지
- RALLY_TP 상태에서 손절가 주문 동시 발동 금지
canonical_ref: AGENTS.md:Direction C2, K2, INTRADAY_ACTION_MATRIX_V1
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- gap_down_pct
- intraday_drop
- rsi14
- intraday_change
- time_slot_label
output_fields:
- sell_timing_verdict
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PORTFOLIO_ALPHA_CONFIDENCE_PER_TICKER_V1:
purpose: '기존 포트폴리오 전체 단일값 PAC(-90.7)를 종목별 분산 PAC로 교체. entry_freshness(35) + breakout_quality(25)
+ flow_accel(20) + fundamental(10) + rs_slope(10) 결합. BULLISH/NEUTRAL/BEARISH
라벨 분산. stddev ≥ 5 강제.
'
output:
field: portfolio_alpha_confidence_per_ticker_v1_json
expected_outputs:
- gate
- stddev
- label_diversity
llm_allowed: cite_only
version: 2026-05-27_PHASE3
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields:
- portfolio_alpha_confidence_per_ticker_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
MACRO_EVENT_TICKER_IMPACT_V1:
purpose: 'FOMC·CPI·옵션만기·반도체가이던스·관세 정적 카탈로그 × 종목 섹터 민감도로 impact_score(-100~+100)와
action_gate를 산출한다. 뒷박 차단 5중 AND의 1표(ALEG-V3+DSD-V1+breakout+smart_money+macro_event).
'
output:
file: Temp/macro_event_ticker_impact_v1.json
expected_outputs:
- gate
- ticker_count
- action_summary
llm_allowed: cite_only
version: 2026-05-28_PHASE4
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PREDICTIVE_ALPHA_REPORT_LOCK_V2:
purpose: 'predictive_alpha_json에서 thesis_signals/antithesis_signals/synthesis_score를
종목별 표로 강제 출력. coverage_pct >= 100% 필요 (ETF 예외 허용 시 >= 80%).
'
output:
file: Temp/predictive_alpha_report_lock_v2.json
expected_outputs:
- gate
- coverage_pct
- missing_tickers
llm_allowed: cite_only
version: 2026-05-28_PHASE5
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ANTI_LATE_ENTRY_GATE_V2:
purpose: '속도, 거래량, 추세 3개 게이트를 결합해 늦은 추격 진입을 차단한다.
'
input_fields:
- close
- prevClose
- ma20
- volume
- avg_volume_5d
- ret5d
expected_outputs:
- gate
- anti_late_entry_status
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ANTI_CHASE_V1:
purpose: '뒷북·설거지 진입을 차단하는 velocity 기반 anti-chase 게이트를 산출한다.
'
input_fields:
- velocity_1d
- velocity_5d
- atr_ratio
expected_outputs:
- anti_chase_gate
- chase_risk_level
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ENTRY_TIMING_DECILE_FACTOR_V1:
purpose: 뒷박 매수 임계값 하드코딩 제거 — T+5 실측 분포 분위 기반 동적 컷 (Direction LC1)
agents_md_ref: 'Direction LC1: LATE_CHASE_CALIBRATION_LOCK_V1'
inputs:
- field: buy_timing_score
unit: ratio_0_1
note: velocity_1d 실측 미확보 시 proxy 사용
- field: t5_ledger
unit: proposal_evaluation_history records
- field: cut_decile
unit: integer_1_10
optional: true
expression: entry_velocity_decile = ntile(buy_timing_score over t5_ledger, 10);
buy_allowed = entry_velocity_decile > cut_decile
components:
cut_decile_default:
value: 3
calibration_status: EXPERT_PRIOR
note: 하위 3분위 차단. samples>=30 후 실측 최저승률 분위로 자동 교체.
min_samples:
value: 30
unit: records
output:
field: velocity_decile_thresholds
unit: dict
includes:
- decile_1_9_pct
- recommended_block_threshold
- calibration_status
gate:
WATCH_PENDING_SAMPLE: samples < 30
CALIBRATED_FROM_LEDGER: samples >= 30
missing_policy: samples<30이면 EXPERT_PRIOR(buy_timing_score<30) 유지, precision=WATCH_PENDING_SAMPLE
implementation: tools/build_late_chase_attribution_v1.py:NF3
calibration_ref: spec/calibration_registry.yaml:NF3
version: 2026-06-04_NF3
owner: quant_team
lifecycle_state: active
input_fields:
- buy_timing_score
- t5_ledger
- cut_decile
output_fields:
- velocity_decile_thresholds
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: fundamental
formulas: {}
+4
View File
@@ -0,0 +1,4 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: macro
formulas: {}
+13
View File
@@ -0,0 +1,13 @@
schema_version: formula_domain_manifest.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domains:
risk: spec/formulas/risk.yaml
entry: spec/formulas/entry.yaml
exit: spec/formulas/exit.yaml
cash: spec/formulas/cash.yaml
portfolio: spec/formulas/portfolio.yaml
reporting: spec/formulas/reporting.yaml
fundamental: spec/formulas/fundamental.yaml
smart_money: spec/formulas/smart_money.yaml
macro: spec/formulas/macro.yaml
formula_count: 149
+670
View File
@@ -0,0 +1,670 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: portfolio
formulas:
TOTAL_HEAT_V1:
purpose: 손절 기준 총 위험노출 계산
inputs:
- field: average_cost
source: account_snapshot
unit: KRW_per_share
- field: stop_price
source: account_snapshot
unit: KRW_per_share
- field: quantity
source: account_snapshot.holding_quantity
unit: shares
- field: total_asset
unit: KRW
expression: sum((average_cost - stop_price) * quantity for each confirmed account_snapshot
holding) / total_asset * 100
output:
field: total_heat_pct
unit: percent
missing_policy:
stop_price: if atr20 exists use entry_price - atr20*2.0 else assume portfolio
heat contribution cap breach
quantity: NO_TOTAL_HEAT
total_asset: NO_TOTAL_HEAT
gates:
- if: total_heat_pct >= 10
action: BLOCK_NEW_BUY
- if: 7 <= total_heat_pct < 10
action: HALVE_NEW_BUY_QUANTITY
- if: total_heat_pct < 7
action: ALLOW_CONTINUE
canonical_ref: spec/risk/aggregate_risk.yaml:risk_control.aggregate_risk_cap
owner: quant_team
lifecycle_state: active
input_fields:
- average_cost
- stop_price
- quantity
- total_asset
output_fields:
- total_heat_pct
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
RISK_BUDGET_CASCADE_V1:
purpose: base risk budget에 Bayesian, 성과, 국면, Kelly 감액을 순서대로 적용
inputs:
- field: base_risk_budget
unit: ratio
default: 0.007
- field: net_return_feedback_multiplier
unit: ratio
default: 1.0
- field: performance_brake_multiplier
unit: ratio
default: 1.0
- field: regime_reset_multiplier
unit: ratio
default: 1.0
- field: bayesian_confidence_multiplier
unit: ratio
- field: kelly_brake_multiplier
unit: ratio
default: 1.0
expression: base_risk_budget * net_return_feedback_multiplier * performance_brake_multiplier
* regime_reset_multiplier * bayesian_confidence_multiplier * kelly_brake_multiplier
output:
field: final_risk_budget
unit: ratio
floor_rule:
if: final_risk_budget < 0.001
action: NO_BET
canonical_ref: spec/05_position_sizing.yaml:position_sizing.cascade_risk_budget_rule
owner: quant_team
lifecycle_state: active
input_fields:
- base_risk_budget
- net_return_feedback_multiplier
- performance_brake_multiplier
- regime_reset_multiplier
- bayesian_confidence_multiplier
- kelly_brake_multiplier
output_fields:
- final_risk_budget
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
POSITION_SIZE_V1:
purpose: 최종 정수 매수수량 산출
inputs:
- field: total_asset
unit: KRW
- field: final_risk_budget
unit: ratio
- field: atr20
unit: KRW_per_share
- field: atr_multiplier
unit: ratio
default: 1.5
- field: available_cash
unit: KRW
- field: entry_price
unit: KRW_per_share
- field: target_weight_limit_amount
unit: KRW
- field: sector_limit_amount
unit: KRW
- field: liquidity_limit_amount
unit: KRW
intermediate_outputs:
atr_quantity: floor((total_asset * final_risk_budget) / (atr20 * atr_multiplier))
cash_limit_quantity: floor(available_cash / entry_price)
target_weight_limit_quantity: floor(target_weight_limit_amount / entry_price)
sector_limit_quantity: floor(sector_limit_amount / entry_price)
liquidity_limit_quantity: floor(liquidity_limit_amount / entry_price)
expression: min(atr_quantity, cash_limit_quantity, target_weight_limit_quantity,
sector_limit_quantity, liquidity_limit_quantity)
output:
field: final_quantity
unit: shares_integer
missing_policy:
atr20: NO_BUY_QUANTITY
total_asset: NO_BUY_QUANTITY
available_cash: NO_BUY_QUANTITY
entry_price: NO_BUY_QUANTITY
target_weight_limit_amount: use very large number only if portfolio rule says
NOT_APPLICABLE
sector_limit_amount: use very large number only if sector cap says NOT_APPLICABLE
liquidity_limit_amount: allow PARTIAL only for report; BUY validation_status
cannot PASS
canonical_ref: spec/05_position_sizing.yaml:position_sizing.volatility_targeting
owner: quant_team
lifecycle_state: active
input_fields:
- total_asset
- final_risk_budget
- atr20
- atr_multiplier
- available_cash
- entry_price
- target_weight_limit_amount
- sector_limit_amount
- liquidity_limit_amount
output_fields:
- final_quantity
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PORTFOLIO_BAND_STATUS_V1:
purpose: 현재 비중이 목표 밴드보다 낮은지, 정상인지, 초과인지 판정
inputs:
- field: current_weight_pct
unit: percent
- field: target_band_min_pct
unit: percent
- field: target_band_max_pct
unit: percent
rules:
- if: current_weight_pct < target_band_min_pct
status: UNDERWEIGHT
action: ADD_ALLOWED_IF_ALL_GATES_PASS
- if: target_band_min_pct <= current_weight_pct <= target_band_max_pct
status: IN_BAND
action: HOLD_OR_SELECTIVE_ADD
- if: current_weight_pct > target_band_max_pct
status: OVERWEIGHT
action: TRIM_REVIEW
output:
field: portfolio_band_status
unit: enum
missing_policy: DATA_MISSING. add/trim 결론 보류.
canonical_ref: spec/risk/portfolio_exposure.yaml:portfolio_exposure_framework.target_allocation_structure
owner: quant_team
lifecycle_state: active
input_fields:
- current_weight_pct
- target_band_min_pct
- target_band_max_pct
output_fields:
- portfolio_band_status
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PORTFOLIO_BETA_V1:
purpose: 보유 포지션의 시가기준 가중평균 베타를 산출하여 팩터 과집중 판단에 사용
inputs:
- field: beta_i
source: data_feed.Beta for each holding i
unit: ratio
- field: market_value_i
source: account_snapshot.holding_quantity × close_price
unit: KRW
- field: total_equity_value
source: sum(market_value_i)
unit: KRW
expression: sum(beta_i × market_value_i / total_equity_value) for each holding
with known beta
output:
field: portfolio_beta
unit: ratio
missing_policy:
beta_i_missing_single: '해당 종목 제외 후 부분 산출. 제외 종목 시가 비중이 30% 초과 시 결과에 "(PARTIAL
— Beta 미확인 {N}개 종목 제외)" 표기.
'
beta_i_missing_all: NO_PORTFOLIO_BETA. 팩터 리스크 점검 PARTIAL 표기.
total_equity_value_zero: NO_PORTFOLIO_BETA
example:
holdings:
- name: 삼성전자
market_value: 100000000
beta: 1.1
- name: SK하이닉스
market_value: 80000000
beta: 1.3
- name: 한화에어로스페이스
market_value: 40000000
beta: 1.6
total_equity: 220000000
result: (1.1×100 + 1.3×80 + 1.6×40) / 220 = (110 + 104 + 64) / 220 = 278/220
≈ 1.26
canonical_ref: spec/risk/portfolio_exposure.yaml:portfolio_exposure_framework.factor_risk_limit
version: 2026-05-18_ROUTING_OPTIMIZATION_V1
owner: quant_team
lifecycle_state: active
input_fields:
- beta_i
- market_value_i
- total_equity_value
output_fields:
- portfolio_beta
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PORTFOLIO_CORRELATION_GATE_V1:
purpose: '위성 포지션들 간 20D 수익률 Pearson 상관관계를 계산해 동일 방향 클러스터가 포트폴리오 하락 리스크를 증폭시키는지
감지한다. 개별 Beta x 상관관계 조정으로 실질 포트폴리오 Beta(satellite_cluster_beta) 산출.
'
applicable: calcApexExecutionHarness_ 포트폴리오 집계 단계. SAPG_V1 이후 실행.
inputs:
- field: ticker
- field: price.ret20D
- field: beta_proxy
- field: weight_pct
computed:
correlation_matrix: 각 위성 쌍 (i,j) Pearson 상관계수. 데이터 부족 시 ret20D/globalKospiRet20D_
프록시.
satellite_cluster_beta: sum(weight_i * weight_j * beta_i * beta_j * corr_ij)
for all i,j pairs
effective_portfolio_beta: (core_weight * core_beta) + satellite_cluster_beta
gate_status:
CORRELATION_BLOCK:
condition: satellite_cluster_beta > 1.5 AND corr >= 0.70인 위성 쌍이 2쌍 이상
action: 고상관 약한 위성 ADD 금지, REVIEW 위성 우선 정리, 실질 beta 보고서 표기 의무
CORRELATION_WARN:
condition: satellite_cluster_beta > 1.2 OR corr >= 0.70인 위성 쌍이 1쌍
action: 신규 위성 편입 시 저상관 후보 우선
CORRELATION_PASS:
condition: satellite_cluster_beta <= 1.2
action: 정상. M2 독립 적용.
output_fields:
- field: satellite_cluster_beta
- field: effective_portfolio_beta
- field: high_corr_pairs
unit: list [{ticker1,ticker2,corr_coef}]
- field: correlation_gate_status
unit: enum [CORRELATION_PASS,CORRELATION_WARN,CORRELATION_BLOCK]
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 상관행렬 직접 계산 금지
- 개별 beta 낮아도 satellite_cluster_beta 높으면 분산 됐다 서술 금지
output:
field: satellite_cluster_beta
additional_fields:
- effective_portfolio_beta
- high_corr_pairs
- correlation_gate_status
version: 2026-05-21_PCG_V1
owner: quant_team
lifecycle_state: active
input_fields:
- ticker
- price.ret20D
- beta_proxy
- weight_pct
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
DYNAMIC_HEAT_GATE_V1:
purpose: '국면별 총 위험노출 임계값을 산출해 신규 매수 차단 여부를 결정한다.
'
inputs:
- field: market_regime
unit: enum
- field: total_heat_pct
unit: pct
output:
field: heat_gate_status
input_fields:
- market_regime
- total_heat_pct
expected_outputs:
- heat_gate_status
- heat_gate_threshold_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- heat_gate_status
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
POSITION_SIZE_REGIME_SCALE_V1:
purpose: '국면별 포지션 크기 스케일을 결정론적으로 산출한다.
'
inputs:
- field: market_regime
unit: enum
output:
field: regime_size_scale
input_fields:
- market_regime
expected_outputs:
- regime_size_scale
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- regime_size_scale
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
DRAWDOWN_GUARD_V1:
purpose: '연속 손절/성과 악화 구간에서 신규 매수 수량을 자동 축소하거나 차단한다.
'
inputs:
- field: win_loss_streak_state
unit: enum
- field: win_loss_streak_buy_scale
unit: multiplier
output:
field: drawdown_guard_state
input_fields:
- consecutive_loss_count
- recent_win_loss_state
expected_outputs:
- drawdown_guard_state
- drawdown_buy_scale
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- drawdown_guard_state
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
POSITION_COUNT_LIMIT_V1:
purpose: '동시 보유 종목 수 상한과 초과 여부를 판단한다.
'
inputs:
- field: position_count
unit: integer
- field: market_regime
unit: enum
output:
field: position_count_gate
input_fields:
- position_count
- market_regime
expected_outputs:
- position_count_gate
- position_count_max
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- position_count_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SINGLE_POSITION_WEIGHT_CAP_V1:
purpose: '단일 종목 비중 상한과 초과 TRIM 필요 여부를 판단한다.
'
inputs:
- field: single_position_weight_json
unit: json
- field: market_regime
unit: enum
output:
field: single_position_weight_gate
input_fields:
- position_weight_pct
- market_regime
expected_outputs:
- single_position_weight_gate
- weight_cap_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- single_position_weight_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
REGIME_TRIM_GUIDANCE_V1:
purpose: '국면별 현금확보용 TRIM 우선순위를 결정한다.
'
inputs:
- field: regime_adjusted_sell_priority_json
unit: json
- field: market_regime
unit: enum
output:
field: regime_trim_guidance
input_fields:
- market_regime
- sector_rank
expected_outputs:
- regime_trim_guidance
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- regime_trim_guidance
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
HEAT_CONCENTRATION_ALERT_V1:
purpose: '단일 종목이 총 Heat의 과도한 비중을 차지하는지 경보를 낸다.
'
inputs:
- field: heat_share_pct
unit: pct
output:
field: heat_concentration_gate
input_fields:
- heat_share_pct
expected_outputs:
- heat_concentration_gate
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- heat_concentration_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SECTOR_CONCENTRATION_LIMIT_V1:
purpose: '섹터 편중 한도와 신규 BUY 차단 여부를 판단한다.
'
inputs:
- field: sector_concentration_json
unit: json
- field: market_regime
unit: enum
output:
field: sector_concentration_gate
input_fields:
- sector_concentration_pct
- market_regime
expected_outputs:
- sector_concentration_gate
- sector_concentration_limit_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- sector_concentration_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PORTFOLIO_DRAWDOWN_GATE_V1:
purpose: '포트폴리오 고점 대비 낙폭을 산출해 신규 BUY 차단 여부를 판단한다.
'
inputs:
- field: portfolio_peak_krw
unit: KRW
- field: total_asset_krw
unit: KRW
output:
field: portfolio_drawdown_gate
input_fields:
- portfolio_peak_krw
- total_asset_krw
expected_outputs:
- portfolio_drawdown_gate
- portfolio_drawdown_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- portfolio_drawdown_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SECTOR_ROTATION_MOMENTUM_V1:
purpose: '섹터 로테이션 모멘텀 상태와 신규 매수 적합성을 판정한다.
'
inputs:
- field: sector
unit: string
- field: momentum_state
unit: enum
output:
field: sector_rotation_momentum_json
input_fields:
- sector
- momentum_state
expected_outputs:
- sector_rotation_momentum_json
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- sector_rotation_momentum_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
MARKET_WEIGHT_AWARE_CLUSTER_GATE_V1:
purpose: '시장 반도체 비중을 반영한 동적 클러스터 차단/경고 임계값을 산출한다.
'
inputs:
- field: semiconductor_cluster_json
unit: json
- field: market_regime
unit: enum
output:
field: semiconductor_cluster_gate
input_fields:
- kospi_semi_weight_pct
- combined_pct
- market_regime
expected_outputs:
- cluster_gate
- cap_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- semiconductor_cluster_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
LEADER_POSITION_WEIGHT_CAP_V1:
purpose: '주도주 종목별 차등 비중 상한과 초과 TRIM 필요 여부를 산출한다.
'
inputs:
- field: single_position_weight_json
unit: json
- field: market_regime
unit: enum
output:
field: single_position_weight_gate
input_fields:
- ticker
- position_weight_pct
- market_regime
expected_outputs:
- leader_position_weight_gate
- weight_cap_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields:
- single_position_weight_gate
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
REGIME_CONDITIONAL_MACRO_FACTOR_V1:
purpose: 거시팩터 종목별 FX 민감도 베타 적용 — 단일팩터 전 종목 균일 지배 차단 (Direction SFP1)
agents_md_ref: 'Direction SFP1: SINGLE_FACTOR_DOMINANCE_CAP_V1'
inputs:
- field: base_macro_score
unit: ratio_0_1
- field: ticker
unit: string
- field: ticker_type
unit: 'enum: export | domestic | neutral'
expression: base_macro_score x fx_sensitivity_beta(ticker_type)
components:
fx_sensitivity_beta:
export: 1.2
domestic: 0.7
neutral: 1.0
note: '수출주(삼성전자·SK하이닉스 등): FX 민감도 20% 가중. 내수주: 30% 축소.'
output:
field: macro_factor_applied
unit: ratio_0_1
gate:
condition: single_factor_max_share_pct > 50
result: SINGLE_FACTOR_DEGENERATE
action: WARN — synthesis_verdict 다양성 확보 실패, 보고서 첫 줄 경고 의무
missing_policy: ticker_type 미확인 시 fx_beta=1.0(neutral) 적용
implementation: tools/build_predictive_alpha_dialectic_engine_v2.py:NF1
calibration_ref: spec/calibration_registry.yaml:NF1 (EXPERT_PRIOR)
version: 2026-06-04_NF1
owner: quant_team
lifecycle_state: active
input_fields:
- base_macro_score
- ticker
- ticker_type
output_fields:
- macro_factor_applied
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
+672
View File
@@ -0,0 +1,672 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: reporting
formulas:
FLOW_CREDIT_V1:
purpose: 가격·거래량·5D 수급 품질을 0~1 점수로 계산
inputs:
- field: close_price
unit: KRW_per_share
- field: open_price
unit: KRW_per_share
optional: true
- field: previous_close_price
unit: KRW_per_share
optional: true
- field: volume
unit: shares
- field: avg_volume_5d
unit: shares
- field: frg_5d_sh
unit: shares
- field: inst_5d_sh
unit: shares
- field: flow_ok
unit: none
components:
C1_price_action:
expression: 1 if close_price >= open_price OR close_price > previous_close_price
else 0
weight: 0.3
missing_action: 0
C2_volume_action:
expression: 1 if volume >= avg_volume_5d * 1.20 else 0
weight: 0.3
missing_action: 0
C3_flow_action:
expression: 1 if flow_ok == true AND (frg_5d_sh + inst_5d_sh) > 0 else 0
weight: 0.4
missing_action: 0
expression: C1_price_action*0.30 + C2_volume_action*0.30 + C3_flow_action*0.40
output:
field: flow_credit
unit: ratio_0_1
hard_override:
- condition: C1_price_action == 0 AND C2_volume_action == 0
result: 0
reason: C3 단독 충족은 물량 받기로 간주
canonical_ref: spec/02_data_contract.yaml:quant_feed_contract.investor_flow_rules.active_quality_gate
owner: quant_team
lifecycle_state: active
input_fields:
- close_price
- open_price
- previous_close_price
- volume
- avg_volume_5d
- frg_5d_sh
- inst_5d_sh
- flow_ok
output_fields:
- flow_credit
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
TRADE_QUALITY_SCORER_V1:
purpose: '실행된 매수·매도를 T+1/T+5/T+20 기준으로 자동 채점해 뒷박/설거지/저점 투매를 데이터로 증명. O4(WIN_LOSS_STREAK_GUARD_V1)
개선 피드백 루프.
'
applicable: monthly_history 업데이트 배치. 진입 후 T+5, T+20 경과 시 자동 평가.
inputs:
- field: velocity_1d_at_entry
unit: percent
note: buy quality — 진입 당일 속도
- field: entry_price
unit: KRW_per_share
note: buy quality
- field: ma20_at_entry
unit: KRW_per_share
note: buy quality
- field: volume_ratio_at_entry
unit: ratio
note: buy quality
- field: t5_return_pct
unit: percent
optional: true
note: buy quality T+5
- field: t20_vs_core_pctp
unit: percent
optional: true
note: buy quality T+20 alpha
- field: sell_price
unit: KRW_per_share
note: sell quality
- field: ma20_at_sell
unit: KRW_per_share
note: sell quality
- field: average_cost
unit: KRW_per_share
note: sell quality — 평단
- field: price_t5_after_sell
unit: KRW_per_share
optional: true
note: sell quality T+5 사후
- field: cash_recovered_krw
unit: KRW
note: sell quality — 실제 회수액
- field: cash_shortfall_min_krw
unit: KRW
note: sell quality — 목표 현금 부족분
scoring:
buy_score:
velocity_ok:
condition: velocity_1d_at_entry < 1
points: 20
ma20_proximity:
condition: entry_price <= ma20_at_entry * 1.01
points: 20
volume_confirm:
condition: volume_ratio_at_entry >= 1.2
points: 20
t5_positive:
condition: t5_return_pct > 0
points: 20
t20_alpha:
condition: t20_vs_core_pctp > 0
points: 20
sell_score:
above_ma20:
condition: sell_price >= ma20_at_sell * 0.99
points: 25
above_cost:
condition: sell_price >= average_cost
points: 25
not_too_early:
condition: price_t5_after_sell is null OR price_t5_after_sell < sell_price
points: 25
cash_goal_met:
condition: cash_recovered_krw >= cash_shortfall_min_krw
points: 25
grade_table:
90100:
grade: EXCELLENT
tag: GOOD_EXECUTION
7589:
grade: GOOD
tag: GOOD_EXECUTION
6074:
grade: ACCEPTABLE
tag: REVIEW_NEEDED
4059:
grade: POOR
tag: CHASE_ENTRY_OR_PANIC_EXIT
0_39:
grade: CRITICAL
tag: PATTERN_ALERT
feedback_tags:
- CHASE_ENTRY
- PANIC_EXIT
- DISTRIBUTION_ENTRY
- OVERSOLD_PANIC
- GOOD_EXECUTION
output:
field: trade_quality_json
schema:
- ticker: 종목코드
action: BUY|SELL
score: 0~100
grade: enum
feedback_tag: enum
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 trade_quality_score를 즉석 계산 금지
- POOR/CRITICAL 종목에 '이번엔 괜찮다' 임의 판단 금지
canonical_ref: AGENTS.md:Direction F1, O4(WIN_LOSS_STREAK)
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- velocity_1d_at_entry
- entry_price
- ma20_at_entry
- volume_ratio_at_entry
- t5_return_pct
- t20_vs_core_pctp
- sell_price
- ma20_at_sell
- average_cost
- price_t5_after_sell
- cash_recovered_krw
- cash_shortfall_min_krw
output_fields:
- trade_quality_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PATTERN_BLACKLIST_AUTO_V1:
purpose: '같은 종목에서 3회 이상 POOR/CRITICAL grade가 누적되면 자동으로 강화 제한 적용. "같은 실수를 4번째는
시스템이 막는다."
'
applicable: TRADE_QUALITY_SCORER_V1 이후. monthly_history 배치.
inputs:
- field: trade_quality_json
unit: array
- field: monthly_history
unit: array
trigger:
condition: 동일 ticker, grade IN [POOR, CRITICAL] 누적 횟수 >= 3
action: PATTERN_BLACKLIST_TRIGGERED
restrictions_applied:
saqg_downgrade: 해당 ticker SAQG를 EXCLUDED로 자동 격하 (BUY 완전 차단)
alpha_score_cap: alpha_lead_score 상한 50점 적용
llm_ban: LLM '이번엔 다르다' 서술 금지 — Override는 사용자 수동 확인만 허용
release_condition: 3회 연속 GOOD 이상 달성 시 블랙리스트 해제
output:
field: pattern_blacklist_status
values:
- TRIGGERED
- CLEAR
- NOT_APPLICABLE
additional_fields:
- blacklist_ticker
- accumulated_poor_count
- release_condition_met
ground_truth: harness
llm_allowed: cite_only
prohibition:
- TRIGGERED 종목에 예외 매수 서술 금지
- 블랙리스트 해제를 LLM이 임의 선언 금지 — 3회 연속 GOOD 조건 충족만
canonical_ref: AGENTS.md:Direction F2, TRADE_QUALITY_SCORER_V1, SAQG
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- trade_quality_json
- monthly_history
output_fields:
- pattern_blacklist_status
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
FUNDAMENTAL_QUALITY_GATE_V1:
purpose: 펀더멘털 품질(ROE/이익성장/부채/현금흐름/밸류)을 결정론적으로 점수화해 BUY 허용 여부를 잠금.
inputs:
- field: roe_pct
unit: percent
optional: true
- field: op_income_growth_pct
unit: percent
optional: true
- field: debt_ratio_pct
unit: percent
optional: true
- field: operating_cf_krw
unit: KRW
optional: true
- field: pe_ttm
unit: ratio
optional: true
output:
field: fundamental_quality_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL53
owner: quant_team
lifecycle_state: active
input_fields:
- roe_pct
- op_income_growth_pct
- debt_ratio_pct
- operating_cf_krw
- pe_ttm
output_fields:
- fundamental_quality_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ROUTING_SERVING_DECISION_TRACE_V2:
purpose: 라우팅→서빙→게이트 경로를 단일 trace JSON으로 고정해 사후감사 가능성 확보.
inputs:
- field: routing_trace_json
unit: json
- field: export_gate_json
unit: json
output:
field: routing_serving_trace_v2_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL53
owner: quant_team
lifecycle_state: active
input_fields:
- routing_trace_json
- export_gate_json
output_fields:
- routing_serving_trace_v2_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EARNINGS_GROWTH_QUALITY_GATE_V1:
purpose: 분기/연간 이익 성장 일관성으로 매수 게이트를 잠금.
inputs:
- field: eps_growth_qoq_pct
unit: percent
optional: true
- field: eps_growth_yoy_pct
unit: percent
optional: true
output:
field: earnings_growth_quality_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL54
owner: quant_team
lifecycle_state: active
input_fields:
- eps_growth_qoq_pct
- eps_growth_yoy_pct
output_fields:
- earnings_growth_quality_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ROUTING_DECISION_EXPLAIN_LOCK_V1:
purpose: 최종 의사결정 게이트 경로와 차단사유를 JSON으로 고정.
inputs:
- field: export_gate_json
unit: json
output:
field: routing_decision_explain_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL54
owner: quant_team
lifecycle_state: active
input_fields:
- export_gate_json
output_fields:
- routing_decision_explain_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
BLANK_CELL_AUDIT_V1:
purpose: '보고서 GFM 표의 빈 셀·일률 stub 라벨을 감사하여 셀-레벨 결정론 충족 여부를 판정한다. 금지 일률값(데이터 누락/NEUTRAL/LOSING/정상/-/빈문자)이
하나라도 있으면 INCOMPLETE_TABLE. enforcement_mode_until 이전은 WARN_ONLY, 이후 hard-block.
'
inputs:
- field: operational_report_json
unit: json
output:
field: blank_cell_audit_v1_json
expected_outputs:
- gate
- blank_fill_pct
- incomplete_tables
- enforcement_mode
llm_allowed: cite_only
version: 2026-05-27_PHASE1
owner: quant_team
lifecycle_state: active
input_fields:
- operational_report_json
output_fields:
- blank_cell_audit_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EJCE_VIEW_RENDERER_V1:
purpose: 'ejce_consensus_table의 Analyst/Trader/Quant 본문 셀을 결정론 템플릿으로 채운다. AGENTS.md
EJ1 의무: 3관점 모두 인용. 본문 셀 비면 INCOMPLETE_EJCE_REPORT.
'
inputs:
- field: ejce_json
unit: json
- field: alpha_lead_json
unit: json
- field: breakout_quality_gate_json
unit: json
- field: anti_chasing_velocity_json
unit: json
- field: heat_concentration_json
unit: json
- field: portfolio_alpha_confidence
unit: score
output:
field: ejce_view_renderer_v1_json
expected_outputs:
- gate
- blank_view_count
- row_count
llm_allowed: cite_only
version: 2026-05-27_PHASE1
owner: quant_team
lifecycle_state: active
input_fields:
- ejce_json
- alpha_lead_json
- breakout_quality_gate_json
- anti_chasing_velocity_json
- heat_concentration_json
- portfolio_alpha_confidence
output_fields:
- ejce_view_renderer_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EARNINGS_QUALITY_SIGNAL_V1:
purpose: 'OPM(영업이익률) 기반 이익 품질을 결정론적으로 라벨링한다. EXPANDING/STABLE/CONTRACTING/VOLATILE/DATA_MISSING
라벨과 buy_modifier(+10 ~ -15)를 종목별로 산출한다.
'
output:
field: earnings_quality_signal_v1_json
expected_outputs:
- gate
- label_counts
- data_missing_pct
llm_allowed: cite_only
version: 2026-05-27_PHASE2B
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields:
- earnings_quality_signal_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
TRADE_QUALITY_FROM_T5_V1:
purpose: '운영(non-backfill) T+5 outcome MATCHED/MISMATCH 기반으로 per-ticker 및 전체 거래품질
점수를 산출한다. T+20 성숙 전 bridge; T+20 성숙 후 자동 승격.
'
output:
file: Temp/trade_quality_from_t5_v1.json
expected_outputs:
- gate
- summary_score
- scored_count
- trade_quality_basis
llm_allowed: cite_only
version: 2026-05-28_PHASE4
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
LLM_NARRATIVE_TEMPLATE_LOCK_V1:
purpose: 'operational_report.json 각 section.markdown에서 금지 어휘(같다/약간/곧/강한모멘텀 등)를
스캔한다. 발견 시 INVALID_NARRATIVE. gate=PASS: 금지어 0건 강제.
'
output:
file: Temp/llm_narrative_template_lock_v1.json
expected_outputs:
- gate
- total_violations
- sections_checked
llm_allowed: cite_only
version: 2026-05-28_PHASE5
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EJCE_DIVERGENCE_AUDIT_V1:
purpose: 'EJCE 3관점 block_reasons 다양성 감사. 10/10 동일 사유 → ANALYST_VIEW_HOMOGENEOUS
경고. unique_reason_pct < 60% → WARN.
'
output:
file: Temp/ejce_divergence_audit_v1.json
expected_outputs:
- gate
- unique_reason_pct
- homogeneous_flag
- analyst_view_homogeneous
llm_allowed: cite_only
version: 2026-05-28_PHASE5
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
INVESTMENT_QUALITY_HEADLINE_V1:
purpose: 'schema_presence=100% vs investment_quality=13% 충돌을 보고서 CORE 첫 섹션으로 강제
표기. 거짓 표면화 게이트. effective_confidence = raw × cap_factor 적용 증빙. DATA_QUALITY_RECONCILIATION_V1
gate=CONFLICT 시 보고서 첫 섹션에 ⚠️ 경고 표시.
'
output:
section: investment_quality_headline
expected_outputs:
- quality_conflict_flag
- investment_quality_score
- schema_presence_score
llm_allowed: cite_only
version: 2026-05-28_PHASE6
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CROSS_SECTION_CONSISTENCY_V1:
purpose: 'operational_report.json 섹션 markdown을 파싱해 CANONICAL_METRICS_V1 지표가 여러
섹션에서 동일한 canonical 값으로 렌더링됐는지 검증. 충돌 발견 시 gate=FAIL(WARN). AGENTS.md R1 enforcement_mode_until
단계적 차단 정책 적용.
'
input_fields:
- Temp/canonical_metrics_v1.json.metrics
- Temp/operational_report.json.sections[].markdown
expected_outputs:
- conflict_count
- conflicts
- forbidden_uniform_labels
- incomplete_tables
- score
- gate
- enforcement_mode_until
llm_allowed: cite_only
version: 2026-05-29_PHASE7
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ALGORITHM_GUIDANCE_PROOF_V1:
purpose: 'YAML↔GAS 커버리지·결정론·LLM 의존도를 종합해 알고리즘 안내 품질 점수를 산출한다.
'
input_fields:
- skeleton_score
- cell_coverage_pct
- harness_gate_pass
- outcome_quality_score
expected_outputs:
- algorithm_guidance_proof_score
- algorithm_guidance_proof_gate
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
AUDIT_REPLAY_SNAPSHOT_V1:
purpose: 'replay 시뮬레이션의 스냅샷을 생성해 의사결정 재현 감사를 지원한다.
'
input_fields:
- replay_date
- portfolio_state
- decision_vector
expected_outputs:
- audit_snapshot
- replay_validation_status
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CONTINUOUS_EVALUATION_DASHBOARD_V1:
purpose: 'T+1/T+5/T+20 성과를 주간 자동 갱신하는 연속 평가 대시보드를 산출한다.
'
input_fields:
- trade_outcomes
- evaluation_period
expected_outputs:
- weekly_scorecard
- profit_giveback_pct
- expectancy_pct
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
DATA_QUALITY_GATE_V2_PY:
purpose: 'Python 하네스 전용 데이터 품질 게이트 v2. GAS 버전과 parity 검증.
'
input_fields:
- harness_context
- required_fields
expected_outputs:
- data_quality_gate
- missing_fields
- quality_score
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
DATA_QUALITY_GATE_V3:
purpose: '데이터 품질 게이트 v3. imputed 데이터 비율·출처 신뢰도를 추가 검증한다.
'
input_fields:
- harness_context
- imputed_fields
- source_reliability
expected_outputs:
- data_quality_gate_v3
- imputed_ratio
- quality_grade
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: smart_money
formulas: {}