Store each API compatibility waiver in its own file under `.github/api-compatibility-waivers/`

Merged
DO
1mo ago
+664-688

Every PR that needs an API-compatibility waiver appended to the end of allowed_breakages in .github/api-compatibility-allowlist.json, so any two such PRs conflicted (three times for #11388 alone). Each waiver is now its own file, .github/api-compatibility-waivers/<fingerprint>.json, so two PRs touch the same file only when they waive the same finding.

New public surface: none (repository CI tooling only).

Change

  • check_api_compatibility.py loads the waiver directory (--waivers, default .github/api-compatibility-waivers). Each file holds against, reason and pull_request; the fingerprint is the filename, so it can't drift from the content. Validation is unchanged: the schema, the unused-waiver check for the current baseline, and a waiver against an older release not covering a current finding. A misnamed file (not <lowercase 64-hex>.json) is an error. A missing directory (git drops it once every waiver is pruned) means no waivers. Duplicates can no longer exist, because the filesystem enforces them. The finding error now names the file to add.
  • allowed_breakages is removed from the allowlist JSON, which keeps model_name_literals and growing_collections. A stale PR that still appends there fails with extra_forbidden.
  • pr_gates.py (Gate: compatibility waiver labeled) compares the changed waiver files at head and at the merge base, so a new file, or a changed against, still needs compatibility impact. Waivers still listed in the merge base's allowed_breakages count as existing. So moving them, as this PR does, adds none, while moving one with a different against still counts as added. That read is transitional, only for this PR's own gate run, and can go in a follow-up.
  • All 73 waivers on main were migrated mechanically. agent_docs/api-design.md now says how to add one; .github/workflows/AGENTS.md's description of the gate names no path and needs no change.

Verification

  • test_check_api_compatibility.py and test_pr_gates.py: 151 passed locally. Pyright on the touched scripts: 0 errors.
  • Ran the real check_api_compatibility.py --against v2.63.0 on this branch: exit 0, all 10 current waivers matched, none unused.

What changes for existing users: nothing.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Posted by CLAI on Douwe's behalf.