{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://notanalgorithm.org/ferc-compliance.schema.json",
  "title": "MARLOWE Certification FERC/NERC Compliance Reference Schema",
  "description": "Validates ferc-compliance.json — the canonical FERC/NERC regulatory reference mapping the Ghost Load™ Entity Audit to grid reliability requirements",
  "type": "object",
  "required": [
    "_meta",
    "penalty_structure",
    "active_regulatory_actions",
    "ghost_load_grid_mapping",
    "regulatory_timeline",
    "marlowe_canonical_invariants"
  ],
  "properties": {
    "_meta": {
      "type": "object",
      "required": ["title", "author", "framework", "prior_art_anchor", "canonical_url"],
      "properties": {
        "title":             { "type": "string" },
        "description":       { "type": "string" },
        "author":            { "const": "L.M. Marlowe" },
        "framework":         { "const": "Architecture of Dependency and Autonomy™" },
        "prior_art_anchor":  { "const": "2025-11-07" },
        "last_updated":      { "type": "string" },
        "canonical_url":     { "type": "string", "format": "uri" },
        "related_dockets":   { "type": "array", "items": { "type": "string" } }
      },
      "additionalProperties": false
    },
    "penalty_structure": {
      "type": "object",
      "required": ["authority", "maximum_per_day_per_violation_usd", "applies_to", "assessed_by"],
      "properties": {
        "authority":                           { "type": "string" },
        "maximum_per_day_per_violation_usd":   { "const": 1000000 },
        "applies_to":                          { "type": "string" },
        "assessed_by":                         { "const": "Federal Energy Regulatory Commission (FERC)" },
        "note":                                { "type": "string" }
      },
      "additionalProperties": false
    },
    "active_regulatory_actions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["id", "type", "title", "authority", "scope", "binding"],
        "properties": {
          "id":                                    { "type": "string" },
          "type":                                  { "type": "string" },
          "title":                                 { "type": "string" },
          "docket":                                { "type": "string" },
          "authority":                             { "type": "string" },
          "issued":                                { "type": "string" },
          "effective_date":                        { "type": "string" },
          "effective":                             { "type": "string" },
          "triggered_by":                          { "type": "string" },
          "trigger":                               { "type": "string" },
          "ferc_action_deadline":                  { "type": "string" },
          "target_completion":                     { "type": "string" },
          "acknowledgment_deadline":               { "type": "string" },
          "reporting_deadline":                    { "type": "string" },
          "standard_authorization_request_comment_period_closed": { "type": "string" },
          "large_load_threshold_mw":               { "type": "integer" },
          "scope":                                 { "type": "array", "items": { "type": "string" } },
          "essential_actions_count":               { "type": "integer" },
          "essential_actions_summary":             { "type": "array", "items": { "type": "string" } },
          "key_provisions":                        { "type": "array", "items": { "type": "string" } },
          "key_requirement":                       { "type": "string" },
          "binding":                               { "type": "boolean" },
          "binding_when_final":                    { "type": "boolean" },
          "civil_penalty_for_non_compliance":      { "type": "boolean" },
          "penalty":                               { "type": "string" },
          "penalty_exposure":                      { "type": "string" },
          "penalty_when_final":                    { "type": "string" },
          "note":                                  { "type": "string" },
          "escalation_path":                       { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "ghost_load_grid_mapping": {
      "type": "object",
      "required": ["definition", "nerc_characterization", "financial_to_grid_mapping", "audit_to_compliance_mapping"],
      "properties": {
        "definition":                    { "type": "string" },
        "nerc_characterization":         { "type": "string" },
        "financial_to_grid_mapping":     { "type": "string" },
        "ercot_connection":              { "type": "string" },
        "audit_to_compliance_mapping": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["audit_output", "regulatory_relevance"],
            "properties": {
              "audit_output":         { "type": "string" },
              "regulatory_relevance": { "type": "string" },
              "nerc_action":          { "type": "string" }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "regulatory_timeline": {
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "marlowe_canonical_invariants": {
      "type": "object",
      "required": ["sovereign_constant_c", "information_drag_delta_microseconds", "jitter_ceiling_omega_milliseconds", "ghost_load_formula", "prior_art_anchor"],
      "properties": {
        "sovereign_constant_c":                  { "const": 0.33 },
        "information_drag_delta_microseconds":   { "const": 1.57 },
        "jitter_ceiling_omega_milliseconds":     { "const": 3.33 },
        "frequency_hz":                          { "const": 1667000000 },
        "golden_ratio_phi":                      { "const": 1.618 },
        "ghost_load_formula":                    { "const": "G = L - N" },
        "prior_art_anchor":                      { "const": "2025-11-07" },
        "uspto_serials":                         { "type": "array", "items": { "type": "string" } }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
