docs(platform): allow git.py's bounded xcode-select -p as the one lookup spawn

hermes_platform/AGENTS.md says lookup never starts anything, and
resolver/base.py says only an uncached probe may spawn. The git resolver
this PR adds runs /usr/bin/xcode-select -p and caches the answer, so it
broke both as written (Greptile's review on resolver/git.py).

Record it as the one exception instead of reimplementing Apple's lookup
in-process: only that lookup says whether /usr/bin/git would open the
Command Line Tools dialog, and the link files libxcselect reads are
undocumented and have moved between macOS releases, so a copy that missed
one would refuse a working git. The exception is scoped to what the code
does: macOS only, only for /usr/bin/git with DEVELOPER_DIR unset, bounded
at 2 s, positive answer cached for the process and negative for 5 s.

Docs only; no behaviour change.
This commit is contained in:
BearHuddleston
2026-11-26 01:05:13 +00:00
parent 5e3b39ec6b
commit 67bbf5a7fd
3 changed files with 10 additions and 2 deletions

View File

@@ -11,4 +11,8 @@ host (where this Python runs) from the terminal execution target (SSH/container)
client (another machine): `host.*` answers only the first. A new bare `shutil.which` or a
hand-written known-path table outside `hermes_platform/` fails
`tests/test_managed_runtime_resolution.py` unless allowlisted with a reason; resolvers land in
`hermes_platform/resolver/`. Lookup never installs, downloads, or starts anything.
`hermes_platform/resolver/`. Lookup never installs, downloads, or starts anything, with one
exception: `resolver/git.py` may run `/usr/bin/xcode-select -p` (macOS only, when the git found is
`/usr/bin/git` and `DEVELOPER_DIR` is unset; bounded at 2 s; a positive answer cached for the
process, a negative one for 5 s). Only Apple's own lookup says whether that stub would open the
Command Line Tools dialog, and the link files it reads are undocumented and change between releases.

View File

@@ -1,7 +1,8 @@
"""Resolver protocols and the results of the two non-passive tiers.
`locate` reads file metadata only. `inspect` may open files and call OS APIs in-process.
`probe` is fresh, never cached, and the only tier that may open a socket or spawn.
`probe` is fresh, never cached, and the only tier that may open a socket or spawn. The one
exception is `git.py`'s bounded, cached `xcode-select -p` (see `hermes_platform/AGENTS.md`).
"""
from __future__ import annotations

View File

@@ -3,6 +3,9 @@
On macOS without Xcode Command Line Tools, ``/usr/bin/git`` exists and is executable, but
spawning it pops Apple's modal "The git command requires the command line developer tools"
dialog. Custom/Homebrew/Nix/PM git binaries live elsewhere and remain usable without CLT.
Deciding that runs ``/usr/bin/xcode-select -p``, the one spawn ``hermes_platform/AGENTS.md``
allows a lookup.
"""
from __future__ import annotations