schema_version: 2026-06-03-value-preserving-cash-raise-optimizer-v9
formula_id: VALUE_PRESERVING_CASH_RAISE_V9
supersedes: VALUE_PRESERVING_CASH_RAISE_OPTIMIZER_V7
purpose: 현금확보와 가치보전 동시 관리 — BREACH_FULL_LIQUIDATION 금지, K2 50/50 강제.
required_fields:
  - value_damage_pct_avg_raw
  - value_damage_pct_avg
  - execution_damage_for_gate

# ── 청산 정책 (liquidation_policy) ──────────────────────────────────────────
liquidation_policy:
  formula_id: VALUE_PRESERVING_CASH_RAISE_V9
  rationale: >
    현재 현금확보가 한 종목을 통째로 던져 15.7% 가치를 깎고 반등 포착 확률 0%.
    가치훼손 캡(10%)과 반등 포착(>=50%)을 게이트로 두고,
    과매도 구간은 K2 50/50 분할로 강제한다.
  rules:
    - id: LP001_SINGLE_STOCK_CONCENTRATION
      rule: "단일 종목 비중이 청산금액의 60%를 넘지 못하게 분산"
      enforcement: HARD_BLOCK
    - id: LP002_BREACH_FULL_LIQUIDATION_BAN
      rule: "후보가 oversold(rsi14<30) 이거나 brt_verdict!=BROKEN 이면 BREACH_FULL_LIQUIDATION 금지"
      exception: "emergency_full_sell=true 일 때만 전량 즉시 허용"
      enforcement: HARD_BLOCK
    - id: LP003_K2_50_50_SPLIT
      rule: "LP002 조건 충족 시 K2 50/50: immediate=floor(qty/2), rebound_wait=나머지"
      rebound_trigger: "prevClose + rebound_factor×ATR20"
      rebound_factors:
        EVENT_SHOCK: 0.7
        RISK_OFF: 0.6
        NEUTRAL: 0.5
        RISK_ON: 0.3
      enforcement: MANDATORY
    - id: LP004_VALUE_DAMAGE_CAP
      rule: "raw_value_damage_pct_avg <= 10.0"
      cap_violated_action: "조합 재탐색. 캡 위반 시 HTS 주문 차단"
      enforcement: HARD_BLOCK
    - id: LP005_REBOUND_CAPTURE
      rule: "rebound_capture_probability >= 0.50"
      enforcement: GATE
  emergency_override:
    condition: "half_expected_krw × 2 < cash_shortfall_min_krw"
    emergency_full_sell: true
    note: "이 조건만이 전량 즉시 허용. 다른 이유로 전량 즉시 금지."
  acceptance_criteria:
    raw_value_damage_pct_avg: {op: "<=", target: 10.0, current: 15.7, blocking: true}
    rebound_capture_probability: {op: ">=", target: 0.50, current: 0.0, blocking: true}
    breach_full_liquidation_count: {op: "==", target: 0, note: "emergency_full_sell=true 제외"}
    single_stock_concentration_pct: {op: "<=", target: 60.0}
  output: Temp/smart_cash_recovery_v9.json
  python_tool: "tools/build_value_preserving_cash_raise_optimizer_v7.py (v9로 출력)"
  gs_coverage: "gas_apex_runtime_core.gs:calcValuePreservingCashRaiseV9_()"
  validator: "tools/validate_value_preserving_cash_raise_optimizer_v7.py + validate_cash_raise_pareto_executor_v2.py"
