{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://aiep.dev/schemas/aiep.canonical.schema.v3.0.0.json",
    "title": "AIEP Canonical Schema v3.0.0",
    "description": "Canonical validation schema for all AIEP record types (P01-P126). Validates by record_type discriminator using anyOf sub-schemas. Clean rewrite from v2.0.0 — do not modify v2.0.0 in place. Additions: P104 SubstrateIdentityRecord, P105 UncertaintyRecord, P106 RecombinationRecord, P109 ConstitutionalAmendmentRecord, P110/P115 SessionParticipantRecord, P111 CorpusFederationRecord, P112 AtomicClaimRecord, P113 EvidenceChallengeRecord, P114 RetractionRecord, P116 DeliveryQueueRecord, P117 HashAddressedRecord, P122 OpenDataSourceRecord, P123 BulkIngestRecord, P124 ConfidenceTierRecord, P125 SubscriptionRecord/BillingEventAttestation/UsageCreditRecord/TierCapabilityDeclaration/SubstrateAccessGate, P126 DissentRecord.",
    "type": "object",
    "anyOf": [
        {
            "$ref": "#/$defs/AiepMetadata"
        },
        {
            "$ref": "#/$defs/AiepWellKnownIndex"
        },
        {
            "$ref": "#/$defs/AiepCertificate"
        },
        {
            "$ref": "#/$defs/AiepAuditEvent"
        },
        {
            "$ref": "#/$defs/AiepInnovationLedgerEntry"
        },
        {
            "$ref": "#/$defs/AiepSubscriptionRecord"
        },
        {
            "$ref": "#/$defs/AiepBillingEventAttestation"
        },
        {
            "$ref": "#/$defs/AiepUsageCreditRecord"
        },
        {
            "$ref": "#/$defs/AiepTierCapabilityDeclaration"
        },
        {
            "$ref": "#/$defs/AiepSubstrateAccessGate"
        },
        {
            "$ref": "#/$defs/AiepSubstrateIdentityRecord"
        },
        {
            "$ref": "#/$defs/AiepUncertaintyRecord"
        },
        {
            "$ref": "#/$defs/AiepRecombinationRecord"
        },
        {
            "$ref": "#/$defs/AiepConstitutionalAmendmentRecord"
        },
        {
            "$ref": "#/$defs/AiepSessionParticipantRecord"
        },
        {
            "$ref": "#/$defs/AiepCorpusFederationRecord"
        },
        {
            "$ref": "#/$defs/AiepAtomicClaimRecord"
        },
        {
            "$ref": "#/$defs/AiepEvidenceChallengeRecord"
        },
        {
            "$ref": "#/$defs/AiepRetractionRecord"
        },
        {
            "$ref": "#/$defs/AiepDeliveryQueueRecord"
        },
        {
            "$ref": "#/$defs/AiepHashAddressedRecord"
        },
        {
            "$ref": "#/$defs/AiepOpenDataSourceRecord"
        },
        {
            "$ref": "#/$defs/AiepBulkIngestRecord"
        },
        {
            "$ref": "#/$defs/AiepConfidenceTierRecord"
        },
        {
            "$ref": "#/$defs/AiepDissentRecord"
        },
        {
            "$ref": "#/$defs/AiepGenericRecord"
        }
    ],
    "$defs": {
        "AiepMetadata": {
            "title": "AIEP Metadata Record",
            "required": [
                "record_type",
                "aiep_protocol",
                "aiep_name",
                "aiep_spec_version",
                "publisher",
                "open_use_policy",
                "certification"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_METADATA"
                },
                "aiep_protocol": {
                    "const": "AIEP"
                },
                "aiep_name": {
                    "type": "string",
                    "minLength": 1
                },
                "aiep_spec_version": {
                    "type": "string",
                    "minLength": 1
                },
                "publisher": {
                    "type": "object",
                    "required": [
                        "name",
                        "domain"
                    ],
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "domain": {
                            "type": "string"
                        },
                        "contact_path": {
                            "type": "string"
                        },
                        "email": {
                            "type": "string"
                        }
                    }
                },
                "open_use_policy": {
                    "type": "object",
                    "required": [
                        "open_use_permitted"
                    ],
                    "properties": {
                        "open_use_permitted": {
                            "type": "boolean"
                        },
                        "statement": {
                            "type": "string"
                        }
                    }
                },
                "certification": {
                    "type": "object",
                    "required": [
                        "claims_aiep_certified"
                    ],
                    "properties": {
                        "claims_aiep_certified": {
                            "type": "boolean"
                        },
                        "certificate_id": {
                            "type": "string"
                        },
                        "certificate_url": {
                            "type": "string"
                        },
                        "issuer": {
                            "type": "string"
                        },
                        "issuer_public_key": {
                            "type": "string"
                        },
                        "signature": {
                            "type": "string"
                        }
                    }
                },
                "governing_law": {
                    "type": "object",
                    "properties": {
                        "jurisdiction": {
                            "type": "string"
                        },
                        "statement": {
                            "type": "string"
                        }
                    }
                }
            },
            "additionalProperties": true
        },
        "AiepWellKnownIndex": {
            "title": "AIEP Well-Known Index Record",
            "required": [
                "record_type",
                "aiep_protocol",
                "aiep_name",
                "aiep_spec_version",
                "hub",
                "policy"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_WELL_KNOWN_INDEX"
                },
                "aiep_protocol": {
                    "const": "AIEP"
                },
                "aiep_name": {
                    "type": "string",
                    "minLength": 1
                },
                "aiep_spec_version": {
                    "type": "string",
                    "minLength": 1
                },
                "hub": {
                    "type": "object",
                    "required": [
                        "name",
                        "machine_base_path"
                    ],
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "description": {
                            "type": "string"
                        },
                        "machine_base_path": {
                            "type": "string"
                        }
                    }
                },
                "policy": {
                    "type": "object",
                    "required": [
                        "open_use_permitted"
                    ],
                    "properties": {
                        "open_use_permitted": {
                            "type": "boolean"
                        },
                        "note": {
                            "type": "string"
                        }
                    }
                },
                "endpoints": {
                    "type": "object"
                },
                "surfaces": {
                    "type": "object"
                }
            },
            "additionalProperties": true
        },
        "AiepCertificate": {
            "title": "AIEP Certificate Record",
            "required": [
                "certificate_id",
                "issuer_id",
                "subject",
                "issued_at_utc",
                "policy_id",
                "signature"
            ],
            "properties": {
                "certificate_id": {
                    "type": "string",
                    "minLength": 1
                },
                "issuer_id": {
                    "type": "string",
                    "minLength": 1
                },
                "subject": {
                    "type": "object",
                    "required": [
                        "domain"
                    ],
                    "properties": {
                        "domain": {
                            "type": "string",
                            "minLength": 1
                        }
                    }
                },
                "issued_at_utc": {
                    "type": "string"
                },
                "expires_at_utc": {
                    "type": "string"
                },
                "policy_id": {
                    "type": "string",
                    "minLength": 1
                },
                "artefacts": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "signature": {
                    "type": "string",
                    "minLength": 1
                },
                "issuer_public_key_url": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepAuditEvent": {
            "title": "AIEP Audit Event Record",
            "required": [
                "event_id",
                "timestamp_utc",
                "event_type",
                "prev_hash",
                "event_hash"
            ],
            "properties": {
                "event_id": {
                    "type": "string",
                    "minLength": 1
                },
                "timestamp_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "event_type": {
                    "type": "string",
                    "minLength": 1
                },
                "file_id": {
                    "type": "string"
                },
                "request_ip_hash": {
                    "type": "string"
                },
                "user_agent_hash": {
                    "type": "string"
                },
                "prev_hash": {
                    "type": "string"
                },
                "event_hash": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": true
        },
        "AiepInnovationLedgerEntry": {
            "title": "AIEP Innovation Ledger Entry",
            "required": [
                "record_type",
                "record_id",
                "title",
                "originator",
                "created_utc",
                "visibility"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_INNOVATION_LEDGER_ENTRY"
                },
                "record_id": {
                    "type": "string",
                    "minLength": 1
                },
                "title": {
                    "type": "string",
                    "minLength": 1
                },
                "originator": {
                    "type": "string",
                    "minLength": 1
                },
                "created_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "visibility": {
                    "enum": [
                        "PUBLIC",
                        "NDA"
                    ]
                },
                "sealed_private_pack_sha256": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepSubscriptionRecord": {
            "title": "AIEP Subscription Record (P125 §2)",
            "description": "Canonical substrate record for a user or tenant subscription lifecycle event. Committed to Reasoning Ledger at creation, tier change, cancellation, trial activation/expiry, reinstatement.",
            "required": [
                "record_type",
                "subscription_id",
                "user_id",
                "product_id",
                "tier",
                "event",
                "subscription_hash",
                "tier_capability_hash",
                "billing_cycle_start",
                "billing_cycle_end",
                "schema_version_id",
                "committed_at_utc"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_SUBSCRIPTION_RECORD"
                },
                "subscription_id": {
                    "type": "string",
                    "minLength": 1
                },
                "user_id": {
                    "type": "string",
                    "minLength": 1
                },
                "product_id": {
                    "type": "string",
                    "minLength": 1
                },
                "tier": {
                    "enum": [
                        "FREE",
                        "PRO",
                        "ENTERPRISE",
                        "CUSTOM"
                    ]
                },
                "event": {
                    "enum": [
                        "CREATED",
                        "UPGRADED",
                        "DOWNGRADED",
                        "CANCELLED",
                        "TRIAL_ACTIVATED",
                        "TRIAL_EXPIRED",
                        "REINSTATED"
                    ]
                },
                "subscription_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "tier_capability_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "billing_subscription_hash": {
                    "type": "string"
                },
                "billing_cycle_start": {
                    "type": "string"
                },
                "billing_cycle_end": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                },
                "committed_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "prev_subscription_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepBillingEventAttestation": {
            "title": "AIEP Billing Event Attestation (P125 §3)",
            "description": "Committed to Reasoning Ledger BEFORE any capability change is applied. BillingEventPayloadHash = H(raw webhook body bytes). Attests the billing event occurred before the system changed state.",
            "required": [
                "record_type",
                "event_id",
                "provider",
                "event_type",
                "billing_event_payload_hash",
                "committed_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_BILLING_EVENT_ATTESTATION"
                },
                "event_id": {
                    "type": "string",
                    "minLength": 1
                },
                "provider": {
                    "type": "string",
                    "minLength": 1
                },
                "event_type": {
                    "type": "string",
                    "minLength": 1
                },
                "billing_event_payload_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "committed_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                },
                "subscription_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepUsageCreditRecord": {
            "title": "AIEP Usage Credit Record (P125 §4)",
            "description": "Append-only quota grant record. Committed at billing cycle boundary and tier change. Quota history fully reconstructable from Reasoning Ledger alone.",
            "required": [
                "record_type",
                "credit_id",
                "subscription_id",
                "user_id",
                "tier",
                "evidence_admission_quota",
                "tool_invocation_quota",
                "session_quota",
                "cycle_start",
                "cycle_end",
                "committed_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_USAGE_CREDIT_RECORD"
                },
                "credit_id": {
                    "type": "string",
                    "minLength": 1
                },
                "subscription_id": {
                    "type": "string",
                    "minLength": 1
                },
                "user_id": {
                    "type": "string",
                    "minLength": 1
                },
                "tier": {
                    "enum": [
                        "FREE",
                        "PRO",
                        "ENTERPRISE",
                        "CUSTOM"
                    ]
                },
                "evidence_admission_quota": {
                    "type": "integer",
                    "minimum": 0
                },
                "tool_invocation_quota": {
                    "type": "integer",
                    "minimum": 0
                },
                "session_quota": {
                    "type": "integer",
                    "minimum": 0
                },
                "cycle_start": {
                    "type": "string"
                },
                "cycle_end": {
                    "type": "string"
                },
                "committed_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepTierCapabilityDeclaration": {
            "title": "AIEP Tier Capability Declaration (P125 §1)",
            "description": "Versioned declaration of permitted substrate operations, tool identifiers, session parameters, and quota defaults per tier. TierCapabilityHash = H(canonical(TierCapabilityDeclaration) || schema_version_id).",
            "required": [
                "record_type",
                "declaration_id",
                "declaration_version",
                "tier_capability_hash",
                "tiers",
                "schema_version_id",
                "declared_at_utc"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_TIER_CAPABILITY_DECLARATION"
                },
                "declaration_id": {
                    "type": "string",
                    "minLength": 1
                },
                "declaration_version": {
                    "type": "string",
                    "minLength": 1
                },
                "tier_capability_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "schema_version_id": {
                    "type": "string"
                },
                "declared_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "tiers": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "object",
                        "properties": {
                            "permitted_operations": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "tool_identifiers": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "evidence_admission_quota_default": {
                                "type": "integer"
                            },
                            "tool_invocation_quota_default": {
                                "type": "integer"
                            },
                            "session_quota_default": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "additionalProperties": true
        },
        "AiepSubstrateAccessGate": {
            "title": "AIEP Substrate Access Gate Record (P125 §5)",
            "description": "Records each access gate evaluation. OPEN = proceed + access decrement committed. CLOSED = fail-closed + NegativeProofRecord committed. Identical to R5 fail-closed admissibility gating.",
            "required": [
                "record_type",
                "gate_event_id",
                "user_id",
                "operation",
                "gate_result",
                "evaluated_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_SUBSTRATE_ACCESS_GATE"
                },
                "gate_event_id": {
                    "type": "string",
                    "minLength": 1
                },
                "user_id": {
                    "type": "string",
                    "minLength": 1
                },
                "subscription_id": {
                    "type": "string"
                },
                "operation": {
                    "type": "string",
                    "minLength": 1
                },
                "tier": {
                    "enum": [
                        "FREE",
                        "PRO",
                        "ENTERPRISE",
                        "CUSTOM"
                    ]
                },
                "gate_result": {
                    "enum": [
                        "OPEN",
                        "CLOSED"
                    ]
                },
                "gate_reason": {
                    "type": "string"
                },
                "negative_proof_record_id": {
                    "type": "string"
                },
                "evaluated_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepSubstrateIdentityRecord": {
            "title": "AIEP Substrate Identity Record (P104)",
            "description": "Persistent AGI identity record. Encodes capability calibration snapshot, session continuity hash, and substrate fingerprint for an identity node.",
            "required": [
                "record_type",
                "identity_id",
                "substrate_fingerprint",
                "capability_snapshot_hash",
                "continuity_hash",
                "created_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_SUBSTRATE_IDENTITY_RECORD"
                },
                "identity_id": {
                    "type": "string",
                    "minLength": 1
                },
                "substrate_fingerprint": {
                    "type": "string",
                    "minLength": 1
                },
                "capability_snapshot_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "continuity_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "created_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "last_seen_utc": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                },
                "identity_version": {
                    "type": "integer",
                    "minimum": 1
                }
            },
            "additionalProperties": true
        },
        "AiepUncertaintyRecord": {
            "title": "AIEP Uncertainty Record (P105)",
            "description": "Governed uncertainty quantification record. Records calibrated uncertainty bounds over a claim or output, with method reference and confidence interval.",
            "required": [
                "record_type",
                "uncertainty_id",
                "claim_ref",
                "uncertainty_method",
                "lower_bound",
                "upper_bound",
                "confidence_level",
                "schema_version_id",
                "committed_at_utc"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_UNCERTAINTY_RECORD"
                },
                "uncertainty_id": {
                    "type": "string",
                    "minLength": 1
                },
                "claim_ref": {
                    "type": "string",
                    "minLength": 1
                },
                "uncertainty_method": {
                    "type": "string",
                    "minLength": 1
                },
                "lower_bound": {
                    "type": "number"
                },
                "upper_bound": {
                    "type": "number"
                },
                "confidence_level": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "method_hash": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                },
                "committed_at_utc": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": true
        },
        "AiepRecombinationRecord": {
            "title": "AIEP Recombination Record (P106)",
            "description": "Cross-domain recombination candidate record. Records a proposed mechanism assembly from two or more distinct spec domains, with ConceptualDistanceScore.",
            "required": [
                "record_type",
                "recombination_id",
                "source_spec_refs",
                "conceptual_distance_score",
                "mechanism_description",
                "schema_version_id",
                "committed_at_utc"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_RECOMBINATION_RECORD"
                },
                "recombination_id": {
                    "type": "string",
                    "minLength": 1
                },
                "source_spec_refs": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "minItems": 2
                },
                "conceptual_distance_score": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "mechanism_description": {
                    "type": "string",
                    "minLength": 1
                },
                "new_art_flag": {
                    "type": "boolean"
                },
                "schema_version_id": {
                    "type": "string"
                },
                "committed_at_utc": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": true
        },
        "AiepConstitutionalAmendmentRecord": {
            "title": "AIEP Constitutional Amendment Record (P109)",
            "description": "Records a proposed or ratified constitutional amendment to the AIEP protocol substrate. Carries amendment hash, ratification status, and quorum evidence.",
            "required": [
                "record_type",
                "amendment_id",
                "amendment_hash",
                "proposed_by",
                "proposed_at_utc",
                "amendment_type",
                "ratification_status",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_CONSTITUTIONAL_AMENDMENT_RECORD"
                },
                "amendment_id": {
                    "type": "string",
                    "minLength": 1
                },
                "amendment_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "proposed_by": {
                    "type": "string",
                    "minLength": 1
                },
                "proposed_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "amendment_type": {
                    "type": "string",
                    "minLength": 1
                },
                "ratification_status": {
                    "enum": [
                        "PROPOSED",
                        "UNDER_REVIEW",
                        "RATIFIED",
                        "REJECTED",
                        "WITHDRAWN"
                    ]
                },
                "ratified_at_utc": {
                    "type": "string"
                },
                "quorum_evidence_hash": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepSessionParticipantRecord": {
            "title": "AIEP Session Participant Record (P110/P115)",
            "description": "Records a participant node in a human-governed session swarm. Carries compatibility score, anonymised fingerprint, and session contribution hash.",
            "required": [
                "record_type",
                "participant_id",
                "session_id",
                "fingerprint_hash",
                "compatibility_score",
                "joined_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_SESSION_PARTICIPANT_RECORD"
                },
                "participant_id": {
                    "type": "string",
                    "minLength": 1
                },
                "session_id": {
                    "type": "string",
                    "minLength": 1
                },
                "fingerprint_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "compatibility_score": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "contribution_hash": {
                    "type": "string"
                },
                "joined_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "left_at_utc": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepCorpusFederationRecord": {
            "title": "AIEP Corpus Federation Record (P111)",
            "description": "Records the inclusion of a participant corpus in a federated reasoning session. Carries corpus hash, participant reference, and surfacing score.",
            "required": [
                "record_type",
                "federation_id",
                "participant_id",
                "corpus_hash",
                "surfacing_score",
                "federated_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_CORPUS_FEDERATION_RECORD"
                },
                "federation_id": {
                    "type": "string",
                    "minLength": 1
                },
                "participant_id": {
                    "type": "string",
                    "minLength": 1
                },
                "corpus_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "surfacing_score": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "federated_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "session_id": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepAtomicClaimRecord": {
            "title": "AIEP Atomic Claim Record (P112)",
            "description": "An atomic extracted claim from a source document or reasoning output. Each claim is individually hashable and cross-verifiable.",
            "required": [
                "record_type",
                "claim_id",
                "source_ref",
                "claim_text",
                "claim_hash",
                "extraction_method",
                "extracted_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_ATOMIC_CLAIM_RECORD"
                },
                "claim_id": {
                    "type": "string",
                    "minLength": 1
                },
                "source_ref": {
                    "type": "string",
                    "minLength": 1
                },
                "claim_text": {
                    "type": "string",
                    "minLength": 1
                },
                "claim_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "extraction_method": {
                    "type": "string",
                    "minLength": 1
                },
                "cross_verification_status": {
                    "enum": [
                        "UNVERIFIED",
                        "VERIFIED",
                        "DISPUTED",
                        "RETRACTED"
                    ]
                },
                "extracted_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepEvidenceChallengeRecord": {
            "title": "AIEP Evidence Challenge Record (P113)",
            "description": "A user-initiated challenge to a specific piece of committed evidence. Carries challenge hash, challenger reference, and resolution status.",
            "required": [
                "record_type",
                "challenge_id",
                "evidence_ref",
                "challenger_id",
                "challenge_text",
                "challenge_hash",
                "challenge_status",
                "challenged_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_EVIDENCE_CHALLENGE_RECORD"
                },
                "challenge_id": {
                    "type": "string",
                    "minLength": 1
                },
                "evidence_ref": {
                    "type": "string",
                    "minLength": 1
                },
                "challenger_id": {
                    "type": "string",
                    "minLength": 1
                },
                "challenge_text": {
                    "type": "string",
                    "minLength": 1
                },
                "challenge_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "challenge_status": {
                    "enum": [
                        "OPEN",
                        "UNDER_REVIEW",
                        "UPHELD",
                        "DISMISSED",
                        "RETRACTED"
                    ]
                },
                "challenged_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "resolved_at_utc": {
                    "type": "string"
                },
                "resolution_note": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepRetractionRecord": {
            "title": "AIEP Retraction Record (P114)",
            "description": "Append-only retraction propagation record. Records evidence or claim retraction with Retraction Watch / CrossRef DOI source where applicable. Never overwrites prior records — the retraction is the new record.",
            "required": [
                "record_type",
                "retraction_id",
                "retracted_ref",
                "retraction_source",
                "retraction_hash",
                "retracted_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_RETRACTION_RECORD"
                },
                "retraction_id": {
                    "type": "string",
                    "minLength": 1
                },
                "retracted_ref": {
                    "type": "string",
                    "minLength": 1
                },
                "retraction_source": {
                    "type": "string",
                    "minLength": 1
                },
                "retraction_doi": {
                    "type": "string"
                },
                "retraction_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "retraction_reason": {
                    "type": "string"
                },
                "propagation_status": {
                    "enum": [
                        "PENDING",
                        "PROPAGATED",
                        "ACKNOWLEDGED"
                    ]
                },
                "retracted_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepDeliveryQueueRecord": {
            "title": "AIEP Delivery Queue Record (P116)",
            "description": "Push notification delivery queue record. Carries delivery target, channel (APNs/FCM/WebPush), payload hash, and delivery status.",
            "required": [
                "record_type",
                "delivery_id",
                "target_id",
                "channel",
                "payload_hash",
                "delivery_status",
                "queued_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_DELIVERY_QUEUE_RECORD"
                },
                "delivery_id": {
                    "type": "string",
                    "minLength": 1
                },
                "target_id": {
                    "type": "string",
                    "minLength": 1
                },
                "channel": {
                    "enum": [
                        "APNs",
                        "FCM",
                        "WebPush",
                        "Email",
                        "InApp"
                    ]
                },
                "payload_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "delivery_status": {
                    "enum": [
                        "QUEUED",
                        "SENT",
                        "DELIVERED",
                        "FAILED",
                        "RETRIED"
                    ]
                },
                "attempt_count": {
                    "type": "integer",
                    "minimum": 0
                },
                "queued_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "delivered_at_utc": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepHashAddressedRecord": {
            "title": "AIEP Hash-Addressed Record (P117)",
            "description": "Content-addressable substrate record. Any AIEP artefact stored by its SHA-256 content hash. Enables deduplication and integrity verification across distributed nodes.",
            "required": [
                "record_type",
                "content_hash",
                "content_type",
                "content_size_bytes",
                "stored_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_HASH_ADDRESSED_RECORD"
                },
                "content_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "content_type": {
                    "type": "string",
                    "minLength": 1
                },
                "content_size_bytes": {
                    "type": "integer",
                    "minimum": 0
                },
                "stored_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "origin_node_fingerprint": {
                    "type": "string"
                },
                "replication_count": {
                    "type": "integer",
                    "minimum": 0
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepOpenDataSourceRecord": {
            "title": "AIEP Open Data Source Record (P122)",
            "description": "Registry entry for an authoritative open data source. Carries provenance, admissibility tier, and last-verified hash of the source endpoint.",
            "required": [
                "record_type",
                "source_id",
                "source_name",
                "source_url",
                "admissibility_tier",
                "endpoint_hash",
                "registered_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_OPEN_DATA_SOURCE_RECORD"
                },
                "source_id": {
                    "type": "string",
                    "minLength": 1
                },
                "source_name": {
                    "type": "string",
                    "minLength": 1
                },
                "source_url": {
                    "type": "string",
                    "minLength": 1
                },
                "jurisdiction": {
                    "type": "string"
                },
                "data_category": {
                    "type": "string"
                },
                "admissibility_tier": {
                    "enum": [
                        "T1_AUTHORITATIVE",
                        "T2_OFFICIAL",
                        "T3_REGULATED",
                        "T4_OPEN",
                        "T5_UNVERIFIED"
                    ]
                },
                "endpoint_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "last_verified_utc": {
                    "type": "string"
                },
                "registered_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepBulkIngestRecord": {
            "title": "AIEP Bulk Ingest Record (P123)",
            "description": "Bulk dataset ingestion and incremental change synchronisation record. Tracks ingest job, source hash, record count, and change diff hash.",
            "required": [
                "record_type",
                "ingest_id",
                "source_id",
                "ingest_status",
                "record_count",
                "source_snapshot_hash",
                "ingest_started_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_BULK_INGEST_RECORD"
                },
                "ingest_id": {
                    "type": "string",
                    "minLength": 1
                },
                "source_id": {
                    "type": "string",
                    "minLength": 1
                },
                "ingest_status": {
                    "enum": [
                        "STARTED",
                        "IN_PROGRESS",
                        "COMPLETED",
                        "FAILED",
                        "PARTIAL"
                    ]
                },
                "record_count": {
                    "type": "integer",
                    "minimum": 0
                },
                "source_snapshot_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "change_diff_hash": {
                    "type": "string"
                },
                "ingest_started_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "ingest_completed_utc": {
                    "type": "string"
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepConfidenceTierRecord": {
            "title": "AIEP Confidence Tier Record (P124)",
            "description": "Source-level confidence tiering and admissibility weighting record. Assigns a computed ConfidenceScore to a source or claim based on provenance, replication, and cross-verification status.",
            "required": [
                "record_type",
                "tier_record_id",
                "subject_ref",
                "confidence_score",
                "admissibility_weight",
                "tier_basis",
                "scored_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_CONFIDENCE_TIER_RECORD"
                },
                "tier_record_id": {
                    "type": "string",
                    "minLength": 1
                },
                "subject_ref": {
                    "type": "string",
                    "minLength": 1
                },
                "confidence_score": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "admissibility_weight": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "tier_basis": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "replication_count": {
                    "type": "integer",
                    "minimum": 0
                },
                "cross_verification_refs": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "scored_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepDissentRecord": {
            "title": "AIEP Dissent Record (P126)",
            "description": "Internal dissent engine output record. Carries session reference, consensus view hash, top outlier divergence score, new art flag count, and resource boundary attestation. Never committed to public substrate.",
            "required": [
                "record_type",
                "session_id",
                "problem_ref",
                "consensus_view_hash",
                "outlier_count",
                "max_divergence_score",
                "new_art_flags_requires_search",
                "resource_boundary_hash",
                "generated_at_utc",
                "schema_version_id"
            ],
            "properties": {
                "record_type": {
                    "const": "AIEP_DISSENT_RECORD"
                },
                "session_id": {
                    "type": "string",
                    "minLength": 1
                },
                "problem_ref": {
                    "type": "string",
                    "minLength": 1
                },
                "consensus_view_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "outlier_count": {
                    "type": "integer",
                    "minimum": 0
                },
                "max_divergence_score": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "new_art_flags_novel_within_session": {
                    "type": "integer",
                    "minimum": 0
                },
                "new_art_flags_requires_search": {
                    "type": "integer",
                    "minimum": 0
                },
                "resource_boundary_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                },
                "all_flags_cleared": {
                    "type": "boolean"
                },
                "generated_at_utc": {
                    "type": "string",
                    "minLength": 1
                },
                "schema_version_id": {
                    "type": "string"
                }
            },
            "additionalProperties": true
        },
        "AiepGenericRecord": {
            "title": "AIEP Generic Record (open extension)",
            "description": "Catch-all for structural index files, protocol-level files (citation, version, discovery, registry), and future or custom AIEP record types. Any valid JSON object passes.",
            "type": "object",
            "additionalProperties": true
        }
    }
}