{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Grid Git Autonomy Configuration",
  "description": "Configuration for autonomous git operations in Grid sessions",
  "type": "object",
  "properties": {
    "git": {
      "type": "object",
      "description": "Git autonomy settings",
      "properties": {
        "auto_branch": {
          "type": "boolean",
          "default": true,
          "description": "Automatically create feature branch when starting work on protected branches"
        },
        "branch_prefix": {
          "type": "string",
          "default": "grid/",
          "description": "Prefix for auto-created Grid branches",
          "pattern": "^[a-z0-9-]+/$"
        },
        "auto_push": {
          "type": "string",
          "enum": ["immediate", "wave", "block", "manual"],
          "default": "wave",
          "description": "When to automatically push: immediate (every commit), wave (after wave completes), block (after block completes), manual (never)"
        },
        "auto_pr": {
          "type": "boolean",
          "default": false,
          "description": "Automatically create pull request when session completes"
        },
        "protected_branches": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": ["main", "master", "production"],
          "description": "Branches that require PRs and cannot be committed to directly"
        },
        "default_base": {
          "type": "string",
          "default": "main",
          "description": "Default base branch for creating pull requests"
        },
        "sync_strategy": {
          "type": "string",
          "enum": ["merge", "rebase"],
          "default": "merge",
          "description": "Strategy for syncing feature branch with base: merge or rebase"
        },
        "commit_signing": {
          "type": "boolean",
          "default": false,
          "description": "Sign commits with GPG (requires gpg configured)"
        },
        "wip_commits": {
          "type": "boolean",
          "default": true,
          "description": "Create WIP commits on session pause for long-running work"
        }
      }
    }
  }
}
