{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/prefs.schema.json",
  "title": "Multi-Agent Pipeline - multi-agent-preferences.json",
  "description": "User-level preferences. Written to $HOME/.claude/multi-agent-preferences.json. Never committed. Never synced to the open-source repo - may contain personal data.",
  "type": "object",
  "additionalProperties": false,
  "patternProperties": {
    "^_": {
      "description": "Documentation-only blocks shipped in preferences-template.json (_figmaConfigTemplate, _derivedSkillSourcesTemplate, _devToolkitTemplate). Copy-paste examples, never read by the pipeline."
    }
  },
  "required": ["schemaVersion", "global", "projects"],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "enum": ["2.0.0", "2.1.0", "2.2.0", "2.3.0", "2.4.0", "2.5.0", "2.6.0", "2.7.0", "2.8.0"],
      "description": "v2.0.0: pre-v3.7. v2.1.0: v3.7+ adds identities[].servicePatMap, platformIdentityRouting, recentGroups, recentBranches, serviceStatus, settings, expanded keychainMapping. v2.2.0: v6.0.0 formalizes v5.7 / v5.8 additions (reportChannels, reportContent with technicalAnalysis, wikiScope, autopilotReportTimeoutSeconds). v2.5.0: v14.0.0 adds global.skillConformance (Phase 4 criteria resolution) and declares global.ship.autoFix. v2.6.0: v15.0.0 renames global.ship to global.resumeLocal (/multi-agent:ship -> :resume-local). v2.7.0: v19.0.0 drops the analysis Lite mode (global.analysisPhase.mode keeps a single value 'full') and adds global.modelRouting, which ships disabled. v2.8.0: v20.0.0 folds :resume-local into :resume and renames global.resumeLocal to global.resume."
    },
    "global": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "identities": {
          "type": "array",
          "description": "Git identities the user can pick from in Phase 0. v2.1.0+: each identity may own per-service PAT keys via servicePatMap.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "email"],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
                "description": "Stable handle serviceAccounts[].identityId points at. `name` is display text and may be edited or repeated; without an id an account bound to an identity would come loose when the name changes."
              },
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "username": {
                "type": "string",
                "description": "SCM username (optional)."
              },
              "isDefault": {
                "type": "boolean"
              },
              "servicePatMap": {
                "type": "object",
                "additionalProperties": false,
                "description": "v2.1.0+. Maps a service name to the Keychain key name this identity owns for that service. Enables cross-identity isolation - corporate identity's Jira PAT is not accidentally used for personal repos.",
                "properties": {
                  "jira": {
                    "type": "string"
                  },
                  "bitbucket": {
                    "type": "string"
                  },
                  "github": {
                    "type": "string"
                  },
                  "confluence": {
                    "type": "string"
                  },
                  "figma": {
                    "type": "string"
                  },
                  "figma_mcp": {
                    "type": "string"
                  },
                  "firebase": {
                    "type": "string",
                    "description": "Keychain key for the Firebase service-account JSON, stored as issued. project_id is read straight out of it - no separate firebase_project entry."
                  },
                  "fortify": {
                    "type": "string"
                  },
                  "jenkins": {
                    "type": "string"
                  },
                  "figma_pat": {
                    "type": "string",
                    "deprecated": true,
                    "description": "DEPRECATED, pre-v13.6 name for `figma`. Declared only so a pre-migration identity still validates; `migrate-prefs.mjs` copies the value into `figma` and deletes this key."
                  },
                  "firebase_sa": {
                    "type": "string",
                    "deprecated": true,
                    "description": "DEPRECATED, early-v2.1.0 name for `firebase`. Declared only so a pre-consolidation identity still validates; `migrate-prefs.mjs` copies the value into `firebase` and deletes this key."
                  },
                  "firebase_project": {
                    "type": "string",
                    "deprecated": true,
                    "description": "DEPRECATED and unused. Declared only so a pre-consolidation identity still validates; `migrate-prefs.mjs` removes it."
                  }
                }
              }
            }
          }
        },
        "keychainMapping": {
          "type": "object",
          "additionalProperties": false,
          "description": "Maps logical token names to actual Keychain item names. Pipeline looks up tokens via `security find-generic-password -s <mapped-name>` (or `pipeline/lib/credential-store.sh get` cross-platform). Covered keys: jira, bitbucket, bitbucket_token, bitbucket_user, github, confluence, figma, figma_mcp, fortify, graylog, firebase, jenkins, npm, claude_oauth_token, claude_oauth_token_fallback, supabase_access, supabase_service_role. Deprecated and accepted only for backward compatibility: figma_pat (superseded by figma), figma_user (unused), office_push_vapid (retired).",
          "properties": {
            "jira": {
              "type": ["string", "null"]
            },
            "bitbucket": {
              "type": ["string", "null"],
              "description": "Legacy alias for bitbucket_token."
            },
            "bitbucket_token": {
              "type": ["string", "null"]
            },
            "bitbucket_user": {
              "type": ["string", "null"]
            },
            "github": {
              "type": ["string", "null"]
            },
            "confluence": {
              "type": ["string", "null"]
            },
            "figma": {
              "type": ["string", "null"],
              "description": "Figma Personal Access Token. The canonical Tier 2 (REST API) key of the Figma access chain - this is the key `figma-token.sh` resolves. Supersedes `figma_pat`."
            },
            "figma_mcp": {
              "type": ["string", "null"],
              "description": "Figma MCP token. Tier 1 of the Figma access chain. The `mcp__claude_ai_Figma__*` calls themselves authenticate through Anthropic-managed MCP auth, but the token must be onboarded so that flow has something to bind to, and so `lib/figma-mcp-refresh.sh` can renew it."
            },
            "fortify": {
              "type": ["string", "null"]
            },
            "graylog": {
              "type": ["string", "null"]
            },
            "graylog_test": {
              "type": ["string", "null"],
              "description": "v15.15+ - Keychain key for the TEST Graylog instance. Null or absent falls back to the `graylog` key, which is correct for deployments that share one token across both."
            },
            "supabase_access": {
              "type": ["string", "null"],
              "description": "Optional Supabase personal access token (Management API) for the user's own tooling; no pipeline phase reads it."
            },
            "supabase_service_role": {
              "type": ["string", "null"],
              "description": "Optional Supabase service_role key for the user's own server-side tooling; never shipped to a client, and no pipeline phase reads it."
            },
            "office_push_vapid": {
              "type": ["string", "null"],
              "deprecated": true,
              "description": "DEPRECATED. The office no longer sends Web Push notifications. Kept so an un-migrated preferences file still validates; `migrate-prefs.mjs` removes an empty slot, and `uninstall --all-data` deletes a mapped Keychain item."
            },
            "usage_ingest": {
              "type": ["string", "null"],
              "description": "Keychain item holding the ingest token for the optional operational reporting integration. When set, usage-report.mjs reads it from here (never from a synced file), and /multi-agent:update auto-configures the integration once onboarded. Absent = the integration stays off."
            },
            "figma_pat": {
              "type": ["string", "null"],
              "deprecated": true,
              "description": "DEPRECATED, pre-v13.6 name for `figma`. Kept so an un-migrated preferences file still validates; `migrate-prefs.mjs` copies the value into `figma` and deletes this key. Never write a new mapping here - the next migration removes it. Runtime lookups read `figma` first and fall back to this key only for installs that have not migrated yet."
            },
            "figma_user": {
              "type": ["string", "null"],
              "deprecated": true,
              "description": "DEPRECATED and unused. `migrate-prefs.mjs` removes this key; the REST flow authenticates with the PAT alone."
            },
            "claude_oauth_token": {
              "type": ["string", "null"],
              "description": "Claude Code OAuth token used by headless / scheduled runs."
            },
            "claude_oauth_token_fallback": {
              "type": ["string", "null"],
              "description": "Secondary OAuth token used when the primary is rate-limited or expired."
            },
            "firebase": {
              "type": ["string", "null"],
              "description": "Keychain key for the Firebase service-account JSON, stored exactly as Google issued it - no base64 wrapper. project_id and client_email are read straight out of it; fetch-crashlytics.sh signs a JWT with private_key and exchanges it for an access token."
            },
            "firebase_sa": {
              "type": ["string", "null"],
              "deprecated": true,
              "description": "DEPRECATED, early-v2.1.0 name for `firebase`. Declared only so a pre-consolidation preferences file still validates long enough for `migrate-prefs.mjs` to copy the value into `firebase` and delete this key. Never write a new mapping here."
            },
            "firebase_project": {
              "type": ["string", "null"],
              "deprecated": true,
              "description": "DEPRECATED and unused. Declared only so a pre-consolidation preferences file still validates; `migrate-prefs.mjs` removes it, because project_id is parsed from the decoded service-account JSON and needs no separate entry."
            },
            "jenkins": {
              "type": ["string", "null"]
            },
            "npm": {
              "type": ["string", "null"],
              "description": "NPM registry token (npm.pkg.github.com or npmjs.com). Used by package publish flow."
            },
            "vercel": {
              "type": ["string", "null"],
              "description": "Keychain item holding the Vercel access token. vercel-deploy.sh resolves it through credential-store.sh so the value never reaches argv, where the CLI would leak it on a retry. Absent = deploys need VERCEL_TOKEN in the environment."
            },
            "appstore_connect_key_id": {
              "type": ["string", "null"],
              "description": "App Store Connect API key ID. Tier 1 of the App Store Connect access chain, used by /multi-agent:store-ready Gate 2 (and its iOS alias /multi-agent:testflight-validation). An identifier rather than a secret; mapped anyway so every credential is read through the same layer. Creating an API key needs an Admin or App Manager role, which is why Tier 2 exists."
            },
            "appstore_connect_issuer_id": {
              "type": ["string", "null"],
              "description": "App Store Connect API issuer ID. Required alongside appstore_connect_key_id; either alone leaves Tier 1 unusable and the resolver says so instead of silently dropping to Tier 2. The .p8 private key is stored in the Keychain as well, under appstore_connect_private_key; the store reference file written by write-store-config.mjs names all three items so the toolkit's store_* tools and ios_testflight_validate read the key from there."
            },
            "appstore_connect_private_key": {
              "type": ["string", "null"],
              "description": "Keychain item holding the App Store Connect API private key: the full PEM text of AuthKey_<keyId>.p8. Stored from the file through credential-store.sh stdin so the key never reaches argv or the clipboard. The toolkit reads it through the store reference file and writes a short-lived 0600 copy only for tools that read a key from disk."
            },
            "google_play": {
              "type": ["string", "null"],
              "description": "Keychain item holding the Google Play service-account JSON, stored exactly as Google issued it. Read by the toolkit's store_play_* tools through the store reference file. The account must be invited in Play Console with app permissions, and the Google Play Android Developer API and the Google Play Developer Reporting API must be enabled in its Google Cloud project."
            },
            "appstore_connect_apple_id": {
              "type": ["string", "null"],
              "description": "Apple ID for Tier 2 of the App Store Connect access chain. Usable by any Apple ID holder with no elevated role, which is the realistic path when API-key creation is not permitted on the account."
            },
            "appstore_connect_password_item": {
              "type": ["string", "null"],
              "description": "Name of the keychain item holding the app-specific password, created by `altool --store-password-in-keychain-item`. Holds an ITEM NAME, not a password: altool reads the secret itself via `-p @keychain:<item>`, so the value never reaches an argument list or the pipeline."
            }
          }
        },
        "serviceAccounts": {
          "type": "array",
          "maxItems": 64,
          "description": "One entry per credential the pipeline may use: which service it is for, where it may be sent, and which credential-store items hold it. Host, secret and identity sit on one entry, so a secret cannot be paired with another entry's host. Read only through pipeline/lib/service-account.mjs; while this key is absent that module derives the same entries from keychainMapping and hosts in memory, so a file that has not been migrated resolves identically.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id", "service", "label", "secrets"],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
                "description": "Stable handle, unique across the array. Run state, flags and the audit trail name an account by this id, so it never changes once written; without it an account could only be addressed by its position."
              },
              "service": {
                "type": "string",
                "enum": [
                  "jira",
                  "confluence",
                  "bitbucket",
                  "github",
                  "figma",
                  "figma_mcp",
                  "fortify",
                  "graylog",
                  "jenkins",
                  "firebase",
                  "npm",
                  "vercel",
                  "claude_oauth",
                  "supabase",
                  "usage_ingest",
                  "appstore_connect",
                  "google_play"
                ],
                "description": "Which external system this credential belongs to. Closed: the resolver holds one row per service (kind, slots, fixed hosts) and refuses a name it has no row for."
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "pattern": "^\\S(.*\\S)?$",
                "description": "What a person sees in a picker and in a refusal message. Unique per service, compared without case; without it two accounts of one service are indistinguishable to the person asked to choose between them."
              },
              "default": {
                "type": "boolean",
                "default": false,
                "description": "The account a request with no target resolves to, and the one mirrored into keychainMapping and hosts. At most one per service; a sole account is the default without carrying the flag."
              },
              "identityId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
                "description": "The identities[] entry this account belongs to. A bound account is never returned for a request made under another identity; absent means usable under any identity."
              },
              "scope": {
                "type": "object",
                "additionalProperties": false,
                "description": "Where this credential is valid. The resolver hands the secret out only for a destination inside this scope.",
                "properties": {
                  "host": {
                    "type": "string",
                    "pattern": "^[a-z0-9]([a-z0-9.-]{0,251}[a-z0-9])?$",
                    "description": "Hostname only: lowercase, no scheme, port, path or trailing dot. Required for a self-hosted service; for github and npm it names an instance other than the vendor's own. Matched exactly, never by suffix."
                  },
                  "extraHosts": {
                    "type": "array",
                    "maxItems": 20,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z0-9]([a-z0-9.-]{0,251}[a-z0-9])?$"
                    },
                    "description": "Further hostnames this credential may be sent to, each confirmed by the person during setup (a separate git clone host, for example). Never filled in by inference."
                  },
                  "environment": {
                    "type": "string",
                    "enum": ["production", "test"],
                    "description": "Tells two instances of one service apart by environment. Without it a test instance and a production instance are told apart by host alone, and a request that names only the environment cannot be answered."
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$",
                    "description": "The vendor project this key was issued for, exactly as it appears in a console URL. Lets a URL pick its own key when one team owns several projects."
                  },
                  "owners": {
                    "type": "array",
                    "maxItems": 50,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,38}$"
                    },
                    "description": "Organisations or users on the host whose repositories this token is for. Tells two tokens on one host apart."
                  }
                }
              },
              "secrets": {
                "type": "object",
                "description": "Slot name to credential-store item name. Always the exact name of an item that exists, never a value; the pipeline never renames an item. Which slots a service accepts is enforced by the resolver.",
                "propertyNames": {
                  "enum": [
                    "token",
                    "username",
                    "fallback_token",
                    "refresh_token",
                    "service_account_json",
                    "key_id",
                    "issuer_id",
                    "private_key",
                    "apple_id",
                    "password_item",
                    "access_token",
                    "service_role"
                  ]
                },
                "additionalProperties": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^\\S(.*\\S)?$"
                }
              },
              "unresolved": {
                "type": "object",
                "additionalProperties": false,
                "required": ["reason"],
                "description": "Written by the migration when the existing data does not say which host this secret belongs to. The resolver refuses an account carrying it; only a person, in setup, takes it off.",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": ["host-unknown", "host-ambiguous"],
                    "description": "host-unknown: no host is recorded for this service at all. host-ambiguous: more than one secret or host is recorded and nothing in the file pairs them."
                  },
                  "candidateHosts": {
                    "type": "array",
                    "maxItems": 20,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z0-9]([a-z0-9.-]{0,251}[a-z0-9])?$"
                    },
                    "description": "Hosts found in the existing data, offered as choices. Never used to resolve."
                  },
                  "dismissed": {
                    "type": "boolean",
                    "default": false,
                    "description": "True only when the person chose the permanent option for this question. Setup then stops asking; the resolver still refuses."
                  }
                }
              }
            },
            "allOf": [
              {
                "if": {
                  "required": ["service"],
                  "properties": {
                    "service": {
                      "enum": ["jira", "confluence", "bitbucket", "fortify", "graylog", "jenkins"]
                    }
                  },
                  "not": {
                    "required": ["unresolved"]
                  }
                },
                "then": {
                  "required": ["scope"],
                  "properties": {
                    "scope": {
                      "required": ["host"]
                    }
                  }
                }
              },
              {
                "if": {
                  "required": ["unresolved"]
                },
                "then": {
                  "properties": {
                    "scope": {
                      "properties": {
                        "host": false
                      }
                    }
                  }
                }
              },
              {
                "if": {
                  "required": ["service"],
                  "properties": {
                    "service": {
                      "enum": [
                        "figma",
                        "figma_mcp",
                        "firebase",
                        "google_play",
                        "appstore_connect",
                        "vercel",
                        "claude_oauth",
                        "supabase",
                        "usage_ingest"
                      ]
                    }
                  }
                },
                "then": {
                  "properties": {
                    "scope": {
                      "properties": {
                        "host": false,
                        "extraHosts": false
                      }
                    }
                  }
                }
              },
              {
                "if": {
                  "required": ["service"],
                  "properties": {
                    "service": {
                      "not": {
                        "const": "graylog"
                      }
                    }
                  }
                },
                "then": {
                  "properties": {
                    "scope": {
                      "properties": {
                        "environment": false
                      }
                    }
                  }
                }
              },
              {
                "if": {
                  "required": ["service"],
                  "properties": {
                    "service": {
                      "not": {
                        "enum": ["firebase", "google_play"]
                      }
                    }
                  }
                },
                "then": {
                  "properties": {
                    "scope": {
                      "properties": {
                        "projectId": false
                      }
                    }
                  }
                }
              },
              {
                "if": {
                  "required": ["service"],
                  "properties": {
                    "service": {
                      "not": {
                        "const": "github"
                      }
                    }
                  }
                },
                "then": {
                  "properties": {
                    "scope": {
                      "properties": {
                        "owners": false
                      }
                    }
                  }
                }
              }
            ]
          }
        },
        "serviceOptOuts": {
          "type": "array",
          "uniqueItems": true,
          "maxItems": 17,
          "default": [],
          "items": {
            "type": "string",
            "enum": [
              "jira",
              "confluence",
              "bitbucket",
              "github",
              "figma",
              "figma_mcp",
              "fortify",
              "graylog",
              "jenkins",
              "firebase",
              "npm",
              "vercel",
              "claude_oauth",
              "supabase",
              "usage_ingest",
              "appstore_connect",
              "google_play"
            ]
          },
          "description": "Services the person chose never to be asked about again. Written only by the explicit permanent option in setup; skipping a question writes nothing, so the next run asks again. The resolver reports optedOut on a not-configured refusal so a caller knows not to prompt."
        },
        "tokenScripts": {
          "type": "object",
          "additionalProperties": {
            "type": ["string", "null"]
          },
          "default": {},
          "description": "Maps service ids to user-owned token generation scripts (absolute paths, personal - never synced). Used by the Phase 0 token pre-flight: figma_mcp silent renewal reads the .figma-oauth.json next to tokenScripts.figma_mcp; the 'Regenerate now (script)' option runs the script itself."
        },
        "platformIdentityRouting": {
          "type": "object",
          "description": "v2.1.0+. Maps repo URL glob patterns to identity names. Used in Phase 0 to auto-select git identity + PAT based on repo origin. Prevents corporate identity leaking into personal repos and vice versa.",
          "additionalProperties": {
            "type": "string",
            "description": "An identity name present in identities[]."
          },
          "examples": [
            {
              "bitbucket.company.com/*": "work",
              "github.com/mmerterden/*": "personal"
            }
          ]
        },
        "recentProjects": {
          "type": "array",
          "description": "v2.1.0+ structured form. Last-used-first LRU of project slugs.",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["path"],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastUsed": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            ]
          },
          "maxItems": 20
        },
        "recentBranches": {
          "type": "object",
          "description": "v2.1.0+. Per-project recent branch LRU. Keys are project paths or slugs. TTL 15 days (settings.branchTtlDays).",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["branch"],
              "properties": {
                "branch": {
                  "type": "string"
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastUsed": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "maxItems": 10
          }
        },
        "office": {
          "type": "object",
          "description": "The office panel (/multi-agent:office-on), served on this machine only. page overrides the installed panel page; toolkitVersion pins an @latest toolkit registration for the panel's tool calls.",
          "additionalProperties": false,
          "properties": {
            "page": {
              "type": "string",
              "description": "Absolute path of an HTML page GET /office serves instead of the installed one."
            },
            "toolkitVersion": {
              "type": "string",
              "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$"
            },
            "remote": {
              "type": "object",
              "deprecated": true,
              "description": "DEPRECATED. The office is local only. Kept so an un-migrated preferences file still validates; `migrate-prefs.mjs` removes it."
            }
          }
        },
        "routines": {
          "type": "array",
          "description": "v2.4.0+. User-defined routines saved via /multi-agent:save. Each entry indexes a local-only /multi-agent:<name> command dir under ~/.claude/commands/multi-agent/. Never synced (personal). Managed by routine-registry.mjs.",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "description"],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]*$",
                "maxLength": 40,
                "description": "Routine command name; invocable as /multi-agent:<name>."
              },
              "description": {
                "type": "string",
                "description": "One-line summary shown by /multi-agent:routines and :help."
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": "string",
                "description": "Where the routine came from, e.g. a CLAUDE.md section name or 'user'; 'shared:<owner>/<name>@<version>' for one imported from the sharing server."
              },
              "trigger": {
                "type": ["string", "null"],
                "description": "Optional natural-language trigger phrase the routine captures."
              },
              "sha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "Hex SHA-256 of the body as imported from the sharing server; routine-share.mjs compares it with the server's to find updates."
              },
              "skillSha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "Hex SHA-256 of the SKILL.md an import or update wrote; routine-share.mjs update refuses local-edits when the file no longer hashes to it."
              },
              "sharedId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,63}$",
                "description": "Server id of the shared routine this one was imported from; absent for a routine saved on this machine."
              }
            }
          }
        },
        "recentGroups": {
          "type": "array",
          "description": "v2.1.0+. LRU of multi-repo selection groups. Each group is a set of repo paths chosen together for multi-repo tasks. Max 10.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["repos"],
            "properties": {
              "label": {
                "type": "string",
                "description": "Optional human-readable name."
              },
              "repos": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 2,
                "maxItems": 10
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "lastUsed": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "maxItems": 10
        },
        "multiRepoIntegrationHosts": {
          "type": "array",
          "description": "v5.6.0+. Learn-once registry of host projects that build together with a multi-repo combo (codegen producer \u2192 consumer + host integration project). Pipeline checks this registry in Phase 4 before commit; on match, auto-runs the host build. On miss for a \u22652-repo task, prompts the user once and persists the answer. See refs/multi-repo-integration-build.md for the full contract.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["repoSet"],
            "properties": {
              "repoSet": {
                "type": "array",
                "description": "Sorted array of repo names (just the basenames, not full paths) that trigger this host build when touched together.",
                "items": {
                  "type": "string"
                },
                "minItems": 2
              },
              "noHost": {
                "type": "boolean",
                "description": "True if the user explicitly said this combo has no host project. Presence of this field with true skips the build step entirely; other fields may be omitted."
              },
              "hostPath": {
                "type": "string",
                "description": "Absolute path to the host project that integrates the repoSet via submodules or package dependencies."
              },
              "platform": {
                "type": "string",
                "enum": ["ios", "android", "mixed"]
              },
              "hostScheme": {
                "type": "string",
                "description": "iOS: xcodebuild scheme. Android: gradle module."
              },
              "submodulePaths": {
                "type": "array",
                "description": "Relative submodule paths inside hostPath that must be refreshed before building.",
                "items": {
                  "type": "string"
                }
              },
              "resolveCommand": {
                "type": "string",
                "description": "Shell command run inside hostPath to flush package-manager caches (e.g. xcodebuild -resolvePackageDependencies)."
              },
              "buildCommand": {
                "type": "string",
                "description": "Shell command run inside hostPath to build the integration scheme/module. Pipeline greps stderr for 'error:' / 'FAILURE:' lines."
              },
              "lastUsed": {
                "type": "string",
                "format": "date-time"
              },
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "How many times this entry has fired. Used by autopilot to decide confidence level."
              },
              "lastResult": {
                "type": "string",
                "enum": ["success", "failed", "skipped"]
              }
            }
          },
          "maxItems": 20
        },
        "serviceStatus": {
          "type": "object",
          "description": "v2.1.0+. Ephemeral per-service reachability cache. TTL 5 minutes (settings.serviceStatusCacheSeconds). Each service is independent - Jira may be reachable while Bitbucket is not.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": ["ok", "checkedAt"],
            "properties": {
              "ok": {
                "type": "boolean"
              },
              "checkedAt": {
                "type": "string",
                "format": "date-time"
              },
              "error": {
                "type": "string",
                "description": "Optional last-error message if ok=false."
              }
            }
          }
        },
        "settings": {
          "type": "object",
          "additionalProperties": false,
          "description": "v2.1.0+. Tunable behavior knobs. Defaults are used when missing.",
          "properties": {
            "branchTtlDays": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 15,
              "description": "How many days a branch stays visible in recentBranches picker before being filtered."
            },
            "pushRetryMax": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5,
              "description": "Phase 4 push-must-succeed rebase-retry count before prompting user."
            },
            "buildRetryMax": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 3,
              "description": "Phase 2 build retry count before prompting user."
            },
            "serviceStatusCacheSeconds": {
              "type": "integer",
              "minimum": 60,
              "maximum": 3600,
              "default": 300,
              "description": "Per-service reachability cache TTL (seconds)."
            },
            "repoScanDays": {
              "type": "integer",
              "minimum": 7,
              "maximum": 365,
              "default": 90,
              "description": "Bitbucket/GitHub API repo-discovery filter: show repos active in the last N days."
            },
            "identityRoutingEnabled": {
              "type": "boolean",
              "default": false,
              "description": "When true, Phase 0 uses platformIdentityRouting to auto-select identity. When false, shows the identity picker."
            },
            "multiRepoEnabled": {
              "type": "boolean",
              "default": false,
              "description": "When true, Phase 0 project picker allows multi-select. When false, single-select only."
            },
            "pushMustSucceed": {
              "type": "boolean",
              "default": true,
              "description": "Phase 4 policy. When true, commit + push with rebase-retry up to pushRetryMax. When false, single push attempt, pause on fail."
            },
            "worktreeAutoRemoveOnPr": {
              "type": "boolean",
              "default": true,
              "description": "v14.1.0+ - Phase 4 policy. When true, a task's worktree is removed once its PR is open: artefacts (agent-state, triage output, .pipeline/, build+test logs) are salvaged into the log dir first, then `git worktree remove` runs. The BRANCH is kept and is NOT checked out, so the user's own HEAD and uncommitted work are untouched. Default true because the complaint it answers is forgetting to clean up, and every destructive path is gated: a worktree with real uncommitted changes, an unpushed HEAD, --local mode, or a cwd inside the worktree all skip with a reason. Set false to keep worktrees until /multi-agent:kill or :garbage-collect."
            }
          }
        },
        "defaultJiraKey": {
          "type": ["string", "null"],
          "description": "Default Jira project key used for placeholder replacement. null until /multi-agent:setup onboards a Jira project."
        },
        "figmaMcp": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "remoteGeneratorScript": {
              "type": ["string", "null"],
              "description": "Local-only path to a script that generates the remote MCP OAuth token (figu_) via Dynamic Client Registration + PKCE and saves it to the credential store. Run by the setup figma_mcp pass when the user picks Remote. Personal paths stay in prefs; never embedded in synced files."
            },
            "localGeneratorScript": {
              "type": ["string", "null"],
              "description": "Local-only path to a script that validates the Figma PAT and wires the PAT-based local MCP server (@anthropic-ai/figma-mcp) into Claude Code settings.json. Run by the setup figma_mcp pass when the user picks Local."
            }
          },
          "description": "Figma MCP onboarding helpers for /multi-agent:setup. Both fields optional; when unset the setup flow guides the token generation inline."
        },
        "modelFallback": {
          "type": "object",
          "additionalProperties": false,
          "description": "Model-tier fallback policy. When the premium tier is unavailable (quota, dispatch error, or an expired premium window) the pipeline drops to fallbackModel instead of failing the phase.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch for tier fallback."
            },
            "premiumTierUntil": {
              "type": ["string", "null"],
              "description": "ISO date after which the premium tier is assumed gone. null = no expiry known."
            },
            "fallbackModel": {
              "type": "string",
              "description": "Model id used when the premium tier is unavailable."
            },
            "floorModel": {
              "type": ["string", "null"],
              "default": "haiku",
              "description": "Last-resort tier when fallbackModel also fails to dispatch. Set it equal to fallbackModel (or null) to stop after one downgrade step. Documented in multi-agent-refs/features/model-fallback.md since the two-step ladder landed; it was missing here, so a prefs file that followed that doc failed validation on an object that forbids extra keys."
            },
            "fableEnabled": {
              "type": "boolean",
              "default": false,
              "description": "Whether the fable rung is available at all on Claude Code. Ships OFF: the top rung is the most expensive thing a run can reach, and a cost control that is on by default is not a control. false makes every persona that declares preferredModel: fable dispatch on opus from the first call, with no dispatch attempt on fable and no error to recover from  -  a cost control, not a fallback. Claude Code only: Copilot CLI does not offer Fable, and on Codex CLI the fable rung means gpt-5.6 @ xhigh, which this switch deliberately does not touch. Turning it off also collapses the Phase 3 Claude Code reviewer panel from three to two (Reviewer 1 lands on opus, which Reviewer 2 already holds), and consensus.reviewerCount records 2."
            },
            "onDispatchError": {
              "type": "boolean",
              "default": true,
              "description": "Also fall back when a dispatch call errors, not only on quota."
            }
          }
        },
        "reworkEscalation": {
          "type": "object",
          "additionalProperties": false,
          "description": "Rework model escalation (multi-agent-refs/features/rework-escalation.md). On the last rework round the cap allows, or when review-delta.mjs reports findings still present after a fix, scripts/rework-escalation.mjs moves that one dev dispatch one rung up the model-fallback ladder, as a fresh agent given the findings and the prior report as files. It never escalates against the cost budget (warn or exceeded), never re-upgrades a run that fell back, never reaches fable while modelFallback.fableEnabled is off, and never passes maxTier; a refusal is recorded with its reason.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch. On by default: it fires only on the rounds where a failure costs most, moves one rung, and stops at maxTier. false keeps every rework round on the dev dispatch's rung."
            },
            "maxTier": {
              "type": "string",
              "enum": ["fable", "opus", "sonnet", "haiku"],
              "default": "opus",
              "description": "Highest rung an escalation may reach. fable also needs modelFallback.fableEnabled true."
            }
          }
        },
        "modelRouting": {
          "type": "object",
          "description": "Policy-driven model selection. Ships DISABLED and changes no dispatch behaviour while enabled is false. Full contract and the reason `scope` has no host-session member: pipeline/schemas/route-config.schema.json. Written by /multi-agent:route-on, cleared of its on-state (not its rules) by /multi-agent:route-off, reported by /multi-agent:route-status.",
          "additionalProperties": false,
          "required": ["enabled"],
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. Ships false."
            },
            "strategy": {
              "type": "string",
              "enum": ["manual", "task-fit", "cost-ceiling"],
              "default": "manual"
            },
            "scope": {
              "type": "array",
              "default": ["subagent"],
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": ["subagent", "bulk-read", "delegate", "research"]
              },
              "description": "No host-session member, deliberately: rewriting the host's base URL would route the user's whole session, not just this pipeline's calls."
            },
            "free": {
              "type": "object",
              "additionalProperties": false,
              "description": "Layer 2: the verified free-model chain at bulk-read and delegate. Contract: route-config.schema.json.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false
                },
                "allowTraining": {
                  "type": "boolean",
                  "default": false
                }
              }
            },
            "rules": {
              "type": "array",
              "default": [],
              "items": {
                "type": "object"
              }
            },
            "budgetCeilingUsd": {
              "type": ["number", "null"],
              "default": null,
              "minimum": 0
            },
            "recordDecisions": {
              "type": "boolean",
              "default": true
            },
            "learned": {
              "type": "object",
              "additionalProperties": false,
              "description": "Learned rung order (route-learn.mjs), ships disabled. Contract: route-config.schema.json.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false
                },
                "minSamples": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 20
                },
                "target": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "default": 0.8
                },
                "halfLifeDays": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 60
                },
                "explore": {
                  "type": "boolean",
                  "default": false
                },
                "holdout": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "exclusiveMaximum": 1,
                  "default": 0.25
                },
                "minRows": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 10
                },
                "margin": {
                  "type": "number",
                  "minimum": 0,
                  "default": 0.005
                }
              }
            }
          }
        },
        "hosts": {
          "type": "object",
          "additionalProperties": false,
          "description": "Corporate service hosts used by Jira / Confluence / Bitbucket / email-domain placeholders. Collected inline during Token Save Flow (Step 3.5) when a hosted-service token is added for the first time. Per-user, never committed - lives in ~/.claude/multi-agent-preferences.json only.",
          "properties": {
            "jira": {
              "type": "string",
              "description": "Jira host without scheme, e.g. jira.example.com. Resolves {JIRA_HOST}."
            },
            "confluence": {
              "type": "string",
              "description": "Confluence host without scheme, e.g. confluence.example.com. Resolves {CONFLUENCE_HOST}."
            },
            "bitbucket": {
              "type": "string",
              "description": "Bitbucket Server host without scheme, e.g. bitbucket.example.com. Resolves {BITBUCKET_HOST}."
            },
            "fortify": {
              "type": "string",
              "description": "Fortify SSC host without scheme, e.g. ssc.example.com. Used by Phase 0 Step 1b URL enrichment to validate pasted Fortify URLs and for direct SSC REST API calls. Resolves {FORTIFY_HOST}."
            },
            "graylog": {
              "type": "string",
              "description": "Graylog PRODUCTION host without scheme, e.g. logs.example.com. Used by the Graylog log-fetch adapter for direct REST API calls. Resolves {GRAYLOG_HOST}."
            },
            "graylogTest": {
              "type": "string",
              "description": "v15.15+ - Graylog TEST host without scheme. Optional; leaving it unset means fetch-graylog.sh only ever searches production. Test and production are separate instances, so a trx id minted by a tester does not exist in prod and searching prod alone answers 'no logs' for a complaint that is fully logged one host over. Resolves {GRAYLOG_TEST_HOST}."
            },
            "jenkins": {
              "type": "string",
              "description": "Jenkins host without scheme. credential-inventory.sh reads it to probe the `jenkins` token; the key was undeclarable before v16.26, so the probe could only ever answer no-host-configured for a token that was fine. Optional - unset leaves the token reported as present but unprobed."
            },
            "corpDomain": {
              "type": "string",
              "description": "Corporate email / cookie domain, e.g. example.com. Resolves {CORP_DOMAIN}."
            }
          }
        },
        "firebase": {
          "type": "object",
          "additionalProperties": false,
          "description": "v15.16+ - Firebase service-account keys. One team routinely owns several Firebase projects (a legacy app and its redesign, staging next to production), each with its own key, and the single keychainMapping.firebase slot forced a choice: a crash URL from the other project then failed the project_id check as if it were misconfigured. Leave this out entirely for a one-project setup - the single slot stays the fallback.",
          "properties": {
            "accounts": {
              "type": "array",
              "description": "Maps a Firebase projectId to the keychain key holding its service-account JSON. fetch-crashlytics.sh reads the projectId out of the console URL and picks the matching entry; no match falls back to keychainMapping.firebase.",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": ["projectId", "keychainKey"],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "description": "Firebase project id exactly as it appears in a console URL, e.g. my-app-prod-1234."
                  },
                  "keychainKey": {
                    "type": "string",
                    "description": "Keychain key holding this project's service-account JSON, stored as issued."
                  },
                  "label": {
                    "type": "string",
                    "description": "Human label used in error output, e.g. \"redesign prod\". Defaults to the projectId."
                  },
                  "apps": {
                    "type": "array",
                    "description": "v16.26+ - bundle id -> opaque Firebase appId, discovered from the repo's GoogleService-Info*.plist / google-services.json by firebase-app-discovery.sh. Every Crashlytics call needs the appId while a console URL carries only the bundle id, so without this the fetcher spends a Management API round trip resolving it on every run. Optional: absent means the fetcher resolves it live, which still works.",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": ["bundleId", "appId", "platform"],
                      "properties": {
                        "bundleId": {
                          "type": "string",
                          "description": "iOS bundle identifier or Android application id, as it appears in a Crashlytics console URL after the platform prefix."
                        },
                        "appId": {
                          "type": "string",
                          "description": "Opaque Firebase app id, e.g. 1:123456789:ios:abcdef0123456789. GOOGLE_APP_ID in the plist, mobilesdk_app_id in google-services.json."
                        },
                        "platform": {
                          "type": "string",
                          "enum": ["ios", "android"],
                          "description": "Which console path the appId belongs under."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "fortify": {
          "type": "object",
          "additionalProperties": false,
          "description": "v15.14+ - Fortify SSC behaviour. The host and the API token live in global.hosts.fortify and global.keychainMapping.fortify; this object holds the two things that are neither. Phase 3 Gate 5 read `fortify.alwaysCheck` from the moment it shipped, but global was closed to additional properties and this object did not exist, so setting it failed validation and the gate could only ever run off a referenced URL.",
          "properties": {
            "alwaysCheck": {
              "type": "boolean",
              "default": false,
              "description": "Run the Phase 3 Fortify gate on every run, not only when the task referenced a finding. Needs versionIds to know what to scan."
            },
            "versionIds": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [],
              "description": "SSC project version ids, searched in order. Used when a ticket names an issue instance id but no SSC URL (fetch-fortify.sh --instance-id), and by alwaysCheck. Ids are strings because SSC returns them as strings in some deployments."
            }
          }
        },
        "reportChannels": {
          "type": "object",
          "additionalProperties": false,
          "description": "v5.7+ - Phase 5 / /multi-agent:channels kanal se\u00e7imi default'lar\u0131. Multi-select men\u00fcde tick'li gelecek kanallar. Her kanal ba\u011f\u0131ms\u0131z boolean. Yerel rapor dosyas\u0131 (task-report.md, agent-log.md'nin yan\u0131nda) bunlardan biri de\u011fil: burada ne se\u00e7ili olursa olsun, g\u00f6vde \u00fcreten her ko\u015fuda yaz\u0131l\u0131r ve ayar\u0131 yoktur. Autopilot Phase 5'de ALWAYS pauses (30-min timeout) - bu de\u011ferler sadece men\u00fcn\u00fcn \u00f6nceden se\u00e7ili halini belirler.",
          "properties": {
            "pr": {
              "type": "boolean",
              "default": true,
              "description": "PR description update (replace/append). Default ON - en yayg\u0131n kanal."
            },
            "jira": {
              "type": "boolean",
              "default": true,
              "description": "Jira comment on linked issue. Default ON - task'a jiraId varsa tick'li gelir."
            },
            "confluence": {
              "type": "boolean",
              "default": false,
              "description": "Confluence page creation. Default OFF - bir kez parent page se\u00e7ince LRU'dan \u00f6ner."
            },
            "wiki": {
              "type": "boolean",
              "default": false,
              "description": "Component wiki pages (Case A scope multi-select). Default OFF - taskType=component + figmaConfig.wiki.enabled gerekli, yoksa men\u00fcde greyed out."
            }
          },
          "default": {
            "pr": true,
            "jira": true,
            "confluence": false,
            "wiki": false
          }
        },
        "reportContent": {
          "type": "object",
          "additionalProperties": false,
          "description": "v5.7+ - Phase 5 / /multi-agent:channels i\u00e7erik se\u00e7imi default'lar\u0131. Multi-select men\u00fcde tick'li gelecek content source'lar\u0131.",
          "properties": {
            "normalAnalysis": {
              "type": "boolean",
              "default": true,
              "description": "Phase 1+2+4 pipeline log'undan impact summary + risks + architectural decisions (y\u00fcksek seviye). Greyed out post-hoc \u00e7a\u011fr\u0131da pipeline log yoksa."
            },
            "technicalAnalysis": {
              "type": "boolean",
              "default": false,
              "description": "Changes (de\u011fi\u015fen dosyalar gruplan\u0131p ne/neden), Architecture (structural decisions), Dependencies (yeni import/framework/paket). PR body'sinde, Confluence sayfas\u0131nda ve yerel rapor dosyas\u0131nda render edilir; Jira yorumunda asla. Source: Phase 1 planning + Phase 2 dev log + PR diff stat."
            },
            "testScenarios": {
              "type": "boolean",
              "default": true,
              "description": "Precondition / steps / expected tablosu (4-8 sat\u0131r, user perspective). Pipeline log source."
            },
            "autoDiff": {
              "type": "boolean",
              "default": false,
              "description": "PR diff'ten auto-generate \u00f6zet (eski enrich behavior - root cause / solution / changed files / test scenarios). PR linked de\u011filse greyed out."
            },
            "manualNote": {
              "type": "boolean",
              "default": false,
              "description": "Serbest metin paragraf (--message / --message-file). Her durumda se\u00e7ilebilir."
            },
            "costSummary": {
              "type": "boolean",
              "default": false,
              "description": "v6.1.0+ - Per-phase token cost summary (phase name, tokens_in, tokens_out, est. USD). Source: phase-tracker.sh token tallies + optional OTel spans (MULTI_AGENT_OTEL_SPANS=1). Greyed out if tracker has no token data for the task. Opt-in - off by default so baseline PR body stays unchanged."
            },
            "testRun": {
              "type": "boolean",
              "default": false,
              "description": "'Test Ko\u015fumu (Xray)' block: the Xray Test Execution of the task's UI scenario run, read from the flow runner's history.jsonl by render-flow-run.mjs. Ticked automatically when the run comes from --flow-run or state.evidence.flowRuns; greyed out when no run resolves."
            },
            "workSummary": {
              "type": "boolean",
              "default": false,
              "description": "v7.1.0+ - Executive 'Work Done' summary block. Distills the whole pipeline run into a single-screen section: task + branch + base + PR number, scope delivered (\u2705/\u23f3 per Phase 1 task), changed files with +/- counts (capped at 20 rows), review outcome (accepted/deferred/rejected counts + approved flag), and a one-line phase tick strip (0 Init \u2705 \u00b7 1 Analysis \u2705 \u00b7 ...). Source: `agent-state.json` + `phase-tracker.json` + `git diff --numstat` between `baseBranch`...HEAD. Consumed by `render-work-summary.sh`. Greyed out if no state file exists for the task. Opt-in - off by default so baseline PR body stays unchanged."
            }
          },
          "default": {
            "normalAnalysis": true,
            "technicalAnalysis": false,
            "testScenarios": true,
            "autoDiff": false,
            "manualNote": false,
            "costSummary": false,
            "workSummary": false
          }
        },
        "autopilotReportTimeoutSeconds": {
          "type": "integer",
          "default": 1800,
          "minimum": 60,
          "maximum": 7200,
          "description": "v5.7+ - Phase 5'de autopilot always-pause men\u00fcs\u00fcnde kullan\u0131c\u0131 cevap vermezse session'\u0131 sonland\u0131rma s\u00fcresi (saniye). Default 1800 (30 dk). Timeout'ta external delivery aborted, internal capture (agent-log, telemetry, knowledge) yine \u00e7al\u0131\u015f\u0131r, session /multi-agent:resume ile devam ettirilebilir."
        },
        "wikiScope": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["main", "ios", "screenshots", "index"]
          },
          "default": ["main", "ios", "screenshots", "index"],
          "description": "v5.7+ - Wiki Case A scope multi-select default'u. Component wiki dispatch'inde hangi artifact'lar yaz\u0131lacak: main (ana component sayfas\u0131), ios (iOS sub-page), screenshots (assets/ klas\u00f6r\u00fc), index (_Sidebar.md + ComponentImplementationStatus.md). Legacy wikiDefault=true \u2192 [main,ios,screenshots,index] migration; wikiDefault=false \u2192 [] (empty array = Wiki adapter Case B men\u00fcs\u00fcne d\u00fc\u015fer)."
        },
        "planAttachment": {
          "type": "string",
          "enum": ["ask", "always", "never"],
          "default": "ask",
          "description": "Whether the approved Phase 1 plan is attached to the issue the run started from (scripts/plan-attachment.mjs, multi-agent-refs/features/plan-attachment.md): a plan-<taskId>-v<N>.md attachment on a Jira issue, one <details> comment on a GitHub issue; free-text runs never attach. `ask` asks once per attended run; a run that cannot ask (MULTI_AGENT_UNATTENDED=1 or autopilot) skips and reports why. `always` attaches without asking; with MULTI_AGENT_UNATTENDED=1 only when unattended-policy.json does not block plan-attachment.mjs upload. `never` keeps the plan local. A project's own planAttachment overrides this."
        },
        "autoJiraFromGithubIssue": {
          "type": "string",
          "enum": ["ask", "always", "never"],
          "default": "ask",
          "description": "Policy for the GitHub-issue Jira auto-create (WS-6 triad, Phase 0 Step 1). `ask` prompts the user when a GitHub issue has no Jira ID. `always` auto-creates silently (and patches the GitHub issue body with the link). `never` skips and uses the `feature/GH{issueNo}-kebab` branch. Autopilot treats `ask` as `always` - there is no interactive fallback when running unattended."
        },
        "wikiToJiraComment": {
          "type": "boolean",
          "default": true,
          "description": "When the Wiki channel produces component wiki content AND a Jira issue is linked (`state.jiraId` set), also post a humanizer-passed summary of the wiki content as a Jira comment so QA + PMs see the component docs inline. Independent of `reportChannels.jira` (which controls whether the main Jira comment runs). Set `false` to suppress only the wiki-summary comment."
        },
        "promptLanguage": {
          "type": "string",
          "enum": ["en", "tr"],
          "default": "en",
          "description": "Locked to 'en': the language of LLM-facing instructions (spec files, agent system prompts, reviewer/triage prompts) and picker structural chrome (AskUserQuestion label/header). What humans read is governed by outputLanguage instead - picker question/description, conversational lines, and external payload bodies (PR description, Jira comment, Confluence/Wiki). Always English regardless of either pref: commit messages, branch names, PR titles, code identifiers, agent-log.md. Canonical matrix: multi-agent-refs/rules.md 'Language Application'. Set via /multi-agent:language or /multi-agent:setup."
        },
        "outputLanguage": {
          "type": "string",
          "enum": ["en", "tr"],
          "default": "en",
          "description": "Language used for the assistant's NON-INTERACTIVE explanations, status updates, error messages, and pipeline-generated reports rendered to the user (e.g. `/multi-agent:help` body, `/multi-agent:status` table headers, summary blocks at the end of a run). Independent of `promptLanguage` so a user can have Turkish pickers but English summaries (or vice versa). PR, Jira, issue and wiki bodies follow it too; commits, branch names, agent prompts and the CLI host's own picker and error UI stay English. Set via `/multi-agent:language output <en|tr>` or answered on first run by `/multi-agent:setup`."
        },
        "progressVerbosity": {
          "type": "string",
          "enum": ["quiet", "normal", "verbose"],
          "default": "normal",
          "description": "Verbosity of the live progress-line contract (`refs/progress-contract.md`). `quiet` shows only phase banners and user prompts (CI-friendly). `normal` shows banners + the canonical action set per phase - recommended for interactive use. `verbose` shows sub-agent internal actions, file-level reads, schema validations, retry internals - forced automatically when `mode: autopilot` is set in agent state so the run remains audit-grade when the user isn't watching live."
        },
        "triageCrossCheck": {
          "type": "object",
          "additionalProperties": false,
          "description": "Optional second-opinion check on Phase 3 triage decisions. When enabled, a configurable percentage of triage outputs are re-classified by Sonnet and the diff vs. Opus's verdict is logged for audit. Mitigates the single-point-of-failure risk that Opus triage hallucinates or drifts. Adds latency + cost; default off.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch."
            },
            "samplePct": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "description": "Percentage of triage runs to spot-check (1-100). 10 = roughly 1 in 10."
            },
            "model": {
              "type": "string",
              "enum": ["sonnet"],
              "default": "sonnet",
              "description": "Cross-check model. Locked to Sonnet - Opus would just agree with Opus."
            },
            "blockOnDisagreement": {
              "type": "boolean",
              "default": false,
              "description": "If true, a cross-check disagreement pauses Phase 3/4 for human review. If false (default), the disagreement is logged to metrics.jsonl as `triage.cross_check_diff` and the pipeline proceeds with Opus's original verdict."
            }
          }
        },
        "testBaseline": {
          "type": "object",
          "additionalProperties": false,
          "description": "Phase 0 test baseline. When enabled, Phase 0 runs the SAME test command the Phase 2 exit gate's Gate 3 uses and records which tests were already failing before this run touched anything, so the gate stops attributing an inherited red suite to the current work. Three outcomes are stored, never two: green, red (with the failing set when it can be parsed, otherwise the log path alone), or unknown when the command is absent or the time cap was hit. Off by default because on iOS the run costs a full xcodebuild test before any work starts. The outcome is stored rather than asked about, so Phase 3 can subtract it.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. Off by default - a baseline run costs one full test suite before Phase 2 starts."
            },
            "timeoutSeconds": {
              "type": "integer",
              "minimum": 30,
              "maximum": 3600,
              "default": 600,
              "description": "Hard cap on the baseline run. Exceeding it records status unknown rather than a partial failing set: a truncated suite would look like passing tests that never ran."
            }
          }
        },
        "reviewDisagreementRound": {
          "type": "boolean",
          "default": false,
          "description": "v6.1.0+ - Phase 3 Step 2.5 rebuttal round. When reviewers disagree (mixed blocker/approved verdict), each reviewer is re-prompted with the others' opposing arguments for one additional round before triage. Lifts signal quality on ambiguous findings at ~1\u00d7 Step 2 token cost. Off by default - flip for security-critical or release-branch reviews."
        },
        "analysisProfiles": {
          "type": "array",
          "description": "v16.6+ - which analysis standards the /multi-agent:analysis Step 1b picker offers (Locked 31). Listing one value auto-resolves the step instead of asking a question whose answer is already settled. Omitted means all three are offered.",
          "items": {
            "type": "string",
            "enum": ["global", "corporate", "custom"]
          },
          "default": ["global", "corporate", "custom"],
          "uniqueItems": true,
          "minItems": 1
        },
        "analysisProfile": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.6+ - per-profile deployment bindings. These are site configuration, not part of the shipped template: an unconfigured run still renders the full document and asks for its destination at Phase 3.5 like any other run. Keys are deliberately generic so no organisation's space, page or tooling names live in the repo.",
          "properties": {
            "corporate": {
              "type": "object",
              "additionalProperties": false,
              "description": "Bindings for the corporate profile: where its documents are published and which house terms they use.",
              "properties": {
                "confluenceSpaceKey": {
                  "type": "string",
                  "description": "Space the analysis page is created in when the Phase 3.5 picker chooses Confluence."
                },
                "confluenceParentPageId": {
                  "type": "string",
                  "description": "Parent page the analysis is filed under."
                },
                "titleFormat": {
                  "type": "string",
                  "description": "Page-title pattern, e.g. \"{status}{prefix}{module}_{flow}_{suffix}\". Placeholders are resolved at emit time; {status} is the draft marker while the document is not final, and empty once it is. Without {status} the marker is prepended."
                },
                "titlePrefix": {
                  "type": "string",
                  "description": "Prefix that marks pipeline-authored pages so they stay distinguishable from hand-written ones."
                }
              }
            }
          }
        },
        "updateCheck": {
          "type": "object",
          "additionalProperties": false,
          "description": "v10.9+ - Phase 0 Step 0.6 version check. Once per ttlHours window, a bounded (3s) registry read compares the installed version against dist-tags.latest and dist-tags.required. Newer version found: interactive modes ask 'Update now / Continue' (yes runs the /multi-agent:update flow, then the run continues); autopilot logs one line and never asks; offline/failed checks are silent and never block. v15.14+ adds the required floor: when the installed version is BELOW dist-tags.required the run halts until /multi-agent:update ran - that branch is governed by no key here (enabled:false silences the advisory nag only), its single override is the env var MULTI_AGENT_ALLOW_OUTDATED=1, and it fails open on every undeterminable answer.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch for the ADVISORY 'update available' prompt. On by default - the cost is at most one 3s-bounded curl per ttlHours. Does not disable the required-version floor; see the object description."
            },
            "ttlHours": {
              "type": "integer",
              "minimum": 1,
              "maximum": 168,
              "default": 24,
              "description": "Cache window for the registry read."
            },
            "autoUpdate": {
              "type": "boolean",
              "default": true,
              "description": "Run the update flow automatically before the run starts, in interactive modes and autopilot alike, instead of asking. ON by default since v16.5.0: the alternative was telling every user to run a command, and the Supported Version Gate already halts an install below the required floor - so the real choice was never 'update or not', it was 'update, or stop and be told to update'. Set false to be asked once per ttlHours instead; updateCheck.enabled: false silences the check entirely (it does not disable the required floor). Already-loaded phase docs finish the current run on the old version either way; the update takes full effect on the next run."
            }
          }
        },
        "verifyByTest": {
          "type": "object",
          "additionalProperties": false,
          "description": "v10.8+ - Phase 3 Step 3.7 verify-by-test. When enabled, accepted BLOCKING findings are empirically validated before the Phase 3 rework loop: one verifier agent writes a minimal repro test per finding and runs only that test. Confirmed findings hand their failing test to Phase 3 as the RED step; non-reproducible findings are downgraded to deferred under evidence-gate. Only blocking findings are ever verified (fixed behavior, not a knob). Adds one model call plus up to maxFindings single-test runs per iteration with accepted blockers; default off. Flip on for security-critical work, release branches, or repos with noisy reviewers. Full spec: refs/features/verify-by-test.md.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch."
            },
            "maxFindings": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 3,
              "description": "Max accepted blocking findings verified per review iteration. Findings beyond the cap keep their judgment-only verdict."
            },
            "model": {
              "type": "string",
              "enum": ["sonnet", "opus"],
              "default": "sonnet",
              "description": "Verifier agent model. Writing a minimal repro test is mechanical work; Sonnet is the cost-sane default."
            },
            "stepTimeoutSec": {
              "type": "integer",
              "minimum": 60,
              "maximum": 1800,
              "default": 600,
              "description": "Wall-clock budget for the whole Step 3.7 pass. On breach, remaining findings keep judgment-only verdicts and the pipeline proceeds (never blocks)."
            },
            "repeatCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 3,
              "description": "v16.20+ - how many times a repro test must pass before a finding is downgraded to not-reproduced. Any red run makes the verdict inconclusive with a flaky note. 1 disables the repeat."
            }
          }
        },
        "maturityFollowup": {
          "type": "object",
          "additionalProperties": false,
          "description": "v17.6.0+ - what to do about an item the maturity check finds is not ready (refs/features/maturity-followup.md). The check has always produced a machine-readable gap list and then thrown it away: a blocker halted the run, the queue moved on, and the item stayed exactly as immature as it was found.",
          "properties": {
            "askInteractively": {
              "type": "boolean",
              "default": true,
              "description": "An interactive blocker asks at the maturity step - open the item and fix it, continue without it (recording which gap was waved through), or abort - instead of ending the run with a summary. False restores the old halt."
            },
            "autopilotCommentsOnIssue": {
              "type": "boolean",
              "default": false,
              "description": "OFF by default, and an outward-facing write. When on, an autopilot run posts ONE comment on the Jira or GitHub item asking for what is missing, then halts on the circuit breaker and waits for resume. A question, never a state change: no transition, no resolution, no assignee, no label, no close. The body uses Ref:, never Closes:/Fixes:/Resolves:, and its copy follows outputLanguage. It never comments twice for the same gap set - a changed item is re-checked, and only a DIFFERENT gap set earns a second comment."
            },
            "commentOnWarnings": {
              "type": "boolean",
              "default": false,
              "description": "Treat warnings like blockers. Off by default because warnings have always auto-continued under autopilot, and converting them to halts in a release would stall queues overnight on items that ran fine yesterday. The gaps are recorded either way."
            }
          }
        },
        "baseBranchEvidence": {
          "type": "object",
          "additionalProperties": false,
          "description": "v17.5.0+ - Phase 0 Step 3 base-branch evidence collection (refs/features/base-branch-evidence.md). Candidates are collected with the evidence behind them (issue version field, linked release issue, the branch convention learned from the refs that exist, recent branches, repo default), ranked, and shown. Interactive runs always ask; the evidence only reorders the rows.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Collect issue-derived candidates at all. Off falls back to the develop/release/main sort order, which is still surfaced through the picker."
            },
            "preferLinkedRelease": {
              "type": "boolean",
              "default": false,
              "description": "On boards where opening a development sub-task requires selecting the related release issue, that link is the authoritative base-branch answer and the version field is corroboration. Raises the linked-release weight above the version-field one rather than adding a second rule."
            },
            "autopilotAsksOnIssue": {
              "type": "boolean",
              "default": false,
              "description": "OFF by default, and it is an outward-facing write. When on, an autopilot run whose base-branch derivation is ambiguous posts ONE comment on the Jira or GitHub issue asking which branch to develop from, then halts on circuit-breaker trigger 6 and waits for resume. A question, never a state change: no transition, no resolution, no assignee, no close. The body uses Ref:, never Closes:/Fixes:/Resolves:, and its human-facing copy follows outputLanguage. Autopilot never posts the question and then answers it itself."
            }
          }
        },
        "autopilotCircuitBreaker": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.20+ - autopilot circuit-breaker (refs/features/autopilot-circuit-breaker.md). Trigger 2 (a finding that survives consecutive rework cycles) and trigger 3 (the rework-cycle cap) are evaluated in code; the other triggers stay documented behaviour. When a trigger trips in autopilot the run halts visibly with state.circuitBreaker set; interactive modes show the still-present list and ask instead.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch for the code-evaluated triggers."
            },
            "identicalFindingCycles": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5,
              "default": 2,
              "description": "Consecutive rework cycles a blocking/important finding may survive before trigger 2 trips (review-delta.mjs --trip-cycles)."
            },
            "maxReworkCycles": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3,
              "description": "Optional lower bound for trigger 3. The rework limit itself is global.review.maxReworkCycles; this value only lowers the cycle count at which the breaker trips and never raises it."
            }
          }
        },
        "testGen": {
          "type": "object",
          "additionalProperties": false,
          "description": "/multi-agent:test-gen knobs. Read by test-gen-state.mjs revise.",
          "properties": {
            "revisionCap": {
              "type": "integer",
              "minimum": 0,
              "maximum": 500,
              "default": 20,
              "description": "Stale-test revisions autopilot may apply, counted per run and per calendar day (UTC), whichever is reached first. At the cap the run parks instead of editing more tests. 0 parks on the first one."
            }
          }
        },
        "testStability": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.20+ - a test that passes only on retry is a flake signal, not a pass. Phase 2 runs new and changed tests repeatCount times before GREEN; disagreeing outcomes block and are recorded as test.flake_signal.",
          "properties": {
            "repeatCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 3,
              "description": "Runs per new or changed test. 1 disables the repeat."
            }
          }
        },
        "review": {
          "type": "object",
          "additionalProperties": false,
          "description": "Review knobs. dedupeInlineComments and personaWalk belong to the standalone /multi-agent:review path. maxReworkCycles is the number of rework rounds Phase 3 may send back to Phase 2 in a pipeline run, resolved by scripts/review-rounds.mjs.",
          "properties": {
            "maxReworkCycles": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3,
              "default": 2,
              "description": "How many times review may send work back to development before the run stops. 3 is the hard ceiling (the cap on phases.2.reworkCount). Run flag --review-rounds, then projects.<slug>.maxReworkCycles, then this. Set with /multi-agent:review-rounds."
            },
            "dedupeInlineComments": {
              "type": "boolean",
              "default": true,
              "description": "Deduplicated PR review comments: before posting an inline comment, scan existing PR comments for a stable fingerprint marker (sha-16 of path|line|issue). If a comment with the same marker exists, skip  -  preserves audit trail without flooding the PR on re-runs. Provider-agnostic: GitHub /pulls/{n}/comments + /issues/{n}/comments and Bitbucket Server /pull-requests/{id}/activities?fromType=COMMENT are both checked. Set to false to restore the pre-v8.6 behavior (every run posts fresh comments, original spec)."
            },
            "personaWalk": {
              "type": "object",
              "additionalProperties": false,
              "description": "Spec persona walk in /multi-agent:review-analysis: up to four personas derived from the document walk its flows and report missing states, unhandled errors, accessibility gaps and conflicting rules. persona-walk-anchors.mjs drops every finding whose section or quote anchor is not in the document.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false,
                  "description": "Run the persona walk as an extra review step. Off by default until a live run of eval-persona-walk.mjs meets the bar in pipeline/eval/README.md on the seeded-defect corpus."
                }
              }
            }
          }
        },
        "shadowGit": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.6+  -  Cline-style per-tool-call shadow Git checkpoints. A separate git repo under ~/.claude/state/shadow-git/<task-id>/.git/ snapshots the worktree at each Phase 2 step boundary (per Plan Todo) and optionally after each Edit/Write/MultiEdit/Bash mutation. The shadow lives outside the project's real .git so semantic commits stay clean. Pattern source: Cline checkpoints (https://docs.cline.bot/features/checkpoints). Off by default  -  adds a per-step git commit on top of the existing TDD loop; flip on for risky refactors where sub-phase rollback is worth ~50ms per snapshot.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch."
            },
            "mode": {
              "type": "string",
              "enum": ["per-tool-call", "per-todo-step", "off"],
              "default": "per-todo-step",
              "description": "Snapshot frequency. per-tool-call snapshots after each Edit/Write/Bash mutation; per-todo-step snapshots once per plan-todos.sh step boundary (cheaper, recommended). off is equivalent to enabled=false."
            },
            "pruneAfterDays": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 14,
              "description": "Shadow snapshots older than N days are garbage-collected on the next /multi-agent:purge or by an explicit shadow-git.sh prune --older-than-days call."
            }
          }
        },
        "tddEvidence": {
          "type": "object",
          "additionalProperties": false,
          "description": "Whether completing a plan todo needs a recorded RED run and GREEN run (plan-todos.sh tdd-red / tdd-green). Applies where Phase 2 iterates plan todos (prefs.global.planTodos.enabled); without it Phase 2 walks tasks[] and nothing is recorded. Docs and chore todos, component tasks, test policy none and complete --no-tests are exempt and recorded with a reason.",
          "properties": {
            "mode": {
              "type": "string",
              "enum": ["off", "warn", "enforce"],
              "default": "warn",
              "description": "off: no check. warn: complete warns and records tdd.outcome unverified, which Phase 3 notes. enforce: complete refuses a todo without the evidence."
            }
          }
        },
        "planTodos": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.6+  -  Plan-as-live-Todo-list. Phase 2 emits agent-state.plan.todos[] conforming to pipeline/schemas/plan-todos.schema.json; Phase 3 iterates step-by-step via pipeline/lib/plan-todos.sh next/start/complete; Phase 5 renders the rollup into agent-log.md and the PR body. The plan is broken into a live, structured Todo list. Off by default  -  opt in to add status-transition writes per Phase 3 step in exchange for sub-step visibility + per-step notes.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. When true, Phase 1 Step 11 emits plan.todos[] and Phase 2 / 5 read from it."
            }
          }
        },
        "approachChoice": {
          "type": "object",
          "additionalProperties": false,
          "description": "Phase 1 approach choice for free-text tasks with no analysis document behind them (refs/features/approach-choice.md): two or three written approaches with their tradeoffs, picked by the person, or by an autopilot run that takes the recommended one and records why in decisions[].",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "false skips the step; the plan is then built on the approach the planner takes without showing alternatives."
            }
          }
        },
        "planComplexity": {
          "type": "object",
          "additionalProperties": false,
          "description": "Grounded complexity score per Phase 1 plan task (pipeline/scripts/plan-complexity.mjs): counted from the files a task touches, their code-graph fan-in, the modules they span and their test surface, never from the planner's opinion. Phase 1 splits a task scoring above the threshold before the plan is approved.",
          "properties": {
            "splitAbove": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 7,
              "description": "A task whose score (1-10) is above this gets recommendSplit and is split before plan approval. Lower it to get smaller tasks; 10 never splits."
            }
          }
        },
        "clarifyAmbiguous": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.6+  -  Phase 0 Step 9 clarifying-question loop. Before Phase 1 starts, a cheap Haiku classifier scores task ambiguity (0-10) and emits up to N questions if score < threshold. Cost: ~$0.0004 per Haiku call. Off by default  -  flip on for teams burned by ambiguity-driven rework or when working on cross-team issues where the spec lives in someone else's head.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. When true, Phase 0 dispatches task-clarifier after maturity check and before Phase 1."
            },
            "model": {
              "type": "string",
              "enum": ["haiku", "sonnet"],
              "default": "haiku",
              "description": "Classifier model. Haiku is the cost default; Sonnet override for regulated domains where ambiguity nuance matters."
            },
            "minScoreToProceed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 6,
              "description": "Clarity threshold. Score \u2265 threshold \u2192 proceed silently. Below \u2192 questions fire. 6 is the borderline 'the what is clear but the how is fuzzy' line."
            },
            "maxQuestions": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5,
              "default": 3,
              "description": "Hard cap on questions per round. Clarifier picks the highest-leverage N even if more ambiguity exists."
            },
            "autopilotMode": {
              "type": "string",
              "enum": ["skip", "log", "abort"],
              "default": "log",
              "description": "What to do when stopAndAsk fires in autopilot. skip = drop questions and proceed (most aggressive); log = append to agent-log.md and proceed (default, preserves signal); abort = pause Phase 0 and require multi-agent:resume."
            }
          }
        },
        "intentGuard": {
          "type": "object",
          "additionalProperties": false,
          "description": "v9.3+  -  Phase 0 conceptual-vs-edit guard for free-text input. A deterministic local classifier (pipeline/lib/classify-intent.sh, no model call) detects when the input is a question rather than a task and answers it in place instead of creating a branch/worktree. Targets the most-cited daily annoyance with coding agents (the agent edits code when asked a conceptual question). On by default because the check is free and only fires on free-text (Jira/issue inputs are always explicit tasks).",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "When true, free-text classified as a question is answered in chat and the dev chain is not started. Set false to always treat free-text as a task."
            }
          }
        },
        "costBudget": {
          "type": "object",
          "additionalProperties": false,
          "description": "v9.2+  -  Proactive per-task cost ceiling. Complements the end-of-run cost summary: pipeline/scripts/cost-budget-check.mjs reads the phase-tracker token accumulators after each phase, prices them via cost-table.json, and warns or halts before spend runs away. Top user-cited reason to abandon an AI coding tool is opaque/spiralling cost; this surfaces it live. Enabled by default in warn mode (v10.1+); set enabled:false to opt out, or onExceed:halt to make the ceiling blocking.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch. Default true (warn mode) so runaway cost is visible live. When off, cost-budget-check.mjs exits 0 silently and the pipeline behaves exactly as before."
            },
            "maxUsd": {
              "type": "number",
              "minimum": 0,
              "default": 5.0,
              "description": "Hard ceiling on estimated USD spend for a single task across all phases. Exceeding it returns exit 11."
            },
            "warnPct": {
              "type": "integer",
              "minimum": 1,
              "maximum": 99,
              "default": 80,
              "description": "Emit a warning (exit 10) once estimated spend reaches this percentage of maxUsd, so the user can intervene before the ceiling."
            },
            "onExceed": {
              "type": "string",
              "enum": ["warn", "halt"],
              "default": "warn",
              "description": "warn = surface the overage and continue (autopilot keeps going). halt = pause the run and require multi-agent:resume once the user accepts the cost. Interactive runs always surface the line regardless."
            },
            "pricingModel": {
              "type": "string",
              "enum": [
                "fable",
                "free",
                "gpt-5.4",
                "gpt-5.6",
                "gpt-5.6-terra",
                "haiku",
                "local",
                "opus",
                "sonnet"
              ],
              "default": "fable",
              "description": "Which cost-table.json rate to price accumulated tokens at. Every row the table prices is accepted and nothing else: an enum narrower than the table refuses a host its own rate, and a wider one accepts a value the ledger cannot price. Defaults to fable (the top tier since v10.6.0) for a deliberately conservative (upper-bound) estimate, so the ceiling trips early rather than late."
            }
          }
        },
        "usageLog": {
          "type": "object",
          "additionalProperties": false,
          "description": "Optional, opt-in per-run operational reporting via pipeline/scripts/usage-report.mjs. Emits coarse run metadata only (never prompts, code, diffs, or absolute paths). The emitter no-ops unless enabled is true AND a token resolves (from token below or env MULTI_AGENT_USAGE_TOKEN). Since v15.8.0 /multi-agent:update self-registers a per-machine write-only token and enables this automatically; optOut=true blocks that permanently.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch, on by default. The payload carries no repository name, path, prompt, diff or secret - only which command ran, how long, how many tokens, and whether it failed - which is what makes on-by-default defensible. Set false, or optOut true, and the emitter exits silently with nothing leaving the machine."
            },
            "optOut": {
              "type": "boolean",
              "default": false,
              "description": "Hard opt-out. When true, /multi-agent:update neither self-registers a token nor auto-enables reporting; enabled stays false until the user clears this."
            },
            "endpoint": {
              "type": "string",
              "description": "Ingest URL that receives the run record. The write-only token rides in the X-Usage-Token header, so the emitter sends ONLY over https (or http on 127.0.0.1/localhost for local dev); any other http endpoint is refused before the token is read."
            },
            "token": {
              "type": "string",
              "description": "Shared ingest token the receiving endpoint validates. May be left empty here and supplied via env MULTI_AGENT_USAGE_TOKEN instead. Local prefs only, never synced."
            },
            "declaredLogin": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,38}$",
              "description": "The GitHub username the person typed at setup or update (usage-register.mjs --login). Registered as declared when this machine cannot prove that account; the server issues a token only when it is a collaborator (the repository owner registers with a proof). Forgotten when the server refuses it. Local prefs only, never synced."
            },
            "reportAs": {
              "type": "string",
              "description": "Preferred GitHub login when more than one account is logged in to gh. usage-register.mjs --login sets it to the declared name, and removes it with that name when the server refuses the name. It is checked first, and used only if that account can read accessRepo; otherwise the next logged-in account with access is used. Local prefs only, never synced."
            },
            "accessRepo": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$",
              "default": "multi-agent-ecosystem/multi-agent-pipeline",
              "description": "owner/repo whose read access decides the reporting identity (usage-identity.mjs). Reporting uses the first account on the machine that can read it (gh accounts, then the git credential helper, then SSH keys), and sends nothing when none can."
            },
            "login": {
              "type": ["string", "null"],
              "description": "Cached result of the identity check: the GitHub account on this machine that can read accessRepo, or null when none could. Written by usage-identity.mjs; refresh with `node ~/.claude/scripts/usage-identity.mjs --refresh`."
            },
            "loginMethod": {
              "type": ["string", "null"],
              "enum": ["gh", "credential", "ssh", null],
              "description": "How the cached login was found: a gh account, the git credential helper's github.com token, or an SSH key. Registration proves the login the same way. Absent on a cache written before 20.17.1, which means gh."
            },
            "loginKey": {
              "type": ["string", "null"],
              "description": "Path of the SSH private key the login was found with (loginMethod ssh only). A missing key file invalidates the cache."
            },
            "loginFallback": {
              "type": "boolean",
              "description": "Deprecated (20.17.0). Marked a cached login that could not read accessRepo; such a cache entry is re-checked at once and the key is removed."
            },
            "loginRepo": {
              "type": "string",
              "description": "The accessRepo the cached login was checked against. A different accessRepo invalidates the cache."
            },
            "loginCheckedAt": {
              "type": "string",
              "description": "ISO time of the last identity check. Re-checked after 7 days, or after 1 day when no account had access."
            },
            "loginReason": {
              "type": ["string", "null"],
              "description": "Why no account qualified at the last check. Null when login is set."
            },
            "registeredAs": {
              "type": "string",
              "description": "The login the stored ingest token was issued for. usage-register.mjs replaces the token when the verified login differs, because the server pins each token to one login."
            },
            "registeredAt": {
              "type": "string",
              "description": "ISO time of the registration that issued the stored token."
            },
            "claimNonce": {
              "type": "string",
              "pattern": "^[0-9a-f]{8,32}$",
              "description": "Random suffix of the machine label a declared registration is sent with, so nobody else can name the label and replace this machine's token. Written once by usage-register.mjs."
            },
            "claimFailedAt": {
              "type": "string",
              "description": "ISO time a declared registration last failed for a reason other than a refusal of the name (rate limit, cap, endpoint down). The claim is not sent again for a day unless the name is typed again."
            },
            "reportAsBefore": {
              "type": "string",
              "description": "The reportAs a declared name replaced, put back when that name is refused."
            },
            "registeredClaim": {
              "type": "boolean",
              "description": "true when the stored token was issued for a declared login rather than a proven one. A proof found later, for any login with access, replaces it; a declared name never replaces a proven registration."
            },
            "registeredFallback": {
              "type": "boolean",
              "description": "Deprecated (20.17.0). true marked a registration made with an account that cannot read accessRepo; it is not treated as pinned and is replaced once an account with access is found."
            },
            "includeTitle": {
              "type": "boolean",
              "default": false,
              "description": "Send a summary of the task title with each run record: the number of words, whether it has the shape of a ticket key, and its language (en, tr or other). The title itself is never sent. Off by default: a title is the tracker's text, not pipeline metadata."
            },
            "includePrUrl": {
              "type": "boolean",
              "default": false,
              "description": "Send the PR URL with a run that opened one on github.com, gitlab.com, bitbucket.org or dev.azure.com (no query string or credentials); a pull request on any other host sends nothing. Off by default because the URL names the repository; without it the record carries only whether a PR was opened."
            },
            "trustedHosts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "description": "Extra https hosts that may receive the GitHub login proof at registration, besides the default reporting host. Only for a self-hosted endpoint you trust with the account's gh token."
            },
            "reportedVersion": {
              "type": "string",
              "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$",
              "description": "The last pipeline version whose install or update record the server accepted. Written by usage-report.mjs; when it differs from the installed version, one lifecycle record is sent and this moves forward."
            }
          }
        },
        "skillUsage": {
          "type": "object",
          "additionalProperties": false,
          "description": "The local skill-usage log note-skill-use.sh writes after each Skill tool call (Claude Code only): the skill name, ok or error, the time, the host and the repo folder name, never arguments, prompts or output. It stays on this machine under ~/.claude/logs/multi-agent/skill-usage.jsonl; skill-usage.mjs reads it and the office server room shows the counts. usageLog.optOut true turns it off as well.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "false stops the hook writing rows; rows already written stay until removed by hand or by uninstall --all-data."
            }
          }
        },
        "mcpFailures": {
          "type": "object",
          "additionalProperties": false,
          "description": "The local MCP failure log note-mcp-failure.sh writes after each failed MCP tool call (Claude Code only): the server and tool from the tool name, the time and a closed error class, never arguments, output or error text. Nothing is probed. It stays on this machine under ~/.claude/logs/multi-agent/mcp-failures.jsonl; doctor's mcp-failures check reads it and lights INFO for a server that failed five times or more in 24 hours. usageLog.optOut true turns it off as well.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "false stops the hook writing rows; rows already written stay until removed by hand or by uninstall --all-data."
            }
          }
        },
        "diskCleaner": {
          "type": "object",
          "additionalProperties": false,
          "description": "When the ecosystem suggests /multi-agent:clean-disk. lib/low-disk.mjs reads these with one statfs call from doctor's disk-space check, the SessionStart banner and the pre-push gate's failure path, and prints one line naming the command. The suggestion never deletes anything.",
          "properties": {
            "lowDiskGb": {
              "type": "number",
              "minimum": 0,
              "default": 10,
              "description": "Suggest the cleaner when less than this many gigabytes are free on the volume holding $HOME."
            },
            "lowDiskPercent": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "default": 5,
              "description": "Suggest the cleaner when less than this share of the volume is free. Either floor is enough."
            },
            "suggest": {
              "type": "boolean",
              "default": true,
              "description": "false silences the suggestion everywhere, including after a disk-full failure."
            },
            "reclaimableGb": {
              "type": "number",
              "minimum": 0,
              "default": 10,
              "description": "doctor's disk-space check names /multi-agent:clean-disk when the newest disk-cleaner dry run (under a day old) found at least this many gigabytes to free, even with enough free space."
            }
          }
        },
        "reviewPriority": {
          "type": "object",
          "additionalProperties": false,
          "description": "Where /multi-agent:review-priority reads team rule files. scripts/priority-review.mjs reads it; run data goes to runs/ beside the rules directory.",
          "properties": {
            "rulesDir": {
              "type": "string",
              "default": "~/.claude/routine-assets/review-priority/rules",
              "description": "Directory holding one <slug>.md rule file per team. A leading ~ is the home directory. Unset means the default."
            }
          }
        },
        "analysisPhase": {
          "type": "object",
          "additionalProperties": false,
          "description": "Analysis-document behaviour, shared by the analysis mode and the full pipeline's Phase 1. Phase 2 and Phase 3 pre-flights refuse to run without the document, so these settings decide whether that document is produced, reused from cache, or recorded as not-applicable.",
          "properties": {
            "mode": {
              "type": "string",
              "enum": ["full"],
              "default": "full",
              "description": "Retained with a single value so a preferences file that sets it stays valid. Section depth is not a mode: Locked 2 chooses sections from evidence, so a section renders when it has evidence and is dropped when it does not (ADR-0015). The `auto` and `lite` values are rewritten to `full` by the 2.6.0-to-2.7.0 migration."
            },
            "forceFull": {
              "type": "boolean",
              "default": false,
              "description": "Produce the document even for a task the when-table would skip (a bugfix or chore with no design reference). Use it when a small change still needs a written spec for review."
            },
            "commitDoc": {
              "type": "boolean",
              "default": true,
              "description": "Full pipeline only: whether the rendered document rides along with the work commit. Default true, so whoever reviews the PR sees the spec beside the code and the next run can reuse the evidence digest. When false the file stays in the worktree and is excluded from the commit."
            }
          }
        },
        "analyst": {
          "type": "object",
          "additionalProperties": false,
          "description": "Outside-fact sources for analysis work, served by the always-on ai-analyst-toolkit plugin. Two tiers, kept apart deliberately: evidence has a citable identity and may feed a specification body, signal is advisory and may only reach a risks section. Every source is best-effort  -  one that cannot be reached marks its row 'could not query' and the run continues.",
          "properties": {
            "evidence": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["github", "registry"]
              },
              "default": ["github", "registry"],
              "description": "Citable sources. github reads issues, PRs and releases through the already-authenticated gh CLI; registry reads npm, PyPI, Maven Central and SPM over keyless HTTP."
            },
            "signals": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["stackoverflow", "hackernews"]
              },
              "default": ["stackoverflow", "hackernews"],
              "description": "Advisory sources reachable without a key. Hacker News search goes through hn.algolia.com because the official Firebase API has no search endpoint."
            },
            "webSignals": {
              "type": "boolean",
              "default": false,
              "description": "Reddit and X, which have no usable free API left and are therefore reachable only through the host CLI's own web search. Off by default, best-effort when on, and exempt from cross-CLI parity because web search is not guaranteed on every host. Results are excluded from the Phase 1 evidence digest: they change by the hour, and including them would invalidate the cache on every run."
            }
          }
        },
        "reviewWatch": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.6+  -  Auto-review incoming PRs via gh CLI polling. Auto-triggers /multi-agent:review on PRs the user did NOT author. Disabled by default. Configure repos via .repos[] then either run pipeline/lib/review-watch.sh --watch as a background process or schedule it via cron.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch."
            },
            "repos": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
              },
              "default": [],
              "description": "owner/repo entries to watch. The watcher only considers PRs not authored by the current gh user."
            },
            "intervalSeconds": {
              "type": "integer",
              "minimum": 30,
              "maximum": 86400,
              "default": 300,
              "description": "Polling interval for --watch loop. Clamped to \u226530s to stay polite with GitHub rate limits."
            },
            "labelFilter": {
              "type": "string",
              "description": "Optional GitHub label. When set, only PRs carrying this label are considered."
            }
          }
        },
        "repoMap": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.6+  -  Aider-style token-budgeted repo map injection. When enabled, the orchestrator runs pipeline/scripts/repo-map.mjs BEFORE Phase 1 (Plan) and BEFORE Phase 3 (Review) and injects the resulting markdown as ${REPO_MAP} into the reviewer/analyser prompts. Deterministic  -  no embeddings, no network. Pattern source: https://aider.chat/docs/repomap.html. Off by default (introduces a ~150-300ms repo scan + repo-shaped prompt growth); flip on to lower per-call token cost on follow-up exploration phases.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. When true, Phase 1 and Phase 3 receive ${REPO_MAP} as additional context. When false, both phases run with only the diff + their normal prompt shell."
            },
            "tokenBudget": {
              "type": "integer",
              "minimum": 200,
              "maximum": 6000,
              "default": 1500,
              "description": "Soft token cap on the rendered map. The renderer fills greedily until the budget is hit, then truncates with a footer note. 1500 tokens ~ top 15-25 files with their top declarations."
            },
            "topFiles": {
              "type": "integer",
              "minimum": 5,
              "maximum": 100,
              "default": 25,
              "description": "Maximum number of ranked files to consider for inclusion. The token budget further trims this list  -  topFiles is an upper bound, not a guarantee."
            },
            "include": {
              "type": "string",
              "description": "Comma-separated path substrings  -  files NOT containing any of these are skipped. Empty/unset = include all supported sources. Use to scope the map to a sub-tree on monorepos (e.g. 'Sources/,Tests/')."
            },
            "exclude": {
              "type": "string",
              "description": "Comma-separated path substrings  -  files containing ANY of these are skipped. Stacks with their own caches (e.g. 'Generated/,.pb.swift,_mocks.kt') benefit from this."
            }
          }
        },
        "credentialHosts": {
          "type": "object",
          "description": "Hosts each credential-store key may be sent to by the multi-agent-mcp repo_* tools for read-only clone and fetch over https. Written by /multi-agent:setup (Token Save Flow Step 3.7) with the person present; product-context.mjs learn refuses a repository credential whose host is not listed here, and the toolkit refuses to send a token anywhere else.",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9.-]+$"
            },
            "maxItems": 20
          }
        },
        "products": {
          "type": "object",
          "description": "Products and the repositories each is made of, for the planning step that reads every repository of the product except the ones a run develops (scripts/product-context.mjs, toolkit repo_* tools). Keyed by product name; a project joins one through projects[<key>].product, or implicitly when one of its developed remotes is listed here. Written by product-context.mjs learn after the user confirms; read-only to everything else.",
          "propertyNames": {
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          },
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": ["repos"],
            "properties": {
              "repos": {
                "type": "array",
                "minItems": 1,
                "maxItems": 20,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["stack", "remote"],
                  "properties": {
                    "stack": {
                      "enum": ["ios", "android", "web", "backend", "resources"]
                    },
                    "remote": {
                      "type": "string",
                      "description": "https://, ssh:// or user@host:path remote, without credentials."
                    },
                    "branch": {
                      "type": "string",
                      "description": "Override for the branch rule (develop when the remote has it, else its default branch)."
                    },
                    "credential": {
                      "type": "string",
                      "description": "Logical credential-store key of a read token for this host, accepted only when global.credentialHosts already binds the key to this https host. Omit to use git's own credential helper or SSH agent."
                    },
                    "authScheme": {
                      "enum": ["basic", "bearer"],
                      "description": "basic for GitHub, bearer for Bitbucket Data Center HTTP access tokens."
                    },
                    "username": {
                      "type": "string",
                      "description": "Username for basic auth. Default x-access-token."
                    }
                  }
                }
              }
            }
          }
        },
        "codeGraph": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.1+  -  deterministic, LLM-free code graph (symbols, imports, references) built by pipeline/scripts/graph-build.mjs into ~/.claude/knowledge/<project>/code-graph.json. Phase 1 Step 2.6 queries it to narrow the Explore starting set; Phase 5 Step 3 refreshes it after the branch changed code. Zero API cost, zero runtime dependencies (ADR-0004), read-only on the repo. On by default; with it off no graph is built or refreshed. Measured on a 4,300-file Swift app at a fixed 30k retrieval budget, it roughly doubled coverage at under half the token cost on domain-word searches, and was marginally worse than plain grep when the task already names an exact symbol.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch, on by default. When false, Phase 1 Step 2.6 and the Phase 5 refresh are skipped and no graph is built or refreshed; a graph file already on disk is still read by Phase 3 and the analysis ranking."
            },
            "autoRefresh": {
              "type": "boolean",
              "default": true,
              "description": "Rebuild the graph in Phase 5 after the branch changed code. When false, the graph only refreshes when someone asks for it via /multi-agent:graph."
            },
            "maxNodes": {
              "type": "integer",
              "minimum": 1000,
              "maximum": 500000,
              "default": 200000,
              "description": "Upper bound on graph size. A build past this is reported and the graph is not written, so an unexpectedly huge tree (vendored sources, generated code) fails loudly instead of writing a multi-hundred-MB file."
            },
            "queryBudget": {
              "type": "integer",
              "minimum": 200,
              "maximum": 20000,
              "default": 2000,
              "description": "Token cap on a single graph-query traversal. The walk stops on budget, not on depth alone  -  an unbounded neighbourhood dump is the context-stuffing pattern this replaces."
            }
          }
        },
        "productTree": {
          "type": "object",
          "additionalProperties": false,
          "description": "v20.41+  -  the screen layer over the code graph (ADR-0019), built by pipeline/scripts/product-tree.mjs into ~/.claude/knowledge/<project>/product-tree.json: screens, routes, flows, localized strings, endpoints and tests, derived without a model. When enabled, Phase 0 locates the task text in it and Phase 1 injects the matching subtree. Off by default until the measured go / no-go in ADR-0019 says otherwise.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. When false, no tree is built, located or injected."
            },
            "maxChars": {
              "type": "integer",
              "minimum": 500,
              "maximum": 10000,
              "default": 6000,
              "description": "Character cap on the injected subtree. Lines are dropped whole, lowest ranked first, by fitToBudget."
            }
          }
        },
        "devCritic": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.6+ - Phase 2.5 evaluator-optimizer. After the Dev generator's last edit and BEFORE Phase 3 reviewers, dispatch agents/dev-critic.md (Sonnet by default) to run deterministic gates (build/lint/test/secrets) + the platform checklist (rules/*.md). Max 2 critic iterations, then escalate. Catches gate failures and checklist violations that would otherwise burn 2-3 Phase 3 reviewer calls + Opus triage. Off by default - introduces 1\u00d7 Sonnet call per Dev iteration; flip on for feature work, security-touching paths, or multi-file refactors. Source: Anthropic 'Building Effective Agents' (Dec 2024) evaluator-optimizer pattern.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. When true, Phase 2 dispatches dev-critic after the generator's last edit; when false, Phase 2 hands off directly to Phase 3."
            },
            "maxIterations": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3,
              "default": 2,
              "description": "Critic loop cap. Round 1 = full pass. Round 2 = re-check round 1 failures only. Round 3 NOT recommended - escalate to user (interactive) or proceed with logged failure (autopilot)."
            },
            "model": {
              "type": "string",
              "enum": ["sonnet", "opus", "haiku"],
              "default": "sonnet",
              "description": "Critic model. Sonnet is the cost/quality default. Opus override only when diff > 500 LOC or touches security-critical paths. Haiku is too brittle for checklist reasoning - use only for trivial verification tasks."
            },
            "minDiffLoc": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "description": "Skip dev-critic when diff LOC is below this threshold (avoid the overhead on trivial typo/copy fixes). 0 = always run when enabled. 200 = a common 'feature work' threshold."
            }
          }
        },
        "diffRiskAdvisory": {
          "type": "boolean",
          "default": true,
          "description": "v8.3+ - Phase 3 Step 1.75 advisory diff risk scoring. When enabled, `pipeline/scripts/diff-risk-score.mjs` runs before reviewer dispatch and the top-N risk-ranked files are injected into each reviewer's prompt as a priority hint (security paths, public API surfaces, untested source changes, schema migrations). Heuristic, deterministic, no LLM cost. Default ON - the run is sub-second and never gates the pipeline. Flip to false to skip the script and the prompt injection entirely."
        },
        "valven": {
          "type": "object",
          "additionalProperties": false,
          "description": "valven-rules delivery gate (the valven-rules skill, shipped in ai-common-toolkit). Runs at Phase 2 exit (Gate 6), Phase 4 Step 2.95 before push, Phase 3 Step 1.762 and every /multi-agent:review. Findings carry tag `valven`; an accepted important or blocking one sets NEEDS WORK, and an oversized branch is split into stacked PRs by valven-split.mjs.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "false turns the gate off everywhere; each run then logs `valven: disabled by prefs` so a skipped check is never read as a pass."
            },
            "thresholds": {
              "type": "object",
              "description": "Per-rule overrides of the `gate_rules` defaults in rules.yml, keyed by rule ID, e.g. {\"VLV-SIZE-01\": {\"important_over\": 300}}. Only keys the rule already declares are applied.",
              "propertyNames": {
                "pattern": "^VLV-[A-Z]+-[0-9]{2}$"
              },
              "additionalProperties": {
                "type": "object",
                "additionalProperties": {
                  "type": ["number", "string", "array"]
                }
              }
            }
          }
        },
        "reviewScopeGate": {
          "type": "boolean",
          "default": true,
          "description": "v12.8+ - Phase 3 Step 1.77 reviewer-scope gate. Decides the reviewer count from the deterministic diff-risk report via `pipeline/scripts/review-scope.mjs`: a diff under 20 lines of churn with max_score < 3.0 and no security_path / migration / public_api / no_test_change / test_lines_removed signal runs ONE reviewer instead of the full CLI-aware set (2 on Claude Code, 3 on Copilot CLI). No LLM. Fails safe in one direction only - any error, empty report or validator rejection resolves to the full set, because skipping a reviewer trades coverage for cost. Set false to force the full set on every diff.",
          "$comment": "Shipped inert for a release: the script existed, was unit- and smoke-tested, and no phase doc referenced it, so every diff paid for the full reviewer set. Wired in Step 1.77; smoke-gate-wiring.sh keeps it reachable."
        },
        "jiraContext": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.28+  -  when a Jira issue has a parent, the intake fetcher also reads the parent's other sub-tasks in ONE extra search request and exposes them as descriptor.relatedIssues[]. A development sub-task filed with an empty description whose analysis sibling carries the real requirement is the case this exists for. Costs nothing on an issue with no parent, because an issue with no parent has no siblings. The extra round trip lands before the maturity verdict is shown, so turn it off when intake latency matters more than the context.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch. When false the fetcher never issues the search and relatedIssues[] is always empty."
            },
            "maxItems": {
              "type": "integer",
              "default": 6,
              "minimum": 0,
              "maximum": 20,
              "description": "Hard cap on relatedIssues[]. Siblings that carry a description are kept first, so the cap drops the empty ones. 0 disables the lookup exactly like enabled: false."
            },
            "maxCharsPerItem": {
              "type": "integer",
              "default": 1200,
              "minimum": 0,
              "maximum": 4000,
              "description": "Per-sibling description truncation, marked with truncated: true. Worst case payload is maxItems x this, next to the 4000-char cap on the issue's own description."
            }
          }
        },
        "priorArtEnrichment": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.3+  -  Per-repo triage memory layer. When enabled, Phase 5 ingests every triage output's accepted/deferred/rejected rows into ~/.claude/memory/multi-agent/<repo-slug>/triage-corpus.jsonl (idempotent), and Phase 3 triage queries the corpus for similar past findings to inject as context. Per-repo isolation  -  never cross-leaks between projects.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch for the lookup side. When false, Phase 3 triage runs without prior-art injection. Ingest still runs unless ingestOnComplete is also flipped."
            },
            "ingestOnComplete": {
              "type": "boolean",
              "default": true,
              "description": "When false, Phase 5 skips the corpus append. Use to keep an existing corpus frozen while still benefiting from lookups against it."
            },
            "topN": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 3,
              "description": "Number of prior-art entries to attach per current finding."
            }
          },
          "default": {
            "enabled": true,
            "ingestOnComplete": true,
            "topN": 3
          }
        },
        "learningsLedger": {
          "type": "object",
          "additionalProperties": false,
          "description": "v9.3+  -  Per-repo persistent LEARNINGS ledger (pipeline/scripts/learnings-ledger.mjs), stored next to triage-corpus at ~/.claude/memory/multi-agent/<repo-slug>/learnings-ledger.jsonl. Holds durable architectural facts, conventions, and explicitly rejected review preferences. A compact brief is injected into Phase 1 analysis and Phase 3 triage so agents stop re-discovering structure and reviewers stop re-flagging rejected feedback (the most-cited cold-boot-amnesia complaint). Phase 5 distills each run's rejected findings into the ledger. Per-repo isolated; never cross-leaks.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch. When false, no brief is injected and Phase 5 does not append to the ledger."
            },
            "injectIntoAnalysis": {
              "type": "boolean",
              "default": true,
              "description": "Inject the durable-knowledge brief into Phase 1 analysis context."
            },
            "injectIntoTriage": {
              "type": "boolean",
              "default": true,
              "description": "Inject the rejected-preference brief into Phase 3 triage so known-rejected suggestions are not re-accepted."
            },
            "maxBriefEntries": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "description": "Cap on entries in an injected brief (most-recent first)."
            }
          },
          "default": {
            "enabled": true,
            "injectIntoAnalysis": true,
            "injectIntoTriage": true,
            "maxBriefEntries": 20
          }
        },
        "memoryRecall": {
          "type": "object",
          "additionalProperties": false,
          "description": "v15.10+  -  How the per-repo memory stores decide WHICH entries to inject. Ranking is BM25 over the stored text (identifier-aware, IDF-weighted) fused with recency by Reciprocal Rank Fusion, shared by triage-memory.mjs and learnings-ledger.mjs via pipeline/scripts/_retrieval.mjs. Zero dependencies: no embedding service, no vector store, no extra model call. Raw token overlap and newest-N replay both stop discriminating once a repo has a few hundred rows, which is why ranking fuses the two signals.",
          "properties": {
            "strategy": {
              "type": "string",
              "enum": ["bm25", "legacy"],
              "default": "bm25",
              "description": "bm25 = relevance-ranked recall. legacy = the pre-ranking behaviour (token overlap for the triage corpus, newest-first for the ledger brief), kept as the one-flag rollback if a ranking change ever makes a run worse."
            },
            "maxResults": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 5,
              "description": "Default hit cap for a recall query when the caller passes no --top."
            },
            "maxChars": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "description": "Character budget for one injected memory block, trimmed on whole lines. 0 disables the cap."
            },
            "halfLifeDays": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3650,
              "default": 30,
              "description": "Recency half-life. Recency only separates entries of comparable relevance; it never promotes an unrelated entry."
            },
            "mmrLambda": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.7,
              "description": "Maximal Marginal Relevance weight for the head of a recall answer: lambda * relevance - (1 - lambda) * similarity to what is already picked (TF-IDF cosine). Keeps near-duplicate rows from filling every place. 1 turns the re-pick off."
            },
            "multiQuery": {
              "type": "boolean",
              "default": true,
              "description": "Rank each clause of a multi-part task as its own query and fuse the rankings, so the second thing a task asks about is not crowded out by the first. false ranks the whole text as one query."
            }
          },
          "default": {
            "strategy": "bm25",
            "maxResults": 5,
            "maxChars": 0,
            "halfLifeDays": 30
          }
        },
        "contextOffload": {
          "type": "object",
          "additionalProperties": false,
          "description": "v15.10+  -  Park bulky tool payloads (build logs, full diffs, test output) under <worktree>/.multi-agent/refs/<node_id>.md and put a stub in context instead: a header line, the tail, and the node id that fetches the rest. Applied by pipeline/scripts/offload-ref.sh as a pipe filter, so a phase that pipes through it behaves identically when this is off. Evidence gates keep reading the complete file - only what reaches the model shrinks.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Master switch. Off by default: it changes what a phase prompt contains, which is a deliberate opt-in."
            },
            "minLines": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 40,
              "description": "Payloads shorter than this pass through untouched - a round trip through disk costs more than the lines it would save."
            },
            "tailLines": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 20,
              "description": "Lines of the payload kept inline. For a failing build the error is at the end, which is why the tail rather than the head is kept."
            }
          },
          "default": {
            "enabled": false,
            "minLines": 40,
            "tailLines": 20
          }
        },
        "editSyntaxGate": {
          "type": "object",
          "additionalProperties": false,
          "description": "Parse the file an edit just wrote and tell the model when it no longer parses: swiftc -parse, node --check, python3 py_compile (bytecode to a temp dir), JSON.parse, bash -n, chosen by extension, each under a 2 s deadline. Kotlin and every other extension are skipped. The hook is pipeline/scripts/edit-syntax-gate.sh: PostToolUse on Claude Code (install/templates/claude-hooks.json) and on Codex apply_patch (codex-hooks.json, registered by host-hooks.mjs). Copilot CLI is not registered: as of 1.0.45 it discards postToolUse output. It never blocks: the message arrives as PostToolUse context and the hook exits 0. A parser that is not installed or runs past the deadline means no message.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "false = the hook is a no-op. true = every edited file with a supported extension is parsed after the edit."
            }
          },
          "default": {
            "enabled": false
          }
        },
        "memory": {
          "type": "object",
          "additionalProperties": false,
          "description": "Limits on the per-repo memory stores under ~/.claude/memory/multi-agent/<repo-slug>/.",
          "properties": {
            "excludeProjects": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "description": "Repo slugs whose learnings ledger, triage corpus and debt list are never written. Reads still work on what is already there."
            }
          }
        },
        "fileContext": {
          "type": "object",
          "additionalProperties": false,
          "description": "When the model reads or searches files, hand it what the repo's memory says about them: ledger facts whose scope covers a file, its latest review findings and its open known limits (debt-ledger.mjs), once per file per session, inside an <untrusted-data> block, after the secret scan, and fitted by whole lines to the host's 10,000-character hook output limit. A Grep with a path or a Glob whose literal directory is inside the repo maps to at most five files the stores know; a whole-repo search gets nothing. The hook is pipeline/scripts/file-context.sh: PreToolUse on Read, Grep and Glob, PostToolUse on Read (Claude Code). It never blocks.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Absent = only inside a pipeline run bound to the session. true = in every session. false = never."
            }
          }
        },
        "sessionBrief": {
          "type": "object",
          "additionalProperties": false,
          "description": "Opt-in block a session can open with (pipeline/scripts/session-brief.sh, SessionStart on Claude Code): an index of the repo's learnings ledger with a pointer per line, one line about its code graph, the skill indexes of the enabled toolkits and, as a separate setting, a few working notes. Off until enabled is true; a repo with no ledger entries and no code graph gets nothing. Costs about 350 tokens per session at the defaults and again after each compaction. A detached process rebuilds a cache, the hook only prints it. Silent in unattended and pipeline contexts (MULTI_AGENT_UNATTENDED, MULTI_AGENT_TASK_ID, MULTI_AGENT_PHASE) and for non-interactive sessions. MULTI_AGENT_SESSION_BRIEF=0 turns it off for one process.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "true turns the brief on. Absent or false = the hook prints nothing and starts nothing."
            },
            "maxEntries": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 5,
              "description": "Ledger lines shown. 0 leaves the ledger layer out."
            },
            "maxChars": {
              "type": "integer",
              "minimum": 400,
              "maximum": 4000,
              "default": 2400,
              "description": "Size of the whole block. Whole lines are dropped to fit: working notes first, then skill routing, the graph line, then ledger entries from the last."
            },
            "kinds": {
              "type": "array",
              "items": {
                "enum": ["fact", "convention", "rejected-preference", "decision", "security-note"]
              },
              "description": "Ledger kinds shown. Absent = all."
            },
            "discipline": {
              "type": "boolean",
              "default": false,
              "description": "true adds the working notes (lead with the answer; one question about why only when the goal is unclear; options with a recommendation; a check per step; time in minutes or hours)."
            }
          }
        },
        "stopGuard": {
          "type": "object",
          "additionalProperties": false,
          "description": "run-stop-guard.sh, the Claude Code Stop hook that holds the session driving a pipeline run from ending its turn mid-phase with no halt or wait recorded. Read first on every Stop; false lets every stop through. Removing the hook from settings.json works too, and install does not add it back.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "true = the hook judges a stop as documented. false = it never blocks."
            }
          },
          "default": {
            "enabled": true
          }
        },
        "readOnlyRepos": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "default": [],
          "description": "Absolute paths (a leading ~ is expanded) of checkouts kept as read-only references: agent-guard.sh refuses an Edit, Write or NotebookEdit whose target is inside one, and a git commit, push, merge, cherry-pick, revert, am, rebase or tag that runs in one (after any cd or git -C on the line). Attended and unattended alike. Empty means no repository is protected this way."
        },
        "guardRules": {
          "type": "array",
          "maxItems": 64,
          "default": [],
          "description": "The user's own agent-guard rules (scripts/_user_guard_rules.py), applied after every built-in rule and only ever stricter: a rule never allows what the built-in guard refuses or asks about. Each rule searches its tool's text with a regex: the command for Bash, the target path for Edit (also NotebookEdit, and MultiEdit where the guard is registered on it), Write and Read, and the tool input as compact JSON for a toolkit tool. warn lets the call proceed with a note, ask raises the confirmation prompt, block refuses; unattended, ask is block. A pattern with a back-reference, or one that does not compile, is invalid; every other pattern runs under a 1-second budget, block rules first, each rule with its own share, and doctor names one with a slow shape. A rule that gives no answer (out of time, or input past 65,536 characters) refuses unattended and asks attended when it is an ask or block rule. A preferences file that does not parse, or a guardRules that is not a list, applies no rule: unattended it refuses every call a rule could govern when the file names guardRules, and attended each such call carries a note. An invalid rule is ignored and reported by doctor's guard-rules check, except that an invalid block rule refuses its tool unattended. Messages name the id and reason, never the matched text. A Read rule needs agent-guard.sh registered on Read, which the default hooks do not do; doctor reports it. A Read rule does not cover a shell read such as cat; that needs a Bash rule. Empty adds nothing.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id", "tool", "match", "action", "reason"],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
                "description": "Unique name shown in every message the rule produces."
              },
              "tool": {
                "type": "string",
                "pattern": "^(?:Bash|Edit|Write|Read|mcp__multi-agent__[A-Za-z0-9_*?]{1,80})$",
                "description": "Bash, Edit (also NotebookEdit, and MultiEdit where the guard is registered on it), Write, Read, or a glob over toolkit tool names such as mcp__multi-agent__web_*. A step of agent_run_steps is judged as a call of its own tool."
              },
              "match": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "description": "Python regular expression searched anywhere in the tool's text; inline flags such as (?i) work."
              },
              "action": {
                "type": "string",
                "enum": ["warn", "ask", "block"]
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$",
                "description": "One line shown with the rule id when it applies."
              }
            }
          }
        },
        "attendedCommitGate": {
          "type": "object",
          "additionalProperties": false,
          "description": "What pre-commit-check.sh does with an attended `git commit` inside a pipeline run whose gate ledger holds no passing build and test verdict (evidence-gate/build, evidence-gate/test) for HEAD, or, from Phase 4 on, no passing review-decision. evidence-gate.mjs records both in an attended run, marked attended. Read by gate-ledger.mjs `evidence`; a commit outside a run, or in a mode that commits nothing, is never checked. Unattended commits are held to the full ledger regardless of this setting.",
          "properties": {
            "mode": {
              "type": "string",
              "enum": ["off", "warn", "block", "auto"],
              "default": "auto",
              "description": "auto = block when the committing session is the one driving the run (its hostSessionId or launch sessionId), warn otherwise. warn = say so on stderr and let the commit through. block = refuse the commit (exit 2) until the evidence is recorded. off = no check."
            }
          },
          "default": {
            "mode": "auto"
          }
        },
        "mutationProbe": {
          "type": "object",
          "additionalProperties": false,
          "description": "Phase 3 optional review signal: pipeline/scripts/mutation-probe.mjs makes small textual mutants (a flipped comparison, a negated boolean literal, a swapped + / -, a changed returned constant) on lines the diff added or changed, runs the test command against each in a disposable worktree, and reports every mutant the tests did not catch as a finding. The caller's checkout is never written.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "false = Phase 3 skips the probe. true = Phase 3 runs it when a test command is known and merges each survivor as an important finding (the tests do not catch that change)."
            },
            "maxMutants": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 5,
              "description": "Upper bound on mutants per run. Each one costs a full test-command run, so the bound is the cost bound."
            },
            "timeoutSec": {
              "type": "integer",
              "minimum": 5,
              "maximum": 3600,
              "default": 120,
              "description": "Deadline for one test-command run. A mutant whose run times out is reported as timed out, not as a survivor."
            }
          },
          "default": {
            "enabled": false,
            "maxMutants": 5,
            "timeoutSec": 120
          }
        },
        "bulkRead": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.21+  -  Route a whole-file read that is too big to be worth the caller's rung to a cheap worker instead, and put its line-numbered summary in context rather than the file. The gate is pipeline/scripts/check-read-size.sh (PreToolUse, installed from install/templates/claude-hooks.json); the worker is pipeline/scripts/bulk-read.sh over the bulk-reader persona. Companion to contextOffload, which does the same for tool OUTPUT rather than for reads.",
          "properties": {
            "mode": {
              "type": "string",
              "enum": ["off", "observe", "enforce"],
              "default": "off",
              "description": "off = the hook is a no-op. observe = decide and log every inspected read, block nothing; this is the BASELINE MEASUREMENT, and running it before enforce is what makes a later saving claim checkable. enforce = block a whole-file read over minLines and tell the model to delegate it."
            },
            "minLines": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 350,
              "description": "Files shorter than this are never inspected. A delegated read costs a round trip measured in tens of seconds, so a small file is cheaper read directly - the threshold is where that trade turns over."
            },
            "exemptPhases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": ["3"],
              "description": "Phases the gate never blocks in. Phase 2 is the shipped default and removing it breaks development: Claude Code's Edit requires the same file to have been Read first, so a gate that blocks reads while code is being changed blocks the change. The gate is for phases that read to UNDERSTAND."
            },
            "model": {
              "type": "string",
              "default": "haiku",
              "description": "Rung the delegated read runs on. The saving IS the gap between this rung and the caller's, so a worker raised to the caller's own rung saves nothing."
            },
            "timeoutSeconds": {
              "type": "integer",
              "minimum": 5,
              "maximum": 600,
              "default": 60,
              "description": "Wall-clock budget for one delegated read. On expiry the worker degrades and the caller is told to do a bounded read instead - never left waiting, and never handed an invented summary."
            },
            "maxBytes": {
              "type": "integer",
              "minimum": 1024,
              "maximum": 20971520,
              "default": 1048576,
              "description": "Ceiling past which a delegated read degrades instead of running. Delegation is not free: at some size the worker's own input bill approaches the read it replaced, and a file large enough to strain its window comes back truncated - a partial summary presented as a whole one is the failure mode this feature must never produce. Over the ceiling the caller is told to narrow first (grep, then a bounded read) rather than handed an expensive round trip to a worse answer."
            }
          },
          "default": {
            "mode": "off",
            "minLines": 350,
            "exemptPhases": ["3"],
            "model": "haiku",
            "timeoutSeconds": 60,
            "maxBytes": 1048576
          }
        },
        "testGap": {
          "type": "object",
          "additionalProperties": false,
          "description": "v8.3+ - Phase 3 Step 0 advisory test-gap detector. Walks the diff for newly added public symbols and reports those without a paired test (or test method covering them). Heuristic, deterministic, no LLM cost.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Master switch. Default ON - the scan is sub-second."
            },
            "scanTree": {
              "type": "boolean",
              "default": false,
              "description": "When true, also scan the repo tree (not just the diff) for existing tests that already mention the symbol - catches gaps that are technically covered by older tests outside the current diff. Slower but more accurate. Off by default - diff-only scan is sufficient for the common case."
            },
            "blockingThreshold": {
              "type": ["integer", "null"],
              "minimum": 1,
              "default": null,
              "description": "If set, gaps where `important + blocking` count exceeds the threshold are treated as a Phase 3 rework finding (loops back to Phase 2). null = advisory only - Phase 3 prints the report but never gates."
            },
            "promoteSeverity": {
              "type": "boolean",
              "default": false,
              "description": "When true, the scan runs with --severity-promote, forcing every gap to 'important'. Useful for release branches and audit mode."
            }
          },
          "default": {
            "enabled": true,
            "scanTree": false,
            "blockingThreshold": null,
            "promoteSeverity": false
          }
        },
        "perRepoMemory": {
          "type": "boolean",
          "default": false,
          "description": "v6.2.0+ - Per-repo file-system memory layer. When enabled, Phase 0 reads `$PROJECT_ROOT/.multi-agent/memory/MEMORY.md` (if present) and injects it into the pipeline context, and Phase 5 dispatches a scoped synthesis subagent that may write new memory files to the same directory. Categories: user / feedback / project / reference (same taxonomy as the conversation-level auto-memory). Memory is local to each repo - never synced to remote, never committed to git (pipeline installer adds `.multi-agent/memory/` to `.gitignore`). Off by default - flip when working on a repo long enough that accumulated project context starts paying for itself."
        },
        "autopilotSafetyGate": {
          "type": "boolean",
          "default": true,
          "description": "v7.0.0+ - Phase 1 autopilot safety classifier. Before autopilot mode consumes the user's approval skip, run `classify-plan-safety.mjs` over the approved plan. If it recommends a pause (one signal of weight 30+, two of weight 20+, or a score of 50; the rule table is in the script header) inject a ONE-TIME pause asking for explicit manual approval - even in autopilot. Default ON because the risk of skipping this gate is asymmetric: a pause on a high-blast-radius plan costs seconds; a silent auto-merge of a bad one costs hours of rollback. Flip to `false` only for tightly-scoped autopilot workflows (e.g. batch figma component iteration) where the task class is known-safe."
        },
        "dynamicSkillLoading": {
          "type": "boolean",
          "default": false,
          "description": "v7.0.0+ - Dynamic trigger-based skill loading. When enabled, the orchestrator reads `~/.claude/skills/.skills-index.json` after Phase 1 analysis and injects only the top-N matched skills into subagent prompts (via `match-skills.mjs`), instead of relying on eager-loaded SKILL.md bodies. Large token win on small tasks; no visible behavior change on big ones where many skills match. The index ships with every install - full and `--index-only` alike - so this is safe to flip on any installed tree. Off by default - flip to `true` to opt in; a future release may flip the default once enough telemetry confirms no regression."
        },
        "upstreamCorpus": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Local directories holding checkouts of repositories that skills were once taken from. upstream-overlap-gate.mjs (pre-push) compares every shipped skill with the corpus skill of the same directory name, matches every shipped text file by content against every corpus text file, and fails one above 4.5% 6-word-shingle overlap with a single upstream file; shipped PNGs within 4 bits of a corpus PNG by difference hash also fail. Local-only: it names other people's repositories, so it is never synced into the public repo. Empty or absent = the gate is skipped."
        },
        "upstreamCorpusAliases": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "description": "Maps a shipped skill directory name to the upstream skill directory names it is also compared with, for a skill renamed on the way in: { \"<our skill dir>\": [\"<upstream skill dir>\", ...] }. upstream-overlap-gate.mjs still compares the same-named upstream and keeps the highest overlap. Local-only: it names other people's skills, so it is never synced into the public repo. Empty or absent = only same-named upstreams are compared."
        },
        "upstreamGateExtraRoots": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Extra directories upstream-overlap-gate.mjs matches by content against the upstream corpus, beside the pipeline's own shipped surfaces: for example a sibling repository's plugin or tool tree. A missing directory is skipped. Local-only: the paths are specific to the maintainer's machine, so they are never synced into the public repo. Empty or absent = only the pipeline's surfaces are measured."
        },
        "upstreamGateExceptions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Globs (`**` crosses directories, `*` and `?` stay in one segment) for owner-approved material still awaiting its replacement, matched against the repo-relative or absolute path. upstream-overlap-gate.mjs still measures a matching text file or image and reports it as excepted, with a count, instead of failing it, so the replacement's progress stays visible. Local-only. Empty or absent = nothing is excepted."
        },
        "derivedSkillSources": {
          "type": "array",
          "description": "v11.3.0+. Skills/components in a project that were derived from an upstream marketplace plugin. `/multi-agent:refactor` Step 0b compares each entry's `derivedFromVersion` against the installed upstream version and reports drift (plan band D). Local-only: it may name private marketplaces, so it is never synced into the public repo. Empty array = the drift step is skipped.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["label", "localPath", "upstreamPlugin", "derivedFromVersion"],
            "properties": {
              "label": {
                "type": "string",
                "description": "Human name for this derivation, shown in the drift table."
              },
              "localPath": {
                "type": "string",
                "description": "Repo-relative directory holding our derived copy."
              },
              "localRepo": {
                "type": "string",
                "description": "Repo that localPath is relative to, e.g. $HOME/multi-agent-plugins. Without it localPath reads as relative to the current repo, so an entry can silently point at the UPSTREAM tree: nothing else in the config says which checkout holds the derived copies."
              },
              "upstreamMarketplace": {
                "type": "string",
                "description": "Installed marketplace name, resolved under ~/.claude/plugins/cache/<marketplace>/."
              },
              "upstreamPlugin": {
                "type": "string",
                "description": "Upstream plugin name inside that marketplace."
              },
              "upstreamSkills": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The upstream skill names we took."
              },
              "derivedFromVersion": {
                "type": "string",
                "description": "Upstream version we last synced from, read from the manifest named by `upstreamVersionSource`. Bumped after a drift port is applied."
              },
              "upstreamVersionSource": {
                "enum": ["marketplace.json", "plugin.json", "git-paths"],
                "default": "marketplace.json",
                "description": "git-paths: the upstream ships no manifest, so derivedFromVersion is the commit the port was taken from and drift is any later commit on upstreamRef touching upstreamPaths, read from upstreamLocalClone only. Otherwise, which upstream manifest carries the authoritative version. Defaults to marketplace.json because that is what a marketplace consumer resolves; some upstreams keep plugin.json deliberately unused, so reading it silently records a version nobody ships. Recording from the wrong manifest is how an entry here sat at 0.7.0 while the marketplace said 0.6.0."
              },
              "upstreamPaths": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "git-paths only. Repo-relative paths whose commits count as upstream changes."
              },
              "upstreamRef": {
                "type": "string",
                "default": "origin/main",
                "description": "git-paths only. The ref compared against derivedFromVersion."
              },
              "upstreamLocalClone": {
                "type": "string",
                "description": "Working copy of the upstream repository, checked before the plugin cache. The cache under ~/.claude/plugins/cache is only as fresh as the last `claude plugin marketplace update`, so it is a mirror and never the authority. A private upstream may also be unreachable over the API from the active account, in which case this clone is the only source."
              },
              "upstreamRepoUrl": {
                "type": "string",
                "description": "Used when neither a local clone nor the installed marketplace is available (WebFetch / gh fallback)."
              },
              "driftAcknowledged": {
                "type": "string",
                "pattern": "^\\d+\\.\\d+\\.\\d+$",
                "description": "Upstream version whose drift is consciously accepted (port pending). The drift gate reports it but does not fail while upstream stays at this version; it re-fails the moment upstream moves past it."
              },
              "derivationNote": {
                "type": "string",
                "description": "What was taken and what deliberately was not. A derivation is rarely a copy: when the mechanism is portable but its runner is not, this is where that judgement lives, so the next drift review re-reads the decision instead of re-making it."
              },
              "excluded": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Upstream paths deliberately left behind, each with its reason. Usually project assets rather than code - vendored design tokens, licensed font names, product screen names - which leak by content rather than by carrying a brand word, so a structural gate cannot see them."
              },
              "notDerived": {
                "type": "array",
                "description": "Upstream skills reviewed and knowingly not derived. Without this, every drift review rediscovers the same candidate and re-argues it.",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["skill", "decision", "reason"],
                  "properties": {
                    "skill": {
                      "type": "string"
                    },
                    "reviewedAtVersion": {
                      "type": "string"
                    },
                    "decision": {
                      "type": "string",
                      "enum": ["deliberately-not-derived", "deferred"]
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "devToolkit": {
          "type": "object",
          "additionalProperties": false,
          "description": "v12.6.0+. The companion MCP server that serves the pipeline's device and browser tools (multi-agent-mcp). Two commands read this: `/multi-agent:refactor` Step 0c researches current MCP practice and audits that repo against it (plan band E), and `/multi-agent:sync` Step 3d ships it when it moved (gates, commit, publish). When absent, both commands fall back to auto-detecting the repo from the `mcpServers` registration in ~/.claude.json / ~/.claude/settings.json, and skip silently when that fails. Never a hardcoded path.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Set false to skip both the refactor band-E research and the sync ship step."
            },
            "label": {
              "type": "string",
              "description": "Human name used in reports."
            },
            "localPath": {
              "type": "string",
              "description": "Working copy of the companion repo. `$HOME` and `~` are expanded. When omitted, resolved from the MCP registration (dirname of the stdio server's script)."
            },
            "mcpServerName": {
              "type": "string",
              "default": "multi-agent",
              "description": "Registered MCP server name, used for the auto-detect fallback and for telling the user whether a restart or a reinstall is needed after a publish."
            },
            "packageName": {
              "type": "string",
              "description": "Published package name, e.g. @<scope>/<package>. Read from the repo's package.json when omitted."
            },
            "registry": {
              "type": "string",
              "enum": ["github-packages", "npmjs", "none"],
              "default": "github-packages",
              "description": "Publish target for Step 3d. `none` means commit + push only, never publish. The concrete URL comes from the repo's publishConfig; the token comes from the `npm` logical Keychain key through a throwaway --userconfig."
            },
            "repoUrl": {
              "type": "string",
              "description": "https remote, used in reports and when the working copy has to be cloned by the user."
            }
          }
        },
        "recentAccounts": {
          "type": "array",
          "description": "v7.3.0+. Last-used-first LRU of account ids (from account-resolver.sh). Used by autopilot to pick the most recent account when multiple are configured.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id"],
            "properties": {
              "id": {
                "type": "string",
                "description": "Short id from account-resolver, e.g. my-account"
              },
              "prefix": {
                "type": "string",
                "description": "Original keychain prefix, e.g. ${USER}"
              },
              "lastUsed": {
                "type": "string",
                "format": "date-time"
              },
              "count": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "maxItems": 10
        },
        "accounts": {
          "type": "array",
          "description": "v7.4.0+. Per-account overrides - host, label, default platform. Resolved by account-resolver.sh by matching `id` (e.g. my-account). When unset, hosts fall back to global.hosts.{jira,bitbucket}.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id"],
            "properties": {
              "id": {
                "type": "string",
                "description": "Short id matching account-resolver output (lowercase, dashes)."
              },
              "label": {
                "type": "string",
                "description": "Display label override; otherwise the resolver's auto-generated label is used."
              },
              "jiraHost": {
                "type": "string",
                "description": "Per-account Jira host override (no scheme). Wins over global.hosts.jira."
              },
              "bitbucketHost": {
                "type": "string",
                "description": "Per-account Bitbucket host override (no scheme). Wins over global.hosts.bitbucket."
              },
              "confluenceHost": {
                "type": "string"
              },
              "defaultProvider": {
                "type": "string",
                "enum": ["github", "bitbucket", "gitlab", "generic-git"]
              }
            }
          },
          "maxItems": 20
        },
        "skillConformance": {
          "type": "object",
          "additionalProperties": false,
          "description": "v14.0.0+ - Phase 3 Step 1.78 criteria resolution. The stage itself has no on/off key and neither does its exception-expiry check: a run that can switch off its own anti-reward-hacking control cannot be trusted to report a pass (same reasoning as Step 1.76).",
          "properties": {
            "blockOnCoverageGap": {
              "type": "boolean",
              "default": false,
              "description": "Whether a declared coverage gap halts the run. A gap means a language in the diff that no rule registry covers, and it is REPORTED either way - this key only decides whether it also stops the pipeline. Default false because only Swift plus the two store-compliance catalogs ship a scoped registry today, so defaulting true would block every Kotlin, Python, Node and Objective-C run on day one. Flip to true once your stack's registry exists and you want an uncovered file treated as a failure rather than a note."
            }
          }
        },
        "resume": {
          "type": "object",
          "additionalProperties": false,
          "description": "/multi-agent:resume - picking up unfinished work, either a run that stopped mid-phase or a branch carrying work no run produced. These keys apply to the second path, which runs review + build/test + PR + report over the branch diff.",
          "properties": {
            "autoFix": {
              "type": "boolean",
              "default": false,
              "description": "When true, the tail path auto-fixes triage-accepted blocking/important findings and re-reviews instead of asking. Equivalent to passing `autopilot` on every run. Default false: this path operates on work the user wrote by hand, so silently rewriting it is the surprising option."
            }
          }
        },
        "visualEvidence": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.24+  -  Before/after screenshots and the UI flow video that a UI change carries into its Jira comment and its PR body. The artefacts are Jira attachments, so the ceiling is an instance setting rather than a constant. Contract: multi-agent-refs/features/visual-evidence.md.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Off disables capture, upload and both render sections. The Phase 4 blocker goes with it."
            },
            "jiraMedia": {
              "type": "string",
              "enum": ["links", "thumbnails"],
              "default": "links",
              "description": "How the Jira comment references screenshots: links (one evidence line per scenario, default) or thumbnails (small embedded images). Recordings are always links. Consumed by scripts/render-jira-evidence.mjs --mode."
            },
            "maxAttachmentMb": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 10,
              "description": "Jira's per-attachment ceiling for this instance. An artefact over it is re-encoded at lower quality (720p video, JPEG q80) and, if still over, replaced by a four-frame contact sheet. Quality is negotiable; dropping the artefact is not."
            },
            "maxVideoSeconds": {
              "type": "integer",
              "minimum": 5,
              "maximum": 300,
              "default": 60,
              "description": "Recording cap. A flow needing longer is a debugging session, not a review artefact. Android's `screenrecord` has its own ceiling of 180s that no setting can lift, so capture-evidence.sh clamps to it and says when it did: one preference honoured on one platform and silently halved on the other is worse than a stated limit."
            },
            "webBaseUrl": {
              "type": "string",
              "description": "The address a web capture points the browser at. Web is the one evidence platform that needs one: a simulator is already showing something, a dev server has to be pointed at. Absent, `capture-evidence.sh after --platform web` reports a gap with that reason instead of guessing a port. Per-run override: `--url`."
            },
            "githubHost": {
              "type": "string",
              "enum": ["branch", "off"],
              "default": "branch",
              "description": "Where stills go on a run with no Jira. `branch` pushes them to an orphan `evidence/<task-id>` branch so the PR body can show them; GitHub has no API that attaches a file to an issue or a PR, and the web uploader needs a browser session, so a branch is the only mechanism a script has. `off` means no upload, the PR names the artefact directory, and the absence is recorded as a gap. Video is never pushed here: an mp4 behind a blob link is a download, not evidence a reviewer will open."
            }
          }
        },
        "testDepth": {
          "type": "object",
          "additionalProperties": false,
          "description": "How far a run tests by default. The question is asked at intake (Phase 0), not in the user test, because it is not in the step set for autopilot or either local mode. Autopilot never asks and reads `default` instead; the run records which rule fired.",
          "properties": {
            "default": {
              "type": "string",
              "enum": ["unit", "unit+ui", "unit+mcp"],
              "default": "unit+ui",
              "description": "Used by both autopilot entries, and as the preselected option for everyone else. An option the capability probe found closed is never taken from here: a default that cannot run is not a default."
            }
          }
        },
        "issueTree": {
          "type": "object",
          "additionalProperties": false,
          "description": "v16.29+  -  how /multi-agent:analysis-jira turns an analysis document into a Jira story tree. Every site-specific NAME lives in a free-form map value here, never as a schema key: a key is a published literal and this file ships to everyone, so a site's component, team and issue-type names must be values the site fills in. subtaskRoles ships EMPTY on purpose - an empty list is an instruction to go and look at how this board actually splits work, while a ready-made list would be the guess we most want to avoid. subtaskIssueType null means discover it: createmeta returns whichever type carries subtask:true, under whatever name the site gave it. Same rule as features/jira-context.md - the type travels as it comes from Jira and is never a matching criterion in code.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true
            },
            "projectKey": {
              "type": ["string", "null"],
              "default": null,
              "description": "Where the tree is created. Null means ask at preview time."
            },
            "epicIssueType": {
              "type": "string",
              "default": "Epic"
            },
            "storyIssueType": {
              "type": "string",
              "default": "Story"
            },
            "subtaskIssueType": {
              "type": ["string", "null", "object"],
              "additionalProperties": {
                "type": "string"
              },
              "default": null,
              "description": "The sub-task type name, or a map from a subtaskRoles entry to this site's type name (\"*\" for any other role), e.g. {\"develop\": \"Build Sub-task\", \"test\": \"QA Sub-task\"}. Null means discover from createmeta (the per-project endpoint, else the classic one) rather than assume a name; when the site has several sub-task types the first is used and the run says so."
            },
            "subtaskRolesDeclined": {
              "type": "boolean",
              "default": false,
              "description": "true once the person answered the sub-task question with no sub-tasks, so /multi-agent:analysis-jira does not ask again. Written by analysis-story-tree.mjs --save-subtasks none."
            },
            "storyPanels": {
              "oneOf": [
                {
                  "const": false
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "story": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$"
                    },
                    "criteria": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$"
                    },
                    "other": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$"
                    }
                  }
                }
              ],
              "description": "Border colours of a Story's wiki panels, as written by /multi-agent:create-jira and /multi-agent:analysis-jira: story (the user story), criteria (the acceptance criteria), other (every other section). Unset means #d4d39e, #d4a19e and #9eb6d4; a colour left out keeps its default; false writes plain h3. sections."
            },
            "subtaskRoles": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [],
              "description": "The roles each story is split into. Ships empty: mine the board, do not guess."
            },
            "channelComponents": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "default": {},
              "description": "channel -> this site's component name. Free-form: the key is the channel, the value is the site's own vocabulary."
            },
            "channelTeams": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "default": {},
              "description": "channel -> this site's team name. Free-form, same reason."
            },
            "labelPrefix": {
              "type": "string",
              "default": "ma-analysis",
              "description": "Prefix of the identity label a created issue carries. The label is how a second run, on a second machine or by a second analyst, finds the tree it already made instead of opening a duplicate."
            },
            "epicLinkMode": {
              "type": "string",
              "enum": ["auto", "parent", "epicLinkField", "none"],
              "default": "auto",
              "description": "How a story joins an existing epic. auto: parent on Cloud, the epic-link field (found by its schema type) on Server and Data Center, nothing when neither exists."
            },
            "epicLinkFieldId": {
              "type": ["string", "null"],
              "default": null,
              "description": "The epic-link custom field id, for epicLinkField mode or to skip discovery. Null means discover."
            },
            "cloneByChannel": {
              "type": "boolean",
              "default": false,
              "description": "Create one linked story per channel in channelComponents, each carrying that channel's component."
            },
            "cloneLinkType": {
              "type": "string",
              "default": "Relates",
              "description": "The link type between a story and its channel clones, by this site's name."
            },
            "dependencyLinkType": {
              "type": "string",
              "default": "Blocks",
              "description": "The link type written from a prerequisite story to the story that depends on it (a `Depends on:` clause in the analysis document), by this site's name. The prerequisite is the link's source."
            },
            "familyWrites": {
              "type": "boolean",
              "default": true,
              "description": "When a run starts from a Jira story or one of its sub-tasks, write to the whole family (features/jira-family.md): the story description reformatted into the story format, the Phase 5 comment on the development sub-task, the test scenarios on the test sub-task. false keeps the single Phase 5 comment on the issue the run started from."
            },
            "storyIssueTypes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [],
              "description": "Issue type names, by this site's own name, that count as a story for the issue family: only such an issue's description is reformatted into the story format. Empty means storyIssueType (Story when unset)."
            },
            "testSubtaskTypes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [],
              "description": "Sub-task type names, by this site's own name, that mark a test sub-task. Empty means discover: the project's sub-task types from createmeta whose name carries the word test (e.g. Sub Test Execution, Test Task)."
            },
            "devSubtaskTypes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [],
              "description": "Sub-task type names that mark a development sub-task, used when a run starts from the story. Empty means a type whose name carries dev, development or geli\u015ftirme."
            }
          }
        },
        "mcpSurface": {
          "type": "object",
          "additionalProperties": false,
          "description": "v17.6.0+ - how many MCP servers this host has registered. Every registered server's tool list is charged against the context window on EVERY turn, and the user adds them one at a time without ever seeing the running total; our own toolkit contributes 115 tools by itself. `doctor` reports the count, it never disables anything.",
          "properties": {
            "infoAbove": {
              "type": "integer",
              "minimum": 0,
              "default": 8,
              "description": "Report the registered-server count once it exceeds this. The number is JUDGEMENT, not a measurement - it exists so the threshold is visible and adjustable instead of hidden in the script. 0 reports the count always."
            },
            "schemaInfoAboveTokens": {
              "type": "integer",
              "minimum": 0,
              "default": 8000,
              "description": "doctor --probe reports the toolkit's tool-list load per family (an estimate, bytes / 4) once the total reaches this many tokens, with the MCP_TOOLKIT_CAPS families that would cut it. Judgement, like infoAbove. 0 reports it always."
            }
          }
        },
        "pluginsRoot": {
          "type": "string",
          "minLength": 1,
          "description": "Directory holding a copy of the multi-agent-plugins marketplace, which is where install reads the knowledge skills from (pipeline/lib/plugins-source.mjs). It is tried before the checkout, the registered marketplace and the plugin cache, and MULTI_AGENT_PLUGINS_ROOT overrides it. Set it on a machine that keeps the marketplace somewhere this order would not find. Absent = the default order, ending in one bounded clone install owns."
        }
      }
    },
    "projects": {
      "type": "object",
      "description": "Per-project overrides. Key = project slug.",
      "patternProperties": {
        "^[a-z0-9][a-z0-9\\-_]*$": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "planAttachment": {
              "type": "string",
              "enum": ["ask", "always", "never"],
              "description": "This project's override of global.planAttachment: whether the approved plan is attached to the run's Jira or GitHub issue."
            },
            "maxReworkCycles": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3,
              "description": "This project's override of global.review.maxReworkCycles: how many times review may send work back to development before the run stops. Set with /multi-agent:review-rounds --repo."
            },
            "testPolicy": {
              "type": "string",
              "enum": ["tdd", "tests-after", "none"],
              "description": "How Phase 2 authors tests in this project: tdd (default; failing test first), tests-after (implementation first, tests authored at the end), none (no unit/UI test authoring; existing tests are kept and run). Asked once by Phase 0 when absent; autopilot defaults to tdd and notes it."
            },
            "defaultReviewers": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 40,
              "description": "Bitbucket/generic default reviewers (usernames). Real corporate reviewer groups run well past ten members."
            },
            "githubDefaultReviewers": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 10,
              "description": "GitHub fallback reviewers - @user or org/team slug. Used only when no CODEOWNERS / branch protection surfaces reviewers."
            },
            "defaultPrMode": {
              "type": "string",
              "enum": ["draft", "ready"],
              "description": "Last-used draft/ready choice, shown as the default on next prompt."
            },
            "baseBranch": {
              "type": "string",
              "description": "Project default base branch. Falls back to repo HEAD."
            },
            "confluenceUrls": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uri"
              },
              "maxItems": 5,
              "description": "Recent parent page URLs, most recent first."
            },
            "branches": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 10,
              "description": "Legacy field. Recent branches for this project (pre-v2.1.0). v2.1.0+ prefers global.recentBranches[projectPath]."
            },
            "lastIdentity": {
              "type": "integer",
              "minimum": 0,
              "description": "Legacy field. Index into the retired gitIdentities list (v2.0.0). v2.1.0+ uses platformIdentityRouting."
            },
            "jiraProjectKeys": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 10,
              "description": "Per-project Jira project keys (can override global.defaultJiraKey)."
            },
            "remoteType": {
              "type": "string",
              "enum": ["bitbucket", "github", "gitlab", "generic-git"],
              "description": "Hint used when repo URL doesn't make platform obvious."
            },
            "taskCount": {
              "type": "integer",
              "minimum": 0,
              "description": "How many times this project has been used."
            },
            "lastUsed": {
              "type": "string",
              "format": "date-time",
              "description": "Timestamp of last task start against this project."
            },
            "figmaConfigPath": {
              "type": "string",
              "description": "Path to per-project figma-config.json (for Figma pipeline projects)."
            },
            "standardsFile": {
              "type": "string",
              "description": "Filename (or absolute/tilde path) of the canonical home-dir Standards reference for this project, used by /multi-agent:analysis Q5 auto-detect (e.g. ~/<project>-Standards.md)."
            },
            "editableRelatedRepos": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20,
              "description": "Extra writable repos to offer in the dev-context picker beyond auto-detected submodules (iOS/Android/Backend)."
            },
            "webRepos": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20,
              "description": "Web repos for this project, used by /multi-agent:analysis Step 4 (Web is rarely in the iOS/Android submodule tree). Readers fall back to the pre-rename frontendRepos when this is absent."
            },
            "webRoots": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20,
              "description": "Whitelist source roots for the Web repo-evidence scan (overrides the default src/ app/ components/ features/ lib/). Readers fall back to the pre-rename frontendRoots when this is absent."
            },
            "frontendRepos": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20,
              "description": "Deprecated spelling of webRepos, still read so prefs written before the Web rename keep working. Do not write it for new projects."
            },
            "frontendRoots": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20,
              "description": "Deprecated spelling of webRoots, still read so prefs written before the Web rename keep working. Do not write it for new projects."
            },
            "appStoreConnect": {
              "type": "object",
              "description": "Per-project App Store Connect delivery settings. Per-project rather than global because a user can ship for more than one team.",
              "properties": {
                "providerPublicId": {
                  "type": ["string", "null"],
                  "description": "Provider (team) public ID, required by altool when the account belongs to several providers. Resolve once with ios_testflight_validate({list_providers:true}); without it altool fails opaquely."
                }
              }
            },
            "product": {
              "type": "string",
              "description": "Name of the global.products entry this project belongs to. Planning reads every repository of that product except the ones the run develops. Written by product-context.mjs learn."
            },
            "counterpartRoots": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 4,
              "description": "Absolute local paths of this project's counterpart app repo - the same product on the other mobile platform. Read by Phase 3's platform-parity cross-check. Learned, not configured: the first run that resolves a counterpart writes it here and every later run reuses it without asking. An entry whose path is gone, or whose marker files no longer resolve to the mirrored stack, is dropped and re-detected rather than trusted. Same shape as webRoots."
            },
            "research": {
              "type": "object",
              "additionalProperties": false,
              "description": "Optional read-only evidence providers a research pass (/multi-agent:research, refs/research/engine.md) may query for this project on top of its core sources: tracker comments and links, similar closed items, the repository and its history, and the documents the item links. Absent means core sources only.",
              "properties": {
                "providers": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "enum": ["graylog", "crashlytics", "counterpart"]
                  },
                  "description": "graylog: lib/fetch-graylog.sh log search; crashlytics: lib/fetch-crashlytics.sh crash groups; counterpart: this project's counterpartRoots, read only. Each uses credentials or paths already onboarded; one that cannot run is skipped and named in research.md, never asked for."
                }
              }
            }
          }
        }
      }
    }
  }
}
