meta: title: "은퇴자산포트폴리오 - 하네스 V8 공식 레지스트리 (13b)" parent_file: "spec/13_formula_registry.yaml" version: "2026-05-25_HARNESS_V8_PROPOSAL51_P1" purpose: > GAS buildHarnessContext_ 단계에서 결정론적으로 산출되는 하네스 전용 공식. LLM이 직접 계산하거나 재판단해서는 안 되는 고착화 결과들이다. 13_formula_registry.yaml 파일 크기 초과로 분리 관리. formula_registry: formulas: # == [2026-05-20_HARNESS_V4] HS009 - TP 가격 유효성 검증 ================== TP_VALIDITY_CHECK_V1: purpose: > TAKE_PROFIT_LADDER_V2가 산출한 TP 가격이 현재가보다 낮은지 검증. 현재가 >= TP 이면 해당 티어는 이미 통과된 것으로 판정하고 null을 반환. prices_lock=true가 무효 가격을 고착화하는 역설을 GAS 단계에서 차단. inputs: - {field: "tp_price", unit: "KRW_per_share"} - {field: "current_price", unit: "KRW_per_share"} expression: "tp_price > current_price ? tp_price : null" output: field: "tp_validated_price" unit: "KRW_per_share_or_null" state_output: field: "tp_state" values: PENDING: "tp_price > current_price - 아직 도달하지 않음" TP1_ALREADY_TRIGGERED: "tp1_price <= current_price - 이미 통과" TP2_ALREADY_TRIGGERED: "tp2_price <= current_price - 이미 통과" UNKNOWN_NO_CLOSE: "current_price 미확인 - 검증 불가" prohibition: - "LLM이 tp_price=null인 경우 대체 TP 가격을 임의 산출하는 것 절대 금지" - "INVALID_TP_STALE 상태에서 HTS 주문표에 가격 기재 금지" canonical_ref: "AGENTS.md:Direction H9 (HS009)" version: "2026-05-20_HARNESS_V4" # == [2026-05-20_HARNESS_V4] C3 - 수익구간 단계 분류 ====================== PROFIT_LOCK_STAGE_CLASSIFIER_V1: purpose: > 보유 포지션의 현재 수익률 구간을 분류하여 profit_lock_stage를 결정론적으로 산출. LLM이 "이미 +51%니까 profit_lock 단계"를 임의 판단하는 것을 하네스에서 선점. spec/exit/take_profit.yaml:profit_lock_ratchet.ratchet_table 완전 구현. inputs: - {field: "average_cost", unit: "KRW_per_share"} - {field: "current_price", unit: "KRW_per_share"} - {field: "atr20", unit: "KRW_per_share", optional: true} - {field: "quantity", unit: "shares"} - {field: "highest_close", unit: "KRW_per_share", optional: true, note: "APEX_SUPER trailing_stop 산출용. 미제공 시 current_price 대체."} derived_fields: profit_pct: "(current_price - average_cost) / average_cost * 100" rules: - if: "profit_pct >= 50" profit_lock_stage: "APEX_SUPER" ratchet_stop: "max(average_cost * 1.35, highest_close_or_current - atr20 * 1.5)" trailing_stop: "max(average_cost * 1.35, highest_close_or_current - atr20 * 1.5)" ratchet_partial_qty: "floor(quantity * 0.10)" tp_ladder_action: "강제 10% 익절 권고" apex_super_alert: "REQUIRED" llm_obligation: "APEX_SUPER_ALERT 필수 출력. trailing_stop 병기 의무. '보유 유지' 단독 서술 절대 금지." - if: "profit_pct >= 30" profit_lock_stage: "PROFIT_LOCK_STAGE_30" ratchet_stop: "average_cost * 1.20" ratchet_partial_qty: "floor(quantity * 0.35)" - if: "profit_pct >= 20" profit_lock_stage: "PROFIT_LOCK_STAGE_20" ratchet_stop: "average_cost * 1.10" ratchet_partial_qty: "floor(quantity * 0.25)" - if: "profit_pct >= 10" profit_lock_stage: "PROFIT_LOCK_STAGE_10" ratchet_stop: "average_cost * 1.00" ratchet_partial_qty: 0 - if: "profit_pct < 10" profit_lock_stage: "NORMAL" ratchet_stop: "STOP_PRICE_CORE_V1 result" ratchet_partial_qty: 0 output: fields: ["profit_lock_stage", "ratchet_stop_price", "ratchet_partial_qty"] prohibition: - "LLM이 profit_lock_stage를 임의 판정 금지 - 하네스 산출값 그대로 사용" - "profit_lock_stage=APEX_SUPER인 종목에 TP 가격 출력 금지" - "APEX_SUPER 구간에서 trailing_stop 미병기 후 '보유 유지'만 서술 금지 (E1 재발 방지)" canonical_ref: "spec/exit/take_profit.yaml:take_profit.profit_lock_ratchet.ratchet_table" version: "2026-05-20_HARNESS_V4" # == [2026-05-20_HARNESS_V4] M1 - 국면별 감축 비율 산출 =================== REGIME_TRIM_WEIGHT_V1: purpose: > 시장 국면(market_regime_state) 기반으로 위성·주도주의 감축 비율 범위를 결정론적 산출. LLM이 "조정기엔 5~10%" 같은 주관적 감축 비율을 제시하는 것을 하네스에서 선점. 국면이 같으면 동일 입력에서 항상 동일 trim_pct_range가 나와야 함. inputs: - {field: "market_regime_state", unit: "enum"} rules: ADVANCE: applicable_regimes: ["RISK_ON", "SECULAR_LEADER_RISK_ON"] satellite_trim_pct_range: [0, 5] leader_trim_pct_range: [0, 0] priority_order: "HOLD_ALL > 약한위성_5%이하 > 중복ETF" new_buy_gate: "ALLOWED_IF_HEAT_PASS" PULLBACK_IN_UPTREND: applicable_regimes: ["LEADER_CONCENTRATION", "NEUTRAL"] satellite_trim_pct_range: [5, 10] leader_trim_pct_range: [0, 5] priority_order: "약한위성 > 중복ETF > 주도주소량헤지" new_buy_gate: "BLOCKED" DISTRIBUTION: applicable_regimes: ["RISK_OFF_CANDIDATE"] satellite_trim_pct_range: [10, 25] leader_trim_pct_range: [5, 10] priority_order: "중복ETF > 약한위성 > 주도주이익잠금" new_buy_gate: "BLOCKED" BREAKDOWN: applicable_regimes: ["RISK_OFF", "EVENT_SHOCK"] satellite_trim_pct_range: [25, 50] leader_trim_pct_range: [10, 25] priority_order: "코어보호해제 > 전종목감축검토" new_buy_gate: "HARD_BLOCKED" output: fields: ["phase", "satellite_trim_pct_min", "satellite_trim_pct_max", "leader_trim_pct_min", "leader_trim_pct_max", "priority_order", "new_buy_gate"] missing_policy: market_regime_state: "UNKNOWN phase. satellite/leader trim = 0. new_buy_gate = BLOCKED." prohibition: - "LLM이 regime_trim_guidance_json 외의 감축 비율을 임의 제시 금지" - "regime_trim_lock=true이면 LLM의 국면 재판정 금지" canonical_ref: "AGENTS.md:Direction M1 (REGIME_TRIM_LOCK)" version: "2026-05-20_HARNESS_V4" # == [2026-05-20_HARNESS_V4] H3 - 주도주 승자 포지션 보호 게이트 ========= SECULAR_LEADER_REGIME_GATE_V1: purpose: > 삼성전자(005930)·SK하이닉스(000660)의 secular_leader_profit_lock 발동 조건을 결정론적으로 판정. LLM이 "수급이 좋으니까 secular_leader 규칙 적용"이라고 임의 판단하는 것을 하네스에서 선점. spec/exit/take_profit.yaml:secular_leader_profit_lock.activation_required_all 완전 구현. applicable_to: ["005930", "000660"] inputs: - {field: "ticker", unit: "string"} - {field: "market_regime_state", unit: "enum"} - {field: "quantity", unit: "shares", note: "holding_quantity from account_snapshot"} - {field: "close_price", unit: "KRW_per_share"} - {field: "ma20", unit: "KRW_per_share"} - {field: "flow_ok", unit: "enum", note: "Y/N"} - {field: "frg_5d_krw", unit: "KRW", optional: true, note: "외국인 5D 순매수금액"} - {field: "inst_5d_krw", unit: "KRW", optional: true, note: "기관 5D 순매수금액"} - {field: "atr20", unit: "KRW_per_share", optional: true} activation_required_all: - "ticker IN [005930, 000660]" - "market_regime_state == SECULAR_LEADER_RISK_ON" - "holding_quantity > 0 (account_snapshot CAPTURE_READ_OK)" - "close_price > ma20" - "flow_ok == Y AND (frg_5d > 0 OR inst_5d > 0)" deactivation_any: - "anti_climax_gate_total >= 3" - "frg_5d < 0 AND inst_5d < 0 (5D 동반 순매도)" - "close_price <= ma20" - "market_regime_state != SECULAR_LEADER_RISK_ON" output: fields: ["secular_leader_gate_active", "secular_leader_gate_status", "secular_leader_gate_reasons"] status_values: ACTIVE: "모든 활성화 조건 충족. secular_leader_profit_lock 규칙 적용." DEACTIVATED: "비활성화 조건 1개 이상 발동. take_profit.core.leadership 규칙으로 복귀." ACTIVATION_FAIL: "활성화 조건 미충족 (데이터 부재 포함)." NOT_APPLICABLE: "대상 종목 아님 (005930·000660 외)." tp1_adjustment_by_stage: PROFIT_LOCK_STAGE_10: action: "tp1_state=DEFERRED_SECULAR_LEADER, tp1_price=null" rationale: "수급 훼손 없는 한 +10% 매도 금지. 본절 상향만." PROFIT_LOCK_STAGE_20: action: "과열신호 < 2이면 tp1_state=DEFERRED_SECULAR_LEADER_OVERHEAT_PENDING" rationale: "과열 2개 미만 시 부분익절 보류." PROFIT_LOCK_STAGE_30: action: "tp1_state=TRAILING_STOP_PRIORITY_SECULAR_LEADER (tp1 참고용 유지)" rationale: "trailing_stop 기반 관리 전환. 30~40% 단계 익절." APEX_SUPER: action: "tp1_state=TRAILING_STOP_PRIORITY_SECULAR_LEADER" rationale: "래칫 stop 관리 우선. 전량익절 금지. trailing_stop 필수 병기." prohibition: - "secular_leader_gate_active=true 구간에서 LLM이 임의로 tp1 매도 신호 생성 금지" - "하네스가 null로 전달한 tp1_price를 LLM이 복원하는 행위 절대 금지" - "NOT_APPLICABLE 종목에 이 규칙 적용 금지" canonical_ref: "spec/exit/take_profit.yaml:secular_leader_profit_lock" version: "2026-05-20_HARNESS_V4" # == [2026-05-20_HARNESS_V4] M4 - 5억원 은퇴자산 목표 추적 ================ GOAL_RETIREMENT_V1: purpose: > 은퇴자산 5억원 목표 대비 현재 자산의 달성률·잔여액·복리 ETA를 결정론적으로 산출. LLM이 "이 추세면 언제 달성 가능하다"고 임의 추정하는 것을 하네스에서 선점. net_expectancy_30(30일 순기대 수익률%)을 복리 기준으로 사용. inputs: - {field: "total_asset_krw", unit: "KRW", note: "buildHarnessContext_ 집계값"} - {field: "net_expectancy_30", unit: "percent", optional: true, note: "Bayesian 성과 계산기 출력. 없으면 ETA=DATA_MISSING."} constants: GOAL_KRW: 500000000 derived_fields: goal_achievement_pct: "total_asset_krw / GOAL_KRW * 100" goal_remaining_krw: "max(0, GOAL_KRW - total_asset_krw)" goal_eta_months: "ceil(ln(GOAL_KRW / total_asset_krw) / ln(1 + net_expectancy_30 / 100))" expression: achievement_pct: "round(total_asset_krw / GOAL_KRW * 1000) / 10" eta_months: "net_expectancy_30 > 0 ? ceil(ln(GOAL_KRW/asset) / ln(1 + r)) : null" eta_label: "ACHIEVED | YYYY-MM | DATA_MISSING" status: "total_asset_krw >= GOAL_KRW ? ACHIEVED : IN_PROGRESS" output: fields: - {field: "goal_asset_krw", unit: "KRW", value: 500000000} - {field: "goal_current_asset_krw", unit: "KRW"} - {field: "goal_achievement_pct", unit: "percent"} - {field: "goal_remaining_krw", unit: "KRW"} - {field: "goal_eta_months", unit: "months_or_null"} - {field: "goal_eta_label", unit: "string"} - {field: "goal_monthly_growth_pct", unit: "percent_or_null"} - {field: "goal_status", unit: "enum"} missing_policy: net_expectancy_30: "goal_eta_months=null, goal_eta_label=DATA_MISSING" total_asset_krw_zero: "goal_achievement_pct=0, goal_remaining_krw=GOAL_KRW" prohibition: - "LLM이 goal_achievement_pct·goal_remaining_krw·goal_eta_label을 재계산 금지 (HS011)" - "LLM이 '이 속도라면 N개월 후 달성'을 GOAL_RETIREMENT_V1 외 임의 계산으로 제시 금지" - "목표 달성 압박을 이유로 heat_gate·cash_floor·stop_loss 규칙 우회 금지" canonical_ref: "AGENTS.md:Direction M4" version: "2026-05-20_HARNESS_V4" # == [2026-05-20_G1] G1 - 현금 부족액 결정론적 산출 ======================= CASH_SHORTFALL_V1: purpose: > D+2 현금 현황 대비 최소 방어선·목표 현금비율까지 부족액을 GAS가 결정론적으로 산출. LLM이 "약 N원 필요" 즉석 계산을 하면 D+2/D+0 혼용·미체결 누락·세금 미반영 등으로 호출마다 결과가 달라지는 금전적 오판 위험 발생. inputs: - {field: "settlement_cash_d2_krw", unit: "KRW"} - {field: "total_asset_krw", unit: "KRW"} - {field: "cash_floor_min_pct", unit: "percent"} - {field: "mrs_score", unit: "score_0_100"} constants: TARGET_CASH_BASE_PCT: 5 TARGET_CASH_MRS_WEIGHT: 15 MRS_DIVISOR: 10 expressions: cash_current_pct_d2: "round(settlement_cash_d2_krw / total_asset_krw * 100, 2)" cash_target_pct: "max(TARGET_CASH_BASE_PCT + (mrs_score / MRS_DIVISOR) * TARGET_CASH_MRS_WEIGHT, cash_floor_min_pct)" cash_shortfall_min_krw: "max(0, round(total_asset_krw * cash_floor_min_pct / 100 - settlement_cash_d2_krw))" cash_shortfall_target_krw: "max(0, round(total_asset_krw * cash_target_pct / 100 - settlement_cash_d2_krw))" output: fields: - {field: "cash_current_pct_d2", unit: "percent"} - {field: "cash_target_pct", unit: "percent"} - {field: "cash_shortfall_min_krw", unit: "KRW"} - {field: "cash_shortfall_target_krw", unit: "KRW"} missing_policy: total_asset_krw_zero: "cash_current_pct_d2=0, 모든 shortfall=0" settlement_cash_d2_missing: "shortfall 산출 불가 → DATA_MISSING" prohibition: - "LLM이 '약 N원 필요' 형태로 부족액을 즉석 계산 금지 (HS011)" - "D+0 즉시현금(immediate_cash_krw) 합산 금지 - D2_ONLY 기준" - "미체결 주문·세금·정산일 조정을 LLM이 임의 적용 금지" canonical_ref: "AGENTS.md:Direction G1" version: "2026-05-20_G1" # == [2026-05-20_G2] G2 - 현금 회복 TRIM 계획 결정론적 산출 ================= TRIM_PLAN_MIN_CASH_V1: purpose: > 현금 부족액(CASH_SHORTFALL_V1) 해소를 위한 종목별 TRIM 계획을 H2 매도우선순위 기반으로 GAS가 사전 결정. LLM이 임의로 종목·수량·순서를 선택하면 매도우선순위 규칙이 무력화됨. inputs: - {field: "sell_candidates_json", unit: "list", note: "H2 매도후보 순위 배열"} - {field: "sell_quantities_json", unit: "list", note: "H3 사전 산출 매도수량"} - {field: "close_price", unit: "KRW_per_share", note: "holdings.close"} - {field: "cash_shortfall_min_krw", unit: "KRW", note: "G1 CASH_SHORTFALL_V1 산출값"} expressions: estimated_sell_krw: "sell_qty × close_price (정수)" accumulated_krw: "누적 합산 estimated_sell_krw" covers_shortfall: "accumulated_krw >= cash_shortfall_min_krw" output: fields: - {field: "trim_plan_to_min_cash_json", unit: "json_array"} output_schema: rank: "H2 순위" ticker: "종목 코드" name: "종목명" tier: "H2 tier" sell_qty: "H3 매도수량 (정수 | CAPTURE_REQUIRED | NO_HOLDING | null)" estimated_sell_krw: "예상 매도금액 (KRW)" accumulated_krw: "누적 예상 매도금액 (KRW)" covers_shortfall: "부족액 해소 여부 (boolean)" missing_policy: no_sell_signal: "sell_qty=null, estimated_sell_krw=0" capture_required: "sell_qty='CAPTURE_REQUIRED', estimated_sell_krw=0" close_price_zero: "estimated_sell_krw=0" prohibition: - "LLM이 H2 순위 외 종목을 임의로 현금 회복 후보로 선정 금지 (HS011)" - "LLM이 수량·순서를 재계산하거나 재정렬 금지" - "CAPTURE_REQUIRED 행을 실행 가능 주문으로 간주 금지" canonical_ref: "AGENTS.md:Direction G2" version: "2026-05-20_G2" # == [2026-05-20_APEX_V1] A1 - 뒷북 매수 방지 선행 알파 점수 ============= ALPHA_LEAD_SCORE_V1: purpose: > 주도 섹터·상대강도·수급가속·거래대금·과열도를 결합해 선행 파일럿 진입 가능성을 0~100 점수와 상태로 확정한다. 이미 과열된 추격매수는 점수가 높아도 차단한다. inputs: [] input_groups: required: - "sector_rotation_rank" - "sector_rotation_rank_delta_5d" - "stock_rs_ratio_5d" - "stock_rs_ratio_20d" - "frg_inst_flow_accel_5d_vs_20d" - "avg_trade_value_5d" - "close_vs_ma20_pct" - "val_surge_pct" - "dart_risk_status" gates: pilot_allowed: "score >= 75 AND 0 <= close_vs_ma20_pct <= 6 AND val_surge_pct < 40" watch_only: "55 <= score < 75" blocked_late_chase: "close_vs_ma20_pct > 10 OR val_surge_pct >= 60 OR dart_risk_status != OK" output: field: "alpha_lead_json" unit: "json_array" output_schema: ticker: "종목 코드" alpha_lead_score: "0~100" lead_entry_state: "PILOT_ALLOWED | WATCH_ONLY | BLOCKED_LATE_CHASE | DATA_MISSING" allowed_tranche_pct: "0 | 20 | 30" blocked_reason_codes: "array" prohibition: - "blocked_late_chase 상태에서 LLM이 뉴스·테마를 이유로 BUY 승격 금지" - "pilot_allowed여도 계획수량 30% 초과 금지" canonical_ref: "proposals/2026-05-20_APEX_ALPHA_PRESERVATION_EXECUTION_HARNESS_V1.md" version: "2026-05-20_APEX_V1" FOLLOW_THROUGH_CONFIRM_V1: purpose: > 돌파 이후 1~3거래일 내 가격 유지·거래대금 과열 완화·수급 유지 여부를 확인해 본진입, 대기, 실패를 결정론적으로 분류한다. inputs: [] input_groups: required: - "breakout_day_close" - "current_close" - "ma5" - "ma20" - "volume_vs_5d" - "frg_inst_flow_3d" - "intraday_low_recovery_pct" states: CONFIRMED_ADD_ON: "돌파 가격 유지 + 거래대금 과열 완화 + 수급 유지" FAILED_BREAKOUT: "돌파 이탈 또는 외국인/기관 동반 매도" WAIT_PULLBACK: "가격은 유지되나 거래대금 과열 또는 눌림 미확인" output: field: "follow_through_json" unit: "json_array" prohibition: - "WAIT_PULLBACK을 LLM이 본진입 허용으로 승격 금지" - "FAILED_BREAKOUT 후 물타기 금지" canonical_ref: "proposals/2026-05-20_APEX_ALPHA_PRESERVATION_EXECUTION_HARNESS_V1.md" version: "2026-05-20_APEX_V1" DISTRIBUTION_RISK_SCORE_V1: purpose: > 가격 유지 또는 상승 중 스마트머니 이탈, 거래대금 둔화, 윗꼬리, 낮은 flow_credit, 섹터 대비 상대약세를 결합해 설거지·분산 위험을 0~100으로 산출한다. related_formula: > spec/13_formula_registry.yaml:DISTRIBUTION_SELL_DETECTOR_V1과 별개의 독립 공식이다(2026-06-22 역할 분리 확정, governance/gas_logic_migration_ledger_v1.yaml F12/F13). 이 공식(점수식, BUY/STAGED_BUY/ADD_ON 차단 게이트)과 SELL_DETECTOR(6신호 카운트, PRE_DISTRIBUTION_EARLY_WARNING 정밀도 보완)는 입력·출력·목적이 다르며 하나가 다른 하나의 중복이 아니다 — 둘 다 유지한다. inputs: [] input_groups: required: - "price_above_ma20" - "frg_5d_sh" - "inst_5d_sh" - "frg_20d_sh" - "inst_20d_sh" - "volume_5d_vs_20d" - "close_location_value" - "upper_wick_ratio" - "flow_credit" - "ret5d_vs_sector" components: smart_money_outflow: 30 volume_fade_after_surge: 20 upper_wick_distribution: 15 flow_credit_low: 20 sector_relative_lag: 15 gates: BLOCK_BUY: "score >= 70" TRIM_REVIEW: "55 <= score < 70" PASS: "score < 55" output: field: "distribution_risk_json" unit: "json_array" prohibition: - "BLOCK_BUY 상태에서 BUY/STAGED_BUY/ADD_ON 출력 금지" - "분산 위험이 높아도 과매도 매도는 SMART_CASH_RAISE_PLAN_V1을 거쳐 실행" canonical_ref: "spec/exit/proactive_exit_radar.yaml" version: "2026-05-20_APEX_V1" PROFIT_PRESERVATION_STATE_V1: purpose: > 수익률, ATR, 고점 대비 하락, 수급 훼손, 분산 위험을 이용해 수익 보호 단계를 분류하고 래칫·트레일링·부분 이익잠금 적용 여부를 잠근다. inputs: [] input_groups: required: - "profit_pct" - "atr20_pct" - "highest_price_since_entry" - "current_close" - "ma20" - "frg_inst_flow_5d" - "distribution_risk_score" states: NORMAL: "profit_pct < 8" BREAKEVEN_RATCHET: "profit_pct >= 8 OR current_close >= average_cost + atr20" PROFIT_LOCK_10: "profit_pct >= 10" PROFIT_LOCK_20: "profit_pct >= 20" PROFIT_LOCK_30: "profit_pct >= 30" APEX_TRAILING: "profit_pct >= 30 AND trend_intact" output: field: "profit_preservation_json" unit: "json_array" prohibition: - "수익 보호 상태를 LLM이 장기 전망으로 해제 금지" - "래칫 가격은 PROFIT_LOCK_RATCHET_V1/TRAILING_STOP_PRICE_V1/TICK_NORMALIZER_V1 결과만 허용" canonical_ref: "spec/13_formula_registry.yaml:PROFIT_LOCK_RATCHET_V1" version: "2026-05-20_APEX_V1" SMART_CASH_RAISE_PLAN_V1: purpose: > cash_shortfall을 해소하되 가격 훼손을 줄이기 위해 즉시 매도수량, 반등 대기수량, 최대 일일 매도수량, 실행 스타일을 결정론적으로 배정한다. inputs: [] input_groups: required: - "cash_shortfall_min_krw" - "cash_shortfall_target_krw" - "sell_candidates_json" - "current_price" - "atr20" - "rsi14" - "bb_position" - "ma20_distance_pct" - "avg_trade_value_5d" - "distribution_risk_score" - "profit_preservation_state" execution_styles: URGENT_LIQUIDITY_TRIM: "cash_floor_status=HARD_BLOCK AND not oversold" OVERSOLD_REBOUND_SELL: "rsi14 < 35 OR bb_position < 20 OR close < ma20 - 8%" DISTRIBUTION_EXIT: "distribution_risk_score >= 70" PROFIT_PROTECT_TRIM: "profit_preservation_state IN [PROFIT_LOCK_20, PROFIT_LOCK_30]" output: field: "cash_raise_plan_json" unit: "json_array" prohibition: - "OVERSOLD_REBOUND_SELL에서 즉시 매도수량 cap 초과 금지" - "코어 주도주는 tier 1~8 후보 소진 전 현금확보 1순위 금지" canonical_ref: "spec/risk/portfolio_exposure.yaml:sell_priority_engine" version: "2026-05-20_APEX_V1" REBOUND_SELL_TRIGGER_V1: purpose: "과매도 현금확보 후보의 잔여 매도를 반등 조건 충족 시점으로 지연한다." inputs: [] input_groups: required: - "current_price" - "prior_close" - "intraday_vwap" - "ma5" - "rsi14" - "volume_vs_5d" - "atr20" trigger_any: - "current_price >= prior_close + 0.5 * atr20" - "current_price > intraday_vwap AND rsi14 recovers above 40" - "current_price >= ma5 AND volume_vs_5d >= 0.8" output: field: "rebound_sell_trigger_json" unit: "json_array" prohibition: - "trigger_state 미충족 잔여수량을 LLM이 즉시 매도로 승격 금지" canonical_ref: "proposals/2026-05-20_APEX_ALPHA_PRESERVATION_EXECUTION_HARNESS_V1.md" version: "2026-05-20_APEX_V1" EXECUTION_QUALITY_GUARD_V1: purpose: "주문금액/거래대금/스프레드/변동성을 이용해 체결 품질과 분할 필요 여부를 검증한다." inputs: [] input_groups: required: - "avg_trade_value_5d" - "order_amount_krw" - "spread_pct" - "tick_size" - "intraday_volatility_pct" rules: max_order_vs_adv: "order_amount_krw <= avg_trade_value_5d * 0.03" split_required: "order_amount_krw > avg_trade_value_5d * 0.01" market_order_ban: "항상 시장가 금지. 비상 hard stop 예외도 하네스 명시 필요" reprice_limit: "불리한 방향 2회 이상 추격 정정 금지" output: field: "execution_quality_json" unit: "json_array" prohibition: - "execution_quality_status != PASS이면 HTS 주문표 PASS 금지" canonical_ref: "spec/05_position_sizing.yaml:liquidity_constraint" version: "2026-05-20_APEX_V1" BUY_PERMISSION_MATRIX_V1: purpose: "POSITION_SIZE_V1 이전에 매수 허가 상태와 최대 tranche를 확정한다." inputs: [] required_pass_all: - "cash_floor_status=PASS" - "heat_gate_status != BLOCK_NEW_BUY" - "distribution_risk_score < 55" - "alpha_lead_score >= 75 OR follow_through_state=CONFIRMED_ADD_ON" - "expected_edge >= floor" output: field: "buy_permission_json" unit: "json_array" states: ["ALLOW_PILOT", "ALLOW_ADD_ON", "WATCH", "BLOCKED"] prohibition: - "BUY_PERMISSION_MATRIX_V1 != ALLOW_*이면 buy_qty_inputs_json.final_qty는 null" canonical_ref: "spec/05_position_sizing.yaml:pre_permission_gate" version: "2026-05-20_APEX_V1" SELL_QUANTITY_ALLOCATOR_V1: purpose: "현금 부족액, 매도우선순위, 실행스타일, cap을 반영해 정수 매도수량을 확정한다." inputs: [] input_groups: required: - "cash_shortfall_krw" - "sell_priority_rank" - "holding_quantity" - "current_price" - "execution_style" - "max_daily_qty_pct" - "immediate_qty_cap_pct" output: field: "smart_sell_quantities_json" unit: "json_array" output_schema: immediate_sell_qty: "integer_or_null" staged_sell_qty: "integer_or_null" rebound_wait_qty: "integer_or_null" expected_cash_recovered_krw: "KRW" prohibition: - "LLM이 Sell_Ratio_Pct × holding_quantity를 직접 계산해 대체 금지" canonical_ref: "spec/00_execution_contract.yaml:signal_quantity_separation" version: "2026-05-20_APEX_V1" LIMIT_PRICE_POLICY_V1: purpose: "매수/매도 지정가를 실행 스타일별로 산출하고 TICK_NORMALIZER_V1을 강제 적용한다." inputs: [] sell_styles: normal_trim: "min(current_price, prior_close * 0.998)" rebound_sell: "rebound_trigger_price 근처 지정가" distribution_exit: "current_price - 0.25 * ATR20 범위 내 방어 지정가" profit_protect: "current_price 또는 trailing_stop 상단 기준" buy_styles: pilot: "close * 1.002 상한, chase cap 적용" pullback: "ma20 * 1.003 또는 close * 1.002 중 낮은 값" add_on: "follow_through_confirm 후 previous entry 대비 0.5~1.0% 상한" output: field: "limit_price_policy_json" unit: "json_array" post_process: "TICK_NORMALIZER_V1" prohibition: - "심리적 가격·차트 지지선으로 limit_price 대체 금지" - "TICK_OK 태그 없는 가격은 HTS 출력 금지" canonical_ref: "spec/13_formula_registry.yaml:TICK_NORMALIZER_V1" version: "2026-05-20_APEX_V1" # == [2026-05-20_K1] K1 - 분할 매수 트랜치 엔진 ========================== STAGED_ENTRY_TRANCHE_V1: purpose: > 파일럿(T1) → 돌파확인(T2) → 눌림재진입(T3) 순서로 매수 비중을 3단계로 분할. LLM이 한 번에 전량 매수를 지시하거나 PILOT_ALLOWED → ADD_ON 단계를 건너뛰는 것을 차단. buy_permission_json의 tranche_phase를 GAS가 확정하고 LLM은 복사만 한다. inputs: - {field: "alpha_lead_score", unit: "score_0_100"} - {field: "lead_entry_state", unit: "enum"} - {field: "follow_through_state", unit: "enum"} - {field: "holding_quantity", unit: "shares"} - {field: "profit_pct", unit: "percent"} - {field: "close_vs_ma20_pct", unit: "percent"} tranche_phases: WAIT_PILOT_SETUP: "진입 조건 미충족 - 매수 금지" TRANCHE_1_PILOT: "신규 파일럿 30% - PILOT_ALLOWED이며 포지션 없음" TRANCHE_2_ADD_ON: "본진입 추가 30% - CONFIRMED_ADD_ON + 기보유" TRANCHE_3_PULLBACK_ADD: "눌림 추가 40% - MA20 ±2% + 수익>3% + ADD_ON" HOLD_CURRENT: "현 포지션 유지 - 추가 매수 조건 미충족" output: fields: - {field: "tranche_phase", unit: "enum"} - {field: "current_tranche_allowed_pct", unit: "percent"} - {field: "next_tranche_condition", unit: "string"} prohibition: - "LLM이 tranche_phase를 임의로 TRANCHE_2·TRANCHE_3으로 승격 금지" - "WAIT_PILOT_SETUP·HOLD_CURRENT 상태에서 current_tranche_allowed_pct > 0 출력 금지" - "T1→T2→T3 순서 건너뜀 금지 - CONFIRMED_ADD_ON 없이 TRANCHE_3 진입 금지" canonical_ref: "AGENTS.md:Direction K1" version: "2026-05-20_K1" # == [2026-05-20_K2] K2 - 반등 대기 분할 매도 체계 ======================= K2_STAGED_REBOUND_SELL_V1: purpose: > 현금확보 매도(OVERSOLD_REBOUND_SELL 스타일)를 즉시매도(50%) + 반등대기(50%)로 분할해 주식가치 훼손을 최소화하면서 현금 수요를 충족한다. 즉시매도 예상금액 × 2가 shortfall을 충당하지 못할 때만 비상 전량 매도(emergency_full_sell=true)를 허용. inputs: - {field: "base_sell_qty", unit: "shares", note: "H3 SELL_QUANTITY_ALLOCATOR_V1 산출"} - {field: "close", unit: "KRW_per_share"} - {field: "cash_shortfall_min_krw", unit: "KRW", note: "G1 CASH_SHORTFALL_V1 산출"} - {field: "profit_preservation_state", unit: "enum"} - {field: "execution_style", unit: "enum", note: "OVERSOLD_REBOUND_SELL 이외 스타일은 미적용"} expressions: half_qty: "floor(base_sell_qty / 2)" half_expected_krw: "half_qty × close" emergency_full_sell: "cash_shortfall_min_krw > 0 AND half_expected_krw × 2 < cash_shortfall_min_krw" immediate_sell_qty: "emergency_full_sell ? base_sell_qty : half_qty" rebound_wait_qty: "emergency_full_sell ? 0 : max(0, base_sell_qty - half_qty)" oversold_cap_qty: "floor(holding_qty × cap_pct/100)" cap_pct_by_profit_state: PROFIT_LOCK_30: 40 APEX_TRAILING: 40 PROFIT_LOCK_20: 35 PROFIT_LOCK_10: 30 default: 50 output: fields: - {field: "immediate_sell_qty", unit: "shares"} - {field: "rebound_wait_qty", unit: "shares"} - {field: "emergency_full_sell", unit: "boolean"} - {field: "rebound_trigger_price", unit: "KRW_per_share", note: "prevClose + 0.5×ATR20 tick-normalized"} prohibition: - "rebound_wait_qty > 0인 물량을 반등 트리거 미충족 상태에서 즉시 매도 금지" - "emergency_full_sell=false에서 rebound_wait_qty를 LLM이 즉시매도로 전환 금지" - "OVERSOLD_REBOUND_SELL 외 스타일에 이 규칙 적용 금지" canonical_ref: "AGENTS.md:Direction K2" version: "2026-05-20_K2" # == [2026-05-20_K3] K3 - 국면·섹터 연계 H2 동적 우선순위 ================ K3_REGIME_SELL_PRIORITY_V1: purpose: > H2 정적 순위에 시장 국면(regime) 신호를 오버레이하여 동적 우선순위를 부여한다. EVENT_SHOCK에서는 KOSPI 고베타 종목이, RISK_ON에서는 섹터 상대약세 종목이 우선 정리된다. H2 원래 rank는 변경하지 않고 regime_priority_adjustment(-3~0)와 final_regime_rank을 추가한다. inputs: - {field: "h2_candidates", unit: "list", note: "H2 매도후보 배열 (rank/tier/score)"} - {field: "market_regime_state", unit: "enum"} - {field: "ret5d", unit: "percent"} - {field: "kospi_ret5d", unit: "percent"} - {field: "frg_5d", unit: "KRW"} - {field: "inst_5d", unit: "KRW"} - {field: "flow_credit", unit: "score_0_1"} - {field: "ac_gate", unit: "string"} adjustment_rules: RISK_OFF_EVENT_SHOCK: high_beta_proxy_gt_1_3: -3 dual_outflow: -2 above_beta_proxy_gt_1: -1 RISK_OFF_CANDIDATE: flow_credit_lt_0_30: -2 flow_credit_lt_0_45: -1 RISK_ON_SECULAR_LEADER: sector_lag_gt_3pct: -2 duplicate_etf: -2 LEADER_CONCENTRATION_NEUTRAL: anti_climax_gate: -1 output: field: "regime_adjusted_sell_priority_json" unit: "json_array" output_schema: rank: "H2 원래 순위" final_regime_rank: "국면 조정 후 최종 순위" regime_priority_adjustment: "조정값 (음수=우선 상향)" adjustment_reason: "조정 근거 코드" regime_applied: "적용된 국면 상태" prohibition: - "LLM이 regime_adjusted_sell_priority_json을 임의로 재정렬 금지" - "sell_priority_lock=true이면 LLM이 final_regime_rank도 번복 금지" - "H2 tier 경계를 넘는 순위 이동 금지 (tier 1 → tier 2 크로스 불가)" canonical_ref: "AGENTS.md:Direction K3" version: "2026-05-20_K3" # == [2026-05-20_L1] L1 - 섹터 로테이션 모멘텀 추적 ==================== SECTOR_ROTATION_MOMENTUM_V1: purpose: > sectorFlowRadar의 rank/prevRank/prevRankW2를 기반으로 각 섹터의 rank_delta를 계산하고 RISING/STABLE/FADING/TOPPING_OUT 모멘텀 상태를 분류한다. FADING(-15)/TOPPING_OUT(-10) 섹터 종목에 ALPHA_LEAD_SCORE_V1 페널티를 적용한다. 결과는 sector_rotation_momentum_json으로 고착화 - LLM 재산출 금지. inputs: - {field: "sector", unit: "string"} - {field: "rank", unit: "integer", note: "현재 주 섹터 로테이션 순위"} - {field: "prev_rank_w1", unit: "integer", note: "1주 전 순위"} - {field: "prev_rank_w2", unit: "integer", note: "2주 전 순위"} derived_fields: rank_delta_w1: "rank - prev_rank_w1 (양수=순위 하락=약화)" rank_delta_w2: "rank - prev_rank_w2" momentum_states: RISING: "rank_delta_w1 <= -2 (순위 상승 → 로테이션 유입)" STABLE: "변화 없음 또는 소폭 등락" TOPPING_OUT: "rank <= 3 AND rank_delta_w1 >= 1 (상위권이지만 하락 전환)" FADING: "rank_delta_w1 >= 2 AND rank_delta_w2 >= 2 (연속 순위 하락)" alpha_lead_penalty: FADING: -15 TOPPING_OUT: -10 output: field: "sector_rotation_momentum_json" unit: "json_array" output_schema: sector: "섹터명" rank: "현재 순위" rank_delta_w1: "1주 delta (양수=하락)" rank_delta_w2: "2주 delta" momentum_state: "RISING/STABLE/TOPPING_OUT/FADING" prohibition: - "LLM이 sector_rotation_momentum_json을 재정렬·재산출 금지" - "sector_rotation_momentum_lock=true이면 LLM이 momentum_state를 번복 금지" canonical_ref: "AGENTS.md:Direction L1" version: "2026-05-20_L1" # == [2026-05-20_L4] L4 - 분배 선행경보 (신고점수축 / 급등약류) ========== PRE_DISTRIBUTION_EARLY_WARNING_V1: purpose: > DISTRIBUTION_RISK_SCORE_V1에 두 가지 선행경보 신호를 추가한다. (1) 신고점 근접 + 거래량 수축: 분배 직전 전형 패턴 (score +12) (2) 5일 급등(+5% 이상) + 수급 약화(flowCredit<0.45): 급등 후 설거지 위험 (score +10) 기존 BLOCK_BUY/TRIM_REVIEW 임계값(70/55)을 낮추지 않고 신호 누적으로 조기 반영. inputs: - {field: "close", unit: "KRW_per_share"} - {field: "high52w", unit: "KRW_per_share", note: "미제공 시 MA20×1.15 대체"} - {field: "volume", unit: "shares"} - {field: "avg_volume_5d", unit: "shares"} - {field: "ret5d", unit: "pct"} - {field: "flow_credit", unit: "0~1"} signals: new_high_volume_contraction: condition: "(close >= high52w×0.97 OR close > MA20×1.15) AND volume < avgVol5d×0.80" score: 12 surge_weak_flow: condition: "ret5d >= 5 AND flow_credit < 0.45" score: 10 output: field: "pre_distribution_warning" values: EARLY_WARNING: "신고점수축 또는 급등약류 신호 발생 - 분배 선행경보" NONE: "선행경보 신호 없음" prohibition: - "LLM이 pre_distribution_warning=EARLY_WARNING 종목에 신규 BUY를 즉시 실행 금지" - "선행경보 무시하고 '아직 BLOCK_BUY 아니니 OK' 판단 금지" canonical_ref: "AGENTS.md:Direction L4" version: "2026-05-20_L4" # == [2026-05-20_L2] L2 - ATR 기반 자동 트레일링 손절 =================== RATCHET_TRAILING_AUTO_V1: purpose: > 수익 구간(PROFIT_LOCK_20/30, APEX_TRAILING)에서 ATR20 기반 자동 트레일링 손절가를 산출한다. 기존 ratchet_stop(하드 래칫)과 비교해 더 유리한(높은) 값을 auto_trailing_stop으로 고착화. LLM이 "익절 후 홀드" 판단에서 임의로 손절가를 낮추는 것을 구조적으로 차단. inputs: - {field: "highest_price_since_entry", unit: "KRW_per_share"} - {field: "stop_price", unit: "KRW_per_share", note: "기존 ratchet_stop"} - {field: "atr20", unit: "KRW_per_share"} - {field: "profit_preservation_state", unit: "enum"} expression: > PROFIT_LOCK_20: auto_trailing_stop = max(ratchet_stop, highest_close - 1.5×ATR20); PROFIT_LOCK_30 / APEX_TRAILING: auto_trailing_stop = max(ratchet_stop, highest_close - 2.0×ATR20); 이외: auto_trailing_stop = null 최종값은 KRX 호가단위로 floor 정규화 (tickNormalize_) output: field: "auto_trailing_stop" unit: "KRW_per_share_or_null" description: "ATR 트레일링 손절가. null이면 해당 수익 구간 아님. LLM이 이 값보다 낮은 손절가 제시 금지." prohibition: - "LLM이 auto_trailing_stop보다 낮은 손절가를 손절 원장에 기재 금지" - "profit_lock 구간에서 ATR 조건 없이 임의로 홀드 연장하는 서술 금지" canonical_ref: "AGENTS.md:Direction L2" version: "2026-05-20_L2" # == [2026-05-20_L3] L3 - 국면별 동적 Heat Gate ========================== DYNAMIC_HEAT_GATE_V1: purpose: > marketRegime에 따라 Heat Gate 임계값을 동적으로 조정한다. EVENT_SHOCK 국면에서는 임계값을 크게 낮춰 신규 매수를 강하게 억제하고, RISK_ON/SECULAR_LEADER 국면에서는 임계값을 높여 매수 여지를 확장한다. 고착화된 HEAT_HARD_BLOCK_PCT=10% 단일값을 국면 감응형으로 대체. inputs: - {field: "total_heat_pct", unit: "pct"} - {field: "market_regime", unit: "string"} thresholds_by_regime: EVENT_SHOCK: {hard_block: 5.0, halve: 3.5} RISK_OFF: {hard_block: 7.0, halve: 5.0} NEUTRAL: {hard_block: 10.0, halve: 7.0} RISK_ON: {hard_block: 12.0, halve: 8.5} SECULAR_LEADER_RISK_ON: {hard_block: 13.0, halve: 9.0} expression: > heatThresholds = calcDynamicHeatThresholds_(marketRegime); heatGate = total_heat_pct >= heatThresholds.hardBlock ? BLOCK_NEW_BUY : total_heat_pct >= heatThresholds.halve ? HALVE_NEW_BUY_QUANTITY : ALLOW_CONTINUE output: field: "heat_gate_threshold_pct" unit: "pct" description: "현재 국면에서 적용된 hard_block 임계값 (GAS 산출, LLM 변경 금지)" prohibition: - "LLM이 heat_gate_threshold_pct를 임의로 재계산하거나 무시 금지" - "heat_gate_status=BLOCK_NEW_BUY이면 LLM이 BUY 액션을 복원 금지" canonical_ref: "AGENTS.md:Direction L3" version: "2026-05-20_L3" # == [2026-05-20_M1] M1 - 연속 손절 자동 매수 축소 ====================== DRAWDOWN_GUARD_V1: purpose: > 연속 손절 횟수(consecutive_losses)에 따라 신규 매수 비중을 자동 축소한다. bayesian_multiplier=0(>=5회) 위에 추가 방어층. 2~4회 구간에서도 조기 축소. inputs: - {field: "consecutive_losses", unit: "integer"} thresholds: ">=5": {state: "NO_BUY", buy_scale: 0.0} ">=3": {state: "REDUCE_BUY", buy_scale: 0.5} ">=2": {state: "CAUTION_BUY", buy_scale: 0.75} "0-1": {state: "NORMAL", buy_scale: 1.0} output: fields: drawdown_guard_state: "NO_BUY/REDUCE_BUY/CAUTION_BUY/NORMAL" drawdown_buy_scale: "atrQty 곱셈 배수 (0~1.0). GAS 적용 후 고착화" drawdown_consecutive_losses: "현재 연속 손절 횟수" prohibition: - "LLM이 drawdown_buy_scale을 무시하고 정상 수량 제시 금지" - "drawdown_guard_state=NO_BUY이면 BUY 주문 수량 0 또는 주문 생성 금지" canonical_ref: "AGENTS.md:Direction M1" version: "2026-05-20_M1" # == [2026-05-20_M2] M2 - 포트폴리오 가중평균 베타 관리 ================= PORTFOLIO_BETA_GATE_V1: purpose: > 보유 종목 가중평균 베타(beta_proxy = ret5d/kospiRet5d)를 산출하고 국면별 상한과 비교해 OVER_BETA/WARN_BETA/PASS를 결정한다. OVER_BETA 시 고베타 종목 TRIM 우선 조정. inputs: - {field: "weight_pct", unit: "pct"} - {field: "ret5d", unit: "pct"} - {field: "kospi_ret5d", unit: "pct"} - {field: "market_regime", unit: "enum"} beta_limits_by_regime: EVENT_SHOCK: {over: 0.7, warn: 0.5} RISK_OFF: {over: 0.8, warn: 0.6} NEUTRAL: {over: 1.0, warn: 0.8} RISK_ON: {over: 1.3, warn: 1.0} SECULAR_LEADER_RISK_ON: {over: 1.5, warn: 1.2} output: fields: portfolio_beta: "가중평균 베타 (GAS 산출)" portfolio_beta_gate: "OVER_BETA/WARN_BETA/PASS/INSUFFICIENT_DATA" portfolio_beta_gate_json: "per-holding 베타 상세" prohibition: - "portfolio_beta_gate=OVER_BETA이면 고베타 종목 신규 BUY 금지" - "LLM이 beta 값을 임의 재계산 금지" canonical_ref: "AGENTS.md:Direction M2" version: "2026-05-20_M2" # == [2026-05-20_M3] M3 - 분할 익절 수량 자동화 ========================= TP_QUANTITY_LADDER_V1: purpose: > TP1/TP2/TP3 도달 시 매도할 수량을 GAS에서 자동 산출해 고착화한다. 수동 입력(tp1_qty>0) 우선 사용, 없으면 보유수량의 33%/33%/34% 자동 분배. LLM이 익절 수량을 임의로 결정하는 것을 구조적으로 차단. inputs: - {field: "holding_qty", unit: "shares"} - {field: "tp1_price", unit: "KRW_per_share"} - {field: "tp1_qty", unit: "shares", note: "수동 입력 우선"} - {field: "tp2_price", unit: "KRW_per_share"} - {field: "tp2_qty", unit: "shares"} - {field: "tp3_qty", unit: "shares"} output: field: "tp_quantity_ladder_json" schema: tp1_qty: "TP1 도달 시 매도 수량 (수동/AUTO_33PCT)" tp2_qty: "TP2 도달 시 매도 수량" tp3_qty: "TP3/잔량 수량" qty_source: "MANUAL/AUTO_33PCT/NO_HOLDING" prohibition: - "tp_quantity_ladder_lock=true이면 LLM이 익절 수량을 임의 변경 금지" - "TP 가격 도달 시 tp_quantity_ladder_json의 수량을 반드시 사용" canonical_ref: "AGENTS.md:Direction M3" version: "2026-05-20_M3" # == [2026-05-20_M4] M4 - 이벤트 리스크 신규 매수 홀드 ================== EVENT_RISK_HOLD_GATE_V1: purpose: > 이벤트 홀드 기간(Event_Hold_Days <= 5) 또는 DART 리스크 플래그가 있는 종목에 신규 매수 홀드 게이트를 적용한다. Event_Hold_Days 컬럼이 없으면 DART_Risk='Y' 또는 DART_Status를 대체 기준으로 사용. inputs: - {field: "event_hold_days", unit: "integer_or_null", note: "Event_Hold_Days 컬럼"} - {field: "dart_risk", unit: "string", note: "Y/N 또는 상태 문자열"} output: field: "event_risk_json" schema: event_hold_gate: "EVENT_HOLD/PASS" event_hold_days: "남은 홀드 일수 (null=컬럼 없음)" dart_risk: "true/false" reason: "event_hold_days_le5:N / dart_risk / no_event_risk" prohibition: - "event_hold_gate=EVENT_HOLD인 종목에 신규 BUY 주문 생성 금지" - "이벤트 홀드를 LLM이 임의 해제 금지" canonical_ref: "AGENTS.md:Direction M4" version: "2026-05-20_M4" # == [2026-05-20_M5] M5 - 섹터 편중도 한도 ============================== SECTOR_CONCENTRATION_LIMIT_V1: purpose: > 단일 섹터 ≥40%(RISK_OFF:35%) 시 해당 섹터 추가 매수 차단. 상위 2개 섹터 합산 ≥65%(RISK_OFF:55%) 시 WARN_TOP2. 포트폴리오 섹터 분산을 GAS가 결정론적으로 산출 - LLM 임의 완화 금지. inputs: - {field: "weight_pct", unit: "pct"} - {field: "sector", unit: "string"} - {field: "market_regime", unit: "enum"} thresholds_by_regime: EVENT_SHOCK_RISK_OFF: {single_block: 35, top2_warn: 55} OTHER: {single_block: 40, top2_warn: 65} output: fields: sector_concentration_gate: "BLOCK_SECTOR/WARN_TOP2/PASS" sector_concentration_json: "섹터별 weight_pct 및 gate 상태" prohibition: - "sector_concentration_gate=BLOCK_SECTOR인 섹터 종목에 추가 BUY 금지" - "LLM이 섹터 편중도를 임의로 재계산하거나 한도를 완화 금지" canonical_ref: "AGENTS.md:Direction M5" version: "2026-05-20_M5" # == [2026-05-20_N1] N1 - 국면별 포지션 사이즈 스케일 ===================== POSITION_SIZE_REGIME_SCALE_V1: purpose: > 국면에 따라 ATR 기반 신규 매수 수량(atrQty)에 스케일 배수를 적용한다. M1(DrawdownGuard) 이후 독립적으로 곱해지는 방어/공격 층. EVENT_SHOCK:0.25, RISK_OFF:0.5, NEUTRAL:1.0, RISK_ON:1.1, SECULAR_LEADER_RISK_ON:1.2 inputs: - {field: "market_regime", unit: "enum"} output: field: "regime_size_scale" schema: regime_size_scale: "0.25~1.2 배수 - atrQty에 곱해지는 국면 스케일" prohibition: - "regime_size_scale 값을 LLM이 임의 변경 금지" - "매수 수량 산출 시 반드시 GAS 확정 regime_size_scale 사용" canonical_ref: "AGENTS.md:Direction N1" version: "2026-05-20_N1" # == [2026-05-20_N2] N2 - 거래량 돌파 확인 게이트 ========================= VOLUME_BREAKOUT_CONFIRM_V1: purpose: > 52주 신고가 97% 이상 부근에서 진입 시 당일 거래량이 5일 평균 거래량×1.2 미만이면 UNCONFIRMED_BREAKOUT으로 alpha_lead_score에서 10점 차감. 거래량 미확인 신고가 뒷박을 방지한다. inputs: - {field: "high52w", unit: "KRW_per_share"} - {field: "close", unit: "KRW_per_share"} - {field: "volume", unit: "shares_integer"} - {field: "avg_volume_5d", unit: "shares_float"} threshold: near_new_high_pct: 97 vol_confirm_multiplier: 1.2 score_penalty: -10 late_chase_risk_add: 15 output: field: "alpha_lead_json" note: "reason_codes에 unconfirmed_breakout_volume 추가" prohibition: - "거래량 미확인 신고가 부근 종목에 PILOT_ALLOWED 부여 금지" canonical_ref: "AGENTS.md:Direction N2" version: "2026-05-20_N2" # == [2026-05-20_N3] N3 - 손절가 적정성 검증 ============================= STOP_PRICE_ADEQUACY_V1: purpose: > 보유 종목의 수동 손절가가 ATR 기반 권고 손절가 대비 너무 넓게 설정되었는지 검증한다. manual_stop < recommended_stop×0.60 → STOP_CRITICAL manual_stop < recommended_stop×0.85 → STOP_WIDE recommended_stop = max(avgCost×0.92, avgCost - ATR20×multiplier), tickNormalize 적용 inputs: - {field: "stop_price", unit: "KRW_per_share"} - {field: "average_cost", unit: "KRW_per_share"} - {field: "atr20", unit: "KRW_per_share"} thresholds: critical_ratio: 0.60 wide_ratio: 0.85 atr_multiplier_high_vol: 2.0 atr_multiplier_normal: 1.5 high_vol_threshold_pct: 8.0 output: field: "stop_adequacy_json" schema: ticker: "종목코드" manual_stop: "수동 손절가" recommended_stop: "ATR 기반 권고 손절가 (tick 정규화)" stop_gap_pct: "gap = (recommended - manual) / recommended × 100" adequacy_status: "PASS/STOP_WIDE/STOP_CRITICAL/INSUFFICIENT_DATA" prohibition: - "stop_adequacy_json을 LLM이 임의 수정 금지" - "STOP_CRITICAL 종목에 추가 매수 신호 생성 금지" canonical_ref: "AGENTS.md:Direction N3" version: "2026-05-20_N3" # == [2026-05-20_N4] N4 - 장기 보유 재검토 플래그 ========================= HOLDING_STALE_REVIEW_V1: purpose: > account_snapshot의 entry_date 기준으로 보유 기간을 산출한다. >60일: STALE_POSITION (근거 재검토 의무), >30일: REVIEW_SOON, <=30일: FRESH entry_date 컬럼이 없으면 ENTRY_DATE_MISSING. inputs: - {field: "entry_date", unit: "ISO_date_string"} thresholds: stale_days: 60 review_days: 30 output: field: "holding_stale_json" schema: ticker: "종목코드" entry_date: "진입일 (ISO)" holding_days: "보유 일수" stale_status: "STALE_POSITION/REVIEW_SOON/FRESH/ENTRY_DATE_MISSING" prohibition: - "holding_stale_json을 LLM이 임의 산출 금지" - "STALE_POSITION 종목 보유 유지 시 근거 재확인 의무 (LLM 자동 승인 금지)" canonical_ref: "AGENTS.md:Direction N4" version: "2026-05-20_N4" # == [2026-05-20_N5] N5 - 국면별 현금 최소 비율 상향 ===================== REGIME_CASH_UPLIFT_V1: purpose: > MRS 기반 cash_floor보다 더 높은 현금 최소 비율이 국면(regime)상 요구될 때 cashFloorInfo.minPct를 상향 오버라이드하고 cashShortfallInfo를 재산출한다. EVENT_SHOCK→20%, RISK_OFF→15%, RISK_ON→5% (MRS값보다 낮으면 MRS값 유지). inputs: - {field: "market_regime", unit: "enum"} - {field: "cash_floor_min_pct", unit: "pct"} thresholds_by_regime: EVENT_SHOCK: 20 RISK_OFF: 15 RISK_ON: 5 NEUTRAL: 0 output: field: "regime_cash_uplift_min_pct" note: "max(mrs_cash_min_pct, regime_min_pct) - 실제 적용된 현금 최소 비율" prohibition: - "regime_cash_uplift_min_pct를 LLM이 임의 낮추기 금지" - "BELOW_FLOOR 상태에서 매수 신호 생성 금지" canonical_ref: "AGENTS.md:Direction N5" version: "2026-05-20_N5" # == [2026-05-20_O1] O1 - 개별 종목 비중 상한 ============================= SINGLE_POSITION_WEIGHT_CAP_V1: purpose: > 개별 종목의 포트폴리오 비중(weight_pct)이 국면별 상한을 초과하면 OVERWEIGHT_TRIM. M5(섹터 편중)와 독립적인 종목 단위 비중 하드 캡. NEUTRAL/RISK_ON:20%, EVENT_SHOCK/RISK_OFF:15% inputs: - {field: "weight_pct", unit: "pct"} - {field: "market_regime", unit: "enum"} thresholds_by_regime: EVENT_SHOCK_RISK_OFF: {cap_pct: 15} OTHER: {cap_pct: 20} output: fields: single_position_weight_gate: "OVERWEIGHT_TRIM/PASS" single_position_weight_json: "종목별 weight_pct vs cap_pct 상태" prohibition: - "OVERWEIGHT_TRIM 종목에 추가 매수 신호 생성 금지" - "LLM이 비중 상한을 임의 완화 금지" canonical_ref: "AGENTS.md:Direction O1" version: "2026-05-20_O1" # == [2026-05-20_O2] O2 - 반도체 클러스터 합산 비중 게이트 ================= SEMICONDUCTOR_CLUSTER_GATE_V1: purpose: > 005930(삼성전자) + 000660(SK하이닉스) 합산 비중이 시장 국면별 상한을 초과하면 CLUSTER_BLOCK. 두 종목이 같은 메모리 사이클에서 동반 하락하는 상관 리스크 통제. EVENT_SHOCK/RISK_OFF: ≥20%, NEUTRAL/RISK_ON: ≥25%, SECULAR_LEADER_RISK_ON: ≥35%, CONCENTRATED_LEADER_ADVANCE(CLA): ≥60% → CLUSTER_BLOCK inputs: - {field: "weight_pct", unit: "pct"} - {field: "market_regime", unit: "enum"} thresholds_by_regime: EVENT_SHOCK_RISK_OFF: {cap_pct: 20} NEUTRAL_RISK_ON: {cap_pct: 25} SECULAR_LEADER_RISK_ON: {cap_pct: 35} CONCENTRATED_LEADER_ADVANCE: {cap_pct: 60} output: fields: semiconductor_cluster_gate: "CLUSTER_BLOCK/PASS" semiconductor_cluster_json: "클러스터 합산 비중 및 종목별 비중" prohibition: - "CLUSTER_BLOCK 상태에서 005930 또는 000660 추가 매수 금지" - "LLM이 하네스/국면별 클러스터 한도를 임의 상향 또는 하향 금지" canonical_ref: "AGENTS.md:Direction O2" version: "2026-05-20_O2" # == [2026-05-20_O3] O3 - 포트폴리오 고점 대비 낙폭 게이트 ================== PORTFOLIO_DRAWDOWN_GATE_V1: purpose: > 총자산(total_asset_krw)의 역대 고점(settings.portfolio_peak_krw) 대비 낙폭을 산출한다. -15% → DRAWDOWN_CAUTION(신규 매수 보류 권고) -20% → DRAWDOWN_FORCE_RISK_OFF(신규 매수 전면 차단 권고) 현재 자산이 고점 초과 시 GAS가 settings에 새 고점을 자동 기록. inputs: - {field: "total_asset_krw", unit: "KRW"} - {field: "portfolio_peak_krw", unit: "KRW", note: "settings 시트 자동 갱신"} thresholds: caution_pct: 15 force_off_pct: 20 output: fields: portfolio_drawdown_gate: "DRAWDOWN_FORCE_RISK_OFF/DRAWDOWN_CAUTION/PASS/INSUFFICIENT_DATA" portfolio_drawdown_pct: "현재 낙폭 % (양수=낙폭)" portfolio_peak_krw: "적용된 고점 자산 (원)" prohibition: - "DRAWDOWN_FORCE_RISK_OFF 상태에서 신규 매수 BUY 주문 생성 금지" - "portfolio_peak_krw를 LLM이 임의 설정 금지" canonical_ref: "AGENTS.md:Direction O3" version: "2026-05-20_O3" # == [2026-05-20_O4] O4 - 최근 승률 하락 매수 축소 게이트 ==================== WIN_LOSS_STREAK_GUARD_V1: purpose: > 최근 30거래 승률(win_rate_30)이 임계값 이하로 하락하면 신규 매수 비중을 자동 축소한다. M1(연속 손절 횟수)과 독립적인 전체 승률 축 방어층. EDGE_CRITICAL(<30%):scale=0.25, EDGE_DEGRADED(<40%):scale=0.50, EDGE_WEAK(<45%):scale=0.75, EDGE_OK(>=45%):scale=1.0 trades_used<10 → INSUFFICIENT_HISTORY(scale=1.0) inputs: - {field: "win_rate_30", unit: "ratio_0_to_1"} - {field: "trades_used", unit: "integer"} thresholds: edge_critical: 0.30 edge_degraded: 0.40 edge_weak: 0.45 min_trades: 10 output: fields: win_loss_streak_state: "EDGE_OK/EDGE_WEAK/EDGE_DEGRADED/EDGE_CRITICAL/INSUFFICIENT_HISTORY" win_loss_streak_buy_scale: "0.25/0.50/0.75/1.0 - atrQty에 곱해지는 배수" win_loss_streak_win_rate_pct: "최근 30거래 승률 %" prohibition: - "win_loss_streak_buy_scale를 LLM이 임의 복원 금지" - "EDGE_CRITICAL 상태에서 atr_qty 수동 상향 금지" canonical_ref: "AGENTS.md:Direction O4" version: "2026-05-20_O4" # == [2026-05-20_O5] O5 - 동시 보유 종목 수 상한 ============================ POSITION_COUNT_LIMIT_V1: purpose: > 동시 보유 종목 수가 국면별 상한을 초과하면 POSITION_COUNT_BLOCK. 과다 분산으로 인한 집중 모니터링 불가 및 Total Heat 과소 추정 방지. NEUTRAL/RISK_ON:10종목, EVENT_SHOCK/RISK_OFF:6종목 inputs: - {field: "market_regime", unit: "enum"} - {field: "holding_qty", unit: "integer", note: "보유 종목 수 (holdings.length)"} thresholds_by_regime: EVENT_SHOCK_RISK_OFF: {max_count: 6} OTHER: {max_count: 10} output: fields: position_count_gate: "POSITION_COUNT_BLOCK/PASS" position_count: "현재 보유 종목 수" position_count_max: "국면별 최대 허용 종목 수" prohibition: - "POSITION_COUNT_BLOCK 상태에서 신규 BUY 주문 생성 금지" - "LLM이 position_count_max를 임의 상향 금지" canonical_ref: "AGENTS.md:Direction O5" version: "2026-05-20_O5" # == [2026-05-20_P1] P1 - 손절가 이탈 즉시 경보 ========================= STOP_BREACH_ALERT_V1: purpose: > 보유 종목 중 close <= stop_price인 종목을 즉시 경보한다. close <= stop_price → BREACH_IMMEDIATE_EXIT (정규 게이트값=BREACH) close <= stop_price × 1.03 → STOP_APPROACHING (게이트=APPROACHING) 현재 stopBreach 필드를 하네스 레벨 gate로 올린 것. inputs: - {field: "close", unit: "KRW_per_share"} - {field: "stop_price", unit: "KRW_per_share"} thresholds: approaching_ratio: 1.03 output: fields: stop_breach_gate: "BREACH/APPROACHING/PASS" stop_breach_alert_json: "종목별 경보 상태·gap_pct 배열" prohibition: - "stop_breach_gate=BREACH 종목에 추가 매수 또는 HOLD 서술 금지" - "stop_breach_alert_json을 LLM이 임의 수정 금지" canonical_ref: "AGENTS.md:Direction P1" version: "2026-05-20_P1" # == [2026-05-20_P2] P2 - 익절가 도달 즉각 수량 연계 ==================== TP_TRIGGER_ALERT_V1: purpose: > 보유 종목 중 close >= tp1_price 또는 close >= tp2_price인 종목을 감지한다. tp_quantity_ladder_json과 연계해 즉각 매도 수량을 확정론적으로 제공한다. tp_trigger_gate=TRIGGERED이면 해당 종목의 tp_qty를 LLM이 임의 변경 금지. inputs: - {field: "close", unit: "KRW_per_share"} - {field: "tp1_price", unit: "KRW_per_share"} - {field: "tp2_price", unit: "KRW_per_share"} - {field: "tp_quantity_ladder_json", unit: "json"} output: fields: tp_trigger_gate: "TRIGGERED/PASS" tp_trigger_alert_json: "트리거된 종목·tp_qty 배열" prohibition: - "TRIGGERED 종목의 매도 수량을 LLM이 tp1_qty/tp2_qty 외 값으로 변경 금지" - "TP 가격 도달 여부를 LLM이 재계산 금지" canonical_ref: "AGENTS.md:Direction P2" version: "2026-05-20_P2" # == [2026-05-20_P3] P3 - Heat 편중도 경보 =============================== HEAT_CONCENTRATION_ALERT_V1: purpose: > 단일 종목의 Heat(=(avgCost-stopPrice)×qty)가 전체 totalHeatKrw의 50% 이상이면 HEAT_CONCENTRATED 경보. 해당 종목 급락 시 total_heat_pct가 급변해 다른 게이트가 무력화되는 구조적 리스크를 사전 차단. inputs: - {field: "average_cost", unit: "KRW_per_share"} - {field: "stop_price", unit: "KRW_per_share"} - {field: "total_heat_pct", unit: "pct", note: "total_heat_krw 기준"} threshold: concentration_pct: 50 output: fields: heat_concentration_gate: "HEAT_CONCENTRATED/PASS/INSUFFICIENT_DATA" heat_concentration_json: "종목별 heat_krw·heat_share_pct" prohibition: - "HEAT_CONCENTRATED 종목에 추가 매수 신호 생성 금지" - "heat_share_pct를 LLM이 임의 계산 금지" canonical_ref: "AGENTS.md:Direction P3" version: "2026-05-20_P3" # == [2026-05-20_P4] P4 - 국면 전환 경보 ================================= REGIME_TRANSITION_ALERT_V1: purpose: > 직전 실행 국면(settings.prev_market_regime) vs 현재 marketRegime를 비교한다. UPGRADE(완화): RISK_OFF→NEUTRAL 등, DOWNGRADE(긴축): NEUTRAL→RISK_OFF 등 LATERAL_SHIFT: 동급 국면 변경, NO_CHANGE: 변동 없음. 국면 전환 시 영향 받는 게이트 목록을 affected_gates에 자동 생성. inputs: - {field: "market_regime", unit: "enum"} - {field: "portfolio_peak_krw", unit: "KRW", note: "settings 시트"} output: fields: regime_transition_type: "UPGRADE/DOWNGRADE/LATERAL_SHIFT/NO_CHANGE" regime_transition_json: "전환 상세 (prev/current/affected_gates)" prohibition: - "DOWNGRADE 국면에서 기존 포지션 규모 자동 유지 서술 금지" - "LLM이 regime_transition_type을 임의 판단 금지" canonical_ref: "AGENTS.md:Direction P4" version: "2026-05-20_P4" # == [2026-05-20_P5] P5 - 포트폴리오 건전성 종합 점수 ==================== PORTFOLIO_HEALTH_SCORE_V1: purpose: > O1~P4까지 모든 게이트 상태를 집계해 단일 건전성 레이블을 산출한다. CRITICAL 게이트 ≥1개, 또는 CAUTION ≥3개 → CRITICAL CAUTION 1~2개 → CAUTION, 0개 → HEALTHY score = max(0, 100 - critical×30 - caution×10) 보고서 첫 줄에 반드시 표시. LLM이 개별 게이트 확인 없이 이 레이블로 우선 판단. inputs: - {field: "heat_gate_status", unit: "enum"} - {field: "cash_floor_status", unit: "enum"} - {field: "portfolio_drawdown_gate", unit: "enum"} - {field: "stop_breach_gate", unit: "enum"} - {field: "tp_trigger_gate", unit: "enum"} output: fields: portfolio_health_label: "HEALTHY/CAUTION/CRITICAL" portfolio_health_score: "0~100 점수" portfolio_health_critical_count: "CRITICAL 상태 게이트 수" portfolio_health_caution_count: "CAUTION 상태 게이트 수" portfolio_health_blocked_json: "게이트별 severity 상세" prohibition: - "보고서 시작 전에 portfolio_health_label을 반드시 표시" - "CRITICAL 레이블이면 보고서 본문 이전에 '긴급 주의' 섹션 필수" - "LLM이 health_score를 재계산하거나 임의로 CRITICAL→CAUTION 완화 금지" canonical_ref: "AGENTS.md:Direction P5" version: "2026-05-20_P5" BUY_TIMING_SUITABILITY_V1: purpose: "core_satellite 후보 품질과 실제 매수 타이밍을 분리한다." inputs: - {field: "candidate_quality_grade", unit: "enum"} - {field: "entry_mode_gate", unit: "enum"} - {field: "timing_score_entry", unit: "score_0_100"} - {field: "timing_score_exit", unit: "score_0_100"} - {field: "expected_edge", unit: "ratio", optional: true} - {field: "liquidity_status", unit: "enum"} - {field: "spread_status", unit: "enum"} output: {field: "execution_recommendation_state", unit: "enum"} gates: - "timing_score_exit >= 50 -> BUY_BLOCKED_T1_EXIT_RISK" - "entry_mode_gate != PASS -> WATCH_TIMING_SETUP" - "candidate_quality_grade=A AND entry_mode_gate=PASS AND timing_score_entry>=75 -> BUY_PILOT_ALLOWED" missing_policy: "핵심 입력 누락 시 CANDIDATE_ONLY. LLM이 BUY로 승격 금지." version: "2026-05-20_CORE_SAT_TIMING_V1" T1_FORCED_SELL_RISK_V1: purpose: "오늘 매수하면 다음 거래일 손절·매도검토가 발생할 위험을 0~100점으로 산출한다." inputs: - {field: "sell_action", unit: "enum"} - {field: "sell_validation", unit: "enum"} - {field: "timing_score_exit", unit: "score_0_100"} - {field: "rw_partial", unit: "count"} - {field: "distribution_risk_score", unit: "score_0_100", optional: true} - {field: "late_chase_risk_score", unit: "score_0_100", optional: true} - {field: "rsi14", unit: "points", optional: true} - {field: "disparity", unit: "pct", optional: true} - {field: "val_surge_pct", unit: "pct", optional: true} - {field: "ret5d", unit: "pct", optional: true} - {field: "dart_risk", unit: "string", optional: true} output: {field: "t1_forced_sell_risk_score", unit: "score_0_100"} expression: "min(100, sell_action_active*40 + timing_exit_ge_50*25 + rw_ge_2*25 + distribution_ge_70*30 + late_chase_ge_70*25 + overheated*20 + surge_after_runup*15 + dart_risk*30)" gates: - "score>=70 -> BUY_BLOCKED_T1_EXIT_RISK" - "50<=score<70 -> WATCH_ONLY_T1_RISK" - "score<50 -> PASS" version: "2026-05-20_CORE_SAT_TIMING_V1" SELL_CONFLICT_AWARE_RECOMMENDATION_V1: purpose: "매도·현금확보·NO_ADD 게이트와 충돌하는 신규 core_satellite 매수 추천을 차단한다." inputs: - {field: "final_action", unit: "enum"} - {field: "sell_action", unit: "enum"} - {field: "cash_preserve_style", unit: "enum"} - {field: "allowed_action", unit: "enum"} output: {field: "sell_conflict_score", unit: "score_0_100"} expression: "min(100, sell_signal_active*55 + cash_preserve_active*20 + no_add_gate*20)" gates: - "score>=70 -> BUY_BLOCKED_SELL_CONFLICT" - "40<=score<70 -> SELL_OR_TRIM_FIRST" - "score<40 -> PASS" version: "2026-05-20_CORE_SAT_TIMING_V1" # == [2026-05-20_H6] H6 - 가짜 매도 신호 차단 홀드 게이트 ================= ANTI_WHIPSAW_HOLD_GATE_V1: purpose: > 연속 매도 신호 5일 이상 + 기관·외국인 순매수 조합을 감지해 가짜 매도(whipsaw)를 차단한다. WHIPSAW_SUSPECTED이면 당일 매도를 1거래일 홀드시키고, 다음날 재평가. 설거지(distribution sell) 패턴과 구별해 실제 분산매도인지 재확인. inputs: - {field: "consecutive_sell_signals_5d", unit: "count", note: "최근 5일간 연속 매도 신호 수"} - {field: "vol_surge_pct", unit: "pct", note: "당일 거래량/avg_vol_5d - 1 (0 이상)"} - {field: "institutional_flow_5d", unit: "KRW", note: "기관 5일 누적 순매수 (양수=순매수)"} - {field: "foreign_flow_5d", unit: "KRW", note: "외국인 5일 누적 순매수 (양수=순매수)"} - {field: "sector_relative_strength_5d", unit: "ratio", note: "섹터 5일 상대강도, 100=시장동률"} scoring: whipsaw_score_components: - {condition: "consecutive_sell_signals_5d >= 5", score: +20, note: "연속 매도신호 누적"} - {condition: "institutional_flow_5d > 0", score: +30, note: "기관 순매수 중 매도신호 = 의심"} - {condition: "foreign_flow_5d > 0", score: +20, note: "외인 순매수 중 매도신호 = 의심"} - {condition: "sector_relative_strength_5d > 100", score: +15, note: "섹터 강세 중 매도신호 = 의심"} - {condition: "vol_surge_pct >= 50", score: -25, note: "대규모 거래량 = 실제 매도 가능성"} - {condition: "vol_surge_pct >= 100", score: -20, note: "거래량 폭증 추가 패널티"} base_score: 0 states: WHIPSAW_SUSPECTED: "whipsaw_score >= 30" CONFIRMED_SELL: "whipsaw_score < 10" INCONCLUSIVE: "10 <= whipsaw_score < 30" hold_policy: WHIPSAW_SUSPECTED: "1거래일 매도 연기. 다음 거래일 재평가 필수." CONFIRMED_SELL: "매도 진행 허용" INCONCLUSIVE: "50% 수량만 매도 허용. 나머지 1거래일 후 재평가." output: fields: anti_whipsaw_gate: "WHIPSAW_SUSPECTED/CONFIRMED_SELL/INCONCLUSIVE" anti_whipsaw_score: "0~100 점수" anti_whipsaw_hold_days: "0 또는 1 (홀드 일수)" anti_whipsaw_json: "상태·점수·홀드 사유 JSON" prohibition: - "WHIPSAW_SUSPECTED 상태에서 당일 전량 매도 신호 생성 금지" - "anti_whipsaw_score를 LLM이 임의 계산 금지" - "anti_whipsaw_gate를 LLM이 재판단하거나 우회 금지" harness_lock: true llm_override: forbidden canonical_ref: "engine_harness_upgrade_proposal_result.txt:ANTI_WHIPSAW_HOLD_GATE_V1" version: "2026-05-20_HARNESS_H6" # == [2026-05-20_H7] H7 - 4경로 결정론적 현금확보 라우터 =================== SMART_CASH_RAISE_V2: purpose: > 현금 부족 상황에서 포트폴리오·종목 상태에 따라 4가지 경로(ROUTE_A~D) 중 하나를 결정론적으로 선택한다. 임의 전량매도·즉흥 트림을 차단하고 주식가치 훼손을 최소화하면서 반등 수익을 보존하는 구조화된 현금확보를 보장한다. inputs: - {field: "position_class", unit: "enum", note: "CORE/SATELLITE"} - {field: "rsi14", unit: "points"} - {field: "profit_lock_stage", unit: "enum", note: "PROFIT_LOCK_STAGE_CLASSIFIER_V1 결과"} - {field: "secular_leader_gate", unit: "enum", note: "SECULAR_LEADER_REGIME_GATE_V1 결과"} - {field: "emergency_full_sell", unit: "bool", note: "긴급 전량매도 플래그 (인간 승인 필수)"} - {field: "cash_shortfall_krw", unit: "KRW", note: "필요 현금 부족분"} - {field: "stop_breach_gate", unit: "enum", note: "STOP_BREACH_ALERT_V1 결과"} route_selection: priority_order: [ROUTE_D, ROUTE_A, ROUTE_B, ROUTE_C, ROUTE_E] routes: ROUTE_D: label: "긴급 전량매도" trigger: "emergency_full_sell=true OR stop_breach_gate=BREACH" action: "전량 매도. 즉시 실행." qty_formula: "full_qty" rebound_wait_pct: 0 note: "반드시 인간 승인 또는 stop 트리거 자동 발동만 허용" ROUTE_A: label: "위성 비중 트림" trigger: "position_class=SATELLITE AND rsi14 >= 35" action: "보유수량의 33~50% 즉시 트림. 나머지 유지." qty_formula: "ROUND(qty * 0.33 ~ 0.50)" rebound_wait_pct: 0 note: "과매도 아닌 위성 종목 비중 축소. 반등 대기 없음." ROUTE_B: label: "과매도 종목 분할 매도" trigger: "rsi14 < 35" action: "50% 즉시 매도 + 50% rebound_trigger_price 도달 시 매도" qty_formula: "K2_STAGED_REBOUND_SELL_V1 공식 적용" rebound_trigger_formula: "prevClose + 0.5 × ATR20" rebound_wait_pct: 50 note: "과매도 반등 수익 보존. K2와 동일 로직 재사용." ROUTE_C: label: "코어 익절 잠금" trigger: "position_class=CORE AND profit_lock_stage IN [PROFIT_LOCK_STAGE_20,PROFIT_LOCK_STAGE_30] AND secular_leader_gate=PASS" action: "PROFIT_LOCK_STAGE_CLASSIFIER_V1 지정 수량만 매도. 잔여 HOLD." qty_formula: "profit_lock_qty (PROFIT_LOCK_STAGE_CLASSIFIER_V1 계산값)" rebound_wait_pct: 0 note: "코어 시큘러 리더는 최소 매도. 익절 수량 외 강제 매도 금지." ROUTE_E: label: "일반 현금부족 단계적 매도" trigger: "cash_shortfall_krw > 0 AND stop_breach_gate != BREACH AND rsi14 >= 35 AND ROUTE_A~D 조건 미해당" action: "H2 sell_priority 순서로 SELL_WATERFALL_ENGINE_V1 Stage 1→2→3 실행." qty_formula: "SELL_WATERFALL_ENGINE_V1 stage1_qty (prevClose 지정가 기준)" rebound_wait_pct: 50 note: "비상 아닌 일반 현금부족 전용 폴백 경로. ROUTE_A~D 조건 미충족 시 실행." output: fields: smart_cash_raise_route: "ROUTE_A/ROUTE_B/ROUTE_C/ROUTE_D/NO_ACTION" smart_cash_raise_qty: "결정론적 매도 수량 (주)" smart_cash_raise_json: "경로·수량·사유·rebound_wait_pct 상세 JSON" prohibition: - "smart_cash_raise_route를 LLM이 임의 선택 금지" - "smart_cash_raise_qty를 LLM이 재계산 금지" - "ROUTE_D는 emergency_full_sell=true 또는 stop_breach_gate=BREACH 외 발동 금지" - "ROUTE_C에서 profit_lock_qty 이상 매도 서술 금지" - "현금 부족 시 코어 시큘러 리더 전량 매도 권고 금지" harness_lock: true llm_override: forbidden canonical_ref: "engine_harness_upgrade_proposal_result.txt:SMART_CASH_RAISE_V2" version: "2026-05-23_HARNESS_V5_PROPOSAL46" # == [2026-05-23_PROPOSAL46] PA1 - 정반합 사전 예측 알파 엔진 ============= PREDICTIVE_ALPHA_ENGINE_V1: purpose: > 正(매수 모멘텀) + 反(분배/과열 신호)를 합산한 방향성 신뢰도(合)를 결정론적으로 산출. LLM이 "분위기가 좋으니까" BUY 권고하는 구조를 3계층 점수로 대체. T+5 피드백 루프로 예측 정확도를 자동 추적하여 45.59% → 70%+ 목표. inputs: - {field: "close", unit: "KRW_per_share"} - {field: "ma20", unit: "KRW_per_share"} - {field: "flow_credit", unit: "ratio_0_1"} - {field: "rs_verdict", unit: "enum"} - {field: "brt_verdict", unit: "enum"} - {field: "volume_ratio_5d", unit: "ratio"} - {field: "rsi14", unit: "score_0_100"} - {field: "velocity_1d", unit: "percent"} - {field: "distribution_signals_count", unit: "integer"} - {field: "foreign_sell_consecutive_days", unit: "integer"} - {field: "usd_krw", unit: "KRW", optional: true} - {field: "days_since_entry", unit: "integer", optional: true} - {field: "profit_pct", unit: "percent", optional: true} thesis_score: max: 100 components: pullback_entry: {condition: "close > ma20 AND close < ma20 * 1.03", score: 20} flow_strong: {condition: "flow_credit >= 0.55", score: 20} rs_leader: {condition: "rs_verdict = LEADER", score: 15} volume_confirm: {condition: "volume_ratio_5d >= 1.2", score: 15} rsi_healthy: {condition: "rsi14 BETWEEN 45 AND 65", score: 15} brt_leader: {condition: "brt_verdict = LEADER", score: 15} antithesis_score: max: 100 components: chase_risk: {condition: "velocity_1d >= 3.0", score: 25} distribution: {condition: "distribution_signals_count >= 2", score: 20} rsi_overbought: {condition: "rsi14 >= 75", score: 20} foreign_sell: {condition: "foreign_sell_consecutive_days >= 5", score: 15} usd_krw_weak: {condition: "usd_krw >= 1480", score: 10} stale_position: {condition: "days_since_entry >= 60 AND profit_pct < 5", score: 10} synthesis: direction_confidence: "thesis_score - antithesis_score" verdicts: STRONG_BUY_SIGNAL: {condition: "direction_confidence >= 40"} MODERATE_BUY_SIGNAL: {condition: "direction_confidence >= 20"} HOLD_NEUTRAL: {condition: "direction_confidence >= -10"} TRIM_SIGNAL: {condition: "direction_confidence >= -30"} EXIT_SIGNAL: {condition: "direction_confidence < -30"} feedback_loop: metric: "prediction_accuracy_rate" storage: "monthly_history sheet" auto_adjust: antithesis_weight_up: "accuracy < 60% → ANTITHESIS 가중치 +10%" thesis_weight_up: "accuracy > 75% → THESIS 가중치 +5%" output: field: "predictive_alpha_json" schema: direction_confidence: "integer (-100 ~ +100)" thesis_score: "integer (0 ~ 100)" antithesis_score: "integer (0 ~ 100)" synthesis_verdict: "enum" prediction_confidence_pct: "percent" thesis_breakdown: "array" antithesis_breakdown: "array" prohibition: - "synthesis_verdict 없이 신규 BUY 서술 금지 (Direction PA1)" - "LLM이 thesis/antithesis 점수를 직접 계산 금지" - "direction_confidence 재계산 또는 번복 금지" canonical_ref: "AGENTS.md:Direction PA1, temp/request_result.txt:proposal_46" version: "2026-05-23_PROPOSAL46" # == [2026-05-23_PROPOSAL46] PA2 - 뒷박 방지 3중 게이트 V2 ================== ANTI_LATE_ENTRY_GATE_V2: purpose: > 기존 ANTI_CHASING_VELOCITY_V1(당일 속도만 체크)의 허점 보완. 2~3일 연속 급등 후 당일 잠시 쉬는 경우도 5일 누적 속도 GATE_2로 차단. 분배 신호 GATE_3을 추가해 3중 AND 게이트 구성. inputs: - {field: "velocity_1d", unit: "percent", note: "(close-prevClose)/prevClose*100"} - {field: "velocity_5d", unit: "percent", note: "(close-close_5d)/close_5d*100"} - {field: "distribution_signals_count", unit: "integer", note: "DISTRIBUTION_SELL_DETECTOR_V1 결과"} - {field: "pre_distribution_warning", unit: "enum", optional: true} - {field: "flow_credit", unit: "ratio_0_1", optional: true} - {field: "ma20", unit: "KRW_per_share", optional: true} gate_1_velocity_1d: BLOCK_CHASE: "velocity_1d >= 3.0%" PULLBACK_WAIT: "velocity_1d >= 1.5%" PASS: "velocity_1d < 1.5%" gate_2_velocity_5d: BLOCK_CHASE_5D: "velocity_5d >= 8.0%" PULLBACK_WAIT_5D: "velocity_5d >= 5.0%" PASS: "velocity_5d < 5.0%" gate_3_distribution: BLOCK_DISTRIBUTION: "distribution_signals_count >= 2 (weighted_sum >= 3.0)" PULLBACK_WAIT_DIST: "pre_distribution_warning = EARLY_WARNING" PASS: "otherwise" final_gate_logic: logic: "AND" BLOCK: "gate_1=BLOCK OR gate_2=BLOCK OR gate_3=BLOCK" PULLBACK_WAIT: "any PULLBACK_WAIT (BLOCK 없을 때)" PASS: "gate_1=PASS AND gate_2=PASS AND gate_3=PASS" entry_grade: A: "velocity_1d < 0.5% AND pullback_zone AND flow_credit > 0.55" B: "velocity_1d < 1.5% AND close near MA20" C: "PULLBACK_WAIT 통과 진입" D: "velocity_5d > 5% 이지만 gate_1 PASS" F: "BLOCK 우회 진입 → PATTERN_BLACKLIST_AUTO_V1 카운트 자동 +1" output: field: "anti_late_entry_json" schema: gate1_status: "BLOCK_CHASE | PULLBACK_WAIT | PASS" gate2_status: "BLOCK_CHASE_5D | PULLBACK_WAIT_5D | PASS" gate3_status: "BLOCK_DISTRIBUTION | PULLBACK_WAIT_DIST | PASS" final_gate_status: "BLOCK | PULLBACK_WAIT | PASS" entry_grade: "A | B | C | D | F" block_reason: "string" velocity_1d: "percent" velocity_5d: "percent" prohibition: - "BLOCK 상태에서 BUY/STAGED_BUY/ADD_ON 출력 금지" - "entry_grade=F 자동 입력 시 PATTERN_BLACKLIST 카운트 +1 강제" - "ANTI_CHASING_VELOCITY_V1(V1) 단독 인용 금지 - 이 V2가 V1을 완전 대체" canonical_ref: "AGENTS.md:Direction A2 (V2로 업그레이드)" version: "2026-05-23_PROPOSAL46" # == [2026-05-23_PROPOSAL46] PA3 - 현금확보 매도 세련화 엔진 V2 ============= CASH_PRESERVATION_SELL_ENGINE_V2: purpose: > K2(50/50 분할) + C1(4단계 폭포수) + C2(타이밍 결정)를 단일 엔진으로 통합. 현금이 급해도 과매도 구간 전량 즉시 청산 방지 + 반등 시 추가 수익 포착. value_preservation_score < 50이면 SELL_VALUE_DAMAGE_WARNING 경보 발령. inputs: - {field: "rsi14", unit: "score_0_100"} - {field: "atr20", unit: "KRW_per_share"} - {field: "prev_close", unit: "KRW_per_share"} - {field: "ma20", unit: "KRW_per_share", optional: true} - {field: "base_qty", unit: "shares", note: "H3 SELL_QUANTITY_ALLOCATOR 산출"} - {field: "stop_loss_price", unit: "KRW_per_share"} - {field: "cash_shortfall_min_krw", unit: "KRW", note: "CASH_SHORTFALL_V1 산출"} - {field: "distribution_signals_count", unit: "integer", optional: true} - {field: "emergency_full_sell", unit: "boolean", optional: true, note: "K2 산출값"} - {field: "oversold_gate", unit: "enum", optional: true} execution_style_decision: OVERSOLD_REBOUND_SELL: "oversold_gate=OVERSOLD AND rsi14 < 30" EMERGENCY_FULL_EXIT: "emergency_full_sell=true" STAGED_WATERFALL: "otherwise" quantity_formulas: OVERSOLD_REBOUND_SELL: immediate_qty: "floor(base_qty * 0.50)" rebound_wait_qty: "base_qty - immediate_qty" rebound_trigger: "TICK_NORMALIZER_V1(prev_close + 0.5 * atr20)" deadline_days: 3 deadline_action: "미체결 3영업일 후 prev_close 지정가로 자동 전환" STAGED_WATERFALL: stage1_qty: "floor(base_qty * 0.50)" stage2_qty: "base_qty - stage1_qty" stage2_deadline: "5 영업일 초과 시 EMERGENCY 전환" EMERGENCY_FULL_EXIT: sell_qty: "base_qty" order_type: "MARKET" rebound_scenario: immediate_sell_krw: "immediate_qty * prev_close" rebound_upside_krw: "rebound_wait_qty * rebound_trigger" downside_risk_krw: "rebound_wait_qty * stop_loss_price" risk_reward_ratio: "(rebound_upside_krw - immediate_sell_krw) / max(1, immediate_sell_krw - downside_risk_krw)" low_rr_alert: "risk_reward_ratio < 1.0 → emergency_full_sell 검토 권고" value_preservation_score: base: 100 deductions: full_sell_oversold: {condition: "immediate_qty=base_qty AND rsi14 < 30", deduct: 30} price_below_prev: {condition: "limit_price < prev_close * 0.97", deduct: 20} distribution_high: {condition: "distribution_signals_count >= 3", deduct: 15} bonuses: rebound_wait_exists: {condition: "rebound_wait_qty > 0", bonus: 15} tight_trigger: {condition: "rebound_trigger <= prev_close * 1.03", bonus: 10} alert: "score < 50 → SELL_VALUE_DAMAGE_WARNING" output: field: "cash_preservation_sell_json" schema: execution_style: "OVERSOLD_REBOUND_SELL | STAGED_WATERFALL | EMERGENCY_FULL_EXIT" immediate_qty: "shares" rebound_wait_qty: "shares" rebound_trigger_price: "KRW (tick-normalized)" rebound_deadline_days: "integer" risk_reward_ratio: "float" value_preservation_score: "integer (0~100)" immediate_sell_krw: "KRW" rebound_upside_krw: "KRW" emergency_full_sell_flag: "boolean" sell_value_damage_warning: "boolean" prohibition: - "OVERSOLD_REBOUND_SELL에서 rebound_wait_qty를 반등 트리거 미충족 상태에서 즉시 매도 금지" - "value_preservation_score 없이 매도 수량 제안 금지 (Direction D2[11])" - "emergency_full_sell=false에서 전량 즉시 청산 지시 금지" canonical_ref: "AGENTS.md:Direction K2/C1/C2, temp/request_result.txt:proposal_46#1-3" version: "2026-05-23_PROPOSAL46" # == [2026-05-23_PROPOSAL46] PA4 - 미시/거시/국제정세 동기화 하네스 ========== MACRO_EVENT_SYNCHRONIZER_V1: purpose: > 외국인 순매도 일수·USD/KRW·FOMC 일정·국내 CPI·VIX 등 거시 변수를 heat_gate + buy_gate에 자동 반영. 현재 LLM 서술용으로만 쓰던 데이터를 결정론적 gate 조정에 연결. 매일 아침 GAS Trigger로 자동 갱신. inputs: - {field: "usd_krw", unit: "KRW", note: "settings manual_input 또는 API"} - {field: "foreign_sell_consecutive_days", unit: "integer", note: "macro 시트 누적"} - {field: "foreign_sell_krw_today", unit: "KRW", optional: true} - {field: "fomc_days_remaining", unit: "integer", optional: true, note: "event_calendar"} - {field: "domestic_cpi", unit: "percent", optional: true} - {field: "vix", unit: "float", optional: true} - {field: "us500_1w_change", unit: "percent", optional: true} macro_risk_score: max: 100 components: usd_krw_critical: {condition: "usd_krw > 1500", score: 20} usd_krw_weak: {condition: "usd_krw > 1480 AND <= 1500", score: 15} foreign_mega: {condition: "foreign_consecutive_sell_days >= 10", score: 20} foreign_high: {condition: "foreign_consecutive_sell_days >= 5", score: 15} fomc_near: {condition: "fomc_days_remaining <= 5", score: 15} cpi_high: {condition: "domestic_cpi > 2.5", score: 10} vix_elevated: {condition: "vix > 20", score: 10} us500_drop: {condition: "us500_1w_change < -3.0", score: 10} macro_risk_regime: MACRO_CRITICAL: {condition: "macro_risk_score >= 60", heat_gate_adj: -3} MACRO_ELEVATED: {condition: "macro_risk_score >= 40", heat_gate_adj: -1} MACRO_NEUTRAL: {condition: "macro_risk_score >= 20", heat_gate_adj: 0} MACRO_FAVORABLE: {condition: "macro_risk_score < 20", heat_gate_adj: +1} event_matrix: FOMC_WEEK: {buy_gate_downgrade: true, sell_block: false} EARNINGS_WEEK: {event_hold_gate: true, note: "해당 종목 M4 EVENT_HOLD 발동"} DART_RISK: {event_hold_gate: true, note: "기존 M4 연동"} GEOPOLITICAL: {regime_size_scale_adj: -0.25, note: "N1 연동"} mega_sell_alert: condition: "foreign_sell_krw_today >= 1_000_000_000_000" effect: "buy_gate_block_until = today + 3 영업일" data_sources: usd_krw: "settings 시트 manual_input" fomc_dates: "settings 시트 event_calendar" foreign_flow: "macro 시트 _foreignFlow" vix_us500: "macro 시트 _vix, _us500Close" output: field: "macro_event_json" schema: macro_risk_score: "integer (0~100)" macro_risk_regime: "MACRO_CRITICAL | MACRO_ELEVATED | MACRO_NEUTRAL | MACRO_FAVORABLE" macro_risk_breakdown: "array" foreign_consecutive_sell_days: "integer" mega_sell_alert: "boolean" buy_gate_block_until: "date or null" effective_heat_gate_adjustment: "integer" event_matrix: "array" fomc_days_remaining: "integer or null" prohibition: - "MACRO_CRITICAL 상태에서 포지션 증가 서술 금지 (Direction D2[10])" - "LLM이 macro_risk_score를 임의 계산 금지 - 하네스 출력만 인용" - "external_context_json 데이터를 주문 판단에 혼입 금지 (G3)" canonical_ref: "AGENTS.md:Direction G3/ME1, temp/request_result.txt:proposal_46#1-4" version: "2026-05-23_PROPOSAL46" # == [2026-05-23_PROPOSAL46] PA5 - 데이터정합성/방향성/일관성 검증기 V2 ======= CONSISTENCY_VALIDATOR_V2: purpose: > 기존 validate_harness_context.py(키 존재 여부만)를 12개 논리 검증 항목으로 확장. 일관성 점수 < 90%이면 보고서 생성 자체 BLOCK - 오염 데이터 분석 원천 차단. DETERMINISTIC_ROUTING_ENGINE_V1의 Step 2(pre-flight)에서 가장 먼저 실행. inputs: - {field: "settlement_cash_d2_krw", unit: "KRW", note: "CV_08 현금 경로 검증"} - {field: "harness_context", unit: "json", note: "전체 harness_context 객체 - CV_01~CV_12 검증 원천"} checks: CV_01: name: "sell_priority 방향 일관성" rule: "sell_candidates_json[n].tier >= sell_candidates_json[n-1].tier (tier 역전 금지)" CV_02: name: "가격 순서 검증" rule: "stop_price < current_price < tp1_price < tp2_price (모든 종목)" CV_03: name: "heat vs 보유 비중 일치" rule: "sum(position_weight_pct) ≈ total_heat_pct (±0.5% 허용)" CV_04: name: "enum 값 유효성" rule: "profit_lock_stage in VALID_STAGES, rs_verdict in {LEADER,NEUTRAL,LAGGARD,BROKEN}, tp_state in VALID_TP_STATES" CV_05: name: "상호 충돌 게이트 탐지" rules: - "heat_gate=BLOCK_NEW_BUY AND final_action=BUY → CONTRADICTION" - "sfg_v1=TRIGGERED AND final_action=BUY → CONTRADICTION" - "intraday_lock=true AND BUY not in blocked_actions → INCOMPLETE" CV_06: name: "수량 정수 검증" rule: "모든 qty 필드 = floor(qty) (소수점 금지)" CV_07: name: "날짜 신선도" rules: - "data_date vs today > 1 영업일 → STALE_WARN" - "data_date vs today > 3 영업일 → STALE_BLOCK" CV_08: name: "현금 계산 경로" rule: "settlement_cash_d2_krw 사용 확인. immediate_cash 합산 금지." CV_09: name: "라우팅 completeness" rule: "routing_execution_log에 10단계 모두 존재 여부" CV_10: name: "LLM 출력 checksum" rule: "rendered_output_checksum 일치 여부 (blueprint vs LLM 출력 수치)" CV_11: name: "GAS 하네스 키 동기화" rule: "buildHarnessContext_() 출력 키 ⊇ validate_harness_context.py REQUIRED_KEYS" gap_output: "HARNESS_KEY_MISSING 목록" CV_12: name: "YAML-to-GAS 커버리지" rule: "spec/ formula_id 목록 vs gas_data_feed.gs calc*_() 교차검증" gap_output: "GAS_COVERAGE_GAP 목록" scoring: formula: "(통과 항목 수 / 12) * 100" BLOCK: "score < 90 → 보고서 생성 중단" WARNING: "score >= 90 AND < 100 → Gap 목록 출력 후 계속" PASS: "score = 100" output: field: "consistency_report_json" schema: score: "integer (0~100)" passed: "array of check_ids" failed: "array of {check_id, reason}" gap_list: "array of {type: HARNESS_KEY_MISSING|GAS_COVERAGE_GAP, item}" block_status: "BLOCK | WARNING | PASS" prohibition: - "consistency_score < 90인 상태에서 보고서 생성 금지" - "LLM이 CV 검증 항목을 직접 계산하거나 우회 선언 금지" - "ROUTING step 2에서 CV_02 통과 전 이후 단계 진행 금지" canonical_ref: "AGENTS.md:Direction D1(Step 2), temp/request_result.txt:proposal_46#1-5" version: "2026-05-23_PROPOSAL46" # == [2026-05-24_PROPOSAL50] EJCE-V1 - 전문가 3관점 합의 게이트 ============= EXPERT_JUDGMENT_CONSENSUS_ENGINE_V1: purpose: > Analyst(기술적 관점)·Trader(실행 타이밍)·Quant(리스크 수치) 3관점 중 2관점 이상 BLOCK이면 consensus_result=NO_BUY를 반환. buy_permission_json.buy_permission_state=ALLOW여도 NO_BUY 종목 BUY 절대 차단. inputs: - {field: "ticker", unit: "string"} - {field: "df", unit: "object - market data feed"} - {field: "paeRow", unit: "object - PAE output row"} - {field: "hApex", unit: "object - harness apex context"} output: field: "ejce_json" schema: ticker: "string" analyst_view: "ALLOW | BLOCK" trader_view: "ALLOW | BLOCK" quant_view: "ALLOW | BLOCK" consensus_result: "BUY_ALLOWED | NO_BUY" block_reasons: "array of string" formula_id: "EXPERT_JUDGMENT_CONSENSUS_ENGINE_V1" prohibition: - "consensus_result=NO_BUY 종목에 BUY/ADD_ON 권고 금지" - "block_reasons 3관점 미인용 시 INCOMPLETE_EJCE_REPORT" - "buy_permission=ALLOW만 확인하고 ejce_json 확인 생략 금지" canonical_ref: "AGENTS.md:Direction EJ1" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] SCRS-V2 - 현금확보 최적 매도조합 ============= SMART_CASH_RECOVERY_SELL_ENGINE_V2: purpose: > 현금부족(cashShortfallInfo) 상황에서 value_damage_score 최소화 조합을 결정론적으로 산출. K2 50/50 분할(immediate_sell_qty + rebound_wait_qty) 포함. LLM이 "이 종목 N주 팔면 될 것 같다"는 즉석 계산 HS011 위반으로 금지. inputs: - {field: "holdings", unit: "array"} - {field: "dfMap", unit: "object"} - {field: "cashShortfallInfo", unit: "object"} - {field: "h2", unit: "object - regime layer"} output: field: "scrs_v2_json" schema: emergency_level: "TRIM_ONLY | FULL_RECOVERY | NO_ACTION" selected_combo: "array of {ticker, immediate_sell_qty, rebound_wait_qty, value_damage_score, rebound_potential, recommended_action}" total_recovery_krw: "integer" formula_id: "SMART_CASH_RECOVERY_SELL_ENGINE_V2" prohibition: - "selected_combo 외 추가 매도 LLM 임의 추가 금지" - "emergency_level=TRIM_ONLY 시 selected_combo 외 추가 매도 절대 금지" - "immediate_sell_qty + rebound_wait_qty 합산해 '전체 X주 매도' 단순화 금지" canonical_ref: "AGENTS.md:Direction C3" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] MRAG-V2 - 거시 국면 적응 게이트 ============= MACRO_REGIME_ADAPTIVE_GATE_V2: purpose: > L1(미시)·L2(거시)·L3(글로벌)·L4(이벤트) 4레이어 각 0~25점 합산 total_mrag_score(0~100) 기반으로 heat_gate_threshold와 position_size_scale을 결정론적으로 동적 조정. ME1과 MRAG-V2 중 더 엄격한 값을 effective_heat_gate_threshold로 확정. inputs: - {field: "macroJson", unit: "object - macro event data"} - {field: "mesResult", unit: "object - MACRO_EVENT_SYNCHRONIZER_V1 output"} - {field: "hApex", unit: "object - harness apex context"} output: field: "mrag_v2_json" schema: micro_risk_score: "integer 0~25" macro_risk_score_normalized: "integer 0~25" global_risk_score: "integer 0~25" event_risk_score: "integer 0~25" total_mrag_score: "integer 0~100" effective_heat_gate_threshold: "number (5|7|10|12) %" effective_position_size_scale: "number (0.25|0.50|1.00|1.10)" regime_label: "EXTREME_RISK|HIGH_RISK|MODERATE_RISK|LOW_RISK" stale_events: "array of {event_name, registered_date, days_stale}" stale_events_count: "integer" formula_id: "MACRO_REGIME_ADAPTIVE_GATE_V2" prohibition: - "LLM이 total_mrag_score를 즉석 계산 금지 (HS011 위반)" - "effective_heat_gate_threshold를 LLM이 임의 완화 금지" - "stale_events_count>0 시 Section_B 이벤트 날짜 불일치 경보 누락 금지" canonical_ref: "AGENTS.md:Direction ME2" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] M5 V1.1 - 반도체 집중 비중 강제 감축 ========= MANDATORY_REDUCTION_PLAN_V1: purpose: > 반도체 클러스터 비중이 cluster_limit * 2.0 초과 시 4주 분할 감축 계획을 결정론적으로 생성. RS_BROKEN→ETF→APEX_SUPER 우선순위로 주당 매도수량 배정. LLM이 "시장 보면서 결정" 임의 유보 금지. inputs: - {field: "semiconductorClusterGate", unit: "object - cluster gate result"} - {field: "holdings", unit: "array"} - {field: "dfMap", unit: "object"} - {field: "h3", unit: "object - cash floor layer"} - {field: "totalAsset", unit: "KRW integer"} output: field: "mandatory_reduction_json" schema: is_mandatory: "boolean" current_cluster_pct: "number %" cluster_limit_pct: "number %" current_excess_pct: "number %p" weekly_reduction_target_krw: "integer KRW" reduction_priority: "array of {ticker, reason, weekly_sell_qty}" formula_id: "MANDATORY_REDUCTION_PLAN_V1" prohibition: - "is_mandatory=true 시 4주 감축 계획 미이행 금지" - "LLM이 reduction_priority 순서 임의 변경 금지" - "weekly_reduction_target_krw LLM 재계산 금지 (HS011 위반)" canonical_ref: "AGENTS.md:Direction A2 (M5 V1.1)" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] DSLE-V1 - 결정론적 서빙 잠금 ================= DETERMINISTIC_SERVING_LOCK_ENGINE_V1: purpose: > 11개 스테이지 토큰 및 numeric_generation_allowed=0을 통해 LLM이 가격·수량·수익률 등 모든 숫자를 자체 생성하는 것을 완전 차단. LLM 역할을 NARRATE_HARNESS_OUTPUT·SYNTHESIZE_RISK_CONTEXT·PRESENT_SCENARIO로 한정. inputs: - {field: "hApex", unit: "object - harness apex context"} - {field: "capturedAtIso", unit: "ISO8601 string"} - {field: "now", unit: "Date object"} output: field: "serving_lock_json" schema: lock_status: "LOCKED | UNLOCKED" llm_role: "CLERK_REPORTER" llm_serving_budget: numeric_generation_allowed: "integer (always 0)" allowed_operations: "array ['NARRATE_HARNESS_OUTPUT','SYNTHESIZE_RISK_CONTEXT','PRESENT_SCENARIO']" stage_tokens: "array of 11 token objects" formula_id: "DETERMINISTIC_SERVING_LOCK_ENGINE_V1" prohibition: - "numeric_generation_allowed=0 무시하고 LLM 숫자 생성 절대 금지" - "stage_tokens에 없는 행동 LLM이 권고 금지" - "serving_lock_json.lock_status=LOCKED 시 LLM 계산 우회 선언 금지" canonical_ref: "AGENTS.md:Direction D3" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] HS007 - 조건부 접속사 Hard-Lock ============= VALIDATE_ORDER_CONDITION_V1: purpose: > 주문 조건 텍스트에 다중 조건 접속사('또는', '동시 충족', '실패 시' 등)가 포함되면 INVALID_MULTI_CONDITION 반환. HTS 자동주문은 단일 지정가만 허용. inputs: - {field: "order_condition_text", unit: "string - 주문 조건 텍스트"} output: field: "order_condition_validation" schema: valid: "boolean" status: "OK | INVALID_MULTI_CONDITION" matched_conjunctions: "array of strings" resolution: "string - 단일 조건 기재 안내" formula_id: "VALIDATE_ORDER_CONDITION_V1" prohibition: - "INVALID_MULTI_CONDITION 판정된 행을 HTS 주문표에 포함 금지" - "LLM이 복합 조건을 단일 조건으로 재해석하여 통과 처리 금지" canonical_ref: "AGENTS.md:Direction 0 (HS007)" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] H10 - 그림자 원장(Shadow Ledger) ============= SHADOW_LEDGER_V1: purpose: > BLOCKED/INVALID 블루프린트를 HTS 주문표에서 제외하되, 차단 사유 및 산출 지표를 투명하게 보존. 사용자의 사후 평가·오버라이드를 지원. inputs: - {field: "blueprints", unit: "array - order_blueprint_json"} - {field: "dfMap", unit: "object - 종목별 data feed map"} output: field: "shadow_ledger_json" schema: shadow_ledger: "array of blocked entries" blocked_count: "integer" formula_id: "SHADOW_LEDGER_V1" shadow_ledger_row: ticker: "종목 코드" name: "종목명" block_reason: "차단 사유 코드" order_type: "BUY | SELL | TRIM 등" limit_price_calc: "산출 지정가 (KRW)" stop_loss_calc: "산출 손절가 (KRW)" take_profit_calc: "산출 익절가 (KRW)" base_qty_calc: "이론 수량 (주)" override_possible: "true - 사용자 오버라이드 가능" prohibition: - "BLOCKED 종목의 산출 지표를 null 처리하거나 은폐 금지 (HS010 위반)" - "Shadow Ledger 종목을 HTS 주문표에 포함 금지" canonical_ref: "AGENTS.md:Direction H10 (HS010_REVISED)" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] D2 - LLM 12가지 금지행동 잠금 ================= LLM_SERVING_CONSTRAINT_V1: purpose: > LLM의 역할을 하네스 출력 복사·해설·위험 합성으로 엄격히 제한. 12가지 금지행동 체크리스트를 보고서 조립 직전 GAS가 평가하여 위반 가능성이 있으면 INVALID_LLM_OVERRIDE 태그를 반환. inputs: - {field: "hApex", unit: "object - harness apex context (전체 하네스 결과)"} output: field: "llm_serving_constraint_json" schema: constraint_status: "PASS | WARN | INVALID_LLM_OVERRIDE" violations: "array of {check, rule, status}" violation_count: "integer" warn_count: "integer" total_checks: "12" formula_id: "LLM_SERVING_CONSTRAINT_V1" prohibition: - "constraint_status=INVALID_LLM_OVERRIDE 시 보고서 계속 생성 금지" - "violations 목록을 LLM이 임의로 해제·무시 금지" canonical_ref: "AGENTS.md:Direction D2" version: "2026-05-24_PROPOSAL50" # == [2026-05-24_PROPOSAL50] H6 - 거래대금 급증 과열신호 ================= AVG_TRADE_VALUE_SIGNAL_V1: purpose: > secular_leader(005930·000660) PROFIT_LOCK_STAGE_20 구간에서 5일 평균 거래대금 > 20일 평균 × 3.0이면 과열신호 +1 판정. 4개 과열신호 합산 판정에 반영하여 APEX_SUPER 구간 부분익절 허용 여부를 결정. inputs: - {field: "ticker", unit: "string"} - {field: "avg_trade_val_5d", unit: "KRW - 5일 평균 거래대금"} - {field: "avg_trade_val_20d", unit: "KRW - 20일 평균 거래대금"} - {field: "profit_lock_stage", unit: "string - PROFIT_LOCK_STAGE_20 여부 확인"} expressions: ratio_5d_vs_20d: "avg_trade_val_5d / avg_trade_val_20d" overheat_triggered: "ratio_5d_vs_20d >= 3.0" overheat_score_add: "1 if overheat_triggered else 0" output: field: "avg_trade_val_signal_json" schema: ticker: "종목 코드" applicable: "boolean - secular_leader AND STAGE_20 여부" signal: "OVERHEAT_TRADE_VALUE | NORMAL | NOT_APPLICABLE" ratio_5d_vs_20d: "number" overheat_triggered: "boolean" overheat_score_add: "0 or 1" formula_id: "AVG_TRADE_VALUE_SIGNAL_V1" prohibition: - "LLM이 overheat_signals를 재집계·번복 금지 (하네스 산출값 우선)" - "secular_leader 이외 종목에 적용 금지" canonical_ref: "AGENTS.md:Direction H6" version: "2026-05-24_PROPOSAL50" # == [PROPOSAL51] P0-B - 매도 주문 3중 가격 검증 ============================= SELL_PRICE_SANITY_V2: purpose: > buildOrderBlueprint_ 산출 매도/STOP_LOSS 주문에 대해 3조건 가격 역전을 검증. validation_status를 인라인 재기록하여 EXPORT_GATE가 자동 차단. LLM이 가격 역전 주문을 HTS에 입력하는 사고를 원천 차단. inputs: - {field: "limit_price", unit: "KRW - 지정가"} - {field: "stop_price", unit: "KRW - 손절가"} - {field: "auto_trailing_stop", unit: "KRW - profit_preservation 자동 추적 손절가"} checks: CHECK_1: "limit_price < final_stop → INVALID_PRICE_INVERSION" CHECK_2: "stop_price < auto_trailing_stop → INVALID_TRAILING_STOP_BREACH" CHECK_3: "limit_price == 0 → INVALID_ZERO_PRICE" output: field: "spsv2_verdict" values: SPSV2_PASS: "3조건 모두 통과" INVALID_PRICE_INVERSION: "지정가 < 최종 손절가 - 역전" INVALID_TRAILING_STOP_BREACH: "손절가 < auto_trailing_stop - 추적 손절 위반" INVALID_ZERO_PRICE: "지정가=0 - 미확정 가격" NOT_SELL_SKIP: "SELL/STOP_LOSS 외 주문 - 검증 스킵" prohibition: - "SPSV2 검증 전 Export Gate 실행 금지" - "INVALID 상태 주문의 HTS 입력 절대 금지" gs_function: "calcSellPriceSanityV2_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P1-A - Export Gate V2 ====================================== EXPORT_GATE_V2: purpose: > EXPORT_READY / REVIEW_ONLY / PENDING_EXPORT 3단계 분류. V1 5개 체크 → V2 8개 체크 (SCRS 렌더링, 헬스 스코어 타입, 클러스터 동기화 추가). REVIEW_ONLY: WARN 체크 있음 (HTS 입력 전 검토 필요). hts_entry_allowed=false. checks: CHECK_1: "account_snapshot 캡처 완료" CHECK_2: "데이터 완성도 (buy_permission_json ≥ holdings)" CHECK_3: "consistency_score >= 70" CHECK_4: "INVALID 매도 주문 없음 (SPSV2 후)" CHECK_5: "cash_floor_status != UNKNOWN" CHECK_6: "SCRS-V2 immediate_sell_qty 유효값 확인" CHECK_7: "portfolio_health_score 숫자형 확인" CHECK_8: "SEMICONDUCTOR_CLUSTER_SYNC 정합성 확인" tiers: EXPORT_READY: "모든 체크 PASS - HTS 입력 허용" REVIEW_ONLY: "WARN 체크 존재, FAIL 없음 - 검토 후 진행" PENDING_EXPORT: "FAIL 체크 존재 - HTS 입력 금지" gs_function: "calcExportGate_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P0-C - 반도체 클러스터 단일 소스 동기화 ===================== SEMICONDUCTOR_CLUSTER_SYNC_V1: purpose: > SEMICONDUCTOR_CLUSTER_GATE_V1 결과 ↔ MANDATORY_REDUCTION_PLAN_V1 is_mandatory 정합성 보장. combined_pct > cap_pct * 2 → is_mandatory=true 강제. 단일 소스(클러스터 게이트)가 의무 감축 여부를 결정. inputs: - {field: "cluster_pct", unit: "% - mandatory_reduction_json.cluster_pct"} - {field: "cluster_limit_pct", unit: "% - mandatory_reduction_json.cluster_limit_pct"} - {field: "is_mandatory", unit: "boolean - 교정 전 값"} expression: "cluster_pct > cluster_limit_pct * 2 ? is_mandatory=true : is_mandatory=false" output: field: "cluster_sync_result_json" schema: status: "SYNCED | CORRECTED" corrected: "boolean" cluster_pct: "number" threshold_pct: "cluster_limit_pct * 2" gs_function: "syncSemiconductorCluster_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P2-B - 사전 분배 레이더 V2 ================================= PROACTIVE_SELL_RADAR_V2: purpose: > 8가지 신호로 분배(설거지) 3일 전 조기 감지 → CRITICAL/WARNING/WATCH/CLEAR 분류. DISTRIBUTION_SELL_DETECTOR V1.1 (사후 확인) 보완 - 사전 예측 기능. signals: SIG_1: "고가 2% 이내 + 거래량 30% 수축 (weight=2.0)" SIG_2: "기관 5일 순매도 전환 (weight=2.0)" SIG_3: "개인 집중유입 70% 초과 (weight=1.5)" SIG_4: "풋/콜 비율 1.3 초과 (weight=1.5)" SIG_5: "뉴스 감성 -20 미만 (weight=1.0)" SIG_6: "거래량 1.5x 급증 + 음봉 (weight=1.5)" SIG_7: "RSI 70이상 + 5일 수익률 음수 (weight=1.5)" SIG_8: "auto_trailing_stop 2% 이내 근접 (weight=2.0)" levels: CRITICAL: "weighted_sum >= 5.0 - 즉시 매도 검토" WARNING: "weighted_sum >= 3.0 - 감축 계획 수립" WATCH: "weighted_sum >= 1.5 - 주의 모니터링" CLEAR: "weighted_sum < 1.5 - 정상" gs_function: "calcProactiveSellRadarV2_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P2-A - 뒷박 차단 게이트 V3 ================================ ANTI_LATE_ENTRY_GATE_V3: purpose: > V2의 3게이트(velocity_1d/velocity_5d/distribution_ws) + GATE_4(PAE) + GATE_5(블랙리스트) → V3: GATE_6(매크로 레짐) 추가. EVENT_SHOCK/RISK_OFF → 신규 매수 BLOCK. 6게이트 AND 조건: 모두 통과해야 PASS. 하나라도 BLOCK → 전체 BLOCK. gates: GATE_1: "velocity_1d >= 3.0% → BLOCK_CHASE" GATE_2: "velocity_5d >= 8.0% → BLOCK_CHASE_5D" GATE_3: "dist_weighted_sum >= 3.0 → BLOCK_DISTRIBUTION" GATE_4: "PAE synthesis_verdict == EXIT/TRIM → BLOCK" GATE_5: "패턴 블랙리스트 TRIGGERED → BLOCK" GATE_6: "매크로 EVENT_SHOCK/RISK_OFF → BLOCK" quantity_scaling: GATE_4_WARN: "direction_confidence < -10 → qty_scale=0.5" GATE_6_WARN: "MACRO_CAUTION → qty_scale=0.7" gs_function: "applyAlegGate4And5Impl_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P0-D - 5계층 가격 단일화 잠금 =========================== PRICE_HIERARCHY_LOCK_V1: purpose: > 동일 종목의 가격을 5계층으로 분리 잠금. LAYER_1(주문가)만 HTS 지정가로 사용. LAYER_5(참고방어가)가 LAYER_1 위치에 나타나면 INVALID_LAYER_VIOLATION - 표간 가격 혼재 완전 차단. layers: LAYER_1: "order_blueprint_json.limit_price - HTS 주문표 지정가 전용" LAYER_2: "prices_json.stop_price / tp1_price / tp2_price - 손절/익절 원장" LAYER_3: "profit_preservation_json.auto_trailing_stop - LAYER_2 손절가 하한 보정용" LAYER_4: "scrs_v2_json.rebound_trigger_price - SCRS-V2 반등대기 트리거 전용" LAYER_5: "proposal_reference.reference_defense_price - WATCH 감시 원장 참고방어가 전용" violation_types: INVALID_LAYER_VIOLATION: "LAYER_5==LAYER_1 또는 LAYER_4==LAYER_2" LAYER_PROXIMITY_WARNING: "LAYER_5와 LAYER_1이 5% 이내 근접" output_contract: price_hierarchy_json: "배열: 종목별 5계층 가격 + layer_violations" gs_function: "applyPriceHierarchyLockAll_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P1-B - 데이터 완성도 필드충족률 게이트 ================== DATA_QUALITY_GATE_V2: purpose: > 핵심 8개 카테고리(prediction/trade_quality/pattern/stop_loss/cash/sell_engine/cluster/alpha_eval)의 필드 충족률로 데이터 완성도 등급 산출. 행수 기준 "정상" 표현 완전 폐기. T+20=0건, trade_quality=0건 시 특수 경고 발동. categories: prediction: "[direction_confidence, synthesis_verdict, thesis_score, antithesis_score]" trade_quality: "[grade, feedback_tag, t5_return_pct, t20_vs_core_pct]" pattern: "[pattern_blacklist_status, accumulated_poor_count]" stop_loss: "[auto_trailing_stop, final_stop_price, stop_price]" cash: "[settlement_cash_d2_krw, cash_floor_status, cash_shortfall_min_krw]" sell_engine: "[scrs_v2_verdict, immediate_qty, rebound_wait_qty]" cluster: "[cluster_state, combined_pct]" alpha_eval: "[alpha_gate_verdict, prediction_accuracy_rate]" grades: COMPLETE: "overall_completeness_pct >= 90" PARTIAL: "overall_completeness_pct >= 60" INSUFFICIENT: "overall_completeness_pct < 60" output_contract: data_quality_gate_v2_json: fields: "[overall_completeness_pct, completeness_grade, category_scores, special_warnings, confidence_ceiling]" gs_function: "calcDataQualityGateV2_" version: "2026-05-25_PROPOSAL51" # == [PROPOSAL51] P1-C - 현금회복 금액 3분리 표시 잠금 =================== CASH_RECOVERY_DISPLAY_LOCK_V1: purpose: > 현금회복 금액을 min_required / optimal_combo / reference_total 3분리 표시. trim_plan 누적 전체 금액(예: 207억)을 주문 섹션에 표시하는 것을 완전 차단. reference_total_krw는 "주문 아님" 레이블 강제. display_rules: SECTION_CASH_RECOVERY: "min_required_krw + optimal_combo_krw만 표시 (SCRS-V2 즉시매도 합계)" SECTION_REFERENCE_TRIM: "reference_total_krw - '참고용 전체 후보 누적 - 주문 아님'" consistency_checks: UNCOVERED: "optimal_combo < min_required → CASH_SHORTFALL_UNCOVERED" OVER_SELL: "optimal_combo > min_required*2 → OVER_SELL_WARNING" output_contract: cash_recovery_display_json: fields: "[min_required_krw, optimal_combo_krw, reference_total_krw, coverage_status, display_mode]" gs_function: "calcCashRecoveryDisplayLock_" version: "2026-05-25_PROPOSAL51" FUNDAMENTAL_QUALITY_GATE_V1: purpose: "펀더멘털 품질 점수화로 BUY 허용을 결정론적으로 잠금." inputs: - {field: "holdings", unit: "array"} - {field: "dfMap", unit: "object"} output: field: "fundamental_quality_json" output_contract: fundamental_quality_json: fields: "[rows[].ticker, rows[].grade, rows[].buy_allowed, rows[].fail_reasons]" gs_function: "calcFundamentalQualityGateV1_" version: "2026-05-25_PROPOSAL53" HORIZON_ALLOCATION_LOCK_V1: purpose: "단기/중기/장기 버킷 비중 상한 위반을 잠금." inputs: - {field: "holdings", unit: "array"} - {field: "total_asset_krw", unit: "KRW"} output: field: "horizon_allocation_json" output_contract: horizon_allocation_json: fields: "[bucket_summary[].bucket, bucket_summary[].cap_pct, bucket_summary[].current_pct, bucket_summary[].violation]" gs_function: "calcHorizonAllocationLockV1_" version: "2026-05-25_PROPOSAL53" SMART_MONEY_LIQUIDITY_GATE_V1: purpose: "스마트머니 흐름과 유동성 결합으로 실행 모드(NORMAL/SELL_SPLIT_ONLY) 고정." inputs: - {field: "holdings", unit: "array"} - {field: "proactive_sell_radar_json", unit: "json"} output: field: "smart_money_liquidity_json" output_contract: smart_money_liquidity_json: fields: "[rows[].flow_state, rows[].liquidity_state, rows[].execution_mode, rows[].buy_allowed]" gs_function: "calcSmartMoneyLiquidityGateV1_" version: "2026-05-25_PROPOSAL53" 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" output_contract: routing_serving_trace_v2_json: fields: "[request_route, bundle_selected, prompt_entrypoint, gate_path, final_block_reason, json_validation_status]" gs_function: "buildRoutingServingDecisionTraceV2_" version: "2026-05-25_PROPOSAL53" FUNDAMENTAL_MULTI_FACTOR_SCORE_V2: purpose: "이익률·성장률·점유율·현금흐름·부채 종합 점수로 BUY 잠금." output_contract: fundamental_multifactor_json: fields: "[rows[].ticker, rows[].score_0_100, rows[].grade, rows[].buy_allowed, rows[].fail_reasons]" gs_function: "calcFundamentalMultiFactorScoreV2_" version: "2026-05-25_PROPOSAL54" EARNINGS_GROWTH_QUALITY_GATE_V1: purpose: "이익 성장 추세 일관성 게이트." output_contract: earnings_growth_quality_json: fields: "[rows[].ticker, rows[].trend, rows[].consistency, rows[].gate]" gs_function: "calcEarningsGrowthQualityGateV1_" version: "2026-05-25_PROPOSAL54" MARKET_SHARE_MOMENTUM_PROXY_V1: purpose: "점유율 모멘텀 프록시로 공격 매수 차단." output_contract: market_share_proxy_json: fields: "[rows[].ticker, rows[].proxy_state, rows[].confidence_band]" gs_function: "calcMarketShareMomentumProxyV1_" version: "2026-05-25_PROPOSAL54" CASHFLOW_STABILITY_GATE_V1: purpose: "현금흐름 안정성 + 회계위험 결합 게이트." output_contract: cashflow_stability_json: fields: "[rows[].ticker, rows[].stability_state, rows[].accrual_risk_flag, rows[].gate]" gs_function: "calcCashflowStabilityGateV1_" version: "2026-05-25_PROPOSAL54" ROUTING_DECISION_EXPLAIN_LOCK_V1: purpose: "최종 의사결정 게이트 경로/차단사유 잠금." output_contract: routing_decision_explain_json: fields: "[gate_path, blocked_by, override_allowed]" gs_function: "calcRoutingDecisionExplainLockV1_" version: "2026-05-25_PROPOSAL54" # === Phase-4~5 신규 하네스 게이트 매핑 (2026-05-28) ======================= TRADE_QUALITY_FROM_T5_V1: purpose: > 운영 T+5 실측 기반 거래품질 점수. T+20 성숙 전 bridge. gate=PASS: scored_count >= 30. output_contract: Temp/trade_quality_from_t5_v1.json: fields: "[gate, summary_score, scored_count, trade_quality_basis, per_ticker[]]" python_tool: "tools/build_trade_quality_from_t5_v1.py" harness_check: "CHECK_74_TRADE_QUALITY_FROM_T5_V1" version: "2026-05-28_PHASE4" PREDICTION_ACCURACY_HARNESS_V2: purpose: > 운영 T+1/T+5/T+20 일치율 회전 윈도 + calibration_state. calibration_state가 BUY_PROPOSAL_FROZEN_RECOMMEND이면 매수 동결 권고. output_contract: Temp/prediction_accuracy_harness_v2.json: fields: "[calibration_state, t1_op_rate, t5_op_rate, t20_op_rate, windows.*]" python_tool: "tools/build_prediction_accuracy_harness_v2.py" harness_check: "CHECK_75_PREDICTION_ACCURACY_HARNESS_V2" version: "2026-05-28_PHASE4" MACRO_EVENT_TICKER_IMPACT_V1: purpose: > 거시이벤트 종목별 영향. action_gate=AVOID_NEW_BUY: 사전 5영업일 매수 차단 권고. 뒷박 5중 AND 게이트의 macro_event 1표. output_contract: Temp/macro_event_ticker_impact_v1.json: fields: "[gate, ticker_count, action_summary, tickers[].primary_gate, tickers[].impact_score]" python_tool: "tools/build_macro_event_ticker_impact_v1.py" harness_check: "CHECK_76_MACRO_EVENT_TICKER_IMPACT_V1" version: "2026-05-28_PHASE4" SELL_WATERFALL_ENGINE_V2: purpose: > V1 4단계 + 슬리피지/exec_mode/에스컬레이션. escalation_skip_violations=0 필수. output_contract: Temp/sell_waterfall_engine_v2.json: fields: "[gate, rows[].stage, rows[].exec_mode, rows[].split_count, rows[].est_slippage_bps, rows[].escalation_rule]" python_tool: "tools/build_sell_waterfall_engine_v2.py" harness_check: "CHECK_77_SELL_WATERFALL_ENGINE_V2" version: "2026-05-28_PHASE4" LLM_NARRATIVE_TEMPLATE_LOCK_V1: purpose: > 서술 금지어휘(같다/약간/곧 등) 스캔. total_violations=0 필수. gate=PASS: narrative 결정론 잠금. output_contract: Temp/llm_narrative_template_lock_v1.json: fields: "[gate, total_violations, sections_checked, section_results[]]" python_tool: "tools/build_llm_narrative_template_lock_v1.py" harness_check: "CHECK_78_LLM_NARRATIVE_TEMPLATE_LOCK_V1" version: "2026-05-28_PHASE5" EJCE_DIVERGENCE_AUDIT_V1: purpose: > EJCE 3관점 합의 진정성. homogeneous_flag=true 또는 unique_reason_pct<60%이면 경고. gate=WARN은 soft(hard-fail 아님). output_contract: Temp/ejce_divergence_audit_v1.json: fields: "[gate, unique_reason_pct, homogeneous_flag, analyst_view_homogeneous, ticker_results[]]" python_tool: "tools/build_ejce_divergence_audit_v1.py" harness_check: "CHECK_79_EJCE_DIVERGENCE_AUDIT_V1" version: "2026-05-28_PHASE5" PREDICTIVE_ALPHA_REPORT_LOCK_V2: purpose: > PA1 정반합 표 강제. coverage_pct >= 80% 필요(ETF 제외 시 90.9% 달성). weight_source=DYNAMIC 컬럼 의무. output_contract: Temp/predictive_alpha_report_lock_v2.json: fields: "[gate, coverage_pct, pa1_report_table[].thesis_signals, pa1_report_table[].antithesis_signals, pa1_report_table[].synthesis_score]" python_tool: "tools/build_predictive_alpha_report_lock_v2.py" harness_check: "CHECK_80_PREDICTIVE_ALPHA_REPORT_LOCK_V2" version: "2026-05-28_PHASE5" CANONICAL_METRICS_V1: purpose: > 단일 진실원천 아키텍처. 논리 지표를 정규 원천에서 산출해 렌더러 중복 읽기 버그 차단. gate=PASS(unresolved=0) / gate=WARN(unresolved>0). output_contract: Temp/canonical_metrics_v1.json: fields: "[gate, metrics.cluster_pct, metrics.cash_min_required_krw, metrics.cash_reference_total_krw, per_ticker.*, resolved_count, unresolved]" python_tool: "tools/build_canonical_metrics_v1.py" harness_check: "CHECK_89_CANONICAL_METRICS_RESOLVED" version: "2026-05-29_PHASE7" CROSS_SECTION_CONSISTENCY_V1: purpose: > 교차섹션 정합성 게이트. canonical 지표가 여러 섹션에서 동일하게 렌더됐는지 검증. enforcement_mode_until 이전 WARN, 이후 FAIL. score=100 목표. output_contract: Temp/cross_section_consistency_v1.json: fields: "[gate, score, conflict_count, conflicts[], forbidden_uniform_labels, incomplete_tables, enforcement_mode_until]" python_tool: "tools/build_cross_section_consistency_v1.py" harness_check: "CHECK_90_CROSS_SECTION_CONSISTENCY" version: "2026-05-29_PHASE7" ALPHA_FEEDBACK_LOOP_V2: purpose: > T5 운영 데이터 기반 PA1 팩터 가중치 조정 권고 생성. 기존 V1(T20 전용)을 확장해 T5≥10건으로 즉시 동작. AFL 원칙: 권고만 출력, 자동 적용 금지. output_contract: Temp/alpha_feedback_loop_v2.json: fields: "[status, cases_analyzed, active_signal_rate_pct, passive_signal_rate_pct, pa1_current_ratio, recommended_adjustments[]]" python_tool: "tools/build_alpha_feedback_loop_v2.py" version: "2026-05-30_Work7" DYNAMIC_VALUE_PRESERVATION_SELL_V6: purpose: > 단순 맹목적 매도(V5) 폐기. 최신 알고리즘 매도 기법(VWAP/TWAP 기반 지지선 연동) 도입. 현금 확보 시 종목의 Rebound_Elasticity_Score (반등 탄력 점수)를 계산하여 RSI < 30 및 이격도 과대 종목은 절대 즉시 매도 금지(EXECUTE_REBOUND_ONLY 강제). 호가창(Tick) 유동성을 고려한 Dynamic Limit Price = Close + (ATR20 * 0.2) 산출하여 값 고정. LLM의 주관 개입 0% 통제. inputs: [] output: field: "dynamic_value_preservation_sell_v6_json" output_contract: Temp/dynamic_value_preservation_sell_v6.json: fields: "[formula_id, status, execution_allowed, selected_sell_combo, cash_recovered_krw, value_damage_pct_avg]" python_tool: "tools/build_dynamic_value_preservation_sell_v6.py" version: "2026-05-31_Advanced1" PREDICTIVE_ALPHA_DIALECTIC_ENGINE_V2: purpose: > 단순 정반합 강세/약세 합산 탈피. 거시 경제(Macro) 국면에 따라 팩터 가중치 동적 변환(Regime-Switching). 국면이 RISK_OFF일 때 펀더멘털 점수 무시, 유동성(Liquidity) 및 스마트머니 점수 가중치 2.5배 상향. 반환된 synthesis_verdict가 BEARISH이면 어떠한 예외 없이 ALLOW_EXECUTION = FALSE 하드락 적용. inputs: [] output: field: "predictive_alpha_engine_v2_json" output_contract: Temp/predictive_alpha_engine_v2.json: fields: "[formula_id, rows, gate, numeric_generation_allowed]" python_tool: "tools/build_predictive_alpha_dialectic_engine_v2.py" version: "2026-05-31_Advanced2" CAPITAL_STYLE_TIME_STOP_V1: purpose: > 투자 방법(단타/스윙/중장기) 결정론적 분리 및 진입 시점부터 타이머 작동. SCALP(단타)로 진입한 종목이 T+3일 내 목표가(TP) 미도달 시 수익률 무관 무조건 TIME_STOP_EXIT 발송. LLM 변명 불가, "타임스탑 청산" 단답형 출력 강제. inputs: [] output: field: "capital_style_time_stop_v1_json" output_contract: Temp/capital_style_time_stop_v1.json: fields: "[formula_id, rows, gate]" python_tool: "tools/build_capital_style_time_stop_v1.py" version: "2026-05-31_Advanced3" EXECUTION_INTEGRITY_GATE_V1: purpose: > 결정론적 직렬화 라우팅 통합 게이트. 파편화된 게이트들을 단일 파이프라인으로 통합하여 단 하나의 조건이라도 실패 시 전체 JSON 출력을 null 처리 및 PENDING_EXPORT 상태로 Lock. LLM 예측 원천 차단. inputs: [] output: field: "execution_integrity_gate_v1_json" output_contract: Temp/execution_integrity_gate_v1.json: fields: "[formula_id, status, failed_checks]" python_tool: "tools/build_execution_integrity_gate_v1.py" version: "2026-05-31_Advanced4" IMPUTED_DATA_EXPOSURE_GATE_V1: purpose: > 실질 입력(펀더멘털 핵심 팩터 ROE/OPM/OCF/FCF, T+20 실현성과, 거래품질·패턴·알파평가)의 대체(imputed)·합성·PENDING 정도를 결정론적으로 측정하여, confidence_cap_basis가 대체데이터를 가리고 있는지(정직성 결함) 폭로하는 감사 게이트. 시스템 자체 신뢰도 캡 공식(raw × (0.4 + 0.6 × coverage))을 재사용하되, 분모를 schema_presence 기반 investment_quality(98.65 등)가 아니라 "실질 데이터 커버리지"로 교체하여 effective_confidence_honest를 산출한다. 대체데이터 감지 시 long_horizon_allowed / fundamental_claim_allowed 를 false로 강제하여 AGENTS.md "펀더멘털 결측 시 장기투자 추천 금지" 규칙을 결정론으로 집행한다. ENGINE_AUDIT_V1 감사 산출물 전용이며 GAS 런타임·HTS 주문 판단에는 개입하지 않는다. inputs: [] formula: weighted_coverage: "Σ(domain_weight_d × coverage_d) # 도메인: fundamental_core(0.30), realized_outcome(0.30), trade_quality(0.15), pattern(0.10), alpha_eval(0.15)" imputed_field_ratio: "1 − weighted_coverage" effective_confidence_honest: "raw_confidence_cap_basis × (0.4 + 0.6 × weighted_coverage)" gate_status: "imputed_field_ratio ≥ 0.50 → IMPUTED_DATA_BLOCK / ≥ 0.25 → IMPUTED_DATA_WARN / else PASS" long_horizon_allowed: "t20_sample > 0 AND fundamental_core_factor_coverage ≥ 0.50" fundamental_claim_allowed: "fundamental_core_factor_coverage ≥ 0.50" output: field: "imputed_data_exposure" output_contract: Temp/engine_audit_v1.json: fields: "[imputed_data_exposure{gate_status, imputed_field_ratio, weighted_coverage, domain_coverage, fundamental_core_factor_coverage, surrogate_outcome_ratio, effective_confidence_honest, confidence_cap_inflation_gap, long_horizon_allowed, fundamental_claim_allowed, report_render_skew, exposure_reasons}]" prohibition: - "LLM이 gate_status / effective_confidence_honest 를 재계산하거나 완화하는 것 금지" - "fundamental_claim_allowed=false 인데 장기·펀더멘털 우위를 단정하는 서술 금지" python_tool: "tools/build_engine_audit_v1.py" validator_tool: "tools/validate_engine_audit_v1.py" canonical_ref: "ENGINE_AUDIT_V1 / spec/28_imputed_data_exposure_contract.yaml" version: "2026-05-31_ENGINE_AUDIT_V1" # == 파이프라인 orphan 공식 일괄 등록 (orphan reconciliation 2026-06-03) ====== ANTI_LATE_ENTRY_PULLBACK_GATE_V4: purpose: > 뒷박/설거지 진입 차단 게이트 V4. velocity·분배신호 복합 조건으로 진입 차단. input_fields: [velocity_1d, velocity_5d, distribution_score] expected_outputs: [anti_late_entry_gate, chase_risk_score] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" ARCHITECTURE_BOUNDARIES_V2: purpose: > 하네스 컴포넌트 간 의존성·권한 경계를 정의하고 위반을 감지한다. input_fields: [component_list, dependency_map] expected_outputs: [boundary_violations, architecture_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" CONFIDENCE_CALIBRATION_V2: purpose: > T+5/T+20 실적 기반 신뢰도 캘리브레이션 v2. 과신·과소신뢰 구간을 보정한다. input_fields: [predicted_confidence, actual_outcome, sample_count] expected_outputs: [calibrated_confidence, calibration_state] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DATA_QUALITY_RECONCILIATION_V1: purpose: > 섹션 간 동일 의미 수치의 불일치를 탐지해 데이터 품질 조정 보고서를 산출한다. input_fields: [section_values, field_map] expected_outputs: [reconciliation_status, mismatch_fields] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DECISION_EVIDENCE_SCORE_V1: purpose: > 의사결정 근거의 출처 추적 가능성과 검증 가능성을 점수화한다. input_fields: [decision_fields, source_paths, formula_ids] expected_outputs: [decision_evidence_score_v1] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DECISION_EVIDENCE_SCORE_V2: purpose: > DECISION_EVIDENCE_SCORE_V1 개선판. 비결정론 경로 탐지 추가. input_fields: [decision_fields, source_paths, formula_ids] expected_outputs: [decision_evidence_score_v2, non_deterministic_paths] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DECISION_REPLAY_SNAPSHOT_PACK_V1: purpose: > 의사결정 시점 스냅샷 패키지를 생성해 재현·감사를 지원한다. input_fields: [decision_date, harness_context_snapshot] expected_outputs: [replay_snapshot_pack, snapshot_hash] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DERIVATION_VALIDITY_SCORE_V1: purpose: > order_blueprint 파생경로 커버리지와 결정론성을 종합해 파생유효성 점수를 산출한다. input_fields: [harness_coverage_audit, order_blueprint_json] expected_outputs: [derivation_validity_score, derivation_validity_grade, derivation_validity_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DFG_V1: purpose: > 데이터 흐름 그래프 V1. 하네스 파이프라인 의존성 방향그래프를 산출한다. input_fields: [tool_list, dependency_map] expected_outputs: [dfg_nodes, dfg_edges, cycle_detected] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DISTRIBUTION_EXIT_PRESIGNAL_V2: purpose: > 분배 국면 선행 신호를 감지해 사전 매도 권고 신호를 산출한다. input_fields: [flow_credit, volume_trend, price_structure] expected_outputs: [distribution_presignal, exit_urgency_level] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" DYNAMIC_VALUE_PRESERVATION_SELL_V3_BRIDGE: purpose: > V3 가치보존 매도와 최신 엔진 간 호환성 브리지. 하위호환 경로 유지. input_fields: [sell_plan_v3, current_engine_context] expected_outputs: [bridged_sell_plan] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" EVALUATION_HISTORY_COVERAGE_V1: purpose: > 종목별·기간별 평가 이력 커버리지를 집계한다. input_fields: [evaluation_log, date_range] expected_outputs: [history_coverage_pct, coverage_by_ticker] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" EXECUTION_AUTHORITY_MATRIX_V1: purpose: > 게이트별 실행 권한 매트릭스를 산출해 HTS 주문 권한을 결정론적으로 고착화한다. input_fields: [gate_states, execution_mode] expected_outputs: [execution_authority_matrix, authorized_actions] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" EXECUTION_QUALITY_HARNESS_V1: purpose: > 매수·매도 실행품질(슬리피지·체결률·타이밍)을 측정해 품질 점수를 산출한다. input_fields: [executed_orders, benchmark_prices] expected_outputs: [execution_quality_score, slippage_pct] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" EXECUTION_READINESS_MATRIX_V1: purpose: > HTS 주문 실행 준비 상태를 100% 기준으로 점검하는 매트릭스를 산출한다. input_fields: [gate_states, sample_counts, data_completeness] expected_outputs: [execution_readiness_matrix, readiness_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" FINAL_CONTEXT_FOR_LLM_V2: purpose: > LLM에 전달할 최종 컨텍스트 패키지 V2. numeric_generation_allowed=0 강제. input_fields: [harness_context, operational_report] expected_outputs: [final_context_for_llm, llm_serving_budget] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" FINAL_DECISION_PACKET_V1: purpose: > 하네스 최종 산출 패키지. 모든 게이트·주문·성과 요약을 단일 JSON으로 통합한다. input_fields: [all_gate_outputs, order_blueprint, operational_report] expected_outputs: [final_decision_packet, input_hash, execution_mode] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" FINAL_EXECUTION_DECISION_V1: purpose: > 최종 실행 의사결정 V1. HTS 주문표 생성 여부와 실행 모드를 결정한다. input_fields: [gate_states, global_execution_gate] expected_outputs: [final_execution_decision, execution_mode] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" FINAL_EXECUTION_DECISION_V2: purpose: > 최종 실행 의사결정 V2. V1 + shadow_ledger 강제 생성 추가. input_fields: [gate_states, global_execution_gate, shadow_ledger_data] expected_outputs: [final_execution_decision_v2, shadow_ledger] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" FORMULA_IMPLEMENTATION_REGISTRY_V1: purpose: > 공식별 GAS/Python 구현 상태를 추적하는 구현 레지스트리를 산출한다. input_fields: [formula_ids, implementation_map] expected_outputs: [implementation_registry, unimplemented_list] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" FORMULA_REGISTRY_SYNC_V1: purpose: > GAS·Python·YAML 간 공식 레지스트리 동기화 상태를 검증한다. input_fields: [gas_formulas, py_formulas, yaml_formulas] expected_outputs: [sync_status, out_of_sync_formulas] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" HARNESS_CONTEXT_VALIDATOR_V2: purpose: > 하네스 컨텍스트 전체의 형식·타입·필수 필드 유효성을 검증한다 (V2). input_fields: [harness_context] expected_outputs: [validation_result, missing_fields, type_errors] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" HORIZON_ALLOCATION_GUARD_V2: purpose: > 투자성향별 목표 보유기간 초과 여부를 감지해 TIME_STOP 플래그를 산출한다 (V2). input_fields: [entry_date, current_date, target_horizon_days] expected_outputs: [time_stop_flag, days_over_horizon] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" HORIZON_REBALANCE_PLAN_V1: purpose: > 성향별 목표 비중 달성을 위한 리밸런싱 실행 계획을 산출한다. input_fields: [current_allocation, target_allocation, rebalance_threshold] expected_outputs: [rebalance_plan, rebalance_trades] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" HORIZON_ROUTING_LOCK_V6: purpose: > 진입 국면·성향·트랜치를 결합해 매수 라우팅을 결정론적으로 고착화한다 (V6). input_fields: [market_regime, capital_style, tranche_phase, gate_states] expected_outputs: [buy_route, routing_reason_codes] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" IMPUTED_DATA_EXPOSURE_GATE_V2: purpose: > 대체(imputed) 데이터 비율을 측정해 신뢰도 과장 위험을 차단하는 게이트 V2. input_fields: [domain_coverage, imputed_fields] expected_outputs: [imputed_gate_v2, effective_confidence_honest] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" INDEX_RELATIVE_HEALTH_GATE_V1: purpose: > 종목의 KOSPI 대비 상대강도와 건전성을 측정해 인덱스 대비 게이트를 산출한다. input_fields: [ticker_return, kospi_return, relative_strength] expected_outputs: [index_relative_health_gate, underperformance_pct] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" INTRADAY_V1: purpose: > 장중 데이터 제약(Intraday Restriction)을 적용해 장중 액션 매트릭스를 산출한다. input_fields: [capture_time, market_close_time, data_type] expected_outputs: [intraday_restriction_gate, allowed_actions] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" LATE_CHASE_ATTRIBUTION_V1: purpose: > 뒷박 진입군 vs 정상 진입군의 T+5/T+20 승률 차이를 정량 측정한다. input_fields: [trade_ledger, entry_velocity_threshold] expected_outputs: [late_vs_normal_winrate_gap_pp, attribution_sample_count] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" LATE_REBOUND_BUCKET_SCORE_V1: purpose: > 반등 대기 분할매도의 실제 반등 수익 회수율을 측정해 지연 반등 버킷 점수를 산출한다. input_fields: [rebound_wait_trades, trigger_prices, actual_sell_prices] expected_outputs: [late_rebound_bucket_score, rebound_capture_rate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" LLM_SERVING: purpose: > LLM 서빙 예산과 허용 범위를 정의한다. numeric_generation_allowed 포함. input_fields: [serving_mode, allowed_operations] expected_outputs: [llm_serving_budget, numeric_generation_allowed] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" MACRO_REGIME_ALIGNMENT_GATE_V2: purpose: > 거시 국면과 포트폴리오 전략 정렬 여부를 측정해 국면 정합 게이트 V2를 산출한다. input_fields: [market_regime, strategy_regime_assumption] expected_outputs: [macro_regime_alignment_gate, alignment_score] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OPERATIONAL_ALPHA_CALIBRATION_V2: purpose: > 실운용 alpha_lead 예측의 T+5/T+20 적중률을 측정해 알파 캘리브레이션 상태를 산출한다. input_fields: [alpha_predictions, actual_outcomes, sample_count] expected_outputs: [alpha_calibration_state, t20_pass_rate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OPERATIONAL_EVAL_QUEUE_V1: purpose: > T+20 평가 대기열을 관리해 평가 완료·미완료 건수를 추적한다. input_fields: [trade_log, evaluation_date] expected_outputs: [eval_queue, pending_count, completed_count] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OPERATIONAL_EVIDENCE_AUDIT_V1: purpose: > 실운용 의사결정의 증거 추적 가능성을 감사한다. input_fields: [decision_log, evidence_map] expected_outputs: [evidence_audit_result, orphan_decisions] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OPERATIONAL_OUTCOME_LOCK_V1: purpose: > 실운용 T+5/T+20 결과를 잠금 처리해 소급 수정을 방지한다. input_fields: [outcome_ledger, lock_date] expected_outputs: [locked_outcomes, lock_status] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OPERATIONAL_T20_OUTCOME_LEDGER_V1: purpose: > 실운용 T+20 거래결과 원장. 실측 30건 이상 시 operational_t20로 인정한다. input_fields: [trade_log, t20_prices, evaluation_date] expected_outputs: [operational_t20_ledger, evaluated_count, pass_rate_pct] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OPERATIONAL_TRUTH_SCORE_V1: purpose: > 실운용 결과 기반 진실성 점수. type_A/type_B 100%를 분리 측정한다. input_fields: [operational_metrics, sample_counts] expected_outputs: [operational_truth_score, true_100_axes, pending_axes] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" ORDER_MATH_RECONCILIATION_V1: purpose: > 주문 수량·금액 계산의 정합성(round-trip 검증)을 감사한다. input_fields: [order_blueprint, portfolio_state] expected_outputs: [math_reconciliation_result, calculation_errors] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" OUTCOME_QUALITY_SCORE_V1: purpose: > T+5/T+20 실측 성과를 종합해 성과품질 점수를 산출한다. input_fields: [t5_outcomes, t20_outcomes, sample_counts] expected_outputs: [outcome_quality_score_v1, outcome_quality_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PASS_100_CRITERIA_V1: purpose: > pass_100 기준 V1. 전체 게이트·점수 100% 충족 기준을 정의한다. input_fields: [gate_states, metric_scores] expected_outputs: [pass_100_score, failed_criteria] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PERFORMANCE_MONITORING_DASHBOARD_V1: purpose: > T+5/T+20 성과 모니터링 대시보드. 주간 자동 갱신. input_fields: [trade_outcomes, monitoring_period] expected_outputs: [performance_dashboard, weekly_scorecard] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PERFORMANCE_READINESS_REPLAY_BRIDGE_V1: purpose: > replay 백필 데이터를 operational_t20 판단에 연결하는 성과준비도 브리지. input_fields: [replay_ledger, operational_threshold] expected_outputs: [performance_readiness_score, readiness_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PERF_RECOVERY_HARNESS_V1: purpose: > 성과 하락 감지 시 자동 포지션 스케일 인하와 회복 계획을 산출한다. input_fields: [recent_performance, degradation_threshold] expected_outputs: [recovery_plan, scale_down_factor] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PERF_RECOVERY_OVERRIDES_V1: purpose: > 성과 회복 기간 중 허용 오버라이드 목록과 조건을 정의한다. input_fields: [recovery_state, override_requests] expected_outputs: [allowed_overrides, blocked_overrides] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PHASE_CHECKS_50_60_V1: purpose: > 단계별 50%·60% 체크포인트에서 중간 평가를 수행한다. input_fields: [completion_pct, phase_thresholds] expected_outputs: [phase_check_result, checkpoint_flags] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PIPELINE_RUNTIME_ANOMALY_CHECK_V1: purpose: > 파이프라인 실행 중 이상 징후(지연·오류·이상값)를 탐지한다. input_fields: [runtime_profile, anomaly_thresholds] expected_outputs: [anomaly_flags, anomaly_severity] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PIPELINE_RUNTIME_CONTRACT_VALIDATOR_V1: purpose: > 파이프라인 실행 결과가 계약 명세를 준수하는지 검증한다. input_fields: [pipeline_outputs, contract_spec] expected_outputs: [contract_validation_result, violations] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PIPELINE_RUNTIME_PROFILE_SUMMARY_V1: purpose: > 파이프라인 실행 시간·메모리·산출물 수를 요약한다. input_fields: [runtime_profile] expected_outputs: [runtime_summary, bottleneck_steps] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PIPELINE_RUNTIME_PROFILE_V1: purpose: > 파이프라인 전체 실행 프로파일을 생성한다. input_fields: [execution_log] expected_outputs: [runtime_profile, step_durations] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PORTFOLIO_HEALTH_V1: purpose: > 포트폴리오 건전성 점수와 레이블(HEALTHY/CAUTION/CRITICAL)을 산출한다. input_fields: [gate_states, heat_pct, drawdown_pct] expected_outputs: [portfolio_health_score, portfolio_health_label] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" PREDICTIVE_ALPHA_DIALECTIC_ENGINE_V1_BRIDGE: purpose: > 정반합 예측 엔진 V1과 V2 간 호환성 브리지. input_fields: [v1_output, v2_context] expected_outputs: [bridged_prediction, bridge_status] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" REALIZED_PERFORMANCE_V1: purpose: > 실현 손익·승률·기대수익을 집계한다. input_fields: [closed_trades, evaluation_period] expected_outputs: [realized_pnl, win_rate, expectancy] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" REBOUND_SELL_EFFICIENCY_V1: purpose: > 반등 대기 분할매도의 효율성(반등 포착율)을 측정한다. input_fields: [rebound_wait_qty, rebound_captured_qty, expected_gain] expected_outputs: [rebound_sell_efficiency_score, efficiency_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" REPORT_AUTHORITY_DIFF_V1: purpose: > 보고서 버전 간 권한 차이를 탐지해 미인가 변경을 감지한다. input_fields: [report_v_prev, report_v_curr, authority_map] expected_outputs: [authority_diff, unauthorized_changes] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" REQUEST_RESULT_ADOPTION_V1: purpose: > 사용자 요청 결과의 채택 여부와 적용 경로를 추적한다. input_fields: [request_log, adoption_status] expected_outputs: [adoption_rate, pending_requests] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" ROOT_CAUSE_ATTRIBUTION_V1: purpose: > 성과 저하·게이트 실패의 근본 원인을 추적하고 귀인 분석을 수행한다. input_fields: [failure_events, causal_graph] expected_outputs: [root_causes, attribution_confidence] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" ROOT_CAUSE_RECOVERY_PLAN_V1: purpose: > 근본 원인 분석 결과를 기반으로 회복 계획을 산출한다. input_fields: [root_causes, available_actions] expected_outputs: [recovery_plan, estimated_recovery_time] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" RS_V2_FUSION: purpose: > 상대강도 V2 신호를 다른 기술적 신호와 융합한 복합 신호를 산출한다. input_fields: [rs_v2_score, tech_signals] expected_outputs: [rs_fusion_score, fusion_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SATELLITE_CANDIDATE_SCREEN_V1: purpose: > 위성 종목 후보군을 기술·펀더멘털·수급 기준으로 스크리닝한다. input_fields: [universe, screening_criteria] expected_outputs: [satellite_candidates, screen_scores] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SCORES_HARNESS_V1: purpose: > 모든 하네스 점수(quality/proof/evidence)를 단일 구조로 통합·검증한다. input_fields: [all_score_outputs] expected_outputs: [scores_harness, score_consistency_check] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SELL_ENGINE_AUDIT_V1: purpose: > 매도 엔진 산출값의 결정론성·수량·가격 유효성을 감사한다. input_fields: [sell_engine_output, order_blueprint] expected_outputs: [sell_engine_audit_result, audit_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SELL_EXECUTION_QUALITY_GATE_V1: purpose: > 매도 실행 품질이 슬리피지·체결률 기준을 충족하는지 검증한다. input_fields: [executed_sells, quality_thresholds] expected_outputs: [sell_execution_quality_gate, quality_score] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SELL_EXECUTION_TIMING_LOCK_V2: purpose: > 매도 실행 타이밍을 과매도 구간·반등대기·긴급전량 조건에 따라 고착화한다 (V2). input_fields: [sell_timing_signals, emergency_condition] expected_outputs: [sell_timing_lock, execution_window] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SEMANTIC_FORMULA_COVERAGE_HARNESS_V1: purpose: > 공식의 의미적 커버리지(입력·출력·성과 바인딩)를 측정한다. input_fields: [formula_ids, semantic_bindings] expected_outputs: [semantic_coverage_score, uncovered_formulas] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SHORT_HORIZON_OUTCOME_MONITOR_V1: purpose: > 단타·단기 포지션의 T+1/T+3/T+5 성과를 실시간 모니터링한다. input_fields: [short_horizon_trades, monitoring_prices] expected_outputs: [short_horizon_outcomes, early_exit_signals] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SMART_CASH_RECOVERY_V4: purpose: > 스마트 현금회복 V4. K2 분할·TRIM 우선순위·반등대기 통합. input_fields: [portfolio_state, cash_shortfall_krw, sell_priority] expected_outputs: [smart_cash_recovery_plan_v4, expected_recovery_krw] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" SMART_CASH_RECOVERY_V7: purpose: > 스마트 현금회복 V7. V6 + 반도체 클러스터 게이트·베타 조정 통합. input_fields: [portfolio_state, cash_shortfall_krw, regime_context] expected_outputs: [smart_cash_recovery_plan_v7, expected_recovery_krw] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STOP_BREACH_V1: purpose: > 손절가 이탈 여부를 판정해 BREACH_IMMEDIATE_EXIT 플래그를 산출한다. input_fields: [current_price, stop_loss_price, gap_threshold] expected_outputs: [stop_breach_gate, gap_pct] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STRATEGY_DECISION_RESULT_V3: purpose: > 전략 의사결정 결과 V3를 구조화해 final_decision_packet에 통합한다. input_fields: [buy_decisions, sell_decisions, hold_decisions] expected_outputs: [strategy_decision_result_v3, decision_summary] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STRATEGY_EXECUTION_LOCKS_REGRESSION_V1: purpose: > 전략 실행 잠금 규칙의 회귀 테스트를 수행한다. input_fields: [lock_rules, test_cases] expected_outputs: [regression_result, failed_locks] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STRATEGY_EXECUTION_LOCKS_V1: purpose: > 전략 실행 잠금 규칙 V1. 게이트별 액션 허용/차단 매트릭스. input_fields: [gate_states, action_requests] expected_outputs: [execution_locks, blocked_actions] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STRATEGY_HARDENING_HARNESS_V1: purpose: > 전략 경화 검증 하네스 V1. 규칙 준수·일관성·완전성을 측정한다. input_fields: [strategy_outputs, hardening_spec] expected_outputs: [hardening_score, hardening_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STRATEGY_HARDENING_HARNESS_V2: purpose: > 전략 경화 검증 하네스 V2. V1 + LLM 의존도 추가 측정. input_fields: [strategy_outputs, hardening_spec, llm_fields] expected_outputs: [hardening_score_v2, llm_dependency_ratio] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" STRATEGY_ROUTING_AUDIT_V1: purpose: > 전략 라우팅 경로의 결정론성과 권한을 감사한다. input_fields: [routing_decisions, authority_matrix] expected_outputs: [routing_audit_result, unauthorized_routes] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" TICK_NORM_V1: purpose: > TICK_NORMALIZER_V1의 별칭 식별자. 동일 로직의 코드 내 단축 참조. input_fields: [price, tick_table] expected_outputs: [normalized_price] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" TRUTHFULNESS_GUARD_V1: purpose: > 거짓 100% 차단 수문장. type_B 표본 부족 축의 100% 표기를 차단한다. input_fields: [outcome_metrics, sample_counts, t20_source] expected_outputs: [truthfulness_gate, contradiction_count, violations] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" TRUTHFUL_DECISION_LEDGER_V2: purpose: > 진실성 기반 의사결정 원장 V2. 거짓 100% 없이 모든 결정 근거를 기록한다. input_fields: [decision_log, truthfulness_check] expected_outputs: [truthful_ledger_v2, ledger_integrity_score] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" VALUE_PRESERVATION_SCORER_V2: purpose: > 현금확보 매도의 가치훼손·반등포착을 종합해 가치보존 점수 V2를 산출한다. input_fields: [sell_plan, rebound_data, value_damage_pct] expected_outputs: [value_preservation_score_v2, preservation_gate] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" WALK_FORWARD_CALIBRATION_V1: purpose: > 워크포워드 방식으로 전략 파라미터를 순차 캘리브레이션한다. input_fields: [historical_data, strategy_params, validation_window] expected_outputs: [calibrated_params, walk_forward_score] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" YAML_TO_CODE_COVERAGE_V1: purpose: > YAML 명세 → 코드 커버리지를 측정하고 orphan·미구현 공식을 탐지한다. input_fields: [yaml_formula_ids, code_text, golden_test_text] expected_outputs: [coverage_ratio, orphan_code_formula_count, unimplemented_rules] llm_allowed: cite_only version: "2026-06-03_ORPHAN_RECONCILE" # == [2026-06-21_PHASE8] 비기계적 매도전략 — 공매도 합성 + confluence 판단 ========= SHORT_INTEREST_RISK_GAUGE_V1: purpose: > 공매도잔고율 추세 + 공매도거래비중 + 상대수익률(섹터·지수 대비) + 거래량 이상 + 실적전망 5요소를 가중합성해 -1(매수지지)~+1(매도압력) 점수로 계량화한다. 잔고율 단독을 매수/매도 트리거로 쓰지 않으며, 잔고율이 1% 미만(현대로템형)인 저잔고율 종목은 거래비중·상대수익률 가중치를 자동 상향한다. output_contract: short_interest_composite_json: fields: "[short_interest_pressure, status, low_balance_regime, label, components, weights_used, missing_inputs]" python_tool: src/quant_engine/qualitative_sell_strategy_v1.py:compute_short_interest_composite version: "2026-06-21_PHASE8" QUALITATIVE_SELL_STRATEGY_V1: purpose: > 매크로(macro_pressure)·실적/펀더멘털 추세(fundamental_trajectory)·공매도수급 (short_interest_pressure)·호가 10단계 미시구조(microstructure_pressure)· 대내외 변수/대형 IPO·섹터 로테이션(liquidity_rotation_risk) 5개 독립 팩터군의 confluence(최소 3/5 동일방향 합의)로만 매도/보유/추가 확신도를 산출한다. 단일 팩터 임계값 돌파만으로는 행동을 트리거하지 않는다(기계적 매도 금지). 현금부족 사유는 입력에서 의도적으로 배제되며(cash_shortfall_excluded=true), 주식가치 보존이 유일한 목적함수다. 매도/추가 판단 시 실제 실적발표일·고영향 매크로 이벤트일 기준으로 검토구간(review_window)을 역산한다(임의 고정일 금지). market_regime(PERFORMANCE_MARKET/TECHNICAL_MARKET)이 ctx.rate_trend로 주어지면 금리국면에 따라 팩터 가중치를 조정한다(MARKET_REGIME_CLASSIFIER_V1). output_contract: qualitative_sell_strategy_json: fields: "[action, conviction, market_regime, composite_score, sell_agreeing_factors, hold_add_agreeing_factors, missing_factors, review_window, rationale, cash_shortfall_excluded, mechanical_sell_prohibited]" python_tool: src/quant_engine/qualitative_sell_strategy_v1.py:compute_qualitative_sell_strategy version: "2026-06-21_PHASE8" MARKET_REGIME_CLASSIFIER_V1: purpose: > 금리 추세(rate_trend: RISING/FLAT/FALLING)를 실적장세(PERFORMANCE_MARKET)/ 기술장세(TECHNICAL_MARKET)로 분류한다. 금리 상승기엔 유동성보다 실적·수출입 펀더멘털이 가격을 주도(실적장세) — fundamental_trajectory 가중 상향. 금리 보합·하락기엔 유동성이 풍부해 수급·미시구조가 가격을 주도(기술장세) — microstructure_pressure/short_interest_pressure 가중 상향. QUALITATIVE_SELL_STRATEGY_V1·SATELLITE_CANDIDATE_SCORE_V1의 가중치 산출에 사용. output_contract: market_regime_json: fields: "[market_regime]" python_tool: src/quant_engine/qualitative_sell_strategy_v1.py:classify_market_regime version: "2026-06-21_PHASE8" MICROSTRUCTURE_PRESSURE_FROM_ORDERBOOK_V1: purpose: > KIS Open API 호가10단계(inquire-asking-price-exp-ccn, FHKST01010200) output1의 total_askp_rsqn/total_bidp_rsqn으로 -1(매수우위)~+1(매도우위) 미시구조 압력을 계량화. QUALITATIVE_SELL_STRATEGY_V1의 microstructure_pressure 입력으로 쓰이며, 전략 방향 결정이 아니라 confluence 성립 후 집행 타이밍 보조로만 사용한다. [CRITICAL] 이 공식이 사용하는 KIS API는 조회(read-only)만 수행 — governance/rules/06_no_direct_api_trading.yaml, 07_no_kis_account_balance_query.yaml. output_contract: microstructure_pressure_json: fields: "[microstructure_pressure, status, total_askp_rsqn, total_bidp_rsqn]" python_tool: src/quant_engine/qualitative_sell_strategy_v1.py:compute_microstructure_pressure_from_orderbook version: "2026-06-21_PHASE8" SATELLITE_CANDIDATE_SCORE_V1: purpose: > 미보유 위성 유니버스 종목을 섹터 수출입 추세(sector_export_trend, 관세청/산업 통상부 무역통계 기반)·펀더멘털 추세·상대수익률로 평가해 BUY_CANDIDATE/WATCH/ NEUTRAL_NO_EDGE/AVOID를 산출한다. market_regime에 따라 수출입 비중을 조정 (실적장세에서 sector_export_trend 가중 상향). output_contract: satellite_candidate_json: fields: "[satellite_action, attractiveness_score, market_regime, components, weights_used]" python_tool: src/quant_engine/qualitative_sell_strategy_v1.py:compute_satellite_candidate_score version: "2026-06-21_PHASE8"