diff options
| author | Mohamed Hegazy <mhegazy@anthropic.com> | 2026-06-15 12:57:33 -0700 |
|---|---|---|
| committer | Mohamed Hegazy <mhegazy@anthropic.com> | 2026-06-15 12:57:33 -0700 |
| commit | 66a63f2c4385068b0776c0c17b5277c42ed56c9c (patch) | |
| tree | 5644e17fcb837d8d4f56b11a894b3317ca01e972 /plugins/commit-commands | |
| parent | ad34eb0fa6ba543c674b276855551b086631d698 (diff) | |
security-guidance: probe for a non-PATH 3.10+ interpreter on HOOK_PY_INCOMPATIBLE (2.0.6 → 2.0.7)macos-altpython-probe
Instrument-first for the macOS Python-3.9 cohort.
v2.0.6 telemetry: ~13.6% of macOS sessions (~6,337 users) run on Apple's
Python 3.9 → HOOK_PY_INCOMPATIBLE → the agentic reviewer can't load (needs
3.10+ syntax). That's ~12x macOS's build-failure rate and the single
biggest macOS degradation. sg-python.sh only probes `python3.1x` on PATH,
so these users have nothing newer ON PATH — but they may still have a
3.10+ installed at a standard location that isn't on the hook's PATH
(Homebrew /opt/homebrew, python.org framework, etc.).
Before building an explicit-path interpreter search, size the RECOVERABLE
fraction: `_probe_alt_python()` checks Homebrew / python.org / distro
locations for a 3.10+ binary and emits the highest found as `sdk_alt_py`
(major*100+minor, or 0 = genuinely 3.9-only). Telemetry-only; probed ONLY
on the HOOK_PY_INCOMPATIBLE path, so healthy sessions never run it.
After a data cycle: non-zero sdk_alt_py = recoverable by an explicit-path
search in sg-python.sh; 0 = needs a user-side Python install (the one-time
notice is the only lever). That decides whether the search is worth building.
Verified locally on macOS Python 3.13:
- py_compile clean; probe returns 314 on this Mac (homebrew 3.14 present).
- 7 new tests (test_altpython_probe.py): highest-version selection,
0-when-none (mocked os.access), framework/distro path parsing, only
counts 3.10+, and emit gated on outcome==HOOK_PY_INCOMPATIBLE.
- Full suite 575/575 + 2 skipped.
No behavior change — purely additive telemetry on the incompatible path.
Version 2.0.6 -> 2.0.7 per the per-PR-bump policy (#2114).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'plugins/commit-commands')
0 files changed, 0 insertions, 0 deletions
