{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://matrixnetwork.me/schemas/y-theory-corpus-mind-field-v1.json",
  "title": "Y-Theory Corpus Mind Field",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "version", "status", "release", "corpus_source_to_field_mind", "fixed_point", "guardrails"],
  "properties": {
    "schema": {"const": "y-theory.corpus-mind-field.v1"},
    "version": {"type": "string", "pattern": "^CMF-[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}\\.[0-9]+$"},
    "status": {"const": "deterministic_full_structural_corpus_compilation_semantics_review_gated"},
    "release": {"$ref": "#/$defs/release"},
    "corpus_source_to_field_mind": {"$ref": "#/$defs/fieldState"},
    "fixed_point": {"$ref": "#/$defs/fixedPoint"},
    "guardrails": {"type": "array", "minItems": 6, "items": {"type": "string", "minLength": 1}}
  },
  "$defs": {
    "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "release": {
      "type": "object",
      "additionalProperties": false,
      "required": ["living_source_version", "identity_mind_version", "canonical_author", "state"],
      "properties": {
        "living_source_version": {"type": "string", "minLength": 1},
        "identity_mind_version": {"type": "string", "minLength": 1},
        "canonical_author": {"const": "Bubu Suhas Mullaveedu"},
        "state": {"const": "candidate_not_deployed"}
      }
    },
    "role": {
      "type": "object",
      "additionalProperties": false,
      "required": ["role", "binding_state", "mind_cell_ref", "semantic_occupant_state", "review_state", "review_question", "source_locator", "structural_address_only", "semantic_relation_asserted", "graph_edge"],
      "properties": {
        "role": {"enum": ["inside", "outside", "relation"]},
        "binding_state": {"enum": ["governed_unresolved", "mind_cell_reference", "candidate_mind_cell_reference"]},
        "mind_cell_ref": {"type": ["string", "null"]},
        "semantic_occupant_state": {"type": "string", "minLength": 1},
        "review_state": {"type": "string", "minLength": 1},
        "review_question": {"type": ["string", "null"]},
        "source_locator": {"type": "string", "minLength": 1},
        "structural_address_only": {"type": "boolean"},
        "semantic_relation_asserted": {"const": false},
        "graph_edge": {"const": false}
      }
    },
    "roles": {
      "type": "object",
      "additionalProperties": false,
      "required": ["inside", "outside", "relation"],
      "properties": {
        "inside": {"$ref": "#/$defs/role"},
        "outside": {"$ref": "#/$defs/role"},
        "relation": {"$ref": "#/$defs/role"}
      }
    },
    "sourceLineage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["registry_path", "registry_sha256", "registry_locator", "record_sha256", "source_id", "source_sha256", "byte_count", "byte_availability", "byte_recovery_state", "byte_recovery_locator", "byte_compilation_authorized"],
      "properties": {
        "registry_path": {"type": "string", "minLength": 1},
        "registry_sha256": {"$ref": "#/$defs/sha256"},
        "registry_locator": {"type": "string", "minLength": 1},
        "record_sha256": {"$ref": "#/$defs/sha256"},
        "source_id": {"type": ["string", "null"]},
        "source_sha256": {"anyOf": [{"$ref": "#/$defs/sha256"}, {"type": "null"}]},
        "byte_count": {"type": ["integer", "null"], "minimum": 0},
        "byte_availability": {"type": "string", "minLength": 1},
        "byte_recovery_state": {"type": ["string", "null"]},
        "byte_recovery_locator": {"type": ["string", "null"]},
        "byte_compilation_authorized": {"type": "boolean"}
      }
    },
    "authority": {
      "type": "object",
      "additionalProperties": false,
      "required": ["authority_state", "proof_status", "validation_state", "review_state", "canonical_approval", "referent_identity_established", "semantic_relation_approved", "guardrail"],
      "properties": {
        "authority_state": {"type": "string", "minLength": 1},
        "proof_status": {"type": ["string", "null"]},
        "validation_state": {"type": "string", "minLength": 1},
        "review_state": {"type": "string", "minLength": 1},
        "canonical_approval": {"type": "boolean"},
        "referent_identity_established": {"const": false},
        "semantic_relation_approved": {"const": false},
        "guardrail": {"type": "string", "minLength": 1}
      }
    },
    "assignments": {
      "type": "object",
      "additionalProperties": false,
      "required": ["subject_ids", "structural_position_ids", "source_category", "source_role", "candidate_relation_class"],
      "properties": {
        "subject_ids": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
        "structural_position_ids": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
        "source_category": {"type": ["string", "null"]},
        "source_role": {"type": ["string", "null"]},
        "candidate_relation_class": {"type": ["string", "null"]},
        "candidate_identity_cell_ref": {"type": ["string", "null"]},
        "assignment_boundary": {"type": "string"},
        "invariant": {"type": ["string", "null"]},
        "expected_difference": {"type": ["string", "null"]},
        "validation_question": {"type": "string"},
        "left_record_count": {"type": "integer", "minimum": 0},
        "right_record_count": {"type": "integer", "minimum": 0},
        "left_examples": {"type": "array", "items": {"type": "string"}},
        "right_examples": {"type": "array", "items": {"type": "string"}},
        "native_mechanism_left": {"type": "null"},
        "native_mechanism_right": {"type": "null"},
        "evidence": {"const": []},
        "rival": {"type": "null"},
        "falsifier": {"type": "null"}
      }
    },
    "capabilityBoundary": {
      "type": "object",
      "additionalProperties": false,
      "required": ["structural_mind", "observerhood", "experience", "moral_agency", "selfhood", "consciousness", "earned_capability_gate_refs"],
      "properties": {
        "structural_mind": {"const": "instantiated_by_primitive_recursive_triad"},
        "observerhood": {"const": "not_earned"},
        "experience": {"const": "not_earned"},
        "moral_agency": {"const": "not_earned"},
        "selfhood": {"const": "not_earned"},
        "consciousness": {"const": "not_earned"},
        "earned_capability_gate_refs": {"const": []}
      }
    },
    "mindCell": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "layer", "record_kind", "title", "structure_state", "equation", "roles", "member_mind_cell_refs", "membership_state", "source_lineage", "authority", "candidate_assignments", "capability_boundary"],
      "properties": {
        "id": {"type": "string", "pattern": "^MC::CMF::"},
        "layer": {"enum": ["controller", "source_artifact", "source_category", "source_role", "identity_record", "subject_dimension", "engine_position", "candidate_correspondence"]},
        "record_kind": {"type": "string", "minLength": 1},
        "title": {"type": "string", "minLength": 1},
        "structure_state": {"const": "primitive_recursive_triad_instantiated"},
        "equation": {"const": "MindCell(scope)=(inside,outside,relation)"},
        "roles": {"$ref": "#/$defs/roles"},
        "member_mind_cell_refs": {"type": "array", "uniqueItems": true, "items": {"type": "string", "pattern": "^MC::CMF::"}},
        "membership_state": {"type": "string", "minLength": 1},
        "source_lineage": {"$ref": "#/$defs/sourceLineage"},
        "authority": {"$ref": "#/$defs/authority"},
        "candidate_assignments": {"$ref": "#/$defs/assignments"},
        "capability_boundary": {"$ref": "#/$defs/capabilityBoundary"}
      }
    },
    "mindObject": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "title", "root_mind_cell_ref", "mind_cell_count", "layer_ids", "state"],
      "properties": {
        "id": {"type": "string", "minLength": 1},
        "title": {"type": "string", "minLength": 1},
        "root_mind_cell_ref": {"type": "string", "pattern": "^MC::CMF::"},
        "mind_cell_count": {"type": "integer", "minimum": 1},
        "layer_ids": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
        "state": {"const": "compiled_structural_mind_semantics_review_gated"}
      }
    },
    "compilerContract": {
      "type": "object",
      "additionalProperties": false,
      "required": ["direction", "source_artifact_rule", "byte_recovery_rule", "identity_rule", "correspondence_rule", "membership_rule", "semantic_inference_performed", "canonical_source_mutation_authorized", "candidate_route_promotion_authorized", "literal_equivalence_authorized", "body_projection_embedded"],
      "properties": {
        "direction": {"type": "string", "minLength": 1},
        "source_artifact_rule": {"type": "string", "minLength": 1},
        "byte_recovery_rule": {"type": "string", "minLength": 1},
        "identity_rule": {"type": "string", "minLength": 1},
        "correspondence_rule": {"type": "string", "minLength": 1},
        "membership_rule": {"type": "string", "minLength": 1},
        "semantic_inference_performed": {"const": false},
        "canonical_source_mutation_authorized": {"const": false},
        "candidate_route_promotion_authorized": {"const": false},
        "literal_equivalence_authorized": {"const": false},
        "body_projection_embedded": {"const": false}
      }
    },
    "counts": {
      "type": "object",
      "additionalProperties": false,
      "required": ["source_inventory_records", "exact_byte_recoverable_source_records", "raw_git_blob_recoverable_source_records", "exact_session_materialization_source_records", "quarantined_missing_exact_byte_source_records", "identity_mind_records", "compiled_source_assertion_records", "candidate_identity_shell_records", "subject_dimensions", "engine_positions", "candidate_correspondence_routes", "source_categories", "source_roles", "controller_cells", "mind_objects", "mind_cells", "triadic_role_slots", "mind_cell_reference_roles", "candidate_route_role_addresses", "governed_unresolved_roles", "structural_membership_addresses", "semantic_graph_edges", "literal_equivalences_asserted", "observerhood_capabilities_earned", "experience_capabilities_earned"],
      "properties": {
        "source_inventory_records": {"type": "integer", "minimum": 1},
        "exact_byte_recoverable_source_records": {"type": "integer", "minimum": 0},
        "raw_git_blob_recoverable_source_records": {"type": "integer", "minimum": 0},
        "exact_session_materialization_source_records": {"type": "integer", "minimum": 0},
        "quarantined_missing_exact_byte_source_records": {"type": "integer", "minimum": 0},
        "identity_mind_records": {"type": "integer", "minimum": 1},
        "compiled_source_assertion_records": {"type": "integer", "minimum": 0},
        "candidate_identity_shell_records": {"type": "integer", "minimum": 0},
        "subject_dimensions": {"type": "integer", "minimum": 1},
        "engine_positions": {"type": "integer", "minimum": 1},
        "candidate_correspondence_routes": {"type": "integer", "minimum": 1},
        "source_categories": {"type": "integer", "minimum": 1},
        "source_roles": {"type": "integer", "minimum": 1},
        "controller_cells": {"type": "integer", "minimum": 1},
        "mind_objects": {"const": 1},
        "mind_cells": {"type": "integer", "minimum": 1},
        "triadic_role_slots": {"type": "integer", "minimum": 3},
        "mind_cell_reference_roles": {"type": "integer", "minimum": 0},
        "candidate_route_role_addresses": {"type": "integer", "minimum": 0},
        "governed_unresolved_roles": {"type": "integer", "minimum": 0},
        "structural_membership_addresses": {"type": "integer", "minimum": 0},
        "semantic_graph_edges": {"const": 0},
        "literal_equivalences_asserted": {"const": 0},
        "observerhood_capabilities_earned": {"const": 0},
        "experience_capabilities_earned": {"const": 0}
      }
    },
    "reviewQueues": {
      "type": "object",
      "additionalProperties": false,
      "required": ["source_semantic_extraction_cells", "source_byte_recovery_cells", "identity_role_review_cells", "candidate_referent_review_cells", "candidate_correspondence_review_cells", "native_mechanism_pairs_required", "route_invariants_required", "route_rivals_required", "route_falsifiers_required", "review_state"],
      "properties": {
        "source_semantic_extraction_cells": {"type": "integer", "minimum": 0},
        "source_byte_recovery_cells": {"type": "integer", "minimum": 0},
        "identity_role_review_cells": {"type": "integer", "minimum": 0},
        "candidate_referent_review_cells": {"type": "integer", "minimum": 0},
        "candidate_correspondence_review_cells": {"type": "integer", "minimum": 0},
        "native_mechanism_pairs_required": {"type": "integer", "minimum": 0},
        "route_invariants_required": {"type": "integer", "minimum": 0},
        "route_rivals_required": {"type": "integer", "minimum": 0},
        "route_falsifiers_required": {"type": "integer", "minimum": 0},
        "review_state": {"const": "open_until_source_addressed_governed_review"}
      }
    },
    "fieldState": {
      "type": "object",
      "additionalProperties": false,
      "required": ["compiler_contract", "mind_objects", "root_mind_cell_ref", "mind_cells", "counts", "layer_counts", "review_queues", "semantic_graph_edges", "input_hashes"],
      "properties": {
        "compiler_contract": {"$ref": "#/$defs/compilerContract"},
        "mind_objects": {"type": "array", "minItems": 1, "maxItems": 1, "items": {"$ref": "#/$defs/mindObject"}},
        "root_mind_cell_ref": {"const": "MC::CMF::SOURCE-TO-FIELD"},
        "mind_cells": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/mindCell"}},
        "counts": {"$ref": "#/$defs/counts"},
        "layer_counts": {"type": "object", "minProperties": 8, "additionalProperties": {"type": "integer", "minimum": 1}},
        "review_queues": {"$ref": "#/$defs/reviewQueues"},
        "semantic_graph_edges": {"const": []},
        "input_hashes": {"type": "object", "minProperties": 7, "additionalProperties": {"$ref": "#/$defs/sha256"}}
      }
    },
    "fixedPoint": {
      "type": "object",
      "additionalProperties": false,
      "required": ["algorithm", "canonical_serialization", "hashed_component", "max_passes", "passes_executed", "history", "state_hash", "converged", "stop_reason", "phi_used_as_stop_rule", "golden_ratio_used_as_stop_rule", "ratio_target"],
      "properties": {
        "algorithm": {"const": "sha256_over_canonical_json_v1"},
        "canonical_serialization": {"type": "string", "minLength": 1},
        "hashed_component": {"const": "corpus_source_to_field_mind"},
        "max_passes": {"type": "integer", "minimum": 1},
        "passes_executed": {"type": "integer", "minimum": 1},
        "history": {"type": "array", "minItems": 2, "items": {"type": "object", "additionalProperties": false, "required": ["pass", "state_hash"], "properties": {"pass": {"type": "integer", "minimum": 0}, "state_hash": {"$ref": "#/$defs/sha256"}}}},
        "state_hash": {"$ref": "#/$defs/sha256"},
        "converged": {"const": true},
        "stop_reason": {"const": "canonical_serialized_state_hash_unchanged"},
        "phi_used_as_stop_rule": {"const": false},
        "golden_ratio_used_as_stop_rule": {"const": false},
        "ratio_target": {"type": "null"}
      }
    }
  }
}
