{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "localConfig.schema.json",
  "title": "Lumpcode local configuration",
  "description": "Schema for .lumpcode/local.json — a gitignored, per-machine file. Created by `lumpcode project-setup` with `{ \"mode\" }` only; shared defaults (primary branch, default agent command, caps) may live in committed `.lumpcode/project.json`. Local wins over project for shared keys. See DOCS/local-config.md.",
  "type": "object",
  "required": ["mode"],
  "additionalProperties": false,
  "properties": {
    "mode": {
      "type": "string",
      "enum": ["shared", "dedicated"],
      "description": "How Lumpcode handles the current checkout. `shared`: day-to-day clone; runs in ~/.lumpcode/project-copies/<projectName>/. `dedicated`: Lumpcode-owned clone (typical daemon machine); destructive reset on the target branch before each tick."
    },
    "primaryBranch": {
      "type": "string",
      "description": "Singular primary integration branch for this machine. Optional on this file when project.json supplies a primary source; after merge, at least one of primaryBranch / primaryBranches / projectBaseBranch is required. Local wins over project when both set."
    },
    "primaryBranches": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true,
      "description": "Ordered list of integration lines the dedicated daemon scans each tick. Entries may be exact branch names or git ls-remote refname globs (e.g. feature/*). When non-empty, wins over singular primaryBranch. Local wins over project when both set.",
      "examples": [["main"], ["dev", "feature/*"]]
    },
    "projectBaseBranch": {
      "type": "string",
      "description": "Deprecated alias for primaryBranch. Prefer primaryBranch or primaryBranches."
    },
    "workspaceStrategy": {
      "type": "string",
      "enum": ["checkout", "worktree"],
      "description": "How each lump run prepares git inside the preflight workspace. `checkout` (default): switch the main worktree to a fresh lump branch. `worktree`: run in a linked worktree under `.lumpcode/worktrees/<branch>/`."
    },
    "disabled": {
      "type": "boolean",
      "description": "When true, the background daemon (`lumpcode start`) skips every lump on this machine without stopping the scheduler. Manual `lumpcode run` is unaffected. Unrelated to per-lump `disabled`."
    },
    "maxParallelRun": {
      "type": "integer",
      "minimum": 1,
      "description": "Maximum concurrent lump runs in a single global-daemon tick when workspaceStrategy is \"worktree\". Omit or set to 1 for sequential ticks (default).",
      "examples": [1, 2, 3]
    },
    "command": {
      "type": "string",
      "description": "Default lump `command` tag when a lump omits top-level command. Registered-tag shape only (not a .ts/.js file path). Local wins over project; lump config wins over both."
    },
    "maximumNumberOfConcurrentBranches": {
      "type": "integer",
      "minimum": 0,
      "description": "Default cap on simultaneously open `lump/<lumpName>/*` branches when the lump omits the field. Local wins over project; lump wins over both."
    },
    "keepHistory": {
      "type": "boolean",
      "description": "Default for lump `keepHistory` when the lump omits it. Local wins over project; lump wins over both."
    },
    "verbose": {
      "type": "boolean",
      "description": "Default for lump `verbose` when the lump omits it. Local-only (not allowed on project.json)."
    },
    "refreshCommand": {
      "type": "string",
      "minLength": 1,
      "description": "Dedicated daemon only: shell command run after each scan-branch checkout and before lump discovery (e.g. npm i). Local wins over project. Ignored in shared mode and by manual run. Frozen at daemon start; restart to pick up changes."
    }
  }
}
