{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kalensr.github.io/agentic-operating-patterns/guides/agentic-sdlc-adoption-guide/schema/project-state.schema.json",
  "title": "Agentic SDLC Adoption Guide Project State",
  "description": "A user-controlled export from the Agentic SDLC Adoption Guide workbench. It may contain sensitive project information. It does not approve high-stakes security, privacy, legal, compliance, clinical, financial, safety, regulated-data, domain architecture, or production-release decisions.",
  "type": "object",
  "required": [
    "schemaVersion",
    "guideVersion",
    "generatedAt",
    "sourceLibraryVersion",
    "application",
    "projectProfile",
    "completedSections",
    "progress",
    "worksheetValues",
    "checklistState",
    "architectureScores",
    "architectureRecommendation",
    "readinessScores",
    "riskRegister",
    "roadmap",
    "promptLibrary",
    "requiredLocalReviewers",
    "unresolvedRisks",
    "rawState"
  ],
  "properties": {
    "schemaVersion": { "type": "string", "const": "2.0.0" },
    "guideVersion": { "type": "string" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "sourceLibraryVersion": { "type": "string" },
    "application": { "type": "string" },
    "storageKey": { "type": "string" },
    "projectProfile": {
      "type": "object",
      "required": [
        "name",
        "type",
        "owner",
        "targetDecisionDate",
        "problemStatement",
        "businessOutcome",
        "knownConstraints",
        "openQuestions"
      ],
      "properties": {
        "name": { "type": "string" },
        "type": { "type": "string" },
        "owner": { "type": "string" },
        "targetDecisionDate": { "type": "string" },
        "problemStatement": { "type": "string" },
        "businessOutcome": { "type": "string" },
        "knownConstraints": { "type": "string" },
        "openQuestions": { "type": "string" }
      },
      "additionalProperties": false
    },
    "completedSections": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "title", "completedChecks", "totalChecks", "complete"],
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "completedChecks": { "type": "integer", "minimum": 0 },
          "totalChecks": { "type": "integer", "minimum": 0 },
          "complete": { "type": "boolean" }
        },
        "additionalProperties": false
      }
    },
    "progress": {
      "type": "object",
      "required": ["checked", "total", "percent"],
      "properties": {
        "checked": { "type": "integer", "minimum": 0 },
        "total": { "type": "integer", "minimum": 0 },
        "percent": { "type": "integer", "minimum": 0, "maximum": 100 }
      },
      "additionalProperties": false
    },
    "worksheetValues": {
      "type": "object",
      "additionalProperties": { "type": ["string", "number", "boolean", "null"] }
    },
    "checklistState": {
      "type": "object",
      "additionalProperties": { "type": "boolean" }
    },
    "architectureScores": {
      "type": "object",
      "required": ["inplace", "refactor", "modular", "services", "lowcode", "defer"],
      "properties": {
        "inplace": { "type": "number" },
        "refactor": { "type": "number" },
        "modular": { "type": "number" },
        "services": { "type": "number" },
        "lowcode": { "type": "number" },
        "defer": { "type": "number" }
      },
      "additionalProperties": false
    },
    "architectureRecommendation": { "type": "string" },
    "readinessScores": {
      "type": "object",
      "required": ["checked", "total", "percent", "groups"],
      "properties": {
        "checked": { "type": "integer", "minimum": 0 },
        "total": { "type": "integer", "minimum": 0 },
        "percent": { "type": "integer", "minimum": 0, "maximum": 100 },
        "groups": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "required": ["checked", "total", "percent"],
            "properties": {
              "checked": { "type": "integer", "minimum": 0 },
              "total": { "type": "integer", "minimum": 0 },
              "percent": { "type": "integer", "minimum": 0, "maximum": 100 }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "riskRegister": {
      "type": "array",
      "description": "Populated risk-register rows only. Blank worksheet rows are omitted from the export.",
      "items": {
        "type": "object",
        "required": ["risk", "owner", "probability", "impact", "detectability", "priority", "mitigation"],
        "properties": {
          "risk": { "type": "string" },
          "owner": { "type": "string" },
          "probability": { "type": "number" },
          "impact": { "type": "number" },
          "detectability": { "type": "number" },
          "priority": { "type": "number" },
          "mitigation": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "roadmap": {
      "type": "object",
      "required": ["days10", "days30", "days60", "days90"],
      "properties": {
        "days10": { "type": "string" },
        "days30": { "type": "string" },
        "days60": { "type": "string" },
        "days90": { "type": "string" }
      },
      "additionalProperties": false
    },
    "promptLibrary": {
      "type": "object",
      "required": ["promptCount"],
      "properties": {
        "promptCount": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": false
    },
    "requiredLocalReviewers": { "type": "string" },
    "unresolvedRisks": {
      "type": "object",
      "additionalProperties": true
    },
    "rawState": {
      "type": "object",
      "additionalProperties": { "type": ["string", "number", "boolean", "null"] }
    }
  },
  "additionalProperties": false
}
