Resolving the scheduler policy from its updates, the later update wins for each key:

- Update 1: cutoff_hour=18, cutoff_inclusive=false, lead_minutes=60, timezone=UTC.
- Update 2: adjacency_allowed=true, cancelled_blocks=true, duplicate_policy=first, duration_max=120.
- Update 3: capacity=2, report_order=input.
- Update 4: adjacency_allowed=false, duration_max=90.
- Update 5: blackout_day=2026-11-01, cancelled_blocks=false, duplicate_policy=last, priority_high_first=true.
- Update 6: blackout_day=2026-11-02, priority_high_first=false.

Current policy: cutoff_hour=18, cutoff_inclusive=false, lead_minutes=60, timezone=UTC, adjacency_allowed=false, cancelled_blocks=false, duplicate_policy=last, duration_max=90, capacity=2, report_order=input, blackout_day=2026-11-02, priority_high_first=false.

Implementation notes:

- **Deduplication:** the first occurrence fixes the position, the last value supplies the data, and the retained index is that last value's original index.
- **Validation:** an invalid duration, a start before the lead time, a blackout day, or a cutoff violation sends the id to rejected. A cancelled appointment is rejected when cancelled_blocks is false.
- **Cancelled appointments:** with cancelled_blocks true, a cancelled appointment goes through the same checks and capacity logic but is reported in blocked.
- **Capacity:** an appointment is accepted only if fewer than capacity accepted intervals overlap it.
- **Overlap:** with adjacency allowed, intervals overlap when s < e2 and s2 < e. Otherwise they overlap when s <= e2 and s2 <= e.
- **Ordering:** processing order is by priority ascending, then original index. For the input report order, outputs are sorted by retained original index; for id order, by id.
- **Mutation:** the payload is not mutated.

```json
{"files": {"main.py": "from core import run\nfrom policy import POLICY\ndef evaluate(payload):\n    return run(payload, POLICY)\n", "policy.py": "POLICY = {\n    'cutoff_hour': 18,\n    'cutoff_inclusive': False,\n    'lead_minutes': 60,\n    'timezone': 'UTC',\n    'adjacency_allowed': False,\n    'cancelled_blocks': False,\n    'duplicate_policy': 'last',\n    'duration_max': 90,\n    'capacity': 2,\n    'report_order': 'input',\n    'blackout_day': '2026-11-02',\n    'priority_high_first': False,\n}\n", "helpers.py": "from datetime import datetime, timedelta, timezone\n\ndef parse(s):\n    if isinstance(s, str) and s.endswith('Z'):\n        s = s[:-1] + '+00:00'\n    return datetime.fromisoformat(s)\n", "core.py": "from datetime import datetime, timedelta, timezone\nfrom zoneinfo import ZoneInfo\nfrom helpers import parse\n\ndef run(payload, policy):\n    now = parse(payload['now']).astimezone(timezone.utc)\n    tz = ZoneInfo(policy['timezone'])\n    rows = payload.get('appointments', [])\n    pos = {}\n    chosen = {}\n    order = []\n    for i, a in enumerate(rows):\n        k = a['id']\n        if k not in chosen:\n            chosen[k] = (i, a)\n            order.append(k)\n        elif policy['duplicate_policy'] == 'last':\n            chosen[k] = (i, a)\n    items = [chosen[k] for k in order]\n    hi = policy['priority_high_first']\n    items.sort(key=lambda t: ((-t[1]['priority'] if hi else t[1]['priority']), t[0]))\n    sel, blk, rej = [], [], []\n    accepted = []\n    lead = timedelta(minutes=policy['lead_minutes'])\n    adj = policy['adjacency_allowed']\n    for idx, a in items:\n        k = a['id']\n        ok = True\n        d = a['duration']if 'duration' in a else a.get('duration_minutes')\n        if d is None or d <= 0 or d > policy['duration_max']:\n            rej.append((idx, k)); continue\n        st = parse(a['start']).astimezone(timezone.utc)\n        en = st + timedelta(minutes=d)\n        if st < now + lead:\n            rej.append((idx, k)); continue\n        ls = st.astimezone(tz)\n        if ls.date().isoformat() == policy['blackout_day']:\n            rej.append((idx, k)); continue\n        cut = datetime(ls.year, ls.month, ls.day, policy['cutoff_hour'], 0, tzinfo=tz).astimezone(timezone.utc)\n        if policy['cutoff_inclusive']:\n            if en > cut:\n                rej.append((idx, k)); continue\n        elif en >= cut:\n            rej.append((idx, k)); continue\n        cancelled = bool(a.get('cancelled'))\n        if cancelled and not policy['cancelled_blocks']:\n            rej.append((idx, k)); continue\n        n = 0\n        for s2, e2 in accepted:\n            if adj:\n                o = st < e2 and s2 < en\n            else:\n                o = st <= e2 and s2 <= en\n            if o:\n                n += 1\n        if n >= policy['capacity']:\n            rej.append((idx, k)); continue\n        accepted.append((st, en))\n        (blk if cancelled else sel).append((idx, k))\n    def out(l):\n        if policy['report_order'] == 'id':\n            return sorted(k for _, k in l)\n        return [k for _, k in sorted(l)]\n    return {'selected': out(sel), 'blocked': out(blk), 'rejected': out(rej)}\n"}}
```

One assumption: the duration field name is not given in the spec, so the code reads `duration` and falls back to `duration_minutes`.