﻿{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "AGLA_ROTA_MACHINE_SCHEMA_V0_2",
  "title": "AGLA ROTA MACHINA Schema",
  "version": "0.2.0-DRAFT",
  "status": "DRAFT",
  "purpose": "Represent a ROTA as a traversable machine-state structure extracted from textual AGLA artifacts, preserving ROTA / WHEEL / CASA / OPERATOR / PLACEMENT / CONNECTION / TRAVERSAL / VISUAL_BINDING distinction, order pluralism, source trace, carrier packages, state separation, loci, cameras, chambers, multiplicatio, validation, and SATOR report surfaces.",
  "depends_on": [
    "LIBER MACHINA EX ROTAE EXTRACTIO v0.1.0",
    "TENET MACHINA EX ROTA v0.1.0",
    "AREPO MACHINA EX ROTA v0.1.0",
    "OPERA MACHINA EX ROTA v0.1.0",
    "ROTA MACHINA EX ROTA v0.1.0",
    "SATOR MACHINA EX ROTA v0.1.0",
    "Î£Î‘Î¤ÎŸÎ¡ MACHINA EX ROTA v0.1.0"
  ],

  "required": [
    "schema_meta",
    "source_trace",
    "terminology_law",
    "rota",
    "wheels",
    "houses",
    "operators",
    "placements",
    "connections",
    "order_model",
    "state_model",
    "traversal_model",
    "extraction_model",
    "validation_model"
  ],

  "properties": {
    "schema_meta": {
      "type": "object",
      "required": [
        "schema_id",
        "schema_version",
        "schema_status",
        "created_for",
        "non_canonical_notice"
      ],
      "properties": {
        "schema_id": {
          "type": "string",
          "const": "AGLA_ROTA_MACHINE_SCHEMA"
        },
        "schema_version": {
          "type": "string",
          "const": "0.2.0-DRAFT"
        },
        "schema_status": {
          "type": "string",
          "enum": [
            "DRAFT",
            "TEST",
            "PROVISIONAL",
            "CANONICAL_CANDIDATE"
          ]
        },
        "created_for": {
          "type": "string",
          "default": "Godot / API / CLI / webapp / parser-ready AGLA ROTA extraction"
        },
        "non_canonical_notice": {
          "type": "string",
          "default": "This schema is a representation layer. It does not define canon, does not execute OPERA, and does not replace source artifacts."
        }
      }
    },

    "source_trace": {
      "type": "object",
      "required": [
        "source_policy",
        "artifact_family",
        "parsed_artifacts",
        "extraction_confidence"
      ],
      "properties": {
        "source_policy": {
          "type": "object",
          "required": [
            "source_before_memory",
            "parse_before_claim",
            "artifact_before_inference"
          ],
          "properties": {
            "source_before_memory": {
              "type": "boolean",
              "const": true
            },
            "parse_before_claim": {
              "type": "boolean",
              "const": true
            },
            "artifact_before_inference": {
              "type": "boolean",
              "const": true
            }
          }
        },
        "artifact_family": {
          "type": "object",
          "required": [
            "tenet",
            "rotas"
          ],
          "properties": {
            "tenet": {
              "$ref": "#/$defs/artifact_ref"
            },
            "rotas": {
              "$ref": "#/$defs/artifact_ref"
            },
            "arepo": {
              "$ref": "#/$defs/artifact_ref"
            },
            "opera": {
              "$ref": "#/$defs/artifact_ref"
            },
            "sator": {
              "$ref": "#/$defs/artifact_ref"
            },
            "patches": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/artifact_ref"
              }
            },
            "auxiliary": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/artifact_ref"
              }
            }
          }
        },
        "parsed_artifacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/parsed_artifact"
          }
        },
        "extraction_confidence": {
          "type": "string",
          "enum": [
            "HIGH",
            "MEDIUM",
            "LOW",
            "MIXED",
            "UNRESOLVED"
          ]
        },
        "unresolved_items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/unresolved_item"
          }
        }
      }
    },

    "terminology_law": {
      "type": "object",
      "required": [
        "rota_not_wheel",
        "house_not_operator",
        "operator_not_placement",
        "placement_not_connection",
        "visual_binding_not_execution",
        "operator_ordinal_not_house_ordinal",
        "pre_wheel_law"
      ],
      "properties": {
        "rota_not_wheel": {
          "type": "boolean",
          "const": true
        },
        "definition_rota": {
          "type": "string",
          "default": "ROTA is the total traversable machine object."
        },
        "definition_wheel": {
          "type": "string",
          "default": "WHEEL is an annular positional component inside a ROTA."
        },
        "wheel_term_policy": {
          "type": "string",
          "enum": [
            "USE_WHEEL_TERM_FOR_3D_MESH_DISAMBIGUATION",
            "WHEEL_NAMES_COMPONENT_NOT_ROTA"
          ]
        },
        "definition_house": {
          "type": "string",
          "default": "CASA / HOUSE is a local positional slot inside a WHEEL."
        },
        "definition_operator": {
          "type": "string",
          "default": "OPERATOR is operative or carrier content allocated to a HOUSE through explicit PLACEMENT."
        },
        "definition_placement": {
          "type": "string",
          "default": "PLACEMENT is explicit binding of OPERATOR to CASA."
        },
        "definition_connection": {
          "type": "string",
          "default": "CONNECTION is a traversable relation between structural references."
        },
        "definition_traversal": {
          "type": "string",
          "default": "TRAVERSAL is lawful movement through structural units."
        },
        "definition_visual_binding": {
          "type": "string",
          "default": "VISUAL_BINDING is optional representation; it is never execution."
        },
        "house_not_operator": {
          "type": "boolean",
          "const": true
        },
        "operator_not_placement": {
          "type": "boolean",
          "const": true
        },
        "placement_not_connection": {
          "type": "boolean",
          "const": true
        },
        "visual_binding_not_execution": {
          "type": "boolean",
          "const": true
        },
        "operator_ordinal_not_house_ordinal": {
          "type": "boolean",
          "const": true
        },
        "pre_wheel_law": {
          "$ref": "#/$defs/pre_wheel_law"
        }
      }
    },

    "rota": {
      "type": "object",
      "required": [
        "rota_id",
        "rota_name",
        "stack_ref",
        "regime_ref",
        "figure_ref",
        "identity",
        "machine_role",
        "operative_status",
        "canonicality_status"
      ],
      "properties": {
        "rota_id": {
          "type": "string",
          "examples": [
            "ROTA_T",
            "ROTA_A",
            "ROTA_NETIVOT",
            "ROTA_SEPHIROT_ARBOR",
            "ROTA_TRADITIO_CAMERA"
          ]
        },
        "rota_name": {
          "type": "string"
        },
        "stack_ref": {
          "type": "string"
        },
        "regime_ref": {
          "type": "string"
        },
        "figure_ref": {
          "type": "string"
        },
        "identity": {
          "$ref": "#/$defs/rota_identity"
        },
        "machine_role": {
          "type": "string",
          "examples": [
            "relative_predicate_machine",
            "absolute_dignity_machine",
            "netivotic_template_machine",
            "sephirotic_arbor_machine",
            "tabula_locus_machine",
            "multiplicatio_chamber_machine",
            "camera_matrix_machine"
          ]
        },
        "operative_status": {
          "type": "string",
          "enum": [
            "STRUCTURAL_ONLY",
            "TRAVERSABLE",
            "AREPO_ADMISSIBLE_WHEN_BOUND",
            "OPERA_EXECUTABLE_AFTER_ADMISSION",
            "DISPLAY_ONLY",
            "DIAGNOSTIC_ONLY"
          ]
        },
        "canonicality_status": {
          "$ref": "#/$defs/canonicality_status"
        }
      }
    },

    "wheels": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/wheel"
      }
    },

    "houses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/house"
      }
    },

    "operators": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/operator"
      }
    },

    "placements": {
      "type": "array",
      "description": "Explicit bindings between operators and houses. This prevents collapse between operator ordinal and house ordinal.",
      "items": {
        "$ref": "#/$defs/operator_placement"
      }
    },

    "connections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/connection"
      }
    },

    "order_model": {
      "$ref": "#/$defs/order_model"
    },

    "state_model": {
      "$ref": "#/$defs/state_model"
    },

    "traversal_model": {
      "$ref": "#/$defs/traversal_model"
    },

    "locus_model": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/locus"
      }
    },

    "camera_model": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/camera"
      }
    },

    "chamber_model": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/chamber"
      }
    },

    "multiplicatio_model": {
      "$ref": "#/$defs/multiplicatio_model"
    },

    "visual_binding": {
      "$ref": "#/$defs/visual_binding"
    },

    "extraction_model": {
      "$ref": "#/$defs/extraction_model"
    },

    "validation_model": {
      "$ref": "#/$defs/validation_model"
    },

    "report_model": {
      "$ref": "#/$defs/report_model"
    },

    "handoff_model": {
      "$ref": "#/$defs/handoff_model"
    },

    "unresolved_items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/unresolved_item"
      }
    }
  },

  "$defs": {
    "canonicality_status": {
      "type": "string",
      "enum": [
        "PARSED_FROM_ARTIFACT",
        "DERIVED_FROM_ARTIFACT",
        "USER_PATCH",
        "NUOVA_DRAFT",
        "PROVISIONAL",
        "CANONICAL_CANDIDATE",
        "UNRESOLVED",
        "INVALID"
      ]
    },

    "artifact_ref": {
      "type": "object",
      "required": [
        "path",
        "class",
        "role"
      ],
      "properties": {
        "path": {
          "type": "string"
        },
        "class": {
          "type": "string",
          "enum": [
            "TENET",
            "ROTAS",
            "AREPO",
            "OPERA",
            "SATOR",
            "PATCH",
            "DEP",
            "AUXILIARY",
            "USER_PATCH"
          ]
        },
        "role": {
          "type": "string"
        },
        "sha256": {
          "type": "string"
        },
        "bytes": {
          "type": "integer"
        },
        "parsed": {
          "type": "boolean"
        }
      }
    },

    "parsed_artifact": {
      "type": "object",
      "required": [
        "artifact_path",
        "parsed_claims",
        "extracted_fields"
      ],
      "properties": {
        "artifact_path": {
          "type": "string"
        },
        "parsed_claims": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "extracted_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "confidence": {
          "type": "string",
          "enum": [
            "HIGH",
            "MEDIUM",
            "LOW",
            "MIXED"
          ]
        }
      }
    },

    "unresolved_item": {
      "type": "object",
      "required": [
        "field",
        "reason",
        "required_source",
        "unresolved_status"
      ],
      "properties": {
        "field": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "required_source": {
          "type": "string"
        },
        "unresolved_status": {
          "type": "string",
          "enum": [
            "UNRESOLVED_NONBLOCKING",
            "UNRESOLVED_BLOCKING",
            "DEFERRED_TO_SOURCE",
            "DEFERRED_TO_OPERA",
            "DEFERRED_TO_USER_PATCH"
          ]
        },
        "blocking_effect": {
          "type": "string"
        },
        "recommended_next_step": {
          "type": "string"
        }
      }
    },

    "pre_wheel_law": {
      "type": "object",
      "required": [
        "wheel_ordinal",
        "houses_count",
        "operative",
        "meaning"
      ],
      "properties": {
        "wheel_ordinal": {
          "type": "string",
          "const": "PRE"
        },
        "houses_count": {
          "type": "integer",
          "const": 1
        },
        "operative": {
          "type": "boolean",
          "const": false
        },
        "meaning": {
          "type": "string",
          "default": "WHEEL PRE is the central identity and potentiality field of a ROTA; no OPERA execution occurs here."
        }
      }
    },

    "rota_identity": {
      "type": "object",
      "required": [
        "pre_wheel_ref",
        "pre_house_ref",
        "identity_operator_ref",
        "operative"
      ],
      "properties": {
        "pre_wheel_ref": {
          "type": "string",
          "default": "WHEEL_PRE"
        },
        "pre_house_ref": {
          "type": "string",
          "default": "WHEEL_PRE.HOUSE_PRE"
        },
        "identity_operator_ref": {
          "type": "string"
        },
        "operative": {
          "type": "boolean",
          "const": false
        },
        "meaning": {
          "type": "string",
          "default": "Identity and potentiality of the ROTA. No source-machine OPERA execution occurs here."
        }
      }
    },

    "wheel": {
      "type": "object",
      "required": [
        "wheel_id",
        "wheel_ordinal",
        "operative",
        "wheel_role",
        "house_count",
        "house_refs"
      ],
      "properties": {
        "wheel_id": {
          "type": "string"
        },
        "wheel_ordinal": {
          "type": "string",
          "examples": [
            "PRE",
            "I",
            "II",
            "III",
            "IV",
            "V",
            "VI",
            "VII",
            "VIII",
            "IX"
          ]
        },
        "operative": {
          "type": "boolean"
        },
        "wheel_role": {
          "type": "string",
          "examples": [
            "identity_axis",
            "principal_operator_wheel",
            "contracted_level",
            "genus_level",
            "locus_axis",
            "chamber_wheel",
            "generative_stage",
            "display_shell",
            "diagnostic_reduction"
          ]
        },
        "level_index": {
          "type": "integer"
        },
        "depth_index": {
          "type": "integer"
        },
        "fixed_to": {
          "type": "string"
        },
        "house_count": {
          "type": "integer",
          "minimum": 1
        },
        "house_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "house": {
      "type": "object",
      "required": [
        "house_id",
        "wheel_ref",
        "house_ordinal",
        "operator_placement_refs"
      ],
      "properties": {
        "house_id": {
          "type": "string"
        },
        "wheel_ref": {
          "type": "string"
        },
        "house_ordinal": {
          "type": "string"
        },
        "house_index": {
          "type": "integer",
          "minimum": 0
        },
        "house_role": {
          "type": "string",
          "examples": [
            "identity_house",
            "operator_slot",
            "empty_slot",
            "locus_slot",
            "chamber_slot",
            "camera_slot",
            "diagnostic_slot",
            "display_slot"
          ]
        },
        "operator_placement_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "operator": {
      "type": "object",
      "required": [
        "operator_id",
        "operator_ordinal",
        "operator_token",
        "operator_label",
        "carrier_domain",
        "carrier_package"
      ],
      "properties": {
        "operator_id": {
          "type": "string"
        },
        "operator_ordinal": {
          "type": "string"
        },
        "operator_token": {
          "type": "string"
        },
        "operator_label": {
          "type": "string"
        },
        "operator_translation": {
          "type": "string"
        },
        "carrier_domain": {
          "type": "string"
        },
        "carrier_package": {
          "$ref": "#/$defs/carrier_package"
        },
        "parent_operator_ref": {
          "type": "string"
        },
        "specificity_level": {
          "type": "integer"
        },
        "operative": {
          "type": "boolean",
          "default": true
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "carrier_package": {
      "type": "object",
      "required": [
        "carrier_type",
        "carrier_token",
        "carrier_script",
        "carrier_display",
        "carrier_status"
      ],
      "properties": {
        "carrier_type": {
          "type": "string",
          "enum": [
            "LATIN_LETTER",
            "HEBREW_LETTER",
            "PHOENICIAN_LETTER",
            "NUMERAL_SIGN",
            "GLYPH",
            "TOKEN",
            "COMPOSITE",
            "ABSTRACT_ID"
          ]
        },
        "carrier_token": {
          "type": "string"
        },
        "carrier_script": {
          "type": "string",
          "examples": [
            "LATIN",
            "HEBREW",
            "PHOENICIAN",
            "NONE",
            "CUSTOM"
          ]
        },
        "carrier_display": {
          "type": "string"
        },
        "unicode_sequence": {
          "type": "string"
        },
        "numeric_value": {
          "type": "number"
        },
        "carrier_status": {
          "type": "string",
          "enum": [
            "PRIMARY",
            "DERIVED",
            "DISPLAY_ONLY",
            "PROVISIONAL",
            "UNRESOLVED"
          ]
        }
      }
    },

    "operator_placement": {
      "type": "object",
      "required": [
        "placement_id",
        "operator_ref",
        "wheel_ref",
        "house_ref",
        "operator_ordinal",
        "house_ordinal",
        "ordinal_relation"
      ],
      "properties": {
        "placement_id": {
          "type": "string"
        },
        "operator_ref": {
          "type": "string"
        },
        "wheel_ref": {
          "type": "string"
        },
        "house_ref": {
          "type": "string"
        },
        "operator_ordinal": {
          "type": "string"
        },
        "house_ordinal": {
          "type": "string"
        },
        "ordinal_relation": {
          "type": "string",
          "enum": [
            "operator_ordinal_equals_house_ordinal",
            "operator_ordinal_differs_from_house_ordinal",
            "pre_identity_exception",
            "unresolved"
          ]
        },
        "placement_role": {
          "type": "string",
          "examples": [
            "principal",
            "child",
            "contracted",
            "identity",
            "locus",
            "diagnostic",
            "display"
          ]
        },
        "parent_placement_ref": {
          "type": "string"
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "connection": {
      "type": "object",
      "required": [
        "connection_id",
        "connection_type",
        "from_ref",
        "to_ref",
        "operative"
      ],
      "properties": {
        "connection_id": {
          "type": "string"
        },
        "connection_type": {
          "type": "string",
          "enum": [
            "circumferential",
            "radial_parent_child",
            "direct_transversal",
            "wheel_alignment",
            "wheel_overlay",
            "identity_axis",
            "locus_axis",
            "chamber_transition",
            "camera_transition"
          ]
        },
        "from_ref": {
          "type": "string"
        },
        "to_ref": {
          "type": "string"
        },
        "operative": {
          "type": "boolean"
        },
        "admissibility_gate_ref": {
          "type": "string"
        },
        "traversal_rule": {
          "type": "string"
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "order_model": {
      "type": "object",
      "required": [
        "source_order",
        "generation_order",
        "display_order",
        "slot_order",
        "active_traversal_order",
        "order_noncollapse_law"
      ],
      "properties": {
        "source_order": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "generation_order": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "display_order": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "slot_order": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "active_traversal_order": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "declared_equivalences": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/order_equivalence"
          }
        },
        "order_conflicts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "order_noncollapse_law": {
          "type": "boolean",
          "const": true
        }
      }
    },

    "order_equivalence": {
      "type": "object",
      "required": [
        "order_a",
        "order_b",
        "equivalence_status"
      ],
      "properties": {
        "order_a": {
          "type": "string"
        },
        "order_b": {
          "type": "string"
        },
        "equivalence_status": {
          "type": "string",
          "enum": [
            "DECLARED_EQUIVALENT",
            "DECLARED_DIFFERENT",
            "UNRESOLVED",
            "FORBIDDEN_TO_COLLAPSE"
          ]
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "state_model": {
      "type": "object",
      "required": [
        "visual_state",
        "admission_state",
        "execution_state",
        "state_noncollapse_law"
      ],
      "properties": {
        "visual_state": {
          "type": "string",
          "enum": [
            "UNSELECTED",
            "SELECTED",
            "HOVERED",
            "FOCUSED",
            "DISPLAYED"
          ]
        },
        "admission_state": {
          "type": "string",
          "enum": [
            "UNTESTED",
            "AREPO_ADMITTED",
            "AREPO_REJECTED",
            "DEFERRED"
          ]
        },
        "execution_state": {
          "type": "string",
          "enum": [
            "NOT_EXECUTED",
            "READY",
            "EXECUTING",
            "EXECUTED",
            "FAILED"
          ]
        },
        "state_noncollapse_law": {
          "type": "boolean",
          "const": true
        }
      }
    },

    "traversal_model": {
      "type": "object",
      "required": [
        "traversal_units",
        "allowed_connection_types",
        "traversal_state_policy"
      ],
      "properties": {
        "traversal_units": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "HOUSE",
              "CONNECTION",
              "WHEEL",
              "OPERATOR_PLACEMENT",
              "LOCUS",
              "CHAMBER",
              "CAMERA"
            ]
          }
        },
        "allowed_connection_types": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "circumferential",
              "radial_parent_child",
              "direct_transversal",
              "wheel_alignment",
              "wheel_overlay",
              "identity_axis",
              "locus_axis",
              "chamber_transition",
              "camera_transition"
            ]
          }
        },
        "traversal_state_policy": {
          "type": "object",
          "required": [
            "visual_selection_is_not_execution",
            "arepo_required_for_admission",
            "opera_required_for_execution"
          ],
          "properties": {
            "visual_selection_is_not_execution": {
              "type": "boolean",
              "const": true
            },
            "arepo_required_for_admission": {
              "type": "boolean",
              "const": true
            },
            "opera_required_for_execution": {
              "type": "boolean",
              "const": true
            }
          }
        }
      }
    },

    "locus": {
      "type": "object",
      "required": [
        "locus_id",
        "coordinates",
        "coordinate_system",
        "house_refs",
        "operator_refs"
      ],
      "properties": {
        "locus_id": {
          "type": "string"
        },
        "coordinate_system": {
          "type": "string",
          "enum": [
            "TABULA_HLT",
            "FIGURA_QUARTA",
            "CUSTOM"
          ]
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "house_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "operator_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "locus_role": {
          "type": "string",
          "enum": [
            "COMBINATION_SLOT",
            "QUESTION_SLOT",
            "CAMERA_SLOT",
            "TRAVERSAL_NODE"
          ]
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "camera": {
      "type": "object",
      "required": [
        "camera_id",
        "camera_code",
        "camera_type",
        "input_refs",
        "output_refs",
        "observation_scope"
      ],
      "properties": {
        "camera_id": {
          "type": "string"
        },
        "camera_code": {
          "type": "string"
        },
        "camera_type": {
          "type": "string",
          "enum": [
            "BINARY_RELATION",
            "TERNARY_RELATION",
            "EVACUATIO",
            "COMPARATIO",
            "FIGURA_TERTIA",
            "CUSTOM"
          ]
        },
        "input_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "output_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "observation_scope": {
          "type": "string"
        },
        "operative": {
          "type": "boolean"
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "chamber": {
      "type": "object",
      "required": [
        "chamber_id",
        "chamber_type",
        "member_refs",
        "chamber_role"
      ],
      "properties": {
        "chamber_id": {
          "type": "string"
        },
        "chamber_type": {
          "type": "string",
          "enum": [
            "TRIADIC",
            "QUATERNARY",
            "MULTIPLICATIO",
            "TABULA",
            "CUSTOM"
          ]
        },
        "member_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "chamber_role": {
          "type": "string"
        },
        "source_extract": {
          "$ref": "#/$defs/source_extract"
        }
      }
    },

    "multiplicatio_model": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "wheel_series": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "wheel_ref",
              "multiplication_role",
              "rotation_policy"
            ],
            "properties": {
              "wheel_ref": {
                "type": "string"
              },
              "multiplication_role": {
                "type": "string",
                "enum": [
                  "W1",
                  "W2",
                  "W3",
                  "W4",
                  "CUSTOM"
                ]
              },
              "rotation_policy": {
                "type": "string",
                "enum": [
                  "FIXED",
                  "ROTATABLE",
                  "LOCKED_TO_PARENT",
                  "DYNAMIC"
                ]
              }
            }
          }
        },
        "combination_output": {
          "type": "string",
          "enum": [
            "LOCUS",
            "CHAMBER",
            "CAMERA",
            "QUESTION",
            "CUSTOM"
          ]
        }
      }
    },

    "visual_binding": {
      "type": "object",
      "description": "Optional representation layer. Must bind visual nodes to structural refs.",
      "properties": {
        "coordinate_system": {
          "type": "string",
          "enum": [
            "2D_POLAR",
            "3D_CYLINDRICAL",
            "3D_LAYERED",
            "CUSTOM"
          ]
        },
        "wheel_layout": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/wheel_visual_binding"
          }
        },
        "house_layout": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/house_visual_binding"
          }
        },
        "connection_layout": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/connection_visual_binding"
          }
        },
        "godot_binding": {
          "type": "object",
          "properties": {
            "scene_class": {
              "type": "string",
              "examples": [
                "Rota3D",
                "Wheel3D",
                "HouseSlot3D"
              ]
            },
            "node_refs": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/godot_node_ref"
              }
            }
          }
        }
      }
    },

    "wheel_visual_binding": {
      "type": "object",
      "required": [
        "wheel_ref"
      ],
      "properties": {
        "wheel_ref": {
          "type": "string"
        },
        "radius": {
          "type": "number"
        },
        "z_offset": {
          "type": "number"
        },
        "rotation_offset_deg": {
          "type": "number"
        },
        "godot_node_path": {
          "type": "string"
        }
      }
    },

    "house_visual_binding": {
      "type": "object",
      "required": [
        "house_ref"
      ],
      "properties": {
        "house_ref": {
          "type": "string"
        },
        "angle_deg": {
          "type": "number"
        },
        "local_position": {
          "type": "object",
          "properties": {
            "x": {
              "type": "number"
            },
            "y": {
              "type": "number"
            },
            "z": {
              "type": "number"
            }
          }
        },
        "godot_node_path": {
          "type": "string"
        }
      }
    },

    "connection_visual_binding": {
      "type": "object",
      "required": [
        "connection_ref"
      ],
      "properties": {
        "connection_ref": {
          "type": "string"
        },
        "curve_type": {
          "type": "string",
          "enum": [
            "straight",
            "arc",
            "bezier",
            "spline",
            "custom"
          ]
        },
        "godot_node_path": {
          "type": "string"
        }
      }
    },

    "godot_node_ref": {
      "type": "object",
      "required": [
        "schema_ref",
        "node_path",
        "node_class"
      ],
      "properties": {
        "schema_ref": {
          "type": "string"
        },
        "node_path": {
          "type": "string"
        },
        "node_class": {
          "type": "string",
          "examples": [
            "Rota3D",
            "Wheel3D",
            "HouseSlot3D",
            "OperatorLabel3D",
            "TraversalPath3D",
            "CameraNode3D",
            "LocusNode3D",
            "ChamberNode3D"
          ]
        }
      }
    },

    "extraction_model": {
      "type": "object",
      "required": [
        "extractable_fields",
        "source_to_schema_map",
        "extraction_rules",
        "unresolved_policy"
      ],
      "properties": {
        "extractable_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source_to_schema_map": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/source_to_schema_rule"
          }
        },
        "extraction_rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/extraction_rule"
          }
        },
        "unresolved_policy": {
          "type": "object",
          "required": [
            "do_not_infer_missing_structure",
            "mark_unresolved",
            "allow_nuova_only_if_declared"
          ],
          "properties": {
            "do_not_infer_missing_structure": {
              "type": "boolean",
              "const": true
            },
            "mark_unresolved": {
              "type": "boolean",
              "const": true
            },
            "allow_nuova_only_if_declared": {
              "type": "boolean",
              "const": true
            }
          }
        }
      }
    },

    "source_to_schema_rule": {
      "type": "object",
      "required": [
        "source_class",
        "source_pattern",
        "target_schema_path",
        "extraction_status"
      ],
      "properties": {
        "source_class": {
          "type": "string",
          "enum": [
            "TENET",
            "ROTAS",
            "AREPO",
            "OPERA",
            "SATOR",
            "USER_PATCH"
          ]
        },
        "source_pattern": {
          "type": "string"
        },
        "target_schema_path": {
          "type": "string"
        },
        "extraction_status": {
          "type": "string",
          "enum": [
            "DIRECT",
            "DERIVED",
            "USER_PATCH",
            "UNRESOLVED"
          ]
        }
      }
    },

    "extraction_rule": {
      "type": "object",
      "required": [
        "rule_id",
        "rule_description",
        "input_artifact_class",
        "output_field",
        "failure_policy"
      ],
      "properties": {
        "rule_id": {
          "type": "string"
        },
        "rule_description": {
          "type": "string"
        },
        "input_artifact_class": {
          "type": "string",
          "enum": [
            "TENET",
            "ROTAS",
            "AREPO",
            "OPERA",
            "SATOR",
            "USER_PATCH"
          ]
        },
        "output_field": {
          "type": "string"
        },
        "failure_policy": {
          "type": "string",
          "enum": [
            "MARK_UNRESOLVED",
            "BLOCK_EXTRACTION",
            "ALLOW_DRAFT_PATCH"
          ]
        }
      }
    },

    "validation_model": {
      "type": "object",
      "required": [
        "structural_validations",
        "boundary_validations",
        "failure_codes"
      ],
      "properties": {
        "structural_validations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/validation_rule"
          }
        },
        "boundary_validations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/validation_rule"
          }
        },
        "failure_codes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/failure_code"
          }
        }
      }
    },

    "validation_rule": {
      "type": "object",
      "required": [
        "rule_id",
        "assertion",
        "failure_code"
      ],
      "properties": {
        "rule_id": {
          "type": "string"
        },
        "assertion": {
          "type": "string"
        },
        "failure_code": {
          "$ref": "#/$defs/failure_code"
        },
        "severity": {
          "type": "string",
          "enum": [
            "INFO",
            "WARNING",
            "BLOCKING"
          ]
        }
      }
    },

    "failure_code": {
      "type": "string",
      "enum": [
        "MISSING_SOURCE_TRACE",
        "ROTA_NOT_PARSED",
        "ROTA_WHEEL_COLLAPSE",
        "HOUSE_OPERATOR_ORDINAL_COLLAPSE",
        "OPERATOR_PLACED_WITHOUT_HOUSE",
        "MISSING_WHEEL_PRE",
        "WHEEL_PRE_MARKED_OPERATIVE",
        "ORDER_COLLAPSE",
        "MISSING_CARRIER_PACKAGE",
        "TRAVERSAL_WITHOUT_CONNECTION",
        "CONNECTION_REFERENCES_UNKNOWN_HOUSE",
        "CONNECTION_REFERENCES_UNKNOWN_WHEEL",
        "CONNECTION_REFERENCES_UNKNOWN_PLACEMENT",
        "HOUSE_REFERENCES_UNKNOWN_WHEEL",
        "PLACEMENT_REFERENCES_UNKNOWN_HOUSE",
        "PLACEMENT_REFERENCES_UNKNOWN_OPERATOR",
        "VISUAL_STATE_TREATED_AS_EXECUTION",
        "VISUAL_STRUCTURE_WITHOUT_ROTAS",
        "VISUAL_ANCHOR_WITHOUT_HOUSE",
        "VISUAL_CONNECTION_WITHOUT_STRUCTURAL_CONNECTION",
        "VISUAL_BINDING_DEFINES_STRUCTURE",
        "AREPO_EXECUTION_BYPASS",
        "OPERA_EXECUTION_WITHOUT_ADMISSION",
        "OPERA_EXECUTION_WITH_UNRESOLVED_PLACEMENT",
        "LOCUS_WITHOUT_COORDINATES",
        "LOCUS_HOUSE_COLLAPSE",
        "LOCUS_OPERATOR_COLLAPSE",
        "CAMERA_OPERATOR_COLLAPSE",
        "CAMERA_OPERA_COLLAPSE",
        "CAMERA_WITHOUT_INPUTS",
        "CAMERA_WITHOUT_SCOPE",
        "CAMERA_OUTPUT_CANONIZATION",
        "CHAMBER_WITHOUT_MEMBERS",
        "CHAMBER_OPERATOR_COLLAPSE",
        "CHAMBER_WITHOUT_ROLE",
        "MULTIPLICATIO_WITHOUT_WHEEL_SERIES",
        "MULTIPLICATIO_WHEEL_UNKNOWN",
        "MULTIPLICATIO_ROTATION_UNDECLARED",
        "MULTIPLICATIO_FLATTENED_TO_SINGLE_WHEEL",
        "SEPHIRAH_AS_ENTITY_COLLAPSE",
        "SEPHIRAH_AS_TRADITIONAL_NAME_COLLAPSE",
        "EMPTY_SLOT_TREATED_AS_NONEXISTENT",
        "BELIMAH_SLOT_FILLED_WITHOUT_ADMISSION",
        "TRADITION_DEFINES_OPERATOR",
        "JSON_EXPORT_TREATED_AS_CANON",
        "VISUALIZATION_TREATED_AS_VALIDATION"
      ]
    },

    "report_model": {
      "type": "object",
      "properties": {
        "available_report_types": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "EXTRACTION_SUMMARY_REPORT",
              "ADMISSION_STATUS_REPORT",
              "MACHINE_STATE_REPORT",
              "VALIDATION_REPORT",
              "UNRESOLVED_FIELD_REPORT",
              "BLOCKING_FAILURE_REPORT",
              "SOURCE_TRACE_AUDIT",
              "ORDER_MODEL_REPORT",
              "VISUAL_BINDING_REPORT",
              "OPERA_READINESS_REPORT",
              "HANDOFF_REPORT",
              "USER_PATCH_REGISTER",
              "JSON_EXPORT_NOTICE",
              "CANONICALITY_NOTICE"
            ]
          }
        },
        "required_status_markers": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "PARSED",
              "DIRECT_TEXT",
              "STRUCTURAL_INFERENCE",
              "USER_PATCH",
              "DERIVED_SCHEMA_REQUIREMENT",
              "UNRESOLVED_NONBLOCKING",
              "UNRESOLVED_BLOCKING",
              "DEFERRED",
              "BLOCKED",
              "INVALID",
              "PROVISIONAL",
              "CANONICAL_CANDIDATE"
            ]
          }
        },
        "canonicality_notice_required": {
          "type": "boolean",
          "const": true
        },
        "json_export_notice_required": {
          "type": "boolean",
          "const": true
        }
      }
    },

    "handoff_model": {
      "type": "object",
      "properties": {
        "handoff_status": {
          "type": "string",
          "enum": [
            "READY_FOR_SATOR_MACHINA_EX_ROTA",
            "READY_FOR_VISUALIZATION",
            "READY_FOR_GODOT_BINDING",
            "READY_FOR_SCHEMA_EXPORT",
            "READY_FOR_SOURCE_MACHINE_OPERA",
            "DEFERRED_TO_AREPO",
            "DEFERRED_TO_SOURCE",
            "BLOCKED"
          ]
        },
        "next_target": {
          "type": "string"
        },
        "required_inputs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "restrictions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },

    "source_extract": {
      "type": "object",
      "properties": {
        "artifact_path": {
          "type": "string"
        },
        "section_hint": {
          "type": "string"
        },
        "quote_or_paraphrase": {
          "type": "string"
        },
        "extraction_status": {
          "type": "string",
          "enum": [
            "DIRECT_TEXT",
            "STRUCTURAL_INFERENCE_FROM_TEXT",
            "USER_SUPPLIED_PATCH",
            "DERIVED_SCHEMA_REQUIREMENT",
            "UNRESOLVED"
          ]
        },
        "confidence": {
          "type": "string",
          "enum": [
            "HIGH",
            "MEDIUM",
            "LOW",
            "MIXED",
            "UNRESOLVED"
          ]
        }
      }
    }
  }
}
