{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/mmerterden/multi-agent-pipeline/pipeline/schemas/token-budget.json",
  "description": "Per-phase token ceilings for the lazy-loaded pipeline docs, enforced by smoke-token-budget.sh. Only the ACTIVE phase is loaded at run time and nothing truncates a phase document, so these numbers govern what may be written, not what a run receives. Two rules, and the split is the point. `max_tokens` and `total_max_tokens` are committed constants a human owns: computing them would end the gate, because a ceiling that is always current x k can never fail. The warn tier is NOT stored - the gate derives it per phase from that phase's own git history (median + 3*MAD of its historical per-commit deltas, which is robust to a single outsized release), because a soft line maintained by hand drifts. A ceiling more than 25% above the measurement is stale and fails, so the ceilings only ratchet down. Ceilings are keyed by the phases in schemas/phases.json and measured against those documents. Ceiling change history: CHANGELOG-archive.md.",
  "phases": {
    "phase-0-init": {
      "max_tokens": 13400
    },
    "phase-1-plan": {
      "max_tokens": 10250
    },
    "phase-2-dev": {
      "max_tokens": 10650
    },
    "phase-3-review": {
      "max_tokens": 17200
    },
    "phase-4-commit": {
      "max_tokens": 6600
    },
    "phase-5-report": {
      "max_tokens": 5700
    }
  },
  "total_max_tokens": 63550
}
