=== META ===
{
  "id": "GTPX-SYNTAX",
  "title": "GTPX Syntax",
  "version": "0.1.0",
  "status": "draft",
  "updated": "2026-04-25",
  "authority": "03_language/GTPX-SYNTAX.gtpx",
  "type": "language_syntax",
  "project": "GTPX",
  "depends_on": [
    "03_language/GTPX-DICTIONARY.gtpx"
  ]
}

=== DATA ===
{
  "purpose": "Defines the allowed structural format of GTPX documents and messages.",

  "syntax_policy": {
    "structure_is_mandatory": true,
    "section_order_is_fixed": true,
    "undefined_sections_are_forbidden": true,
    "free_text_outside_structure_is_forbidden": true
  },

  "document_structure": [
    "META",
    "DATA",
    "RULES",
    "STATUS"
  ],

  "section_format": {
    "META": "JSON object",
    "DATA": "JSON object",
    "RULES": "JSON object",
    "STATUS": "JSON object"
  },

  "section_rules": {
    "META": {
      "required_fields": [
        "id",
        "title",
        "version",
        "status",
        "updated",
        "authority"
      ]
    },
    "DATA": {
      "required": true
    },
    "RULES": {
      "required": true
    },
    "STATUS": {
      "required": true
    }
  },

  "request_structure": [
    "CONTRACT",
    "AGENT",
    "PURPOSE",
    "CONTEXT",
    "SOURCE_SET",
    "FILE_SET",
    "REQUEST",
    "EXPECTED_OUTPUT",
    "PAYLOAD_HASH",
    "END_OF_MESSAGE"
  ],

  "response_structure": [
    "ACK",
    "STATUS",
    "SUMMARY",
    "MISSING_CONTEXT",
    "ANALYSIS",
    "RISKS",
    "PROPOSED_ACTIONS",
    "PATCH",
    "DRY_RUN",
    "NEXT_STEP"
  ],

  "forbidden_patterns": [
    "missing_required_sections",
    "incorrect_section_order",
    "undefined_sections",
    "mixed_structure_and_free_text",
    "partial_messages_without_status"
  ]
}

=== RULES ===
{
  "section_order_must_be_respected": true,
  "all_sections_must_exist": true,
  "json_must_be_valid": true,
  "no_extra_fields_allowed_without_definition": true,
  "no_implicit_structure_allowed": true,
  "request_and_response_structures_are_authoritative": true
}

=== STATUS ===
{
  "state": "draft",
  "open_questions": [
    "Confirm if FILE_SET is mandatory or optional.",
    "Confirm if PATCH and DRY_RUN sections must always exist or only when used."
  ],
  "next_step": "Create and populate 03_language/GTPX-SEMANTICS.gtpx."
}