Files
QuantEngineByItz/spec/13_formula_registry.yaml
T
kjh2064 ee3e799de1 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>
2026-06-13 13:20:14 +09:00

4667 lines
173 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
meta:
title: 은퇴자산포트폴리오 — LLM 실행용 공식 레지스트리
parent_file: RetirementAssetPortfolio.yaml
version: 2026-05-16-F14_peg_formula
language: ko-KR
timezone: Asia/Seoul
role: canonical
purpose: '핵심 투자 알고리즘을 LLM이 반복 계산할 수 있도록 공식의 입력, 출력, 단위, 누락 처리, 차단 조건을 구조화한다.
'
formula_registry:
policy:
field_source: spec/12_field_dictionary.yaml
execution_order:
- YAML_GAS_COVERAGE_AUDIT_ENGINE_V1
- HARNESS_DATA_FRESHNESS_GATE_V1
- INTRADAY_ACTION_MATRIX_V1
- FLOW_CREDIT_V1
- MARKET_RISK_SCORE_V1
- TARGET_CASH_PCT_V1
- TOTAL_HEAT_V1
- CASH_RATIOS_V1
- PORTFOLIO_BAND_STATUS_V1
- MEAN_REVERSION_GATE_V1
- EXPECTED_EDGE_V1
- RISK_BUDGET_CASCADE_V1
- PEG_SCORE_V1
- POSITION_SIZE_V1
- STOP_PRICE_CORE_V1
- TRAILING_STOP_PRICE_V1
- PROFIT_LOCK_RATCHET_V1
- PROFIT_RATCHET_TIERED_V2
- TAKE_PROFIT_LADDER_V1
- DIVERGENCE_SCORE_V1
- OVERHANG_PRESSURE_V1
- SECTOR_ROTATION_RADAR_V1
- FLOW_ACCELERATION_V1
- DISTRIBUTION_SELL_DETECTOR_V1
- BREAKOUT_QUALITY_GATE_V2
- FOLLOW_THROUGH_DAY_CONFIRM_V1
- ANTI_CHASING_VELOCITY_V1
- PULLBACK_ENTRY_TRIGGER_V1
- BUY_TIMING_SUITABILITY_V1
- T1_FORCED_SELL_RISK_V1
- SELL_CONFLICT_AWARE_RECOMMENDATION_V1
- CASH_CREATION_PURPOSE_LOCK_V1
- CASH_RECOVERY_OPTIMIZER_V1
- SELL_WATERFALL_ENGINE_V1
- EXECUTION_METHOD_LADDER_V1
- SELL_EXECUTION_TIMING_V1
- SELL_VALUE_PRESERVATION_TIERED_V2
- TICK_NORMALIZER_V1
- SELL_PRICE_SANITY_V1
- BENCHMARK_RELATIVE_TIMESERIES_V1
- RS_RATIO_V1
- RS_VERDICT_V2
- SATELLITE_ALPHA_QUALITY_GATE_V1
- SATELLITE_AGGREGATE_PNL_GATE_V1
- ALPHA_EVALUATION_WINDOW_V1
- PORTFOLIO_CORRELATION_GATE_V1
- SATELLITE_LIFECYCLE_GATE_V1
- CLA_REGIME_EXIT_CONDITION_V1
- LLM_SERVING_CONSTRAINT_V1
- DETERMINISTIC_ROUTING_ENGINE_V1
- ALPHA_FEEDBACK_LOOP_V1
- TRADE_QUALITY_SCORER_V1
- PATTERN_BLACKLIST_AUTO_V1
missing_policy_default: DATA_MISSING. 계산 결과를 추정하지 않는다.
output_requirement: 각 공식은 result, inputs_used, missing_inputs, rule_id를 출력 근거에
남긴다.
python_harness_supplements:
note: GAS execution_order 제외 — Python-harness 전용 보조 공식. formula_id가 코드에 직접 등장하지
않을 수 있음.
formulas:
- REGIME_CONDITIONAL_MACRO_FACTOR_V1
- REBOUND_CAPTURE_THESIS_FACTOR_V1
- ENTRY_TIMING_DECILE_FACTOR_V1
- SELL_SLIPPAGE_BUDGET_FACTOR_V1
- PROFIT_GIVEBACK_RATCHET_FACTOR_V1
# bridge_only 공식: 직접 구현이 없으며 상위 파이프라인 결과물로 표현됨
- EXECUTION_AUTHORITY_MATRIX_V1
- FINAL_DECISION_PACKET_V1
- ORDER_MATH_RECONCILIATION_V1
- REPORT_AUTHORITY_DIFF_V1
# PY_FILES 목록에 누락된 tools/src 구현체 — Python-harness 전용
- MACRO_EVENT_TICKER_IMPACT_V1
- INVESTMENT_QUALITY_HEADLINE_V1
- ALGORITHM_GUIDANCE_PROOF_V1
- CANONICAL_ARTIFACT_RESOLVER_V1
- COMPLETION_GAP_V1
- FINAL_EXECUTION_DECISION_V2
- FORMULA_REGISTRY_SYNC_V1
- HORIZON_REBALANCE_PLAN_V1
- PIPELINE_RUNTIME_PROFILE_V1
implementation_map:
REGIME_CONDITIONAL_MACRO_FACTOR_V1: tools/build_predictive_alpha_dialectic_engine_v2.py:NF1
REBOUND_CAPTURE_THESIS_FACTOR_V1: tools/build_predictive_alpha_dialectic_engine_v2.py:NF2
ENTRY_TIMING_DECILE_FACTOR_V1: tools/build_late_chase_attribution_v1.py:NF3
SELL_SLIPPAGE_BUDGET_FACTOR_V1: tools/build_value_preservation_scorer_v1.py:NF4
PROFIT_GIVEBACK_RATCHET_FACTOR_V1: tools/build_ratchet_trailing_general_v1.py:NF5
EXECUTION_AUTHORITY_MATRIX_V1: spec/13b_harness_formulas.yaml:bridge_only
FINAL_DECISION_PACKET_V1: spec/13b_harness_formulas.yaml:bridge_only
ORDER_MATH_RECONCILIATION_V1: spec/13b_harness_formulas.yaml:bridge_only
REPORT_AUTHORITY_DIFF_V1: spec/13b_harness_formulas.yaml:bridge_only
MACRO_EVENT_TICKER_IMPACT_V1: tools/validate_engine_harness_gate.py
INVESTMENT_QUALITY_HEADLINE_V1: tools/validate_specs.py
ALGORITHM_GUIDANCE_PROOF_V1: tools/build_algorithm_guidance_proof_v1.py
CANONICAL_ARTIFACT_RESOLVER_V1: tools/validate_canonical_artifact_resolver_v1.py
COMPLETION_GAP_V1: tools/build_completion_gap_v1.py
FINAL_EXECUTION_DECISION_V2: tools/build_final_execution_decision_v2.py
FORMULA_REGISTRY_SYNC_V1: tools/build_formula_registry_sync_v1.py
HORIZON_REBALANCE_PLAN_V1: tools/build_horizon_rebalance_plan_v1.py
PIPELINE_RUNTIME_PROFILE_V1: src/quant_engine/pipeline_runtime_anomaly_lib_v1.py
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
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
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
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
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
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
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
STOP_PRICE_CORE_V1:
purpose: 코어 포지션 HTS 입력용 손절가 계산
inputs:
- field: entry_price
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
- field: current_price
unit: KRW_per_share
derived_fields:
atr20_pct: atr20 / current_price * 100
atr_multiplier: 2.0 if atr20_pct >= 8 else 1.5
expression: max(entry_price * 0.92, entry_price - atr20 * atr_multiplier)
output:
field: stop_price
unit: KRW_per_share
missing_policy:
atr20: entry_price * 0.92 with DATA_MISSING tag
entry_price: NO_STOP_PRICE
canonical_ref: spec/exit/stop_loss.yaml:stop_loss.core
STOP_PROPOSAL_LADDER_V1:
purpose: '사용자 판단용 proposal_reference_sheet에 표시할 손절 1/2/3 가격·수량 래더 산출. HTS 즉시
주문표가 아니라 제안표 전용이며, 기존 손절 규칙과 profit preservation 결과만 사용한다.
'
inputs:
- field: position_class
unit: enum [core, satellite]
- field: holding_quantity
unit: shares
optional: true
- field: proposed_quantity
unit: shares
optional: true
- field: stop_price
unit: KRW_per_share
- field: profit_lock_stage
unit: enum
optional: true
- field: protected_stop_price
unit: KRW_per_share
optional: true
- field: auto_trailing_stop
unit: KRW_per_share
optional: true
- field: tp3_qty
unit: shares
optional: true
derived_fields:
base_stop_quantity: holding_quantity 우선, 없으면 proposed_quantity
rules:
stop1:
price_expression: stop_price
quantity_expression: core=floor(max(1, base_stop_quantity*0.50)), satellite=floor(max(1,
base_stop_quantity*0.70))
rationale: spec/exit/stop_loss.yaml core/satellite quantity_rule의 1차 손절
stop2:
price_expression: stop_price
quantity_expression: max(base_stop_quantity - stop1_quantity, 0)
rationale: 종가 회복 실패 시 잔여 청산
stop3:
price_expression: auto_trailing_stop 우선, 없으면 protected_stop_price
quantity_expression: tp3_qty 우선, 없으면 base_stop_quantity - tp1_quantity -
tp2_quantity
activation: profit_lock_stage != NORMAL 또는 auto_trailing_stop 존재
rationale: 수익보전 구간 러너 보호 스탑
output:
field: proposal_stop_ladder
unit: object
missing_policy:
stop_price: NO_STOP_LADDER
holding_quantity: proposed_quantity fallback
protected_stop_price: stop3는 비움
prohibition:
- stop2/stop3를 차트 패턴이나 심리적 가격으로 임의 산출 금지
- stop3 활성 근거가 없으면 null 유지
canonical_ref: spec/00_execution_contract.yaml:proposal_policy.proposal_stop_ladder_selection
TRAILING_STOP_PRICE_V1:
purpose: 고점 대비 ATR 기반 trailing stop 가격 계산
inputs:
- field: highest_price_since_entry
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
- field: trailing_atr_multiplier
unit: ratio
default: 1.5
expression: highest_price_since_entry - atr20 * trailing_atr_multiplier
output:
field: trailing_stop_price
unit: KRW_per_share
missing_policy:
highest_price_since_entry: NO_TRAILING_PRICE
atr20: NO_TRAILING_PRICE
canonical_ref: spec/exit/take_profit.yaml:take_profit.trailing_stop
ABSOLUTE_RISK_STOP_V1:
purpose: 절대 리스크 손절가와 청산 수량을 산출하는 taxonomy wrapper
inputs:
- field: holdings
unit: object[]
- field: df_map
unit: object
output:
field: absolute_risk_stop_rows
unit: object[]
canonical_ref: spec/exit/stop_loss.yaml:stop_loss.core
note: stop_loss.core/satellite 및 stop_adequacy 결과를 묶는 wrapper
RELATIVE_UNDERPERF_ALERT_V1:
purpose: 상대성과 약화 경보를 산출하는 taxonomy wrapper
inputs:
- field: holdings
unit: object[]
- field: df_map
unit: object
- field: kospi_ret20d
unit: pct
optional: true
output:
field: relative_underperf_alert
unit: object
canonical_ref: spec/exit/stop_loss.yaml:stop_loss.relative_weakness_exit
note: calcRelativeStopSignal_의 하위 wrapper
STOP_ACTION_LADDER_V1:
purpose: 손절/익절/시간손절의 최종 액션 래더를 산출하는 taxonomy wrapper
inputs:
- field: context
unit: object
output:
field: stop_action_ladder
unit: object
canonical_ref: spec/exit/stop_loss.yaml:stop_loss.sell_signal_priority
note: calcSellDecision_ / SL003_PRIORITY_MATRIX 결과를 표준화
PROFIT_LOCK_RATCHET_V1:
purpose: '분할 익절 단계별 손절선 상향(래칫) 공식. tier_1 익절 완료 후 손절선을 본절(average_cost)로 상향하여
원금을 보호. tier_2 익절 완료 후 trailing stop으로 전환하여 추세 끝단 보유. TAKE_PROFIT_LADDER_V2.action_on_trigger에서
참조.
'
inputs:
- field: average_cost
unit: KRW_per_share
- field: tier_completed
unit: enum [tier_1, tier_2]
- field: highest_price_since_entry
unit: KRW_per_share
optional: true
note: tier_2 완료 후 TRAILING_STOP_PRICE_V1 호출 시 필요
- field: atr20
unit: KRW_per_share
optional: true
rules:
tier_1_completed:
expression: ratchet_stop_price = average_cost
label: 본절 보호 — 원금 방어선으로 상향
rationale: tier_1(1.5R) 도달 시 원금 손실 구간 탈출. 손절이 더 이상 손실 없음.
tier_2_completed:
expression: ratchet_stop_price = TRAILING_STOP_PRICE_V1 result
label: trailing stop 전환 — 추세 끝단까지 보유
rationale: tier_2(3R) 도달 후 잔여는 trailing stop으로 추세 추종.
output:
field: ratchet_stop_price
unit: KRW_per_share
missing_policy:
average_cost: NO_RATCHET_PRICE
atr20: tier_2일 때 TRAILING_STOP_PRICE_V1 미산출. DATA_MISSING 표기 후 본절 유지.
tier_completed_missing: NO_RATCHET_PRICE — tier 완료 여부 미확인 시 적용 금지
prohibition:
- 이 공식 외 임의 레이블(profit_lock_ratchet, 차트 지지선 등)로 보호스탑 생성 금지
- tier_1 미완료 상태에서 본절 보호선 조기 적용 금지
- tier_completed 명시 없이 ratchet_stop_price 산출 금지
canonical_ref: spec/exit/take_profit.yaml:take_profit.tiered_ladder
version: 2026-05-18_AUDIT_RESPONSE_V1
TAKE_PROFIT_LADDER_V1:
purpose: 평단·보유수량 기준 3단계 익절 가격과 정수 수량 계산
inputs:
- field: average_cost
unit: KRW_per_share
- field: quantity
unit: shares
- field: position_class
unit: enum
output:
field: take_profit_ladder
unit: object
rules:
core:
tier_1:
price_expression: average_cost * 1.15
quantity_expression: floor(quantity * 0.25)
tier_2:
price_expression: average_cost * 1.25
quantity_expression: floor((quantity - tier_1_quantity) * 0.40)
tier_3:
price_expression: TRAILING_STOP_PRICE_V1
quantity_expression: quantity - tier_1_quantity - tier_2_quantity
satellite:
tier_1:
price_expression: average_cost * 1.10
quantity_expression: floor(quantity * 0.50)
tier_2:
price_expression: average_cost * 1.20
quantity_expression: floor((quantity - tier_1_quantity) * 0.50)
tier_3:
price_expression: TRAILING_STOP_PRICE_V1 or time_stop
quantity_expression: quantity - tier_1_quantity - tier_2_quantity
missing_policy:
average_cost: NO_TAKE_PROFIT_PRICE
quantity: NO_TAKE_PROFIT_QUANTITY
canonical_ref: spec/exit/take_profit.yaml:take_profit.tiered_ladder
TAKE_PROFIT_LADDER_V2:
purpose: '평단·ATR20·보유수량 기준 3단계 익절 가격과 정수 수량 계산. 각 단계 가격 = max(고정% 기준가, ATR R-Multiple
기준가). 고정% 최저선을 보장하면서도 고변동성 종목은 ATR 기반으로 더 늦게 익절. ATR 미확인 시 TAKE_PROFIT_LADDER_V1(고정%
전용)으로 자동 fallback.
'
design_rationale: 'R = ATR20 (1일 평균 변동폭 = 1 위험단위). 1.5R 도달 = 손절 리스크(1R)의 1.5배
수익 → 본절 스탑 상향 근거 확보. 3.0R 도달 = 확실한 수익 구간. 고정% 최저선(코어+15%, 위성+10%) 보장으로 저변동성
종목이 너무 일찍 익절되는 것을 방지한다.
'
inputs:
- field: average_cost
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
optional: true
- field: quantity
unit: shares
- field: position_class
unit: enum
derived_fields:
r_unit: 'atr20 # 1R = ATR20 (1일 평균 변동폭)'
atr_tier1_price: 'average_cost + atr20 * 1.5 # 1.5R 수익점'
atr_tier2_price: 'average_cost + atr20 * 3.0 # 3.0R 수익점'
break_even_trigger: 'atr_tier1_price # 1.5R 도달 시 손절선 → 본절 상향'
output:
field: take_profit_ladder_v2
unit: object
rules:
core:
tier_1:
price_expression: max(average_cost * 1.15, average_cost + atr20 * 1.5)
quantity_expression: floor(quantity * 0.25)
action_on_trigger: 25% 익절 + 손절선 본절(average_cost)로 즉시 상향
rationale: 1.5R 이상이면 리스크 무위험 상태 전환. 고정% 최저선 +15% 보장.
tier_2:
price_expression: max(average_cost * 1.25, average_cost + atr20 * 3.0)
quantity_expression: floor((quantity - tier_1_quantity) * 0.40)
action_on_trigger: 40% 추가 익절
rationale: 3.0R = 확실한 수익 구간. 고정% 최저선 +25% 보장.
tier_3:
price_expression: TRAILING_STOP_PRICE_V1
quantity_expression: quantity - tier_1_quantity - tier_2_quantity
action_on_trigger: 잔여 전량 trailing으로 추세 끝단까지 보유
satellite:
tier_1:
price_expression: max(average_cost * 1.10, average_cost + atr20 * 1.5)
quantity_expression: floor(quantity * 0.33)
action_on_trigger: 33% 익절 + 손절선 본절 상향. 잔여 67% 추세 추종.
rationale: '위성 50% 즉시 익절(V1)은 단기 익절 편향. V2에서 33%로 조정하여 중장기 추세 추종 원칙에 부합.
1.5R이면 무위험 상태로 전환 후 보유 연장.
'
tier_2:
price_expression: max(average_cost * 1.20, average_cost + atr20 * 3.0)
quantity_expression: floor((quantity - tier_1_quantity) * 0.50)
action_on_trigger: 50% 추가 익절
tier_3:
price_expression: TRAILING_STOP_PRICE_V1 or time_stop
quantity_expression: quantity - tier_1_quantity - tier_2_quantity
action_on_trigger: 잔여 전량 trailing or time_stop 청산
missing_policy:
atr20: 'TAKE_PROFIT_LADDER_V1 fallback. DATA_MISSING_ATR 태그 출력. fixed_pct
가격만 산출 (tier_1: +10%/+15%, tier_2: +20%/+25%).
'
average_cost: NO_TAKE_PROFIT_PRICE
quantity: NO_TAKE_PROFIT_QUANTITY
output_columns:
- 계좌
- 종목명
- 평단(원)
- ATR20(원)
- 1R(%)
- tier_1_ATR가격
- tier_1_고정%가격
- tier_1_최종가격(max)
- tier_1_수량
- tier_2_ATR가격
- tier_2_고정%가격
- tier_2_최종가격(max)
- tier_2_수량
- tier_3_기준가(원)
- 잔여수량
canonical_ref: spec/exit/take_profit.yaml:take_profit.tiered_ladder
version: 2026-05-18_ADVANCED_EXIT_V2
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
PEG_SCORE_V1:
purpose: 코스닥 종목의 ForwardPER을 EPS 3개년 성장률로 나눠 밸류에이션 타당성 판정. 고PER이라도 고성장이 뒷받침되면
허용.
applicable: 코스닥 상장 종목에만 실행. KOSPI 종목은 이 공식 미적용.
inputs:
- field: forward_pe
unit: ratio
source: spec/12_field_dictionary.yaml:field_dictionary.forward_pe
- field: eps_growth_3y_cagr_pct
unit: percent
source: '컨센서스 3개년 EPS CAGR (예: 30% → 30 입력)'
- field: sector_median_forward_pe
unit: ratio
source: spec/12_field_dictionary.yaml:field_dictionary.sector_median_forward_pe
derived_fields:
peg: forward_pe / eps_growth_3y_cagr_pct
rules:
- if: peg <= 1.5
result: PASS
valuation_gate: OK
quantity_modifier: 1.0
- if: 1.5 < peg <= 2.5
result: CAUTION
valuation_gate: CAUTION
quantity_modifier: 0.7
- if: peg > 2.5
result: REJECT
valuation_gate: REJECT
quantity_modifier: 0.0
fallback:
condition: eps_growth_3y_cagr_pct == DATA_MISSING OR eps_growth_3y_cagr_pct
<= 0
rules:
- if: forward_pe <= sector_median_forward_pe * 2.0
result: PASS
quantity_modifier: 1.0
- if: forward_pe <= sector_median_forward_pe * 3.0
result: CAUTION
quantity_modifier: 0.7
- if: forward_pe > sector_median_forward_pe * 3.0
result: REJECT
quantity_modifier: 0.0
prohibition: EPS 성장률 추정·보간으로 PEG 계산 금지 — 확정 컨센서스 없으면 fallback만 허용
output:
field: peg_gate_result
unit: enum [PASS, CAUTION, REJECT]
required_fields:
- peg
- peg_gate_result
- quantity_modifier
- valuation_gate
missing_policy:
forward_pe: fallback 규칙 적용. DATA_MISSING 표기.
sector_median_forward_pe: fallback 분자 기준 미산출 → CAUTION 보수 처리.
canonical_ref: spec/strategy/stock_model.yaml:stock_model.kosdaq_valuation_gate
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
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
FINANCIAL_HEALTH_SCORE_V1:
purpose: 'ROE·영업이익률·부채비율·FCF를 결합해 종목의 재무 건전성을 0~20점으로 정량화. 수급·모멘텀 중심 편향을 보완하는
펀더멘털 축. 연간 기준 재무 데이터 사용.
'
inputs:
- field: roe_pct
unit: percent
optional: true
- field: operating_margin_pct
unit: percent
optional: true
- field: debt_to_equity
unit: ratio
optional: true
- field: fcf_b
unit: KRW_100M
optional: true
- field: sector_type
unit: enum
optional: true
note: 금융업(financial) 여부 — D/E 스코어링 건너뜀 판단
components:
profitability:
max_points: 8
source_field: roe_pct
rules:
- if: roe_pct >= 15
points: 8
- if: 10 <= roe_pct < 15
points: 5
- if: 5 <= roe_pct < 10
points: 2
- if: 0 <= roe_pct < 5
points: 0
- if: roe_pct < 0
points: -5
label: 수익성_훼손_페널티
missing_rule: 4pt 중립 처리 (DATA_MISSING_PROFITABILITY 태그)
operating_efficiency:
max_points: 7
source_field: operating_margin_pct
rules:
- if: operating_margin_pct >= 20
points: 7
- if: 10 <= operating_margin_pct < 20
points: 4
- if: 0 <= operating_margin_pct < 10
points: 2
- if: operating_margin_pct < 0
points: 0
label: 영업적자_HF007_발동
missing_rule: 3pt 중립 처리
financial_stability:
max_points: 5
source_field: debt_to_equity
financial_sector_skip: true
rules:
- if: debt_to_equity < 50
points: 5
- if: 50 <= debt_to_equity < 100
points: 3
- if: 100 <= debt_to_equity < 200
points: 1
- if: 200 <= debt_to_equity <= 400
points: 0
- if: debt_to_equity > 400
points: 0
label: 극단_부채_HF008_발동
missing_rule: 2pt 중립 처리
cash_generation:
max_points: 5
source_field: fcf_b
rules:
- if: fcf_b > 0
points: 5
label: 현금_창출
- if: fcf_b <= 0
points: 0
label: 현금_소각_또는_부재
missing_rule: 2pt 중립 처리
expression: "clamp(\n profitability_pts + operating_efficiency_pts +\n financial_stability_pts\
\ + cash_generation_pts,\n min=-5, max=20\n)\n"
output:
field: financial_health_score
unit: points_neg5_to_20
score_interpretation:
18_to_20: 재무 최우량 — ROE 높고 부채 낮고 FCF 창출
12_to_17: 재무 양호
6_to_11: 재무 보통 — 일부 약점 존재
0_to_5: 재무 취약 — 수급 강세여도 진입 신중
negative: 재무 훼손 — 영업적자 또는 ROE 음수. 수급 점수 불문 등급 하향 압력
missing_policy:
all_inputs_missing: 'financial_health_score = 8pt (전체 중립). DATA_MISSING_FHS
태그 필수. 재무 데이터 미제공 자체를 패널티로 처리하지 않음. 단, 코스닥 종목은 all_missing 시 6pt (더 보수적)
적용.
'
partial_missing: 각 컴포넌트별 missing_rule 적용 후 합산
sector_exception:
financial_sector:
definition: 은행·보험·증권·카드·캐피탈·리츠 등 금융업 SIC 분류
treatment: 'debt_to_equity 컴포넌트 건너뜀. financial_stability_pts = 3pt 기본값.
ROE·Operating_Margin·FCF 컴포넌트는 동일 적용.
'
canonical_ref: spec/08_scoring_rules.yaml:strategy_score.financial_health
version: 2026-05-18_FINANCIAL_HEALTH_V1
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
RS_MOMENTUM_V1:
purpose: 상대강도(RS)와 수급 가속도를 측정하여 상투 진입 방지 및 후발주(Laggard) 조기 식별
inputs:
- field: close_price
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: avg_trade_value_5d
unit: KRW
- field: avg_trade_value_20d
unit: KRW
- field: relative_strength_1m_percentile
unit: percentile
derived_fields:
disparity_20d: close_price / ma20
momentum_acceleration: avg_trade_value_5d / avg_trade_value_20d
rules:
- if: disparity_20d > 1.15
action: TRIGGER_HF009_BLOCK
label: 이격도_과열(상투)
- if: momentum_acceleration < 0.8 AND close_price > ma20
action: TRIM_WARNING
label: 수급_가속도_둔화(설거지_경계)
- if: relative_strength_1m_percentile > 70
action: LAGGARD_SELL_PRIORITY_1
label: 상대강도_최하위(우선감축)
output:
field: alpha_shield_status
unit: enum
OVERSOLD_DELAY_V1:
purpose: 현금 확보 시 '지하실 매도(패닉 셀)' 방지를 위한 데드캣 바운스 대기 알고리즘
inputs:
- field: rsi_14
unit: points
optional: true
- field: current_price
unit: KRW_per_share
- field: cash_shortfall_krw
unit: KRW
rules:
- condition: rsi_14 < 30 AND cash_shortfall_krw > 0
action: 전량 시장가 매도 금지. 25%만 TRIM 실행하고 잔여 수량은 단기 반등(+3% 이상) 시점까지 매도 유예.
label: 과매도_분할탈출(Staged Exit)
output:
field: oversold_exit_strategy
unit: string
DIVERGENCE_SCORE_V1:
purpose: '가격이 MA20 위로 상승하는 국면에서 외국인·기관이 동반 이탈하고 flow_credit이 낮으면 개인이 받아주는 취약한
구조임을 0~1 점수로 계량화. 코스피 상승 중에도 경고가 나와야 하는 핵심 선제 레이더.
'
applicable: 보유 종목 분석 시 항상 실행. 매수/매도 요청 불문.
inputs:
- field: close_price
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: frg_5d_sh
unit: shares
- field: inst_5d_sh
unit: shares
- field: flow_credit
unit: ratio_0_1
note: FLOW_CREDIT_V1 결과
- field: frg_20d_sh
unit: shares
optional: true
note: 존재 시 추세 확인 가중치 상향
derived_flags:
price_above_ma20: 1 if close_price > ma20 else 0
foreign_net_sell: 1 if frg_5d_sh < 0 else 0
institution_net_sell: 1 if inst_5d_sh < 0 else 0
flow_quality_low: 1 if flow_credit < 0.40 else 0
expression: "divergence_score = price_above_ma20 *\n (foreign_net_sell * 0.40\
\ + institution_net_sell * 0.30 + flow_quality_low * 0.30)\n"
output:
field: divergence_score
unit: ratio_0_1
gates:
- if: divergence_score >= 0.70
status: DIVERGENCE_ALERT
note: 20D 동반 이탈 확인 시 임계값 0.60으로 하향
- if: 0.40 <= divergence_score < 0.70
status: DIVERGENCE_CAUTION
- if: divergence_score < 0.40 OR price_above_ma20 == 0
status: PASS
missing_policy:
frg_5d_sh: W1 DATA_MISSING. 레이더 결과 무효.
inst_5d_sh: foreign_net_sell만 사용 (inst 가중치 0 처리)
flow_credit: FLOW_CREDIT_V1 먼저 실행 후 재시도
frg_20d_sh: DATA_MISSING 시 5D 기준만 적용. 임계값 0.70 유지.
canonical_ref: spec/exit/proactive_exit_radar.yaml:divergence_alert
version: 2026-05-19_PROACTIVE_RADAR_V1
OVERHANG_PRESSURE_V1:
purpose: '외국인 매도 속도가 최근 20D 평균 대비 급가속하면서 거래대금이 감소하면 오버행(대기 매도 물량) 누적으로 가격 지지
실패 가능성을 사전 경고.
'
applicable: 보유 종목 분석 시 항상 실행.
inputs:
- field: frg_5d_sh
unit: shares
- field: frg_20d_sh
unit: shares
optional: true
- field: volume
unit: shares
- field: avg_volume_5d
unit: shares
- field: flow_credit
unit: ratio_0_1
optional: true
derived_flags:
selling_acceleration:
with_20d: 'frg_5d_sh < 0 AND frg_20d_sh < 0 AND frg_5d_sh < (frg_20d_sh
/ 4) * (-1.5)
'
without_20d_fallback: 'frg_5d_sh < -500000 # 절대값 기준 임시 적용 OR flow_credit
< 0.30
'
volume_weakness: volume < avg_volume_5d * 0.80
overhang_score:
expression: '(selling_acceleration ? 0.60 : 0) + (volume_weakness ? 0.40 :
0)'
output:
field: overhang_score
unit: ratio_0_1
gates:
- if: overhang_score >= 1.00
status: OVERHANG_ALERT
note: 매도 가속 + 거래대금 감소 동시 발생
- if: overhang_score >= 0.60
status: OVERHANG_CAUTION
note: 둘 중 하나만 발생
- if: overhang_score < 0.60
status: PASS
missing_policy:
frg_5d_sh: W2 DATA_MISSING. 레이더 결과 무효.
avg_volume_5d: volume_weakness=false 처리 (보수적)
frg_20d_sh: DATA_MISSING 시 fallback 기준 적용
cross_alert:
rule: W1_DIVERGENCE_ALERT + W2_OVERHANG_ALERT 동시 → CRITICAL_ALERT 상향
output_tag: '[W1+W2_CRITICAL_ALERT]'
canonical_ref: spec/exit/proactive_exit_radar.yaml:overhang_warning
version: 2026-05-19_PROACTIVE_RADAR_V1
SECTOR_ROTATION_RADAR_V1:
purpose: '보유 섹터의 SmartMoney 5D 점수가 -0.5 이하로 하락하고 타 섹터로 자금이 이동하는 로테이션 초기 신호를
포착한다. 주가 꺾임보다 2~4주 선행하는 수급 선행 지표.
'
applicable: 보유 종목의 sector_flow 데이터 존재 시 실행.
inputs:
- field: sector_smartmoney_5d
unit: normalized_score
source: sector_flow 탭 — 보유 종목 섹터
- field: sector_rank
unit: integer
optional: true
note: 이전 주 대비 순위 변화
- field: sector_top2_names
unit: list
optional: true
note: 자금 유입 상위 2개 섹터
derived_flags:
held_sector_outflow: sector_smartmoney_5d < -0.50
rank_deterioration: sector_rank가 이전 주 대비 2단계 이상 하락
rotation_destination: sector_top2_names에 보유 종목 섹터 없음
gates:
- if: held_sector_outflow AND (rank_deterioration OR rotation_destination)
status: ROTATION_ALERT
note: 선제 TRIM 최적 시점. tier_1 익절 미실행 즉시 검토.
- if: held_sector_outflow AND NOT rank_deterioration AND NOT rotation_destination
status: ROTATION_CAUTION
note: 초기 신호. 다음 5D 업데이트 후 재확인.
- if: NOT held_sector_outflow
status: PASS
output:
field: rotation_radar_status
unit: enum
missing_policy:
sector_flow_missing: W3 DATA_MISSING. sector_flow 탭 점검 권고.
cross_alert:
rule: W3_ROTATION_ALERT + (W1 OR W2 ALERT) 동시 → CRITICAL_ALERT
output_tag: '[W3+CRITICAL_ALERT: 섹터 로테이션 + 수급 이탈 동시. 익절 최적 시점.]'
canonical_ref: spec/exit/proactive_exit_radar.yaml:sector_rotation_radar
version: 2026-05-19_PROACTIVE_RADAR_V1
MEAN_REVERSION_GATE_V1:
purpose: '주가가 MA20 대비 과도하게 상승하면 신규 매수를 하드 블록한다. 에너지 분산(Distribution) 구간에서의 추격
매수(상투 잡기)를 원천 봉쇄.
'
applicable: 매수 주문 생성 전 항상 실행.
inputs:
- field: close_price
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
expression: deviation_ratio = close_price / ma20
output:
field: deviation_ratio
unit: ratio
gates:
- if: deviation_ratio >= 1.15
status: BUY_HARD_BLOCK
rule_id: MRG001
note: HF009_OVEREXTENSION_BLOCK 연동
- if: 1.10 <= deviation_ratio < 1.15
status: BUY_CAUTION
rule_id: MRG001_SOFT
note: 과열 접근 -- 신규 매수 강도 축소
- if: deviation_ratio < 1.10
status: PASS
missing_policy:
ma20: MRG001 DATA_MISSING. MA20 데이터 필요. 매수 보류.
canonical_ref: spec/08_scoring_rules.yaml:hard_filters.HF009_OVEREXTENSION_BLOCK
version: 2026-05-19_ALPHA_SHIELD_V1
FLOW_ACCELERATION_V1:
purpose: '가격 상승 중 외국인 매수 강도가 20D 평균 대비 급격히 둔화되는 에너지 소진(Distribution) 초기 신호를
포착. W1보다 선행. W1(방향 전환) 이전에 설거지 구간을 조기 경고.
'
applicable: 보유 포지션 분석 시 항상 실행. W1/W2/W3와 동시.
inputs:
- field: frg_5d_sh
unit: shares
note: 외국인 5D 순매수
- field: frg_20d_sh
unit: shares
note: 외국인 20D 누적 순매수
- field: close_price
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
derived_flags:
buy_energy_20d_avg: 'frg_20d_sh / 4 # 20D 평균의 5D 기대값'
flow_accel_ratio: frg_5d_sh / buy_energy_20d_avg (>0인 경우)
price_above_ma20: 1 if close_price > ma20 else 0
gates:
- if: price_above_ma20 AND frg_5d_sh > 0 AND flow_accel_ratio < 0.50
status: FLOW_DECEL_WARNING
note: 매수 에너지 20D 평균 절반 미만. 설거지 초기. W1과 동시 발화 시 CRITICAL_ALERT.
- if: price_above_ma20 AND frg_5d_sh <= 0
status: W1_DOMAIN
note: 순매도 전환 -- W1 DIVERGENCE_SCORE_V1 처리
- if: NOT price_above_ma20 OR buy_energy_20d_avg <= 0
status: PASS
output:
field: flow_acceleration_status
unit: enum
cross_alert:
rule: FLOW_DECEL_WARNING + W1_DIVERGENCE_ALERT -> CRITICAL_ALERT
output_tag: '[W4+W1_CRITICAL: 설거지 에너지 소진 + 수급 이탈 동시]'
missing_policy:
frg_20d_sh: W4 DATA_MISSING. 가속도 산출 불가.
frg_5d_sh: W4 DATA_MISSING.
canonical_ref: spec/exit/proactive_exit_radar.yaml:flow_acceleration_radar
version: 2026-05-19_ALPHA_SHIELD_V1
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
ECP_RISK_SCALE_V1:
purpose: 총자산 곡선(Equity Curve) 모멘텀에 따른 리스크 예산 자동 조절
inputs:
- field: total_asset
unit: KRW
- field: total_asset_ma10
unit: KRW
note: 10일 자산 이동평균
rules:
- if: total_asset < total_asset_ma10
action: RISK_BUDGET_HALVE
label: 자산곡선_역배열_방어
- if: total_asset >= total_asset_ma10
action: RISK_BUDGET_NORMAL
label: 자산곡선_정배열_정상
output:
field: equity_curve_status
unit: enum
RS_RATIO_V1:
purpose: '종목의 5D 수익률을 KOSPI 5D 수익률로 나눠 상대강도(RS)를 계산한다. sell_priority_engine의
rw_ge_4_or_rs_laggard 판정 공식. RS 강세 종목(rs_ratio >= 1.20)은 손실 중에도 매도 후순위로 보호.
'
applicable: 매도 후보 종목 분석 시 항상 실행.
inputs:
- field: stock_close_5d_return
unit: ratio
note: (close - close_5d_ago) / close_5d_ago
- field: kospi_close_5d_return
unit: ratio
note: KOSPI 기준 동일 계산
expression: 'rs_ratio = stock_close_5d_return / kospi_close_5d_return (kospi_close_5d_return
== 0 이면 1.0 처리)
'
output:
field: rs_ratio
unit: ratio
gates:
- if: rs_ratio >= 1.20
status: RS_LEADER
note: 시장 대비 20%+ 강세. sell_priority 보호. core_quality_protection에 준하는 후순위.
- if: 0.80 <= rs_ratio < 1.20
status: RS_NEUTRAL
- if: rs_ratio < 0.80
status: RS_LAGGARD
note: '시장 대비 20%+ 약세. rw_ge_4_or_rs_laggard: 35점 발동.'
missing_policy:
stock_close_5d_return: RS_LAGGARD=false (보수적). 데이터 확보 후 재산출.
kospi_close_5d_return: RS_LAGGARD=false (보수적).
canonical_ref: spec/risk/portfolio_exposure.yaml:sell_priority_engine.components.weakness_points
version: 2026-05-19_ALPHA_SHIELD_V1
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
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
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
RS_VERDICT_V1:
purpose: '종목의 10일 수익률을 KOSPI 10일 수익률과 비교해 초과 수익률(excess_ret_10d)을 계산하고 LEADER/MARKET/LAGGARD/BROKEN
4단계 판정을 내린다. composite_verdict, SFG_V1, RAG_V1의 선행 입력으로 사용된다.
'
applicable: 매 buildTickerRow_ 실행 시 _addTickerGates_ 내에서 계산. LLM 재계산 금지.
inputs:
- field: price.ret10D
unit: pct
note: 종목 10일 수익률
- field: globalKospiRet10D_
unit: pct
note: KOSPI 10일 수익률 (preReads)
- field: rw_partial
unit: int_0_5
note: 상대약세 청산 신호 합계
- field: flow_credit
unit: ratio_0_1
note: FLOW_CREDIT_V1 결과
derived:
excess_ret_10d: (price.ret10D - globalKospiRet10D_) if both available else
null
gates:
- if: excess_ret_10d < -10 AND rw_partial >= 3
verdict: BROKEN
note: 구조적 이탈
- if: excess_ret_10d < -3 OR (excess_ret_10d < 0 AND rw_partial >= 3)
verdict: LAGGARD
note: 시장 대비 약세
- if: excess_ret_10d > 3 AND flowCredit >= 0.6
verdict: LEADER
note: 시장 대비 강세
- if: otherwise
verdict: MARKET
note: 시장 중립
output:
field: rs_verdict
unit: enum [LEADER, MARKET, LAGGARD, BROKEN, UNKNOWN]
additional_fields:
- excess_ret_10d
missing_policy:
price.ret10D: rs_verdict = UNKNOWN. composite_verdict = WATCH_CANDIDATE.
globalKospiRet10D_: rs_verdict = UNKNOWN.
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 뉴스·차트 감각으로 rs_verdict를 LEADER로 상향 금지
- rs_verdict = BROKEN 종목을 'RS가 곧 회복될 것'으로 임의 완화 금지
canonical_ref: spec/risk/portfolio_exposure.yaml:sell_priority_engine.weakness_points
version: 2026-05-21_CLA_HARNESS_V1
COMPOSITE_VERDICT_V1:
purpose: 'SS001 등급(A/B/C/D)과 rs_verdict(LEADER/MARKET/LAGGARD/BROKEN/UNKNOWN)를
결합해 종목의 최종 포지션 판정을 내린다. LLM이 "좋아 보인다"류 언어적 판단으로 판정을 변경하는 것을 구조적으로 방지한다.
'
applicable: _addTickerGates_ 내에서 SS001 계산 직후 실행.
inputs:
- field: ss001_grade
unit: enum [A,B,C,D]
- field: rs_verdict
unit: enum [LEADER,MARKET,LAGGARD,BROKEN,UNKNOWN]
matrix: 'GRADE LEADER MARKET LAGGARD BROKEN UNKNOWN
A PRIME_CANDIDATE PRIME_CANDIDATE WATCH_CANDIDATE EXIT_REVIEW WATCH_CANDIDATE
B PRIME_CANDIDATE WATCH_CANDIDATE REDUCE_CANDIDATE EXIT_REVIEW WATCH_CANDIDATE
C WATCH_CANDIDATE REDUCE_CANDIDATE REDUCE_CANDIDATE CLOSE_POSITION REDUCE_CANDIDATE
D REDUCE_CANDIDATE REDUCE_CANDIDATE CLOSE_POSITION CLOSE_POSITION REDUCE_CANDIDATE
'
output:
field: composite_verdict
unit: enum [PRIME_CANDIDATE, WATCH_CANDIDATE, REDUCE_CANDIDATE, EXIT_REVIEW,
CLOSE_POSITION]
action_guidance:
PRIME_CANDIDATE: 코어 유지·추가. RAG_V1 PASS 시 위성 추가 허용.
WATCH_CANDIDATE: 현재 비중 유지. 추가매수 보류.
REDUCE_CANDIDATE: 분할 축소. 5% 이상 비중이면 TRIM 실행.
EXIT_REVIEW: 다음 반등 시 전량 매도 준비.
CLOSE_POSITION: 즉시 정리. calcFinalDecision_ SELL 강제 검토.
missing_policy:
ss001_grade: composite_verdict = WATCH_CANDIDATE (보수적)
rs_verdict: UNKNOWN 컬럼으로 처리
ground_truth: harness
llm_allowed: cite_only
prohibition:
- composite_verdict = CLOSE_POSITION인 종목을 LLM이 'HOLD도 무방'으로 서술 금지
- composite_verdict 없이 종목 정리 우선순위 결정 금지
canonical_ref: spec/13_formula_registry.yaml:RS_VERDICT_V1
version: 2026-05-21_CLA_HARNESS_V1
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
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
BENCHMARK_RELATIVE_TIMESERIES_V1:
purpose: '종목을 KOSPI 기준 시계열로 평가해 초과낙폭, 반등 회복률, 하락장 베타, RS선 기울기와 brt_verdict를
결정론적으로 산출한다. LLM은 값 인용만 가능하다.
'
applicable: _addTickerGates_에서 RS_VERDICT_V2 이전 실행. 과거 가격 배열이 없으면 RET20/RET60
기반 프록시임을 method에 남긴다.
inputs:
- field: price.ret5D
unit: pct
- field: price.ret20D
unit: pct
- field: price.ret60D
unit: pct
- field: price.close
unit: KRW_per_share
- field: high52w
unit: KRW_per_share
optional: true
- field: globalKospiRet5D_
unit: pct
- field: globalKospiRet20D_
unit: pct
- field: globalKospiRet60D_
unit: pct
- field: globalKospiDrawdown_
unit: pct
derived:
stock_drawdown_from_high_pct: if high52W>0 then max(0,(1-close/high52W)*100)
else null
excess_drawdown_pctp: stock_drawdown_from_high_pct - globalKospiDrawdown_
recovery_ratio_5d: price.ret5D / globalKospiRet5D_ if globalKospiRet5D_ >
0 else null
recovery_ratio_20d: price.ret20D / globalKospiRet20D_ if globalKospiRet20D_
> 0 else null
downside_beta: price.ret20D / globalKospiRet20D_ if globalKospiRet20D_ < 0
else null
rs_ratio_5d: price.ret5D / globalKospiRet5D_ if globalKospiRet5D_ != 0 else
null
rs_ratio_20d: price.ret20D / globalKospiRet20D_ if globalKospiRet20D_ != 0
else null
rs_ratio_60d: price.ret60D / globalKospiRet60D_ if globalKospiRet60D_ != 0
else null
rs_line_20d_slope: (rs_ratio_20d - rs_ratio_5d) / 15 if both available else
(ret20D - k20) / 20
rs_line_60d_slope: (rs_ratio_60d - rs_ratio_20d) / 40 if both available else
(ret60D - k60) / 60
brt_method: RS_RATIO_MULTI_WINDOW_PROXY if rs_ratio_5d and rs_ratio_20d available
else PROXY_FROM_RET20_RET60
verdict_table:
LEADER: excess_drawdown_pctp <= 0 AND recovery_ratio_20d >= 1.20 AND rs_line_20d_slope
> 0
MARKET: excess_drawdown_pctp between -5 and 5 AND recovery_ratio_20d between
0.80 and 1.20
LAGGARD: excess_drawdown_pctp >= 5 OR recovery_ratio_20d < 0.80 OR rs_line_20d_slope
< 0
BROKEN: excess_drawdown_pctp >= 10 AND (recovery_ratio_20d < 0.50 OR rs_line_60d_slope
< 0)
output:
fields:
- stock_drawdown_from_high_pct
- excess_drawdown_pctp
- recovery_ratio_5d
- recovery_ratio_20d
- downside_beta
- rs_ratio_5d
- rs_ratio_20d
- rs_ratio_60d
- rs_line_20d_slope
- rs_line_60d_slope
- brt_verdict
- brt_method
missing_policy: 필수 KOSPI 또는 종목 수익률 누락 시 brt_verdict=UNKNOWN, LLM 대체 계산 금지.
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 excess_drawdown/recovery_ratio/downside_beta/rs_slope를 직접 계산 금지
- brt_verdict=BROKEN 종목을 낙폭과대 매수 기회로 서술 금지
version: 2026-05-21_BRT_V1_C2
RS_VERDICT_V2:
purpose: RS_VERDICT_V1과 BENCHMARK_RELATIVE_TIMESERIES_V1의 brt_verdict를 보수적으로
융합한다.
applicable: BRT_V1 직후. 기존 rs_verdict 필드명은 최종 V2 결과로 유지하고 rs_verdict_v1_raw를
감사용 보존.
inputs:
- field: rs_verdict_v1_raw
unit: enum
- field: brt_verdict
unit: enum [LEADER,MARKET,LAGGARD,BROKEN,UNKNOWN]
fusion_logic:
BROKEN: rs_verdict_v1_raw=BROKEN OR brt_verdict=BROKEN
LAGGARD: rs_verdict_v1_raw=LAGGARD OR brt_verdict=LAGGARD, 단 BROKEN 아님
LEADER: rs_verdict_v1_raw=LEADER AND brt_verdict=LEADER
MARKET: 그 외
special_cases:
- brt_verdict=LEADER AND rs_verdict_v1_raw=LAGGARD -> MARKET
- brt_verdict=BROKEN AND rs_verdict_v1_raw=LEADER -> LAGGARD
output:
field: rs_verdict
additional_fields:
- rs_verdict_v1_raw
- rs_verdict_source
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_RS_VERDICT_V2
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
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
SATELLITE_AGGREGATE_PNL_GATE_V1:
purpose: 위성 합산 평가손익이 코어 수익을 잠식하는 정도를 추적해 위성 전략 실패를 감지한다.
inputs:
- field: position_class
unit: enum [core,satellite]
- field: profit_loss
unit: KRW
computed:
core_total_pnl_krw: sum(profit_loss for core)
satellite_total_pnl_krw: sum(profit_loss for satellite)
satellite_loss_to_core_gain_ratio: abs(min(0,satellite_total_pnl_krw)) / max(core_total_pnl_krw,1)
gates:
PASS: ratio < 0.25
SAPG_ALERT: 0.25 <= ratio < 0.50
SAPG_CRITICAL: ratio >= 0.50
output:
field: sapg_status
additional_fields:
- core_total_pnl_krw
- satellite_total_pnl_krw
- satellite_loss_to_core_gain_ratio
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_SAPG_V1
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
HARNESS_DATA_FRESHNESS_GATE_V1:
purpose: 'harness_context 주요 입력 데이터의 영업일 기준 신선도를 검증한다. 신선도 부족 시 BRT/SAPG/SAQG
결과의 신뢰도 등급을 자동 하향하고 STALE_BLOCK 상태에서 HTS 주문표 생성을 차단한다.
'
applicable: buildHarnessContext_ 가장 먼저 실행 (모든 공식 선행).
inputs:
- field: metadata.generated_at
unit: datetime
- field: metadata.market_date
unit: date
- field: today_date
unit: date
computed:
data_age_business_days: business_days_diff(today_date, metadata.market_date)
freshness_status:
FRESH:
condition: data_age_business_days <= 1
note: 정상
STALE_1D:
condition: data_age_business_days == 2
harness_impact: brt_method에 STALE_1D 태그
STALE_WARN:
condition: data_age_business_days IN [3,4]
harness_impact: brt_verdict LOW, ELIGIBLE -> WATCHLIST_ONLY
STALE_BLOCK:
condition: data_age_business_days >= 5
harness_impact: brt_verdict=DATA_STALE_BLOCKED, HTS 주문표 생성 금지
output:
field: data_freshness_status
additional_fields:
- data_age_business_days
- freshness_degraded_gates
ground_truth: harness
llm_allowed: cite_only
prohibition:
- STALE_BLOCK 상태에서 BRT 결과로 주문 생성 금지
- LLM이 신선도를 임의 판단하거나 사용 가능으로 완화 금지
version: 2026-05-21_HDFG_V1
SATELLITE_LIFECYCLE_GATE_V1:
purpose: '위성 종목에 WATCH/PILOT/CONFIRMED/REVIEW/EXIT 5단계 라이프사이클을 부여한다. 각 단계는 전환
조건, 허용 액션, 보유 기준이 명확히 다르다. 이진 CORE/SATELLITE 분류를 확장하며 기존 분류와 병렬 적용.
'
applicable: _addTickerGates_ 내 COMPOSITE_VERDICT_V1 이후 실행.
inputs:
- field: ticker
unit: string
- field: composite_verdict
unit: enum
- field: brt_verdict
unit: enum
- field: excess_drawdown_pctp
unit: pct_points
- field: entry_date
unit: date
- field: alpha_evaluation_window_json
unit: array
optional: true
output:
field: satellite_lifecycle_stage
additional_fields:
- lifecycle_transition_reason
- lifecycle_days_in_stage
- review_warning
lifecycle_stages:
WATCH:
definition: 관심종목. 미투자. SAQG_V1 ELIGIBLE 미달.
transition_to_PILOT: saqg_v1=ELIGIBLE AND rag_v1=PASS AND brt_verdict IN
[LEADER,MARKET]
allowed_actions:
- WATCH
PILOT:
definition: 소액 파일럿. T1 트랜치 30% 진입.
transition_to_CONFIRMED: t20_vs_core_pctp >= 0 AND brt_verdict=LEADER AND
composite_verdict=PRIME_CANDIDATE
transition_to_REVIEW: t5_alpha_gate=alpha_negative 연속2회 OR brt_verdict=LAGGARD
OR excess_drawdown_pctp > 8
allowed_actions:
- HOLD_PILOT
- ADD_T2_IF_CONFIRMED
CONFIRMED:
definition: 알파 검증됨. 정규 비중 편입.
transition_to_REVIEW: t20_vs_core_pctp < -5 OR brt_verdict=LAGGARD OR composite_verdict=REDUCE_CANDIDATE
allowed_actions:
- HOLD
- ADD_T2
- ADD_T3
- PARTIAL_TP
REVIEW:
definition: 알파 훼손. 감시, 축소 모드.
transition_to_CONFIRMED: brt_verdict=LEADER 연속2주 AND composite_verdict=PRIME_CANDIDATE
transition_to_EXIT: brt_verdict=BROKEN OR composite_verdict=CLOSE_POSITION
OR t20_vs_core_pctp < -10 OR excess_drawdown_pctp >= 15
forced_reduce: 4주 이상 REVIEW 시 비중 50% 감축 권고
allowed_actions:
- HOLD_REDUCED
- TRIM_ON_REBOUND
- NO_ADD
EXIT:
definition: 정리 확정. 다음 반등 시 전량 청산.
allowed_actions:
- FULL_EXIT_ON_TRIGGER
- STAGED_EXIT
prevent: EXIT 진입 후 LLM이 단계 복귀 금지
output_fields:
- field: satellite_lifecycle_stage
unit: enum [WATCH,PILOT,CONFIRMED,REVIEW,EXIT]
- field: lifecycle_transition_reason
unit: string
- field: lifecycle_days_in_stage
unit: int
hard_rules:
- EXIT 단계 종목에 신규 ADD/BUY 금지
- REVIEW 단계 종목에 T3 트랜치 진입 금지
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 lifecycle_stage 임의 격상 금지
- EXIT -> CONFIRMED 복귀는 하네스 재산출 후만 가능
version: 2026-05-21_SLG_V1
CLA_REGIME_EXIT_CONDITION_V1:
purpose: 'CONCENTRATED_LEADER_ADVANCE 국면의 종료 조건을 결정론적으로 탐지한다. CLA 활성 중에도 하네스가
주기적으로 종료 신호(S1~S5)를 스캔한다. 종료 조건 충족 시 market_regime을 CLA -> NEUTRAL 전환 권고.
'
applicable: buildHarnessContext_ 내 market_regime=CLA일 때만 실행.
inputs:
- field: ticker
unit: string
- field: rs_verdict
unit: enum
- field: brt_verdict
unit: enum
- field: frg_5d_sh
unit: shares
- field: volume
unit: shares
- field: avg_volume_5d
unit: shares
- field: market_regime
unit: string
output:
field: cla_exit_status
additional_fields:
- cla_exit_signals_triggered
- cla_exit_total_weight
exit_signals:
S1_rs_degradation:
condition: (삼성전자 OR SK하이닉스 rs_verdict=LAGGARD) 연속5영업일
weight: 3
S2_kospi_contribution_drop:
condition: 삼성전자+SK하이닉스 최근20D KOSPI 기여도 < 30%
weight: 2
S3_foreign_flow_reversal:
condition: 삼성전자 frg_5d_sh < 0 AND SK하이닉스 frg_5d_sh < 0 연속3일
weight: 2
S4_volume_exhaustion:
condition: 삼성전자+SK하이닉스 volume < avgVolume5d*0.6 연속3일
weight: 1
S5_brt_degradation:
condition: 삼성전자 brt_verdict=MARKET AND SK하이닉스 brt_verdict=MARKET (LEADER에서
하락)
weight: 2
exit_decision:
CLA_EXIT_CONFIRMED:
condition: total_weight >= 5
action: market_regime -> NEUTRAL 권고. O2 반도체 25% 상한 재적용.
CLA_EXIT_WARNING:
condition: total_weight IN [3,4]
action: CLA 종료 경보. 위성 신규매수 제한 해제 준비.
CLA_ACTIVE:
condition: total_weight < 3
action: CLA 계속 유지. 기존 보호 규칙 적용.
output_fields:
- field: cla_exit_status
unit: enum [CLA_ACTIVE,CLA_EXIT_WARNING,CLA_EXIT_CONFIRMED]
- field: cla_exit_signals_triggered
unit: list
- field: cla_exit_total_weight
unit: int
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 CLA 종료를 임의 선언 금지
- CLA_EXIT_CONFIRMED 없이 O2 반도체 25% 상한 재적용 금지
version: 2026-05-21_CLA_EXIT_V1
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
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
SELL_PRICE_SANITY_V1:
purpose: 'HTS 입력 전 매도 지정가의 역전, 비현실가, 호가단위 불일치를 100% 차단한다. LS전기(E1 오류) 재발 방지:
지정가 < 손절가 역전 사례를 하네스가 선점 차단.
'
applicable: calcApexExecutionHarness_ 주문 최종 검증 단계. TICK_NORMALIZER_V1 직후 실행.
inputs:
- field: sell_limit_price
unit: KRW_per_share
- field: stop_loss_price
unit: KRW_per_share
- field: current_price
unit: KRW_per_share
- field: tick_unit
unit: KRW_per_share
note: TICK_NORMALIZER_V1 산출값
validation_rules:
INVALID_PRICE_INVERSION:
condition: sell_limit_price < stop_loss_price
action: HTS 주문표 제거. Shadow Ledger 이동. reason_code=INVALID_PRICE_INVERSION.
example: 지정가 261,000 < 손절가 291,000 → 즉시 차단
INVALID_CHASE_UP_SELL:
condition: sell_limit_price > current_price * 1.03
action: 사용자 Override 없이 주문표 제거.
INVALID_TICK:
condition: sell_limit_price % tick_unit != 0
action: TICK_NORMALIZER_V1 자동 재정규화 후 재산출. (HS008 통합)
WARN_DEEP_DISCOUNT_SELL:
condition: sell_limit_price < current_price * 0.90
action: 주문표 유지, 보고서 상단 경고 표시.
output:
field: sell_price_sanity_status
values:
- PASS
- INVALID_PRICE_INVERSION
- INVALID_CHASE_UP_SELL
- INVALID_TICK
- WARN_DEEP_DISCOUNT_SELL
additional_fields:
- sanity_fail_reason
- corrected_limit_price
ground_truth: harness
llm_allowed: cite_only
prohibition:
- INVALID_PRICE_INVERSION 행을 HTS 주문표에 기재 금지
- LLM이 '임시로' 역전 가격을 주문표에 넣는 행위 절대 금지
- TICK 재정규화 전 가격을 HTS에 입력 금지 (HS008)
canonical_ref: AGENTS.md:Direction A1, HS008(TICK_NORMALIZER_V1)
version: 2026-05-22_3RD_HARNESS
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
INTRADAY_ACTION_MATRIX_V1:
purpose: '장중 시각(capture_time)에 따라 허용·금지 액션을 테이블로 고정한다. 09:31 캡처임에도 전체 주간 전략
출력(E4 오류) 재발 방지.
'
applicable: DETERMINISTIC_ROUTING_ENGINE_V1 STAGE 1. capture_time 확정 직후.
inputs:
- field: capture_time
unit: HH:MM
note: account_snapshot에서 자동 추출
- field: market_date
unit: date
time_slot_table:
09:00-09:30:
label: OPEN_AUCTION
allowed_actions:
- WATCH_ONLY
blocked_actions:
- BUY
- SELL
- TRIM
09:30-10:30:
label: EARLY_SESSION
allowed_actions:
- TRIM_ONLY
blocked_actions:
- BUY
- SELL_ALL
note: OVERSOLD_REBOUND_SELL 제외
10:30-14:00:
label: MID_SESSION
allowed_actions:
- TRIM
- STAGED_SELL
- WATCH
blocked_actions:
- BUY_NEW
- SELL_ALL
14:00-15:00:
label: LATE_SESSION
allowed_actions:
- TRIM
- STAGED_SELL
blocked_actions:
- BUY_NEW
- SELL_ALL
15:00-15:20:
label: PRE_CLOSE
allowed_actions:
- TRIM_ONLY
blocked_actions:
- BUY
- SELL_ALL
15:20-15:30:
label: CLOSE_VERIFY
allowed_actions:
- ALL_ACTIONS_ALLOWED
blocked_actions: []
note: 종가 근처 재검증 후 실행. 모든 액션 허용.
15:30+:
label: POST_MARKET
allowed_actions:
- REBALANCING_REVIEW
- NEXT_DAY_PLAYBOOK
blocked_actions:
- HTS_IMMEDIATE_EXECUTION
BEFORE_MARKET:
label: PRE_MARKET
allowed_actions:
- PLAYBOOK_DRAFT
blocked_actions:
- HTS_IMMEDIATE_EXECUTION
output:
fields:
- field: time_slot_label
unit: enum
- field: allowed_intraday_actions
unit: list
- field: blocked_intraday_actions
unit: list
ground_truth: harness
llm_allowed: cite_only
prohibition:
- allowed_intraday_actions[]에 없는 주문 유형을 보고서에 생성 금지
- 09:00-10:30 캡처 시 BUY/SELL_ALL 주문표 생성 금지
- TRIM_ONLY 구간에서 주간 전략·종가 예측 등 전체 보고서 출력 금지 — 해당 섹션은 '15:20 재실행 예정' 표기
canonical_ref: AGENTS.md:Direction A3, Direction 0(장중 제약)
version: 2026-05-22_3RD_HARNESS
ANTI_CHASING_VELOCITY_V1:
purpose: '가격 상승 속도가 국면별 임계값 초과 시 BUY를 결정론적으로 차단한다. N2(거래량 확인)만으로는 막지 못하는 속도
기반 뒷박 매수 원천 차단.
'
applicable: _addTickerGates_ 내 alpha_lead_score 산출 직후.
inputs:
- field: close
unit: KRW_per_share
- field: close_1d_ago
unit: KRW_per_share
- field: close_5d_ago
unit: KRW_per_share
- field: market_regime
unit: enum
computed:
velocity_1d: (close - close_1d_ago) / close_1d_ago * 100
velocity_5d: (close - close_5d_ago) / close_5d_ago * 100
thresholds_by_regime:
EVENT_SHOCK:
v1d_max: 2
v5d_max: 5
verdict: BLOCK_CHASE_SHOCK
RISK_OFF:
v1d_max: 3
v5d_max: 7
verdict: BLOCK_CHASE_RISKOFF
NEUTRAL:
v1d_max: 4
v5d_max: 9
verdict: WARN_CHASE_NEUTRAL
RISK_ON:
v1d_max: 5
v5d_max: 12
verdict: WARN_CHASE_RISKON
CLA:
v1d_max: 6
v5d_max: 15
verdict: WARN_CHASE_CLA
actions:
BLOCK_CHASE: BUY 금지. alpha_lead_score에 -15 페널티 적용.
WARN_CHASE: BUY 주문표에 '속도 추격 경고 — 풀백 대기 권고' 표기.
CLEAR: 정상. 속도 기반 차단 없음.
output:
field: anti_chasing_velocity_status
values:
- BLOCK_CHASE_SHOCK
- BLOCK_CHASE_RISKOFF
- WARN_CHASE_NEUTRAL
- WARN_CHASE_RISKON
- WARN_CHASE_CLA
- CLEAR
additional_fields:
- velocity_1d
- velocity_5d
- velocity_penalty_applied
ground_truth: harness
llm_allowed: cite_only
prohibition:
- BLOCK_CHASE 상태에서 '분위기 좋으니 추격 매수 괜찮다' 우회 서술 금지
- LLM이 velocity 직접 계산 금지 — 하네스 산출값만 인용
canonical_ref: AGENTS.md:Direction B1
version: 2026-05-22_3RD_HARNESS
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
DISTRIBUTION_SELL_DETECTOR_V1:
purpose: 'PRE_DISTRIBUTION_EARLY_WARNING(2신호)의 정밀도 한계 보완. 기관·외인이 개인에게 물량을 넘기는
설거지 구간을 6신호 합산으로 조기 감지.
'
applicable: _addTickerGates_ 내 FLOW_ACCELERATION_V1 직후.
inputs:
- field: close
unit: KRW_per_share
- field: high52w
unit: KRW_per_share
optional: true
- field: avg_volume_5d
unit: shares
- field: volume
unit: shares
- field: ret5d
unit: percent
- field: flow_credit
unit: ratio_0_1
- field: frg_5d_sh
unit: shares
- field: inst_5d_sh
unit: shares
- field: rsi14
unit: score_0_100
optional: true
- field: obv_slope_20d
unit: float
optional: true
signals:
SIG_1:
condition: high52w > 0 AND close >= high52w * 0.97 AND volume < avg_volume_5d
* 0.80
label: 신고가 근접 + 거래량 수축
weight: 2.0
SIG_2:
condition: ret5d >= 5 AND flow_credit < 0.45
label: 5일 급등 + 수급 약화
weight: 2.0
SIG_3:
condition: frg_5d_sh < 0 AND inst_5d_sh < 0
label: 외인+기관 동반 순매도 (3일 연속)
weight: 1.5
SIG_4:
condition: rsi14 != null AND rsi14 >= 75 AND close < open_today
label: RSI 과열 + 당일 음봉
weight: 1.5
SIG_5:
condition: obv_slope_20d != null AND obv_slope_20d < 0
label: OBV 20일 기울기 음수
weight: 1.0
SIG_6:
condition: ret1d_prev >= 5 AND close < open_today * 0.98
label: 전일 급등 후 당일 -2% 갭하락
weight: 1.0
classification:
weighted_sum: sum of (signal.weight for each triggered signal)
DISTRIBUTION_CONFIRMED:
condition: weighted_sum >= 4.0
action: BUY 완전 차단 + TRIM_REVIEW 발동
DISTRIBUTION_WARNING:
condition: weighted_sum >= 2.0 AND weighted_sum < 4.0
action: BUY 보류 권고 + EARLY_WARNING 표기
DISTRIBUTION_CLEAR:
condition: weighted_sum < 2.0
action: 정상 진행
output:
field: distribution_sell_detector_status
values:
- DISTRIBUTION_CONFIRMED
- DISTRIBUTION_WARNING
- DISTRIBUTION_CLEAR
additional_fields:
- weighted_sum
- signals_triggered
ground_truth: harness
llm_allowed: cite_only
prohibition:
- DISTRIBUTION_CONFIRMED 상태에서 LLM '단기 조정이니 괜찮다' 우회 금지
- PRE_DISTRIBUTION_EARLY_WARNING과 독립적으로 둘 다 체크 (OR 아님, AND 독립)
- LLM이 신호 합산을 직접 계산 금지
canonical_ref: AGENTS.md:Direction B3, L4(PRE_DISTRIBUTION)
version: 2026-05-22_3RD_HARNESS
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
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
DETERMINISTIC_ROUTING_ENGINE_V1:
purpose: '"LLM이 먼저 판단 → 하네스가 검증" 구조를 역전. 9단계 라우팅을 고정 순서로 실행하고 LLM은 최종 결과의 보고관으로만
동작. 라우팅 단계 건너뜀 및 순서 변경 절대 금지.
'
applicable: 모든 분석 보고서 생성 최선행. STAGE 0부터 순서대로 실행.
inputs:
- field: harness_context
unit: json
note: 전체 하네스 컨텍스트 — 모든 STAGE 결과 포함
output:
field: routing_execution_log
schema:
- stage: int
status: PASS|BLOCKED|SKIPPED
output_key: string
elapsed_ms: int
routing_stages:
STAGE_0:
name: HARNESS_DATA_FRESHNESS_GATE_V1
action: STALE_BLOCK → 즉시 중단. 보고서 생성 금지. 데이터 갱신 요청만 출력.
STAGE_1:
name: INTRADAY_ACTION_MATRIX_V1
action: capture_time 기반 허용·금지 액션 테이블 확정. TRIM_ONLY 구간이면 간소화 모드.
STAGE_2:
name: PORTFOLIO_HEALTH_SCORE_V1
action: CRITICAL → 긴급 섹션 필수 출력 후 진행.
STAGE_3:
name: RISK_GATE_CHECKLIST (10개 순서 고정)
gates:
- cash_floor_status
- heat_gate_status
- drawdown_guard_state
- portfolio_drawdown_gate
- portfolio_beta_gate+PORTFOLIO_CORRELATION_GATE
- sector_concentration_gate
- semiconductor_cluster_gate
- position_count_gate
- win_loss_streak_state
- single_position_weight_gate
action: BLOCK 있으면 blocked_actions[] 업데이트.
STAGE_4:
name: SELL_GATE_CHECKLIST (5개)
gates:
- stop_breach_gate
- tp_trigger_gate
- DISTRIBUTION_SELL_DETECTOR_V1
- heat_concentration_gate
- regime_transition_type
action: sell_priority_decision_table 생성 (독립 표 필수).
STAGE_5:
name: CASH_RECOVERY (OPTIMIZER + WATERFALL)
action: CASH_RECOVERY_OPTIMIZER_V1 → SELL_WATERFALL_ENGINE_V1 → SELL_PRICE_SANITY_V1.
STAGE_6:
name: BUY_SCREENING (6개 순서 고정)
gates:
- ANTI_CHASING_VELOCITY_V1
- PULLBACK_ENTRY_TRIGGER_V1
- N2_VOLUME_BREAKOUT
- K1_TRANCHE
- RAG+SFG+SATELLITE_LIFECYCLE
- SECTOR_ROTATION+PRE_DISTRIBUTION
action: buy_candidates_json 확정.
STAGE_7:
name: QUANTITY_FINALIZATION
action: ATR20 기반 atr_qty → regime_size_scale × drawdown_buy_scale → TP_QUANTITY_LADDER
→ SELL_PRICE_SANITY 재검증.
STAGE_8:
name: SHADOW_LEDGER_SEPARATION
action: PASS → HTS 주문표. 비PASS → Shadow Ledger (I4 컬럼명 규칙).
STAGE_9:
name: REPORT_ASSEMBLY (LLM)
action: 하네스 결과를 정해진 양식으로 서술. 숫자 1원·1주 변경 금지. LLM_SERVING_CONSTRAINT_V1 적용.
ground_truth: harness
llm_allowed: STAGE_9 보고서 작성만 허용
prohibition:
- STAGE 건너뜀 금지
- STAGE_0 STALE_BLOCK 시 전체 보고서 생성 금지
- STAGE_9에서 LLM이 숫자 변경 금지 — 보고관(Clerk)으로만 동작
canonical_ref: AGENTS.md:Direction D1, Direction Q(QEH)
version: 2026-05-22_3RD_HARNESS
LLM_SERVING_CONSTRAINT_V1:
purpose: 'LLM이 보고서 작성 시 침범 금지 영역 8개를 명시적으로 잠금. HS011 확장판. 30년 실전 전문가의 정밀도는 자유로운
해석이 아닌 규칙 준수에서 나온다.
'
applicable: DETERMINISTIC_ROUTING_ENGINE_V1 STAGE_9 진입 직전 검사.
inputs:
- field: harness_context
unit: json
note: LLM 보고서 생성 전 전체 컨텍스트 검사
output:
field: serving_constraint_check
schema:
violations_detected: list [FB_code]
allowed_actions_taken: list [AL_code]
forbidden_actions:
FB1: 가격·수량 즉석 계산 → DATA_MISSING 표기만 허용 (HS011)
FB2: 하네스 판정 '이번만 예외' 번복
FB3: '''분위기가 좋으니'' 류 감성 서술로 BLOCK 우회'
FB4: rule_id 없는 판단 서술 (근거 공식 ID 없이 결론 금지)
FB5: 매수와 매도를 같은 문단에 연결 서술 (BRT3 재투자 연결 금지)
FB6: 목표 달성률 압박으로 리스크 게이트 완화 서술 (M4 압박 금지)
FB7: 외부 웹 데이터로 prices_json 덮어쓰기 (G3 외부 격리)
FB8: 손절가·익절가 null인 종목에 '보유 유지' 단독 서술
allowed_roles:
AL1: 하네스 결과의 '왜 이 점수인가?' 배경 설명
AL2: 뉴스·이벤트·섹터 흐름 질적 리스크 합성
AL3: '''만약 반도체가 추가 하락하면...'' 시나리오 제시'
AL4: N4 HOLDING_STALE_REVIEW 연동 보유 근거 재확인
ground_truth: harness
llm_allowed: cite_only
prohibition:
- 8개 금지 영역은 어떤 조건에서도 침범 불가
- '위반 항목은 ''[LLM_SERVING_CONSTRAINT: FB{N} 위반]''으로 보고서에 표시'
canonical_ref: AGENTS.md:Direction D2, Direction Q(QEH), HS011
version: 2026-05-22_3RD_HARNESS
PROFIT_RATCHET_TIERED_V2:
purpose: '기존 L2(RATCHET_TRAILING_AUTO_V1)에 APEX_SUPER(+60%+) 구간 신설. 삼성전자 +61.5%(E3
오류) 재발 방지: 단순 ''보유 유지'' 서술 없이 래칫 스탑 필수 표기.
'
applicable: PROFIT_LOCK_STAGE_CLASSIFIER_V1 직후. 수익 구간별 자동 적용.
inputs:
- field: profit_pct
unit: percent
- field: profit_lock_stage
unit: enum
note: PROFIT_LOCK_STAGE_CLASSIFIER_V1 산출
- field: highest_close
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
- field: average_cost
unit: KRW_per_share
- field: quantity
unit: shares
- field: secular_leader_gate_active
unit: boolean
optional: true
ratchet_table_v2:
NORMAL:
trailing_stop: 'null'
tp_ladder_action: 없음
BREAKEVEN_RATCHET:
trailing_stop: average_cost * 1.005 (세후)
tp_ladder_action: 없음
PROFIT_LOCK_10:
trailing_stop: highest_close - 2.5 * atr20
tp_ladder_action: 없음
note: '[신규 V2]'
PROFIT_LOCK_20:
trailing_stop: highest_close - 1.5 * atr20
tp_ladder_action: tp1_qty 확인
PROFIT_LOCK_30:
trailing_stop: highest_close - 1.8 * atr20
tp_ladder_action: tp1+tp2 확인
note: 'V2: 1.8 (V1: 2.0 보다 타이트)'
APEX_TRAILING:
trailing_stop: highest_close - 1.5 * atr20
tp_ladder_action: tp1+tp2 확인
note: 'V2: 1.5 (V1: 2.0 보다 타이트)'
APEX_SUPER:
condition: profit_pct >= 60
trailing_stop: max(ratchet_stop, highest_close - 1.2 * atr20)
tp_ladder_action: 강제 10% 익절 권고 (quantity * 0.10, 매 +10%마다)
llm_obligation: '보고서에 ''APEX_SUPER 구간: trailing_stop=XXX원, 10% 익절 검토'' 필수
표기'
note: '[신규 V2] +60% 초과 종목 전용. 삼성전자 현재 해당.'
SECULAR_LEADER_DEFERRED:
trailing_stop: 'null'
tp_ladder_action: H3 연동 유지
output:
field: auto_trailing_stop_v2
additional_fields:
- ratchet_stage_v2
- apex_super_active
- tp_ladder_qty_v2
ground_truth: harness
llm_allowed: cite_only
prohibition:
- APEX_SUPER 구간 종목에 '보유 유지' 단독 서술 금지 — trailing_stop 병기 필수
- LLM이 trailing_stop을 재계산 금지 — 하네스 산출값 그대로 사용
- SECULAR_LEADER_DEFERRED 구간에서 H3 규칙 무시 금지
canonical_ref: AGENTS.md:Direction E1, L2(RATCHET_TRAILING_AUTO_V1), M3
version: 2026-05-22_3RD_HARNESS
SELL_VALUE_PRESERVATION_TIERED_V2:
purpose: '현금확보 매도 시 ''좋은 매도''와 ''나쁜 매도''를 하네스가 자동 판별. 반등 시 추가 수익까지 고려한 세련된 매도
결정 트리 (K2 + SELL_WATERFALL 통합).
'
applicable: SELL_WATERFALL_ENGINE_V1 이후. 종목별 최적 매도 스타일 확정.
inputs:
- field: emergency_full_sell
unit: boolean
- field: oversold_gate
unit: enum
- field: rsi14
unit: score
- field: profit_lock_stage
unit: enum
- field: velocity_5d
unit: percent
- field: h2_priority_rank
unit: int
- field: rs_verdict
unit: enum
- field: cash_shortfall_min_krw
unit: KRW
- field: waterfall_plan_json
unit: json
decision_tree:
- if: emergency_full_sell == true
verdict: EMERGENCY_EXIT
plan: SELL_WATERFALL stage_4 실행
- elif: oversold_gate == OVERSOLD AND rsi14 < 30
verdict: OVERSOLD_REBOUND_SELL
plan: K2 + SELL_WATERFALL stage_2. rebound_tp_price = prev_close + 1.0 * atr20
- elif: profit_lock_stage IN [PROFIT_LOCK_20, APEX_TRAILING, APEX_SUPER] AND
velocity_5d > 8
verdict: APEX_TRIM
plan: tp_quantity_ladder.tp1_qty 즉시 매도. limit = current - 0.5 * atr20
- elif: h2_priority_rank == 1 AND rs_verdict == BROKEN
verdict: STAGED_EXIT
plan: SELL_WATERFALL stage_1 → stage_2 → stage_3 순서
- elif: cash_shortfall_min_krw > 0
verdict: PRESERVE_TIERED
plan: CASH_RECOVERY_OPTIMIZER_V1 조합 실행
- else: null
verdict: HOLD
plan: 매도 조건 미충족
output:
field: preservation_verdict
additional_fields:
- recommended_plan_ref
- rebound_upside_krw
ground_truth: harness
llm_allowed: cite_only
prohibition:
- decision_tree 순서 임의 변경 금지
- EMERGENCY_EXIT 외 조건에서 전량 즉시 매도 지시 금지
canonical_ref: AGENTS.md:Direction E2, K2, SELL_WATERFALL_ENGINE_V1
version: 2026-05-22_3RD_HARNESS
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
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
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
HORIZON_ALLOCATION_LOCK_V1:
purpose: 단기/중기/장기 투자 버킷별 비중 상한을 적용해 기간 혼재와 과집중을 차단.
inputs:
- field: invest_horizon
unit: enum
optional: true
- field: market_value_krw
unit: KRW
optional: true
- field: total_asset_krw
unit: KRW
output:
field: horizon_allocation_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL53
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
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
FUNDAMENTAL_MULTI_FACTOR_SCORE_V2:
purpose: 이익률/성장률/점유율/현금흐름/부채를 종합 점수화해 매수 허용을 잠금.
inputs:
- field: roe_pct
unit: percent
optional: true
- field: opm_pct
unit: percent
optional: true
- field: revenue_growth_pct
unit: percent
optional: true
- field: op_income_growth_pct
unit: percent
optional: true
- field: market_share_proxy_pct
unit: percent
optional: true
- field: operating_cf_krw
unit: KRW
optional: true
- field: free_cf_krw
unit: KRW
optional: true
- field: debt_ratio_pct
unit: percent
optional: true
output:
field: fundamental_multifactor_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL54
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
MARKET_SHARE_MOMENTUM_PROXY_V1:
purpose: 상대 성장/RS 기반 점유율 모멘텀 프록시를 산출해 공격 매수 여부를 잠금.
inputs:
- field: revenue_growth_pct
unit: percent
optional: true
- field: alpha_lead_score
unit: score
optional: true
output:
field: market_share_proxy_json
llm_allowed: cite_only
version: 2026-05-25_PROPOSAL54
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
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
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
VALUE_PRESERVATION_SCORER_V1:
purpose: '종목별 가치 훼손 점수(value_damage_score 0~100) + 반등 잠재력(rebound_potential
0~100) + 권고 동작(recommended_action)을 결정론 공식으로 산출한다. SCRS-V2 selected_combo의
빈 셀에 주입하여 LLM 자유 해석을 차단한다.
'
inputs:
- field: Close
unit: KRW_per_share
- field: MA20
unit: KRW_per_share
- field: MA60
unit: KRW_per_share
- field: ATR20
unit: KRW_per_share
- field: RSI14
unit: percent
- field: BB_Position
unit: 0to1_scale
- field: Frg_5D
unit: KRW
- field: Inst_5D
unit: KRW
- field: AvgTradeValue_5D_M
unit: KRW_hundred_million
- field: AvgTradeValue_20D_M
unit: KRW_hundred_million
- field: Recovery_Ratio_5D
unit: ratio
- field: Stock_Drawdown_From_High_Pct
unit: percent
output:
field: value_preservation_scorer_v1_json
expected_outputs:
- gate
- distinct_actions
- row_count
llm_allowed: cite_only
version: 2026-05-27_PHASE1
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
RATCHET_TRAILING_GENERAL_V1:
purpose: '모든 보유 종목(수익률≥0%)에 7-tier 공식으로 auto_trailing_stop을 산출한다. 기존 APEX 한정
trailing을 전 종목으로 일반화. 수익 보호 + 뒷박 재진입 차단.
'
inputs:
- field: Profit_Pct
unit: percent
- field: Close
unit: KRW_per_share
- field: ATR20
unit: KRW_per_share
- field: High52W
unit: KRW_per_share
- field: Stop_Price_Est
unit: KRW_per_share
- field: Account_Avg_Cost
unit: KRW_per_share
output:
field: ratchet_trailing_general_v1_json
expected_outputs:
- gate
- coverage_pct
llm_allowed: cite_only
version: 2026-05-27_PHASE1
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
ROUTING_EXECUTION_LOG_TABLE_V1:
purpose: 'DETERMINISTIC_ROUTING_ENGINE_V1 11단계(①CV-V2사전검증 ②데이터신선도 ③장중판별 ④포트폴리오상태
⑤거시이벤트동기화 ⑥선제매도레이더 ⑦매수타이밍게이트 ⑧매도우선순위/현금확보 ⑨RS/위성품질 ⑩가격정규화/검증 ⑪LLM서빙)의 실행 로그를
표로 강제 출력한다. GAS 미보고 단계는 결정론 fallback으로 보강. 누락 단계 > 0이면 INCOMPLETE_ROUTING_LOG.
'
inputs:
- field: routing_execution_log
unit: json
- field: _harness_context
unit: json
output:
field: routing_execution_log_v1_json
expected_outputs:
- gate
- stage_coverage_pct
- request_route
llm_allowed: cite_only
version: 2026-05-27_PHASE1
FUNDAMENTAL_RAW_INGEST_V1:
purpose: 'data_feed(Forward_PE/PBR/EPS)와 네이버 금융 fallback을 통해 보유 종목의 펀더멘털 raw
지표를 수집하고 fundamental_raw_v1.json을 생성한다.
'
output:
field: fundamental_raw_v1_json
expected_outputs:
- gate
- coverage_pct
- non_etf_count
llm_allowed: cite_only
version: 2026-05-27_PHASE2
FUNDAMENTAL_MULTIFACTOR_V3:
purpose: 'ROE(25) + OPM(20) + OCF(15) + FCF(15) + Debt(10) + Valuation(15) =
100점 6요소 결정론 공식으로 종목별 펀더멘털 등급을 산출한다. ETF는 별도 분류, 데이터 부족 시 보유 필드 기준 정규화 적용.
'
output:
field: fundamental_multifactor_v3_json
expected_outputs:
- gate
- grade_diverse
- non_etf_count
llm_allowed: cite_only
version: 2026-05-27_PHASE2
HORIZON_CLASSIFICATION_V1:
purpose: '펀더멘털 등급 + 이격도 + ATR% + RSI14 기반으로 종목별 투자 기간을 분류한다. LONG/MID/SHORT/ETF/UNKNOWN
결정론 트리. HORIZON_ALLOCATION_LOCK_V1에 주입.
'
output:
field: horizon_classification_v1_json
expected_outputs:
- gate
- classified_pct
- allocation_pct
llm_allowed: cite_only
version: 2026-05-27_PHASE2
SMART_MONEY_FLOW_SIGNAL_V2:
purpose: 'Frg_5D/20D + Inst_5D/20D 백분위 기반으로 종목별 스마트머니 흐름을 산출한다. STRONG_INFLOW
/ INFLOW / NEUTRAL / OUTFLOW / STRONG_OUTFLOW 라벨 분산 강제.
'
output:
field: smart_money_flow_signal_v2_json
expected_outputs:
- gate
- label_diversity
- coefficient_of_variation
llm_allowed: cite_only
version: 2026-05-27_PHASE3
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
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
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
GROWTH_RATE_SIGNAL_V1:
purpose: 'EPS YoY / 매출 YoY 기반 성장률 시그널을 결정론적으로 산출한다. HYPER_GROWTH/GROWTH/FLAT/DECLINE/DATA_MISSING
라벨과 단/중/장기 horizon 적합도를 포함한다.
'
output:
field: growth_rate_signal_v1_json
expected_outputs:
- gate
- label_counts
- data_missing_pct
llm_allowed: cite_only
version: 2026-05-27_PHASE2B
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
MARKET_SHARE_SIGNAL_V2:
purpose: '실매출 점유율 데이터 없는 환경에서 AvgTradeValue_20D_M 백분위 + 외인/기관 수급 + 20일 모멘텀 3중
프록시로 GAINING/STABLE/LOSING/NO_PEER_DATA를 산출한다. confidence는 항상 LOW(proxy 기반).
실데이터 확보 시 HIGH confidence로 업그레이드 예정.
'
output:
field: market_share_signal_v2_json
expected_outputs:
- gate
- unique_states
- non_etf_scored_count
llm_allowed: cite_only
version: 2026-05-27_PHASE2B
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
PREDICTION_ACCURACY_HARNESS_V2:
purpose: '운영 T+1/T+5/T+20 일치율을 90/30/7일 회전 윈도로 산출. calibration_state: CALIBRATED/MONITOR/PAE_CALIBRATION_REQUIRED/BUY_PROPOSAL_FROZEN_RECOMMEND.
'
output:
file: Temp/prediction_accuracy_harness_v2.json
expected_outputs:
- calibration_state
- t5_op_rate
- t5_sample
- window_90d_rate
llm_allowed: cite_only
version: 2026-05-28_PHASE4
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
SELL_WATERFALL_ENGINE_V2:
purpose: 'V1 4단계 유지 + 호가단위 슬리피지(bps) 시뮬, TWAP/지정가 분할(유동성기반), 부분체결 잔량 자동 stage
승격(단계 건너뜀 금지).
'
output:
file: Temp/sell_waterfall_engine_v2.json
expected_outputs:
- gate
- stage_counts
- escalation_skip_violations
llm_allowed: cite_only
version: 2026-05-28_PHASE4
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
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
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
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
FINAL_JUDGMENT_GATE_V1:
purpose: '판단 결정론 계층 — 키스톤. 모든 게이트·신호 JSON + _harness_context를 읽어 종목별 단일 action_verdict를
AND-11 조건으로 결정론 산출. action_verdict in {BUY_PILOT, HOLD, TRIM, SELL, WATCH,
BLOCKED}. harness_key 부재 시 DATA_MISSING 명시(silent PASS 금지). effective_confidence
= raw_confidence × (0.4 + 0.6 × invest_quality/100).
'
output:
file: Temp/final_judgment_gate_v1.json
expected_outputs:
- gate
- coverage_pct
- verdict_counts
- silent_pass_violations
- late_chase_buy_violations
- ticker_count
llm_allowed: cite_only
version: 2026-05-28_PHASE6
VERDICT_CONSISTENCY_LOCK_V1:
purpose: '판단 일관성 잠금 — operational_report.json의 서술을 final_judgment_gate_v1.json
verdict와 대조. verdict=BLOCKED/SELL인데 보고서가 긍정 BUY 서술 → INVALID_VERDICT_OVERRIDE
위반, gate=FAIL. LLM의 verdict 자유도를 0으로 제거. 사용자 H10 수동 오버라이드는 예외.
'
output:
file: Temp/verdict_consistency_lock_v1.json
expected_outputs:
- gate
- override_count
- warn_count
- violations
llm_allowed: cite_only
version: 2026-05-28_PHASE6
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
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
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
VELOCITY_V1:
purpose: '1일/5일 가격 속도를 계산해 뒷박 추격 차단과 풀백 트리거의 입력으로 공급한다.
'
inputs:
- field: close_price
unit: KRW_per_share
- field: previous_close_price
unit: KRW_per_share
- field: ret5d
unit: percent
output:
field: velocity_1d
input_fields:
- close
- prevClose
- ret5d
expected_outputs:
- velocity_1d
- velocity_5d
llm_allowed: cite_only
version: 2026-05-30_PHASE8
PROFIT_LOCK_STAGE_V1:
purpose: '수익률 구간을 NORMAL/BREAKEVEN/PROFIT_LOCK/APEX 계열로 분류한다.
'
inputs:
- field: profit_pct
unit: percent
output:
field: profit_lock_stage
input_fields:
- profit_pct
expected_outputs:
- stage
llm_allowed: cite_only
version: 2026-05-30_PHASE8
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
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
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
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
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
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
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
SEMICONDUCTOR_CLUSTER_GATE_V1:
purpose: '반도체 클러스터 집중도와 국면별 차단/감축 여부를 판단한다.
'
inputs:
- field: semiconductor_cluster_json
unit: json
- field: market_regime
unit: enum
output:
field: semiconductor_cluster_gate
input_fields:
- combined_pct
- market_regime
expected_outputs:
- semiconductor_cluster_gate
- combined_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
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
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
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
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
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
K2_STAGED_REBOUND_SELL_V1:
purpose: '과매도 구간 현금확보 매도를 50/50 분할과 반등 대기로 구조화한다.
'
inputs:
- field: base_sell_qty
unit: shares
- field: previous_close_price
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
output:
field: immediate_sell_qty
input_fields:
- baseQty
- prev_close
- atr20
expected_outputs:
- immediate_sell_qty
- rebound_wait_qty
- rebound_trigger_price
llm_allowed: cite_only
version: 2026-05-30_PHASE8
STOP_BREACH_ALERT_V1:
purpose: '손절가 이탈 여부와 즉시 청산 경보를 결정한다.
'
inputs:
- field: close_price
unit: KRW_per_share
- field: stop_price
unit: KRW_per_share
output:
field: stop_breach_gate
input_fields:
- close
- stop_price
expected_outputs:
- stop_breach_gate
- gap_pct
llm_allowed: cite_only
version: 2026-05-30_PHASE8
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
ANTI_WHIPSAW_GATE_V1:
purpose: '반등/조정 혼선 구간에서 설거지성 매수와 성급한 매도를 차단한다.
'
inputs:
- field: close_price
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: rsi14
unit: points
output:
field: anti_whipsaw_status
input_fields:
- close
- ma20
- rsi14
expected_outputs:
- anti_whipsaw_status
llm_allowed: cite_only
version: 2026-05-30_PHASE8
BREAKEVEN_RATCHET_V1:
purpose: '손익분기 이상 구간에서 손절선을 평단 이상으로 올리는 래칫을 산출한다.
'
inputs:
- field: average_cost
unit: KRW_per_share
- field: highest_price_since_entry
unit: KRW_per_share
output:
field: breakeven_stop_price
input_fields:
- average_cost
- highest_close
expected_outputs:
- breakeven_stop_price
llm_allowed: cite_only
version: 2026-05-30_PHASE8
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
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
CAPITAL_STYLE_ALLOCATION_V1:
purpose: '투자성향별 자금 유동성/공격성 가중치와 conviction을 산출한다.
'
inputs:
- field: smart_money_flow_signal_v2_json
unit: json
- field: fundamental_multifactor_v3_json
unit: json
- field: macro_event_ticker_impact_v1_json
unit: json
- field: liquidity_flow_signal_v1_json
unit: json
output:
field: capital_style_conviction
input_fields:
- investor_style
- liquidity_profile
expected_outputs:
- capital_style_conviction
- capital_style_label
llm_allowed: cite_only
version: 2026-05-30_PHASE8
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
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
ARTIFACT_FRESHNESS_GATE_V1:
purpose: '하네스 산출물의 타임스탬프를 검증해 신선도 게이트를 산출한다.
'
input_fields:
- artifact_timestamp
- max_age_hours
expected_outputs:
- freshness_gate
- stale_artifacts
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
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
CANONICAL_ARTIFACT_RESOLVER_V1:
purpose: '동일 의미의 중복 산출물 중 유일 출처를 지정해 단일 진실원장을 고정한다.
'
input_fields:
- artifact_key
- candidate_paths
expected_outputs:
- canonical_path
- duplicate_artifacts
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
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
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
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
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
COMPLETION_GAP_V1:
purpose: 'pass_100 기준 대비 미충족 항목과 격차를 정량화해 완료 갭 보고서를 산출한다.
'
input_fields:
- pass_100_criteria
- current_metrics
expected_outputs:
- completion_gap_score
- failed_criteria_list
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
COMPREHENSIVE_PROPOSAL_V1:
purpose: '매수·매도·보유·현금확보 전 섹션을 통합한 종합 제안서를 생성한다.
'
input_fields:
- buy_proposals
- sell_proposals
- portfolio_state
expected_outputs:
- comprehensive_proposal
- proposal_id
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
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
DATA_INTEGRITY_100_LOCK_V1:
purpose: '핵심 데이터 필드의 정합성을 검증해 100% 잠금 게이트를 산출한다 (V2로 대체됨).
'
input_fields:
- harness_context_fields
expected_outputs:
- data_integrity_gate
- integrity_violations
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
DATA_INTEGRITY_100_LOCK_V2:
purpose: '전 섹션 수치 일관성·출처 추적 가능성을 검증해 데이터 무결성 잠금을 산출한다.
'
input_fields:
- report_sections
- source_paths
expected_outputs:
- data_integrity_score
- integrity_gate
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
DATA_INTEGRITY_SCORE_V1:
purpose: '하네스 컨텍스트 전체의 데이터 무결성 점수를 산출한다.
'
input_fields:
- harness_context
expected_outputs:
- data_integrity_score_v1
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
DATA_MATURITY_TRUTH_GATE_V1:
purpose: 'type_A(결정론)/type_B(표본 의존) 축을 분리해 진실성 기반 성숙도 게이트를 산출한다.
'
input_fields:
- type_a_metrics
- type_b_metrics
- sample_counts
expected_outputs:
- maturity_gate
- truthful_100_axes
- pending_evidence_axes
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
DATA_MATURITY_TRUTH_GATE_VALIDATOR_V1:
purpose: 'DATA_MATURITY_TRUTH_GATE_V1 산출값의 형식·범위 유효성을 검증한다.
'
input_fields:
- maturity_gate_output
expected_outputs:
- validation_result
- validation_errors
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
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
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
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
REBOUND_CAPTURE_THESIS_FACTOR_V1:
purpose: 과매도 반등 진입을 thesis 팩터로 명시 — 영구 약세편향 해소 (Direction SFP1)
agents_md_ref: 'Direction SFP1: SINGLE_FACTOR_DOMINANCE_CAP_V1 — REBOUND_CAPTURE
thesis 반영'
inputs:
- field: rsi14
unit: index_0_100
- field: current_price
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: flow_credit
unit: ratio_0_1
- field: down_streak
unit: days_integer
expression: thesis_bonus = 15.0 if (25<=rsi14<=40) AND (current_price<=ma20*1.03)
AND (flow_credit>=0.5) AND (down_streak>=2) else 0
components:
REBOUND_CAPTURE_WEIGHT:
value: 15.0
unit: thesis_points
calibration_status: EXPERT_PRIOR
note: 과매도 반등 4조건 동시 충족 시 thesis 점수 가산
conditions:
rsi14_range: 25 <= rsi14 <= 40 (과매도~회복 초입)
price_pullback: current_price <= ma20 x 1.03 (MA20 ±3% 눌림목)
flow_quality: flow_credit >= 0.5 (자금 유입 최소 기준)
down_streak: down_streak >= 2 (연속 하락 2일 이상)
output:
field: rebound_capture_hit
unit: boolean
missing_policy: 4개 조건 중 1개라도 데이터 없으면 rebound_capture_hit=false
implementation: tools/build_predictive_alpha_dialectic_engine_v2.py:NF2
calibration_ref: spec/calibration_registry.yaml:NF2 (EXPERT_PRIOR)
version: 2026-06-04_NF2
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
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
PROFIT_GIVEBACK_RATCHET_FACTOR_V1:
purpose: 수익금 보전 ATR 기반 동적 래칫 — 번 돈을 지키는 원칙 (Direction E1·L2·R4 확장)
agents_md_ref: Direction E1(APEX_SUPER), L2(ATR 트레일링), R4(전 보유종목 coverage)
inputs:
- field: prev_trail_stop
unit: KRW_per_share
- field: high_since_entry
unit: KRW_per_share
- field: atr20
unit: KRW_per_share
- field: market_regime
unit: enum
- field: profit_pct
unit: percent
expression: trail_stop = max(prev_trail_stop, high_since_entry - k * atr20)
components:
k_regime_map:
APEX_SUPER_ge_50pct: 1.0
APEX_TRAILING_ge_40pct: 1.5
PROFIT_LOCK_30_ge_30pct: 2.0
PROFIT_LOCK_20_ge_20pct: 2.0
PROFIT_LOCK_10_ge_10pct: 2.5
BREAKEVEN_RATCHET_ge_0pct: null
NORMAL_lt_0pct: null
calibration_status: EXPERT_PRIOR
output:
field: auto_trailing_stop
unit: KRW_per_share
gate:
coverage_check: ratchet_coverage_pct == 100 (Direction R4 CHECK_64)
fail_action: BLOCK 보고서 발행
missing_policy: atr20 미확인 시 BREAKEVEN_RATCHET(=avg_cost*1.00) 적용
implementation: tools/build_ratchet_trailing_general_v1.py:NF5
calibration_ref: spec/calibration_registry.yaml:NF5 k값 (EXPERT_PRIOR)
version: 2026-06-04_NF5