=== META ===
{
  "id": "GTPX-CONTRACT-MODEL",
  "title": "GTPX Contract Model",
  "version": "0.1.0",
  "status": "draft",
  "updated": "2026-04-25",
  "authority": "04_contract/GTPX-CONTRACT-MODEL.gtpx",
  "type": "contract_model",
  "project": "GTPX",
  "depends_on": [
    "03_language/GTPX-DICTIONARY.gtpx",
    "03_language/GTPX-SYNTAX.gtpx",
    "03_language/GTPX-SEMANTICS.gtpx"
  ]
}

=== DATA ===
{
  "purpose": "Defines what a contract is in GTPX and which dimensions it must control.",

  "contract_definition": "A contract is a formal, explicit, and machine-readable set of rules that defines allowed behavior, constraints, boundaries, and expectations for a GTPX request and response.",

  "contract_scope": [
    "allowed_behavior",
    "forbidden_behavior",
    "input_requirements",
    "output_requirements",
    "validation_requirements",
    "source_requirements",
    "execution_constraints",
    "error_handling_policy"
  ],

  "contract_dimensions": {
    "behavior_control": "Defines what the AI model is allowed and not allowed to do.",
    "input_control": "Defines required structure and completeness of input.",
    "output_control": "Defines required structure and limits of output.",
    "source_control": "Defines which sources are allowed, required, or forbidden.",
    "validation_control": "Defines validation rules before execution.",
    "execution_control": "Defines execution conditions such as dry_run, commit, or blocked states.",
    "error_control": "Defines how errors must be handled (fail_closed, blocked, etc.)."
  },

  "contract_requirements": [
    "contract_must_be_explicit",
    "contract_must_be_machine_readable",
    "contract_must_define_constraints",
    "contract_must_define_allowed_actions",
    "contract_must_define_failure_behavior"
  ],

  "contract_effect": "No request may be processed and no response may be generated outside the rules defined in the contract."
}

=== RULES ===
{
  "contract_is_mandatory_for_execution": true,
  "execution_without_contract_is_forbidden": true,
  "contract_overrides_default_behavior": true,
  "contract_must_not_be_implicit": true,
  "contract_must_be_validated_before_use": true
}

=== STATUS ===
{
  "state": "draft",
  "open_questions": [
    "Confirm whether contract inheritance is allowed in later versions.",
    "Confirm whether multiple contracts per request are allowed."
  ],
  "next_step": "Create and populate 04_contract/GTPX-CONTRACT-CORE.gtpx."
}