=== META ===
{
  "id": "GTPX-CONTRACT-CORE",
  "title": "GTPX Contract Core",
  "version": "0.1.1",
  "status": "draft",
  "updated": "2026-04-26",
  "authority": "04_contract/GTPX-CONTRACT-CORE.gtpx",
  "type": "contract_core",
  "project": "GTPX",
  "depends_on": [
    "04_contract/GTPX-CONTRACT-MODEL.gtpx",
    "03_language/GTPX-ENUMS.gtpx",
    "06_protocol/GTPX-RESPONSE-MODEL.gtpx"
  ]
}

=== DATA ===
{
  "purpose": "Defines the minimal mandatory field set for a valid GTPX contract, including response delivery requirements.",

  "contract_policy": {
    "contract_is_mandatory": true,
    "all_fields_must_be_present": true,
    "missing_field_results_in_blocked": true,
    "implicit_values_are_forbidden": true
  },

  "minimal_contract_fields": [
    "meta_ugovora",
    "obavezni_sadrzaj",
    "dodatni_sadrzaj",
    "ogranicenja_komunikacije"
  ],

  "meta_ugovora": {
    "description": "Defines identity and purpose of the contract.",
    "fields": [
      "contract_id",
      "contract_version",
      "contract_purpose"
    ]
  },

  "obavezni_sadrzaj": {
    "description": "Defines required elements that must always exist.",
    "fields": [
      "allowed_actors",
      "allowed_sources",
      "required_structure",
      "required_validation",
      "required_output_format",
      "response_delivery"
    ]
  },

  "response_delivery": {
    "description": "Defines mandatory response delivery behavior required by the contract.",
    "fields": [
      "response_mode",
      "require_complete_response",
      "require_response_hash",
      "incomplete_response_policy"
    ],
    "field_requirements": {
      "response_mode": "Must use response_mode from GTPX-ENUMS.",
      "require_complete_response": "Must be boolean and must be true for system outputs.",
      "require_response_hash": "Must be boolean and must be true for atomic system outputs.",
      "incomplete_response_policy": "Must use incomplete_response_policy from GTPX-ENUMS."
    }
  },

  "dodatni_sadrzaj": {
    "description": "Defines optional extensions allowed within the contract.",
    "fields": [
      "extended_rules",
      "custom_constraints",
      "domain_specific_requirements"
    ]
  },

  "ogranicenja_komunikacije": {
    "description": "Defines strict limitations of allowed behavior.",
    "fields": [
      "forbidden_actions",
      "fail_policy",
      "max_scope",
      "allowed_operations"
    ]
  }
}

=== RULES ===
{
  "all_minimal_fields_are_required": true,
  "field_names_must_not_be_changed": true,
  "contract_without_any_field_is_invalid": true,
  "contract_must_define_allowed_and_forbidden_behavior": true,
  "contract_must_define_fail_policy": true,
  "contract_must_define_structure_requirements": true,
  "contract_must_define_response_delivery": true,
  "response_mode_must_use_gtpx_enums": true,
  "incomplete_response_policy_must_use_gtpx_enums": true,
  "system_output_contracts_must_require_atomic_response": true,
  "system_output_contracts_must_reject_incomplete_response": true
}

=== STATUS ===
{
  "state": "draft",
  "open_questions": [
    "Confirm exact field naming standard (snake_case vs strict GTPX naming).",
    "Confirm if additional mandatory fields will be added after first implementation.",
    "Confirm whether response_delivery belongs permanently under obavezni_sadrzaj or should later become a dedicated top-level contract section."
  ],
  "next_step": "Integrate response delivery validation into GTPX runtime model."
}