Skip to content

check-pr-size.py: the fail-closed binary guard makes every golden-bearing PR unmergeable #615

Description

@localai-bot

What

scripts/check-pr-size.py:480-481 errors on any path git reports as binary:

if change.lines is None:
    errors.append(f"binary change {change.path!r} is not reviewable as text")
    continue

There is no exemption route. --pr-number is accepted and validated, then never consulted for this decision.

Why it is wrong

  1. It blocks a whole class of legitimate work. Parity goldens (*.npy, *.i32) are binary by nature. No PR that captures an oracle golden can pass this gate. That blocks feat(tenstorrent): allowlist MistralForCausalLM + device-aware gate #431 today and every future golden-bearing PR — the ROCm, Tenstorrent and Nemotron lanes all need them.

  2. It contradicts the checker's own classification model. The asset class exists for shipped artwork, and the comment above SITE_ASSET says so explicitly: "the binaries among them have no reviewable line budget at all, so they take the asset class the same way any other shipped artwork does." The classifier is built to give binaries a class; the guard then refuses every one of them regardless.

  3. It post-dates the precedent it rejects. The guard landed 2026-08-10 (450a1b696). The Tenstorrent golden precedent landed 2026-08-09 (971d55063). The one post-guard golden commit on main (5080983fd, 16 .npy files) also trips it and reached main by a route the current PR-only ruleset no longer permits.

  4. Its stated purpose is already served elsewhere. The real protection is explicit classification — classify_path raises on any unclassified path, binary or not. Refusing a classified binary adds nothing beyond blocking the work.

Proposed change

Drop the lines is None error. Keep explicit classification, so an unclassified binary is still refused — the protection that actually matters is retained; only the blanket refusal of classified binaries goes.

Per AGENTS.md this is a checker-semantics change: it needs a spec, a red-before test, and green-after evidence, with the argument recorded in the commit message.

Found while reviewing external-contributor PRs; see #431.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions