{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://aiep.dev/schemas/aiep.compliance_signals.schema.v1.json",
    "title": "AIEP Compliance Signals Record v1",
    "description": "Machine-readable compliance rule set — signals and rules the AIEP Trawler enforces (/.well-known/aiep/compliance/signals.json).",
    "type": "object",
    "required": [
        "record_type",
        "aiep_protocol",
        "version",
        "signals",
        "rules"
    ],
    "properties": {
        "record_type": {
            "type": "string",
            "const": "AIEP_COMPLIANCE_SIGNALS"
        },
        "aiep_protocol": {
            "type": "string",
            "const": "AIEP"
        },
        "version": {
            "type": "string",
            "minLength": 1
        },
        "signals": {
            "type": "object",
            "required": [
                "well_known_endpoints",
                "certification_claim_field"
            ],
            "properties": {
                "well_known_endpoints": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "certification_claim_field": {
                    "type": "object",
                    "required": [
                        "path",
                        "expected_type"
                    ],
                    "properties": {
                        "path": {
                            "type": "string"
                        },
                        "expected_type": {
                            "type": "string"
                        }
                    }
                },
                "certification_required_fields_when_claimed": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "certification_mark_phrases": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "rules": {
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "rule_id",
                    "name",
                    "trigger",
                    "severity",
                    "action"
                ],
                "properties": {
                    "rule_id": {
                        "type": "string",
                        "minLength": 1
                    },
                    "name": {
                        "type": "string",
                        "minLength": 1
                    },
                    "trigger": {
                        "type": "string"
                    },
                    "severity": {
                        "type": "string",
                        "enum": [
                            "HIGH",
                            "MEDIUM",
                            "LOW",
                            "INFO"
                        ]
                    },
                    "action": {
                        "type": "string"
                    }
                }
            }
        }
    },
    "additionalProperties": true
}