{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "framework-config.schema.json",
  "title": "AIOX Framework Configuration (L1)",
  "description": "Read-only framework defaults shipped with the npm package",
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object",
      "description": "Framework metadata — name and version",
      "properties": {
        "name": {
          "type": "string",
          "description": "Framework display name"
        },
        "framework_version": {
          "type": "string",
          "description": "Semantic version of the framework"
        }
      },
      "required": ["name", "framework_version"],
      "additionalProperties": false
    },
    "markdownExploder": {
      "type": "boolean",
      "description": "Enable markdown exploder for document processing",
      "default": true
    },
    "resource_locations": {
      "type": "object",
      "description": "Default paths for framework resources",
      "properties": {
        "agents_dir": { "type": "string", "description": "Path to agent definitions" },
        "tasks_dir": { "type": "string", "description": "Path to task definitions" },
        "templates_dir": { "type": "string", "description": "Path to templates" },
        "checklists_dir": { "type": "string", "description": "Path to checklists" },
        "tools_dir": { "type": "string", "description": "Path to tools" },
        "scripts": {
          "type": "object",
          "description": "Script directory paths by category",
          "properties": {
            "core": { "type": "string" },
            "development": { "type": "string" },
            "infrastructure": { "type": "string" },
            "legacy": { "type": "string" }
          },
          "additionalProperties": false
        },
        "data_dir": { "type": "string", "description": "Path to data directory" },
        "elicitation_dir": { "type": "string", "description": "Path to elicitation templates" },
        "squads_template_dir": { "type": "string", "description": "Path to squad templates" },
        "minds_dir": { "type": "string", "description": "Path to minds output" }
      },
      "additionalProperties": false
    },
    "performance_defaults": {
      "type": "object",
      "description": "Default performance tuning options",
      "properties": {
        "lazy_loading": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean", "default": true },
            "heavy_sections": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Config sections loaded lazily"
            }
          },
          "additionalProperties": false
        },
        "git": {
          "type": "object",
          "properties": {
            "show_config_warning": { "type": "boolean", "default": true },
            "cache_time_seconds": { "type": "integer", "minimum": 0 }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "dev": {
      "type": "object",
      "description": "Development execution defaults",
      "properties": {
        "execution_mode": {
          "type": "string",
          "enum": ["native", "delegate"],
          "default": "native"
        },
        "delegate_to": {
          "type": "string",
          "description": "Default external executor provider when execution_mode=delegate"
        },
        "auto_review": {
          "type": "boolean",
          "description": "Require orchestrator review before story state mutation",
          "default": true
        },
        "fast_path": {
          "type": "object",
          "description": "Fast-path gate defaults for mechanical, batchable, or parallelizable tasks",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true
            },
            "min_confidence": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.58
            },
            "min_batch_items": {
              "type": "integer",
              "minimum": 1,
              "default": 3
            },
            "external_executor_threshold": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.78
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "external_executors": {
      "type": "object",
      "description": "External executor provider defaults",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": false
        },
        "default_sandbox": {
          "type": "string",
          "enum": ["read-only", "workspace-write", "full-auto", "danger-full-access"],
          "default": "workspace-write"
        },
        "run_dir": {
          "type": "string",
          "default": ".aiox/external-runs"
        }
      },
      "additionalProperties": false
    },
    "utility_scripts_registry": {
      "type": "object",
      "description": "Registry of utility scripts by category",
      "properties": {
        "helpers": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Agent helper utility names"
        },
        "executors": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Task execution utility names"
        },
        "framework": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Framework-level utility names"
        }
      },
      "additionalProperties": false
    },
    "ide_sync_system": {
      "type": "object",
      "description": "IDE synchronization system for agent definitions",
      "properties": {
        "enabled": { "type": "boolean", "default": true },
        "source": { "type": "string", "description": "Source directory for agent definitions" },
        "targets": {
          "type": "object",
          "description": "IDE target configurations",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "enabled": { "type": "boolean" },
              "path": { "type": "string" },
              "skillsPath": { "type": "string" },
              "fallbackSources": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Fallback source directories used when the primary IDE sync source has no matching definitions"
              },
              "format": {
                "type": "string",
                "enum": ["full-markdown-yaml", "condensed-rules", "cursor-style", "kimi-skill"]
              }
            },
            "additionalProperties": false
          }
        },
        "redirects": { "type": "object", "additionalProperties": true },
        "validation": {
          "type": "object",
          "properties": {
            "strict_mode": { "type": "boolean" },
            "fail_on_drift": { "type": "boolean" },
            "fail_on_orphaned": { "type": "boolean" }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "template_overrides": {
      "type": "object",
      "description": "Template customization defaults (override at L2)",
      "properties": {
        "story": {
          "type": "object",
          "properties": {
            "sections_order": {
              "oneOf": [
                { "type": "array", "items": { "type": "string" } },
                { "type": "null" }
              ],
              "description": "Custom section order for story templates. null = use template default.",
              "default": null
            },
            "optional_sections": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Section IDs that can be skipped in story templates",
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
