{
  "version": 1,
  "contracts": [
    {
      "id": "leave_balance_eligibility",
      "description": "연차·휴가 잔여와 신청 가능 여부를 원장 연도 및 구성값으로 검증한다.",
      "applies_to_tools": [
        "search_hr_data"
      ],
      "intent_match": {
        "subject_terms_any": [
          "연차",
          "휴가"
        ],
        "action_terms_any": [
          "잔여",
          "가능",
          "승인",
          "신청",
          "사용할 수"
        ]
      },
      "data_contract": {
        "source_object": "HMM_LEAVE_BALANCES",
        "identity_fields": [
          "EMPLOYEE_CODE"
        ],
        "required_fields": [
          "LEAVE_YEAR",
          "ANNUAL_ENTITLEMENT",
          "CARRYOVER_DAYS",
          "USED_DAYS",
          "PENDING_DAYS",
          "AVAILABLE_REMAINING_DAYS"
        ],
        "computed_fields": {
          "AVAILABLE_REMAINING_DAYS": {
            "expression": "ANNUAL_ENTITLEMENT + CARRYOVER_DAYS - USED_DAYS - PENDING_DAYS",
            "authoritative_source": "DATABASE_VIRTUAL_COLUMN"
          }
        },
        "missing_record_semantics": "NO_BALANCE_DATA_FOR_YEAR",
        "forbidden_missing_record_fallbacks": [
          "ZERO",
          "NVL",
          "COALESCE",
          "OUTER_JOIN_DEFAULT",
          "LITERAL_VALUE"
        ]
      },
      "temporal_contract": {
        "current_balance_year": "LATEST_AVAILABLE_LEAVE_YEAR",
        "requested_period_and_current_balance_are_separate": true,
        "period_status_fields": [
          "REQUEST_PERIOD_LABEL",
          "PERIOD_STATUS"
        ],
        "past_period_status": "HISTORICAL_REQUEST_PERIOD",
        "past_period_decision": "DO_NOT_DECIDE_NEW_APPLICATION_FROM_CURRENT_BALANCE",
        "past_period_decision_field": "APPLICATION_DECISION_STATUS",
        "past_period_decision_value": "NOT_APPLICABLE_FOR_HISTORICAL_PERIOD",
        "forbidden_past_period_decision_field_patterns": [
          "^CAN_",
          "^APPROVAL_(ALLOWED|DENIED)$"
        ],
        "validate_stated_days_against": [
          "INCLUSIVE_CALENDAR_DAYS",
          "MONDAY_TO_FRIDAY_DAYS"
        ],
        "day_count_mismatch_status": "DATE_COUNT_REQUIRES_VALIDATION"
      },
      "answer_contract": {
        "separate_data_facts_and_policy_requirements": true,
        "deny_conclusions_without_required_fields": [
          "ZERO_REMAINING_DAYS",
          "LEAVE_APPROVAL_ALLOWED",
          "LEAVE_APPROVAL_DENIED"
        ],
        "missing_evidence_response": "STATE_INSUFFICIENT_EVIDENCE_WITHOUT_INVENTING_VALUES",
        "missing_evidence_message": "조회 결과가 필수 원장 근거나 시간 기준 계약을 충족하지 않아 휴가 가능 여부를 확정할 수 없습니다. 계약 필드가 충족된 원장 결과로 다시 조회해야 합니다."
      }
    }
  ]
}
