{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agla.local/schemas/qath-graph-4-occupation.schema.json",
  "title": "QATH Graph_4 executed OPERA-slot occupation",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "profile_id", "profile_version", "status", "authority_effect", "phase",
    "request", "graph_provider", "arithmetic_provider", "heuristic_policy", "state_space_policy",
    "door_register_ref", "baseline_traversal", "nodes", "transitions",
    "non_baseline_connections", "configuration_candidates",
    "h_multiplicatio_result", "generated_opera_series"
  ],
  "properties": {
    "profile_id": {"const": "QATH_GRAPH_4_OCCUPATION"},
    "profile_version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
    "status": {"const": "CANDIDATE_ISOLATED_AGENT_EXECUTION"},
    "authority_effect": {"const": "NONE"},
    "phase": {"const": "QATH_RUN"},
    "request": {
      "type": "object", "additionalProperties": false,
      "required": ["user_requirement", "q_reformulation"],
      "properties": {
        "user_requirement": {"type": "string", "minLength": 1},
        "q_reformulation": {"type": "string", "minLength": 1}
      }
    },
    "graph_provider": {
      "type": "object", "additionalProperties": false,
      "required": ["profile_id", "commit", "manifest_path", "manifest_blob", "binding_mode", "mutation"],
      "properties": {
        "profile_id": {"const": "MACHINARIUM_LOCAL_GRAPH_4"},
        "commit": {"const": "a7dd79c7a9857855ac3f8129a21c72ff5a0d5661"},
        "manifest_path": {"type": "string", "minLength": 1},
        "manifest_blob": {"const": "12dda41aa16f512919c406a25a8a6df4183782aa"},
        "binding_mode": {"const": "PINNED_EXTERNAL_CANDIDATE"},
        "mutation": {"const": "FORBIDDEN"}
      }
    },
    "arithmetic_provider": {
      "type": "object", "additionalProperties": false,
      "required": ["commit", "binding_mode", "providers"],
      "properties": {
        "commit": {"const": "dc58d005c23df514054c06556243367304a8d22a"},
        "binding_mode": {"const": "ORDINAL_QUALITY_AND_INTERPRETIVE_HEURISTIC"},
        "providers": {
          "type": "object", "additionalProperties": false,
          "required": ["LOCAL_INDEX", "TENET", "ROTAS", "AREPO", "SATOR"],
          "properties": {
            "LOCAL_INDEX": {"$ref": "#/$defs/provider"}, "TENET": {"$ref": "#/$defs/provider"},
            "ROTAS": {"$ref": "#/$defs/provider"}, "AREPO": {"$ref": "#/$defs/provider"},
            "SATOR": {"$ref": "#/$defs/provider"}
          }
        }
      }
    },
    "heuristic_policy": {
      "type": "object", "additionalProperties": false,
      "required": ["activation", "provider_ontology", "local_ontology_effect", "claim", "experimental_question", "operational_value", "trace_requirement", "future_control_test"],
      "properties": {
        "activation": {"const": "EXPLICIT_PROVISIONAL"},
        "provider_ontology": {"const": "STACK_ARITHMETICA_CATEGORICAL_ONTOLOGY_PRESERVED"},
        "local_ontology_effect": {"const": "NONE"},
        "claim": {"const": "QUALITY_AT_ORDINAL_POSITION_IS_INTERVENTION_NOT_NUMERICAL_IDENTITY"},
        "experimental_question": {"const": "WHAT_OCCURS_WHEN_QUALITY_Y_IS_ACTIVATED_AT_ORDINAL_POSITION_X"},
        "operational_value": {"const": "TRACEABLE_REPRODUCIBLE_PROCEDURE_INDEPENDENT_OF_EMERGENCE_CLAIM"},
        "trace_requirement": {"const": "RETAIN_PROCEDURE_INPUT_HANDOFF_ADMISSION_EXECUTION_AND_OUTPUT_EVIDENCE"},
        "future_control_test": {"const": "DISABLE_HEURISTICS_AND_OBSERVE_SEQUENCE_EMERGENCE"}
      }
    },
    "state_space_policy": {
      "type": "object", "additionalProperties": false,
      "required": ["purpose", "target", "anti_collapse_rule", "evidence_rule"],
      "properties": {
        "purpose": {"const": "CONTROLLED_REPRODUCIBLE_TRACEABLE_STATE_SPACE_REDUCTION"},
        "target": {"const": "STOCHASTIC_PROCESSES"},
        "anti_collapse_rule": {"const": "REDUCTION_MUST_NOT_ERASE_LIVE_ALTERNATIVES_OR_PREMATURELY_CLOSE_HYPOTHESES"},
        "evidence_rule": {"const": "PRESERVE_ALTERNATIVES_ADMISSIONS_REJECTIONS_HANDOFFS_AND_OUTPUTS"}
      }
    },
    "door_register_ref": {
      "type": "object", "additionalProperties": false,
      "required": ["path", "provenance", "interpretive_status", "handoff_law"],
      "properties": {
        "path": {"const": "fixtures/qath-graph-4.door-register.json"},
        "provenance": {"const": "HUMAN_SUPPLIED_STRUCTURAL_DERIVATION"},
        "interpretive_status": {"const": "ARITHMETICAL_ACTS_AND_TRINARY_CORRELATIONS_ARE_HEURISTICS"},
        "handoff_law": {"const": "SOURCE_SATOR_OUTPUT_TO_TARGET_AREPO_INPUT"}
      }
    },
    "baseline_traversal": {"const": ["L01", "L02", "L03", "L04"]},
    "nodes": {"type": "array", "minItems": 4, "maxItems": 4, "uniqueItems": true, "items": {"$ref": "#/$defs/node"}},
    "transitions": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"$ref": "#/$defs/transition"}},
    "non_baseline_connections": {
      "type": "array", "minItems": 3, "maxItems": 3,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["connection_ref", "operational_state"],
        "properties": {
          "connection_ref": {"enum": ["C01-03", "C04-01", "C02-04"]},
          "operational_state": {"const": "INACTIVE_UNLESS_EXPLICITLY_BOUND"}
        }
      }
    },
    "configuration_candidates": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/configuration"}},
    "h_multiplicatio_result": {
      "type": "object", "additionalProperties": false,
      "required": ["state", "configuration_id", "result_id", "chamber_count", "substrate_use"],
      "properties": {
        "state": {"const": "EXECUTED"},
        "configuration_id": {"const": "QATH-H-CONFIG-ADMIT-01"},
        "result_id": {"type": "string", "minLength": 1},
        "chamber_count": {"type": "integer", "minimum": 1},
        "substrate_use": {"const": "STABILIZE_REQUIRED_OPERAE_SERIES"}
      }
    },
    "generated_opera_series": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/generatedSeries"}}
  },
  "$defs": {
    "provider": {
      "type": "object", "additionalProperties": false,
      "required": ["path", "blob"],
      "properties": {
        "path": {"type": "string", "minLength": 1},
        "blob": {"type": "string", "pattern": "^[0-9a-f]{40}$"}
      }
    },
    "node": {
      "type": "object", "additionalProperties": false,
      "required": ["locus_id", "ordinal_position", "activated_quality", "opera_symbol", "effective_opera_id", "phase_function", "interpretive_bias_source", "providers", "local_applicatio"],
      "properties": {
        "locus_id": {"enum": ["L01", "L02", "L03", "L04"]},
        "ordinal_position": {"type": "integer", "minimum": 1, "maximum": 4},
        "activated_quality": {"enum": ["IDENTIFICATIO", "DIFFERENTIATIO", "MEDIATIO", "STABILIZATIO"]},
        "opera_symbol": {"enum": ["Q", "A", "T", "H"]},
        "effective_opera_id": {"type": "string", "minLength": 1},
        "phase_function": {"enum": ["IDENTIFY_AND_REFORMULATE_REQUEST", "DIFFERENTIATE_REQUEST_PRINCIPLES", "MEDIATE_PRINCIPLE_RELATIONS", "MULTIPLY_CHAMBERS_AND_STABILIZE_REQUIRED_OPERAE"]},
        "interpretive_bias_source": {"const": "INCIDENT_DOOR_ARITHMETICAL_ACT_AND_TRINARY_CORRELATION"},
        "providers": {
          "type": "object", "additionalProperties": false,
          "required": ["TENET", "ROTAS", "AREPO", "OPERA", "SATOR"],
          "properties": {
            "TENET": {"$ref": "#/$defs/provider"}, "ROTAS": {"$ref": "#/$defs/provider"},
            "AREPO": {"$ref": "#/$defs/provider"}, "OPERA": {"$ref": "#/$defs/provider"},
            "SATOR": {"$ref": "#/$defs/provider"}
          }
        },
        "local_applicatio": {
          "type": "object", "additionalProperties": false,
          "required": ["id", "function", "applicatio_state", "opera_execution_state", "may_self_admit", "preparatory_dependency", "output_state"],
          "properties": {
            "id": {"type": "string", "pattern": "^APPLICATIO_QATH_L0[1-4]_[QATH]$"},
            "function": {"const": "EXECUTION_SPECIFIC_CHARACTERISTICS"},
            "applicatio_state": {"const": "APPLIED_TO_RUN"},
            "opera_execution_state": {"const": "EXECUTED"},
            "may_self_admit": {"const": false},
            "preparatory_dependency": {"type": ["string", "null"]},
            "output_state": {"type": "string", "minLength": 1}
          }
        }
      }
    },
    "transition": {
      "type": "object", "additionalProperties": false,
      "required": ["id", "state", "from", "to", "connection_ref", "source_output_door", "target_input_door", "source_sator", "target_arepo", "binding_status", "handoff_state"],
      "properties": {
        "id": {"enum": ["QATH-TR-01-02", "QATH-TR-02-03", "QATH-TR-03-04"]},
        "state": {"enum": ["1_2", "2_3", "3_4"]},
        "from": {"enum": ["L01", "L02", "L03"]},
        "to": {"enum": ["L02", "L03", "L04"]},
        "connection_ref": {"enum": ["C01-02", "C02-03", "C03-04"]},
        "source_output_door": {"enum": ["N1_Output_+1", "N2_Output_+1", "N3_Output_+1"]},
        "target_input_door": {"enum": ["N2_Input_+1", "N3_Input_+1", "N4_Input_+1"]},
        "source_sator": {"type": "string", "minLength": 1},
        "target_arepo": {"type": "string", "minLength": 1},
        "binding_status": {"const": "EXTERNAL_QATH_DECLARATION"},
        "handoff_state": {"const": "COMPLETED"}
      }
    },
    "configuration": {
      "type": "object", "additionalProperties": false,
      "required": ["id", "designed_by", "selected_tenet", "element_set", "rota_ref", "multiplicatio_mode", "arepo_h_state", "execution_state"],
      "properties": {
        "id": {"type": "string", "minLength": 1},
        "designed_by": {"const": "APPLICATIO_QATH_L04_H"},
        "selected_tenet": {"enum": ["TENET_A", "TENET_T", "TENET_D", "TENET_I"]},
        "element_set": {"type": "array", "items": {"enum": ["A", "T", "E"]}, "minItems": 1, "uniqueItems": true},
        "rota_ref": {"const": "ROTAS_D"},
        "multiplicatio_mode": {"enum": ["MULTIPLICATIO_OA", "MULTIPLICATIO_PL", "MULTIPLICATIO_CT", "MULTIPLICATIO_RT"]},
        "arepo_h_state": {"enum": ["REJECTED_TENET_DOMAIN", "ADMITTED_FOR_EXECUTION"]},
        "execution_state": {"enum": ["NOT_EXECUTED", "EXECUTED_BY_OPERA_H"]}
      }
    },
    "generatedSeries": {
      "type": "object", "additionalProperties": false,
      "required": ["series_id", "opera_sequence", "node_count", "admission_state", "execution_state", "admission_trace"],
      "properties": {
        "series_id": {"type": "string", "minLength": 1},
        "opera_sequence": {"type": "array", "minItems": 1, "items": {"type": "string", "pattern": "^OPERA_[A-Z]+$"}},
        "node_count": {"type": "integer", "minimum": 1},
        "admission_state": {"enum": ["REJECTED", "ADMITTED_NON_EXECUTED"]},
        "execution_state": {"const": "NOT_EXECUTED"},
        "admission_trace": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
      }
    }
  }
}
