{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://altheia.local/schemas/altheia-sector-blueprint-architect-configuration-1.8.schema.json",
  "title": "ALTHEIA Sector Blueprint Architect Configuration 1.8",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "module", "module_version", "saved_at", "workspace", "assistant_answers", "briefing", "artifacts", "sector_pack_input", "normalization", "validation", "approval"],
  "properties": {
    "schema_version": {"const": "altheia_sector_blueprint_architect_configuration_1.8"},
    "module": {"const": "identity_corpus_sector_blueprint_architect"},
    "module_version": {"const": "1.8"},
    "saved_at": {"type": "string", "format": "date-time"},
    "workspace": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mode", "quality_code"],
      "properties": {
        "mode": {"enum": ["editable", "reference"]},
        "quality_code": {"enum": ["Q0", "Q1", "Q2", "Q3", "Q4", "Q5", "Q6"]}
      }
    },
    "assistant_answers": {
      "type": "object",
      "additionalProperties": false,
      "required": ["assistantSector", "assistantObjective", "assistantAudience", "assistantKnowledge", "assistantConstraints"],
      "properties": {
        "assistantSector": {"type": "string"},
        "assistantObjective": {"type": "string"},
        "assistantAudience": {"type": "string"},
        "assistantKnowledge": {"type": "string"},
        "assistantConstraints": {"type": "string"}
      }
    },
    "briefing": {
      "type": "object",
      "additionalProperties": false,
      "required": ["sectorName", "sectorId", "description", "markets", "languages", "actors", "offer", "lifecycle", "channels", "decisions", "relationship", "regulation", "researchGoals", "sources", "coreMinimum", "archetypeStrategy", "businessModels"],
      "properties": {
        "sectorName": {"type": "string"},
        "sectorId": {"type": "string"},
        "description": {"type": "string"},
        "markets": {"type": "string"},
        "languages": {"type": "string"},
        "actors": {"type": "string"},
        "offer": {"type": "string"},
        "lifecycle": {"type": "string"},
        "channels": {"type": "string"},
        "decisions": {"type": "string"},
        "relationship": {"type": "string"},
        "regulation": {"type": "string"},
        "researchGoals": {"type": "string"},
        "sources": {"type": "string"},
        "coreMinimum": {"enum": ["30", "33", "36", "39"]},
        "archetypeStrategy": {"enum": ["hybrid", "general", "sector"]},
        "businessModels": {"type": "array", "items": {"enum": ["B2C", "B2B", "B2B2C"]}, "uniqueItems": true}
      }
    },
    "artifacts": {
      "type": "object",
      "additionalProperties": false,
      "required": ["assistant_prompt", "research_brief", "prompt_pack", "blueprint", "improvement_prompt", "improvement_request", "improvement_patch"],
      "properties": {
        "assistant_prompt": {"type": ["string", "null"]},
        "research_brief": {"type": ["string", "null"]},
        "prompt_pack": {"type": ["string", "null"]},
        "blueprint": {"type": ["object", "null"]},
        "improvement_prompt": {"type": ["string", "null"]},
        "improvement_request": {"type": ["object", "null"]},
        "improvement_patch": {"type": ["object", "null"]}
      }
    },
    "sector_pack_input": {"type": ["string", "object", "null"]},
    "product_authoring": {
      "type": "object",
      "additionalProperties": false,
      "required": ["catalog", "models", "owner", "reviewer", "confirmed", "candidate"],
      "properties": {
        "catalog": {"type": ["string", "object", "null"]},
        "models": {"type": ["string", "array", "null"]},
        "owner": {"type": "string"},
        "reviewer": {"type": "string"},
        "confirmed": {"type": "boolean"},
        "candidate": {"type": ["object", "null"]}
      }
    },
    "product_calibration": {
      "type": "object",
      "additionalProperties": false,
      "required": ["brand_candidate", "dataset", "dataset_summary", "report", "decision", "reviewer", "notes", "confirmations"],
      "properties": {
        "brand_candidate": {"type": ["object", "null"]},
        "dataset": {"type": "null", "description": "Los registros de calibración no se persisten en la configuración del navegador."},
        "dataset_summary": {"type": ["object", "null"]},
        "report": {"type": ["object", "null"]},
        "decision": {"type": ["object", "null"]},
        "reviewer": {"type": "string"},
        "notes": {"type": "string"},
        "confirmations": {
          "type": "object",
          "additionalProperties": false,
          "required": ["technical_review", "domain_review", "privacy_review"],
          "properties": {
            "technical_review": {"type": "boolean"},
            "domain_review": {"type": "boolean"},
            "privacy_review": {"type": "boolean"}
          }
        }
      }
    },
    "normalization": {"type": ["object", "null"]},
    "validation": {"type": ["object", "null"]},
    "approval": {
      "type": "object",
      "additionalProperties": false,
      "required": ["reviewer", "research_reviewed", "domain_reviewed", "measurement_reviewed", "applicability_reviewed", "notes", "approved_at"],
      "properties": {
        "reviewer": {"type": "string"},
        "research_reviewed": {"type": "boolean"},
        "domain_reviewed": {"type": "boolean"},
        "measurement_reviewed": {"type": "boolean"},
        "applicability_reviewed": {"type": "boolean"},
        "notes": {"type": "string"},
        "approved_at": {"type": ["string", "null"], "format": "date-time"}
      }
    }
  }
}
