{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://uwmd.org/schemas/section-lease-up-schedule.schema.json",
  "title": "UW Markdown Lease-Up Schedule Section",
  "description": "Content payload for the `lease_up_schedule` section (UW_FORMAT_SPEC.md §4.25, RFC 0008). A period-by-period trajectory from current to stabilized rents: a `model_type`, a uniform `period_granularity`, the driving `assumptions`, the `schedule` array, and a `stabilized_summary`. This is a state-and-verify structure (RFC 0021 §6, the `capital_stack` precedent): the Tier-3 calc engine never reads it, so a variable-length period array is safe, and every stated aggregate is recomputed by `verifyLeaseUpSchedule` rather than trusted. This schema enforces structure only. The cross-field rules a validator/verifier adds are: the period grammar and granularity uniformity (LU-01); strictly-increasing gap-free periods (LU-02); a non-empty schedule whose stabilization_target is not before it starts (LU-03); natural_turnover with no rent_roll in the document (LU-04, warning); the base variant's stabilized NOI within tolerance of noi_model (CC-15, warning); and each period's stated net_cash_flow recomputing from its components or the result is `failed`. RFC0096 LU-05 owns model identity, optional typed payload leaves and the listed closed objects; existing LU-01/02/03/04 and CC-15 retain their predicates.",
  "type": "object",
  "additionalProperties": false,
  "required": ["model_type", "period_granularity", "schedule"],
  "properties": {
    "_role": {
      "enum": ["primary", "senior", "junior", "summary", "detail", "component"],
      "description": "Optional signed scalar block annotation (RFC 0040)."
    },
    "_meta": {
      "type": "object",
      "description": "Standard block provenance envelope (§2.5). Not constrained here."
    },
    "_notes": {
      "description": "Universal annotation; not validated by LU-05."
    },
    "_overrides": {
      "description": "Universal override metadata; admission remains with its existing metadata owners."
    },
    "model_type": {
      "enum": ["natural_turnover", "absorption_curve"],
      "description": "`natural_turnover` = an occupied asset re-leasing at market through turnover (value-add); `absorption_curve` = filling vacant or newly-built space (ground-up / lease-up of new construction). Gates nothing structurally: natural_turnover with no rent_roll is LU-04 (warning), not a refusal."
    },
    "period_granularity": {
      "enum": ["monthly", "quarterly"],
      "description": "The schedule's cadence, uniform per schedule. Every `period` uses this granularity's grammar (LU-01)."
    },
    "stabilization_target": {
      "type": ["string", "null"],
      "description": "The period by which the deal is underwritten to stabilize, in the declared granularity's grammar. MUST NOT be earlier than the first schedule period (LU-03). LU-05 checks string type independently and whole-input ASCII grammar only under an own admitted cadence; no fallback cadence."
    },
    "assumptions": {
      "type": ["object", "null"],
      "additionalProperties": false,
      "description": "The assumption set driving the trajectory — the deal thesis, never defaultable background (nothing here enters the cascade tables). Rates are fractions (0.04 = 4%).",
      "properties": {
        "monthly_turnover_rate": { "type": ["number", "null"], "minimum": 0, "maximum": 1, "description": "Fraction of units/space turning per month (natural_turnover)." },
        "market_rent_psf_at_stabilization": { "type": ["number", "null"], "minimum": 0, "description": "Underwritten market rent per SF at the stabilization target." },
        "vacancy_during_lease_up": { "type": ["number", "null"], "minimum": 0, "maximum": 1, "description": "Average vacancy carried through the lease-up window, as a fraction." },
        "concession_months_per_lease": { "type": ["number", "null"], "minimum": 0, "description": "Free-rent months granted per new lease." },
        "tenant_improvement_psf": { "type": ["number", "null"], "minimum": 0, "description": "TI allowance per leased SF." },
        "leasing_commission_rate": { "type": ["number", "null"], "minimum": 0, "maximum": 1, "description": "LC as a fraction of lease value." }
      }
    },
    "schedule": {
      "type": "array",
      "minItems": 1,
      "description": "The stated trajectory, one entry per period, strictly increasing and gap-free (LU-02). Stated data, not formulas: the calc engine never iterates it; specific cells remain addressable by path (e.g. `lease_up_schedule.schedule[5].rent_revenue`).",
      "items": { "$ref": "#/$defs/period" }
    },
    "stabilized_summary": {
      "type": ["object", "null"],
      "additionalProperties": false,
      "description": "The stated endpoint. `occupied_sf` and `occupancy_rate` are verified against the final period (the rate through the Protocol §XIII size denominator); `annualized_noi` cross-checks `noi_model` within LEASE_UP_STABILIZED_TOLERANCE (CC-15).",
      "properties": {
        "occupied_sf": { "type": ["number", "null"], "minimum": 0 },
        "occupancy_rate": { "type": ["number", "null"], "minimum": 0, "maximum": 1, "description": "Fraction, not percent." },
        "annualized_egi": { "type": ["number", "null"] },
        "annualized_noi": { "type": ["number", "null"] }
      }
    }
  },
  "$defs": {
    "period": {
      "type": "object",
      "additionalProperties": false,
      "required": ["period"],
      "description": "One period of the trajectory. Dollar figures are period totals; rates are fractions. A period stating `net_cash_flow` without all three components is `unverifiable` for that row, never wrong.",
      "properties": {
        "period": {
          "type": "string",
          "pattern": "^\\d{4}-(Q[1-4]|0[1-9]|1[0-2])$",
          "description": "`YYYY-Qn` (quarterly) or `YYYY-MM` (monthly), matching `period_granularity` (LU-01)."
        },
        "occupied_sf": { "type": ["number", "null"], "minimum": 0, "description": "Physically occupied SF at period end." },
        "leased_sf": { "type": ["number", "null"], "minimum": 0, "description": "Leased SF at period end (leased ≥ occupied during free-rent periods)." },
        "in_place_rent_psf": { "type": ["number", "null"], "minimum": 0 },
        "market_rent_psf": { "type": ["number", "null"], "minimum": 0 },
        "vacancy_rate": { "type": ["number", "null"], "minimum": 0, "maximum": 1, "description": "Fraction, not percent." },
        "rent_revenue": { "type": ["number", "null"], "description": "Period rent revenue." },
        "concessions": { "type": ["number", "null"], "description": "Period concessions, stated as a negative number." },
        "ti_lc_capex": { "type": ["number", "null"], "description": "Period TI/LC capital, stated as a negative number." },
        "net_cash_flow": { "type": ["number", "null"], "description": "Stated period net: verified as rent_revenue + concessions + ti_lc_capex at the currency quantum." }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "period_granularity"
        ],
        "properties": {
          "period_granularity": {
            "const": "monthly"
          }
        }
      },
      "then": {
        "properties": {
          "stabilization_target": {
            "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])(?![\\s\\S])",
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "period_granularity"
        ],
        "properties": {
          "period_granularity": {
            "const": "quarterly"
          }
        }
      },
      "then": {
        "properties": {
          "stabilization_target": {
            "pattern": "^[0-9]{4}-Q[1-4](?![\\s\\S])",
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  ],
  "examples": [
    {
      "model_type": "natural_turnover",
      "period_granularity": "quarterly",
      "stabilization_target": "2027-Q4",
      "assumptions": {
        "monthly_turnover_rate": 0.04,
        "market_rent_psf_at_stabilization": 22.0,
        "vacancy_during_lease_up": 0.18,
        "concession_months_per_lease": 1,
        "tenant_improvement_psf": 35.0,
        "leasing_commission_rate": 0.06
      },
      "schedule": [
        { "period": "2026-Q3", "occupied_sf": 31000, "leased_sf": 31000, "in_place_rent_psf": 21.5, "market_rent_psf": 22.0, "vacancy_rate": 0.27, "rent_revenue": 166375, "concessions": -5400, "ti_lc_capex": -42500, "net_cash_flow": 118475 },
        { "period": "2026-Q4", "occupied_sf": 34000, "leased_sf": 35500, "in_place_rent_psf": 21.65, "market_rent_psf": 22.0, "vacancy_rate": 0.2, "rent_revenue": 184025, "concessions": -8100, "ti_lc_capex": -52500, "net_cash_flow": 123425 }
      ],
      "stabilized_summary": {
        "occupied_sf": 40500,
        "occupancy_rate": 0.953,
        "annualized_egi": 858000,
        "annualized_noi": 478000
      }
    }
  ]
}
