{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.norruva.com/nrpf/v1/nrpf-compliance-result.schema.json",
  "title": "NRPF Compliance Result",
  "description": "A single regulation evaluation result within a compliance orchestration run. Derived from OrchestrationResult.RegulationResult (@modules/compliance-kernel/domain/entities/OrchestrationResult.ts).",
  "$comment": "@task P2-W4-13 @epic P2-ConsumerDistribution",
  "type": "object",
  "required": ["regulation", "status", "reason"],
  "additionalProperties": false,
  "properties": {
    "regulation": {
      "type": "string",
      "description": "Regulation code evaluated (e.g. BATTERY_REG, ESPR, EUDR, REACH, ROHS).",
      "examples": ["BATTERY_REG", "ESPR", "EUDR", "REACH", "ROHS"]
    },
    "status": {
      "type": "string",
      "enum": ["passed", "failed", "warning", "not_applicable", "pending"],
      "description": "Outcome of the regulation evaluation."
    },
    "reason": {
      "type": "string",
      "description": "Human-readable explanation of the evaluation outcome."
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "description": "Optional numeric compliance score for this regulation (0–100)."
    },
    "violations": {
      "type": "array",
      "description": "List of specific rule violations found during evaluation.",
      "items": {
        "type": "object",
        "required": ["ruleId", "severity", "description"],
        "additionalProperties": false,
        "properties": {
          "ruleId": {
            "type": "string",
            "description": "Identifier of the rule that was violated."
          },
          "severity": {
            "type": "string",
            "enum": ["low", "medium", "high", "critical"],
            "description": "Severity of the violation."
          },
          "description": {
            "type": "string",
            "description": "Human-readable description of what was violated."
          },
          "field": {
            "type": "string",
            "description": "JSON pointer or dot-notation path to the field that caused the violation."
          },
          "remediation": {
            "type": "string",
            "description": "Suggested corrective action."
          }
        }
      }
    },
    "details": {
      "type": "object",
      "description": "Regulation-specific evaluation details. Shape varies by regulation.",
      "additionalProperties": true
    },
    "evaluatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when this regulation was evaluated."
    }
  }
}
