{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usemeridian-us/json-schema/usemeridian-us-project-settings-schema.json",
  "title": "ProjectSettings",
  "description": "Persisted per-project settings shown in the dashboard.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usemeridian-us-openapi.json#/components/schemas/ProjectSettings",
  "properties": {
    "project_id": {
      "type": "string",
      "title": "Project Id"
    },
    "max_pinned_decisions": {
      "type": "integer",
      "maximum": 200.0,
      "minimum": 1.0,
      "title": "Max Pinned Decisions",
      "description": "Warn when the live constitution reaches this many items.",
      "default": 20
    },
    "executor_config": {
      "$ref": "#/$defs/ExecutorConfig"
    },
    "hitl_auto_answer": {
      "type": "integer",
      "maximum": 2.0,
      "minimum": 0.0,
      "title": "Hitl Auto Answer",
      "description": "HITL auto-answer mode: 0=off, 1=safe (executor questions only, no destructive keywords), 2=aggressive (everything except correction + security-sensitive requests).",
      "default": 0
    },
    "auto_worktrees": {
      "type": "integer",
      "maximum": 1.0,
      "minimum": 0.0,
      "title": "Auto Worktrees",
      "description": "0716c9e0: suggest git worktree on claim_sprint_item (default ON).",
      "default": 1
    },
    "require_merge_approval": {
      "type": "integer",
      "maximum": 2.0,
      "minimum": 0.0,
      "title": "Require Merge Approval",
      "description": "0716c9e0/e7548587: merge-approval mode for completing an item with an active worktree. 0=off (no check), 1=advisory (warn via HITL, proceed — default), 2=strict (BLOCKS completion on a genuine active, unmerged worktree unless explicitly overridden with override_merge_approval + a reason).",
      "default": 1
    },
    "code_intel_enabled": {
      "type": "integer",
      "maximum": 1.0,
      "minimum": 0.0,
      "title": "Code Intel Enabled",
      "description": "Sprint-2/3: show codebase-memory-mcp install URL in dashboard and agent guidance.",
      "default": 0
    },
    "execution_mode": {
      "type": "string",
      "enum": [
        "autonomous",
        "interactive"
      ],
      "title": "Execution Mode",
      "description": "ecf69de8: executor posture. 'autonomous' (default) claims and runs sprint items immediately; 'interactive' asks for direction before executing.",
      "default": "autonomous"
    },
    "use_mode": {
      "type": "string",
      "enum": [
        "standard_publication",
        "commercialized"
      ],
      "title": "Use Mode",
      "description": "Rights-gate use mode. 'standard_publication' (default) stores link-only images with credit and a review flag. 'commercialized' refuses their image bytes unless a human approves an override.",
      "default": "standard_publication"
    }
  },
  "type": "object",
  "required": [
    "project_id"
  ],
  "$defs": {
    "ExecutorConfig": {
      "properties": {
        "repo_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Repo Path"
        },
        "repo_paths": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Repo Paths"
        },
        "env_file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Env File"
        },
        "test_cmd": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Test Cmd"
        },
        "test_min": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Test Min"
        },
        "deploy_cmd": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deploy Cmd"
        },
        "shell_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Shell Type"
        },
        "branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Branch"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "ExecutorConfig",
      "description": "Per-project executor defaults injected into executor sessions."
    }
  }
}