{
  "id": "1082@61967cca",
  "pr": 1082,
  "title": "perf: fast path for simple versions (intermediate commit 61967cca)",
  "merged": "2026-02-11",
  "after_ultra_release": false,
  "known": [
    {
      "id": "unicode-digits",
      "match": {
        "probe": "P2",
        "traits": "non-ascii"
      },
      "fixed_by": "review",
      "status": "verified"
    },
    {
      "id": "inner-whitespace",
      "match": {
        "probe": "P2",
        "traits": "whitespace"
      },
      "fixed_by": "review",
      "status": "verified"
    },
    {
      "id": "oversized-int-exception",
      "match": {
        "probe": "P2",
        "traits": "long-digits"
      },
      "fixed_by": 1155,
      "status": "verified"
    }
  ],
  "provider": "tokenfactory",
  "targets": [
    {
      "target": "packaging.version:Version",
      "image": "bw-pair:348e2d05c100a5f9",
      "run_id": "adj-1082-61967cca-4f437a",
      "samples": 3,
      "usd": 0.05,
      "verdicts": [
        {
          "signature": "P2|outcome|exc:packaging.version.InvalidVersion|ok|non-ascii",
          "label": "likely-bug",
          "votes": {
            "likely-bug": 3
          },
          "rationale": "The fast‑path treats any character not in `_NON_SIMPLE_VERSION_INDICATORS` as a simple numeric version. The set deliberately lists ASCII letters and punctuation (e.g. `!+-ABCDEHILOPRSTVW_abcdehiloprstvw`) but does not include full‑width digits such as `０`. Consequently `Version('０')` is accepted by the fast‑path (`int('０')` succeeds) whereas the original regex rejects it, a non‑conformant change.",
          "evidence": [
            "_NON_SIMPLE_VERSION_INDICATORS = frozenset('!+-ABCDEHILOPRSTVW_abcdehiloprstvw')",
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version):",
            "self._release = tuple(map(int, version.strip().split('.')))",
            "    self._release = tuple(map(int, version.strip().split('.')))",
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version): ... self._release = tuple(map(int, version.strip().split('.')))"
          ],
          "rejected": [],
          "reason": "",
          "known": [
            "unicode-digits"
          ],
          "facts": "Outcome differs. Input [\"０\"]: base raises packaging.version.InvalidVersion, head returns normally."
        },
        {
          "signature": "P2|outcome|exc:packaging.version.InvalidVersion|ok|non-ascii+whitespace",
          "label": "likely-bug",
          "votes": {
            "likely-bug": 3
          },
          "rationale": "A trailing space is not in `_NON_SIMPLE_VERSION_INDICATORS`, so the fast‑path triggers, strips the space and parses the full‑width digit. The original regex does not allow whitespace, so the new behaviour accepts an invalid version string.",
          "evidence": [
            "_NON_SIMPLE_VERSION_INDICATORS = frozenset('!+-ABCDEHILOPRSTVW_abcdehiloprstvw')",
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version):",
            "self._release = tuple(map(int, version.strip().split('.')))",
            "    self._release = tuple(map(int, version.strip().split('.')))",
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version): ... self._release = tuple(map(int, version.strip().split('.')))"
          ],
          "rejected": [],
          "reason": "",
          "known": [
            "unicode-digits",
            "inner-whitespace"
          ],
          "facts": "Outcome differs. Input [\"０ \"]: base raises packaging.version.InvalidVersion, head returns normally."
        },
        {
          "signature": "P2|outcome|exc:builtins.ValueError|exc:packaging.version.InvalidVersion|long-digits+whitespace",
          "label": "intended",
          "votes": {
            "intended": 2,
            "needs-human": 1
          },
          "rationale": "The fast‑path explicitly converts a `ValueError` from the integer parsing into `InvalidVersion` (`except ValueError: raise InvalidVersion(...)`). When the fast‑path is taken and the integer conversion fails, the new code raises `InvalidVersion` instead of letting the original `ValueError` propagate, which matches the observed change.",
          "evidence": [
            "    self._release = tuple(map(int, version.strip().split('.')))",
            "except ValueError: raise InvalidVersion(f'Invalid version: {version!r}') from None"
          ],
          "rejected": [
            "try:",
            "try:"
          ],
          "reason": "",
          "known": [
            "inner-whitespace",
            "oversized-int-exception"
          ],
          "facts": "Outcome differs. Input [\" 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... (4307 chars): base raises builtins.ValueError, head raises packaging.version.InvalidVersion. (packaging.version.InvalidVersion is a subclass of builtins.ValueError.)"
        },
        {
          "signature": "P2|outcome|exc:packaging.version.InvalidVersion|ok|long-digits+non-ascii",
          "label": "intended",
          "votes": {
            "intended": 2,
            "needs-human": 1
          },
          "rationale": "The fast‑path is designed to accept simple dot‑separated numeric versions without invoking the full regex. A very long all‑digit version passes the `_NON_SIMPLE_VERSION_INDICATORS.isdisjoint` test and is parsed successfully, whereas the original regex path rejects it (raising `InvalidVersion`). This is the performance optimisation the PR targets.",
          "evidence": [
            "_NON_SIMPLE_VERSION_INDICATORS = frozenset('!+-ABCDEHILOPRSTVW_abcdehiloprstvw')",
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version):",
            "self._release = tuple(map(int, version.strip().split('.')))",
            "    self._release = tuple(map(int, version.strip().split('.')))"
          ],
          "rejected": [],
          "reason": "",
          "known": [
            "unicode-digits",
            "oversized-int-exception"
          ],
          "facts": "Outcome differs. Input [\"100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... (4308 chars): base raises packaging.version.InvalidVersion, head returns normally."
        },
        {
          "signature": "P2|outcome|exc:packaging.version.InvalidVersion|ok|whitespace",
          "label": "likely-bug",
          "votes": {
            "likely-bug": 3
          },
          "rationale": "The fast‑path calls `version.strip()` before splitting on dots, thereby accepting leading/trailing whitespace (e.g. `' 1.2.3 '`). PEP 440 does not permit whitespace in a version string, and the original regex rejects it. The change was not mentioned in the PR description, indicating an unintended relaxation.",
          "evidence": [
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version):",
            "self._release = tuple(map(int, version.strip().split('.')))",
            "    self._release = tuple(map(int, version.strip().split('.')))",
            "_NON_SIMPLE_VERSION_INDICATORS = frozenset('!+-ABCDEHILOPRSTVW_abcdehiloprstvw')",
            "if _NON_SIMPLE_VERSION_INDICATORS.isdisjoint(version): ... self._release = tuple(map(int, version.strip().split('.')))"
          ],
          "rejected": [],
          "reason": "",
          "known": [
            "inner-whitespace"
          ],
          "facts": "Outcome differs. Input [\" 1. 2.3 \"]: base raises packaging.version.InvalidVersion, head returns normally."
        }
      ]
    }
  ]
}